diff --git a/.babelrc.js b/.babelrc.js index 436e94f97465c..0caaf19bf06ea 100644 --- a/.babelrc.js +++ b/.babelrc.js @@ -1,46 +1,26 @@ "use strict"; -// Thanks Logan for this. -// This works around https://github.com/istanbuljs/istanbuljs/issues/92 until -// we have a version of Istanbul that actually works with 7.x. -function istanbulHacks() { - return { - inherits: require("babel-plugin-istanbul").default, - visitor: { - Program: { - exit: function(path) { - if (!this.__dv__) return - - const node = path.node.body[0]; - if ( - node.type !== "VariableDeclaration" || - node.declarations[0].id.type !== "Identifier" || - !node.declarations[0].id.name.match(/cov_/) || - node._blockHoist !== 3 - ) { - throw new Error("Something has gone wrong in Logan's hacks."); - } - - // Gross hacks to put the code coverage block above all compiled - // import statement output. - node._blockHoist = 5; - }, - }, - }, - }; -} - -let envOpts = { +const env = process.env.BABEL_ENV || process.env.NODE_ENV; +const envOpts = { loose: true, }; +switch (env) { + case "development": + envOpts.debug = true; + // fall-through + case "test": + case "cov": + envOpts.targets = { + node: "current", + }; +} + const config = { comments: false, - presets: [ - ["@babel/env", envOpts], - ], + presets: [["@babel/env", envOpts]], plugins: [ - // TODO: Use @babel/preset-flow when + // TODO: Use @babel/preset-flow when // https://github.com/babel/babel/issues/7233 is fixed "@babel/plugin-transform-flow-strip-types", ["@babel/proposal-class-properties", { loose: true }], @@ -48,25 +28,21 @@ const config = { "@babel/proposal-numeric-separator", ["@babel/proposal-object-rest-spread", { useBuiltIns: true }], ], - overrides: [{ - test: "packages/babylon", - plugins: [ - "babel-plugin-transform-charcodes", - ["@babel/transform-for-of", { assumeArray: true }], - ], - }], + overrides: [ + { + test: "packages/babylon", + plugins: [ + "babel-plugin-transform-charcodes", + ["@babel/transform-for-of", { assumeArray: true }], + ], + }, + ], }; -if (process.env.BABEL_ENV === "cov") { +// we need to do this as long as we do not test everything from source +if (env === "cov") { config.auxiliaryCommentBefore = "istanbul ignore next"; - config.plugins.push(istanbulHacks); -} - -if (process.env.BABEL_ENV === "development") { - envOpts.targets = { - node: "current" - }; - envOpts.debug = true; + config.plugins.push("babel-plugin-istanbul"); } module.exports = config; diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000000..79b85e29f5364 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,61 @@ +version: 2 +aliases: + - &restore-node-modules-cache + keys: + - v1-yarn-deps-{{ checksum "yarn.lock" }} + + - &restore-yarn-cache + 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 + + - &yarn-install + run: | + sudo npm i -g yarn@^1.5.1 + yarn --version + + - &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 + +jobs: + build: + working_directory: ~/babel + docker: + - image: circleci/node:9 + steps: + - checkout + - restore-cache: *restore-yarn-cache + - restore-cache: *restore-node-modules-cache + - *yarn-install + - run: make test-ci-coverage + # Builds babel-standalone with the regular Babel config + - run: 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 \ No newline at end of file diff --git a/.eslintignore b/.eslintignore index bbfa4a378cb7c..39e51ed1b442a 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,6 @@ /lib +/build +package.json packages/babel-runtime !packages/babel-runtime/scripts !packages/babel-runtime/core-js.js @@ -18,5 +20,4 @@ packages/babel-preset-env-standalone/babel-preset-env.js packages/babel-preset-env-standalone/babel-preset-env.min.js packages/babel-standalone/babel.js packages/babel-standalone/babel.min.js -packages/babylon/build packages/babylon/test/expressions diff --git a/.eslintrc b/.eslintrc.json similarity index 64% rename from .eslintrc rename to .eslintrc.json index 38da02aafebbb..a26533ebde85a 100644 --- a/.eslintrc +++ b/.eslintrc.json @@ -1,8 +1,7 @@ { + "root": true, "extends": "babel", - "plugins": [ - "prettier" - ], + "plugins": ["prettier"], "rules": { "curly": ["error", "multi-line"], "prettier/prettier": "error", @@ -13,12 +12,10 @@ }, "overrides": [ { - "files": [ - "packages/*/src/**/*.js", - "codemods/*/src/**/*.js" - ], + "files": ["packages/*/src/**/*.js", "codemods/*/src/**/*.js"], "rules": { - "no-undefined-identifier": "error" + "no-undefined-identifier": "error", + "no-deprecated-clone": "error" } }, { @@ -28,7 +25,7 @@ "test/**/*.js" ], "env": { - "mocha": true + "jest": true } } ] diff --git a/.flowconfig b/.flowconfig index ff9a56ee0783f..a60a4a9144d5b 100644 --- a/.flowconfig +++ b/.flowconfig @@ -13,8 +13,8 @@ codemods/*/src [libs] lib/file.js lib/parser.js -lib/packages/babel-types/lib/index.js.flow lib/third-party-libs.js.flow +packages/babel-types/lib/index.js.flow [options] include_warnings=true diff --git a/.gitignore b/.gitignore index 34b621caa069a..2d2ee52239f3e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,15 +16,19 @@ package-lock.json !/packages/babel-runtime/core-js/map.js /packages/babel-runtime/helpers/*.js !/packages/babel-runtime/helpers/toArray.js +!/packages/babel-runtime/helpers/iterableToArray.js !/packages/babel-runtime/helpers/temporalRef.js /packages/babel-runtime/helpers/builtin/*.js !/packages/babel-runtime/helpers/builtin/toArray.js +!/packages/babel-runtime/helpers/builtin/iterableToArray.js !/packages/babel-runtime/helpers/builtin/temporalRef.js /packages/babel-runtime/helpers/builtin/es6/*.js !/packages/babel-runtime/helpers/builtin/es6/toArray.js +!/packages/babel-runtime/helpers/builtin/es6/iterableToArray.js !/packages/babel-runtime/helpers/builtin/es6/temporalRef.js /packages/babel-runtime/helpers/es6/*.js !/packages/babel-runtime/helpers/es6/toArray.js +!/packages/babel-runtime/helpers/es6/iterableToArray.js !/packages/babel-runtime/helpers/es6/temporalRef.js /packages/babel-register/test/.babel /packages/babel-cli/test/tmp diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000000..ec6d3cdd7f5b0 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +package.json diff --git a/.prettierrc b/.prettierrc index f7d1c5e0d570c..371aad410ab4d 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,14 @@ { + "arrowParens": "avoid", "trailingComma": "es5", + "useTabs": false, + "semi": true, + "singleQuote": false, + "bracketSpacing": true, + "jsxBracketSameLine": false, + "tabWidth": 2, + "parser": "babylon", + "printWidth": 80, "overrides": [{ "files": [ "**/codemods/*/src/**/*.js", diff --git a/.travis.yml b/.travis.yml index 4f25f7126c45b..43aa9e525bd67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ cache: directories: - node_modules node_js: + # We test the latest version on circleci - '8' - '6' - '4' @@ -19,6 +20,8 @@ env: before_install: - curl -o- -L https://yarnpkg.com/install.sh | bash +install: yarn --ignore-engines + before_script: - 'if [ "$JOB" = "babylon-flow-tests" ]; then make bootstrap-flow; fi' - 'if [ "$JOB" = "babylon-test262-tests" ]; then make bootstrap-test262; fi' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 80a09cc74e3aa..6db766225b58b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -116,7 +116,7 @@ $ TEST_ONLY=babel-cli make test ```sh # Run tests for the @babel/plugin-transform-classes package. -$ TEST_ONLY=es2015-class make test +$ TEST_ONLY=babel-plugin-transform-classes make test ``` Use the `TEST_GREP` variable to run a subset of tests by name: @@ -175,7 +175,7 @@ For example, in [`@babel/plugin-transform-exponentiation-operator/test`](https:/ - 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. +   - 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. @@ -234,7 +234,7 @@ descriptive name, and add the following: After writing tests for babylon, just build it by running: ```sh -$ make build-babylon +$ make build ``` Then, to run the tests, use: diff --git a/Makefile b/Makefile index 123c16e1a4e0c..94e80e1e2f15b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ MAKEFLAGS = -j1 FLOW_COMMIT = 622bbc4f07acb77eb1109830c70815f827401d90 -TEST262_COMMIT = 1282e842febf418ca27df13fa4b32f7e5021b470 +TEST262_COMMIT = 52f70e2f637731aae92a9c9a2d831310c3ab2e1e export NODE_ENV = test @@ -41,16 +41,24 @@ build-dist: build watch: clean make 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 scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow BABEL_ENV=development ./node_modules/.bin/gulp watch flow: ./node_modules/.bin/flow check --strip-root lint: - ./node_modules/.bin/eslint scripts $(SOURCES) *.js --format=codeframe --rulesdir="./scripts/eslint_rules" + ./node_modules/.bin/eslint scripts $(SOURCES) '*.js' '**/.*.js' --format=codeframe --rulesdir="./scripts/eslint_rules" fix: - ./node_modules/.bin/eslint scripts $(SOURCES) *.js --format=codeframe --fix --rulesdir="./scripts/eslint_rules" + # The config is hardcoded because otherwise prettier searches for it and also picks up some broken package.json files from tests + ./node_modules/.bin/prettier --config .prettierrc --write --ignore-path .eslintignore '**/*.json' + ./node_modules/.bin/eslint scripts $(SOURCES) '*.js' '**/.*.js' --format=codeframe --fix --rulesdir="./scripts/eslint_rules" clean: test-clean rm -rf packages/babel-polyfill/browser* @@ -75,7 +83,7 @@ test-ci: test-ci-coverage: SHELL:=/bin/bash test-ci-coverage: BABEL_ENV=cov make bootstrap - ./scripts/test-cov.sh + TEST_TYPE=cov ./scripts/test-cov.sh bash <(curl -s https://codecov.io/bash) -f coverage/coverage-final.json bootstrap-flow: @@ -124,8 +132,8 @@ publish: bootstrap: make clean-all - yarn - ./node_modules/.bin/lerna bootstrap + yarn --ignore-engines + ./node_modules/.bin/lerna bootstrap -- --ignore-engines make build cd packages/babel-runtime; \ node scripts/build-dist.js diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 4028adfc42abd..0000000000000 --- a/circle.yml +++ /dev/null @@ -1,30 +0,0 @@ -general: - artifacts: - - "packages/babel-standalone/babel.js" - - "packages/babel-standalone/babel.min.js" - - "packages/babel-preset-env-standalone/babel-preset-env.js" - - "packages/babel-preset-env-standalone/babel-preset-env.min.js" - -machine: - node: - version: - 8 - -dependencies: - pre: - - curl -o- -L https://yarnpkg.com/install.sh | bash - cache_directories: - - ~/.yarn-cache - override: - - yarn - -test: - override: - - make test-ci-coverage - # Builds babel-standalone with the regular Babel config - - 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. - - ./node_modules/mocha/bin/_mocha packages/babel-standalone/test/ --opts test/mocha.opts - - ./node_modules/mocha/bin/_mocha packages/babel-preset-env-standalone/test/ --opts test/mocha.opts diff --git a/codemods/babel-plugin-codemod-optional-catch-binding/package.json b/codemods/babel-plugin-codemod-optional-catch-binding/package.json index efb72d5e85821..602534c6e2fe7 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-beta.39", + "version": "7.0.0-beta.42", "description": "Remove unused catch bindings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-remove-unused-catch-binding", "license": "MIT", @@ -9,13 +9,13 @@ "@babel/plugin" ], "dependencies": { - "@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.39" + "@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/doc/design/monorepo.md b/doc/design/monorepo.md index e8544bfcee9bd..d10cc9741b762 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 ran together which finds bugs that touch multiple modules easier. + * Tests across modules are run together which finds bugs that touch multiple modules easier. **Cons:** diff --git a/lerna.json b/lerna.json index 8c57a156712bb..c98859af04ec2 100644 --- a/lerna.json +++ b/lerna.json @@ -1,16 +1,16 @@ { "lerna": "2.0.0-rc.4", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "changelog": { "repo": "babel/babel", "labels": { - "PR: Spec Compliancy": ":eyeglasses: Spec Compliancy", - "PR: Breaking Change": ":boom: Breaking Change", - "PR: New Feature": ":rocket: New Feature", - "PR: Bug Fix": ":bug: Bug Fix", - "PR: Polish": ":nail_care: Polish", - "PR: Docs": ":memo: Documentation", - "PR: Internal": ":house: Internal" + "PR: Spec Compliancy :eyeglasses:": ":eyeglasses: Spec Compliancy", + "PR: Breaking Change :boom:": ":boom: Breaking Change", + "PR: New Feature :rocket:": ":rocket: New Feature", + "PR: Bug Fix :bug:": ":bug: Bug Fix", + "PR: Polish :nail_care:": ":nail_care: Polish", + "PR: Docs :memo:": ":memo: Documentation", + "PR: Internal :house:": ":house: Internal" } }, "cacheDir": ".changelog", diff --git a/lib/third-party-libs.js.flow b/lib/third-party-libs.js.flow index 97d19dfda262e..df59f5032f161 100644 --- a/lib/third-party-libs.js.flow +++ b/lib/third-party-libs.js.flow @@ -3,9 +3,9 @@ */ declare module "micromatch" { - declare function exports(Array, Array, ?{ - nocase: boolean, - }): Array; + declare module.exports: { + (Array, Array, ?{ nocase: boolean }): Array, + }; } declare module "resolve" { diff --git a/package.json b/package.json index baf7716f07e33..651b1b333413f 100644 --- a/package.json +++ b/package.json @@ -10,32 +10,33 @@ "test": "make test" }, "devDependencies": { - "@babel/cli": "7.0.0-beta.39", - "@babel/core": "7.0.0-beta.39", - "@babel/preset-env": "7.0.0-beta.39", - "@babel/preset-flow": "7.0.0-beta.39", - "@babel/preset-stage-0": "7.0.0-beta.39", - "@babel/register": "7.0.0-beta.39", - "async": "^1.5.0", + "@babel/cli": "7.0.0-beta.41", + "@babel/core": "7.0.0-beta.41", + "@babel/preset-env": "7.0.0-beta.41", + "@babel/preset-flow": "7.0.0-beta.41", + "@babel/preset-stage-0": "7.0.0-beta.41", + "@babel/register": "7.0.0-beta.41", + "babel-core": "^7.0.0-0", "babel-eslint": "^8.0.1", + "babel-jest": "^22.4.1", "babel-loader": "8.0.0-beta.0", - "babel-plugin-istanbul": "^4.1.4", - "babel-plugin-transform-charcodes": "0.0.10", - "babylon": "7.0.0-beta.39", + "babel-plugin-transform-charcodes": "^0.1.0", + "babylon": "7.0.0-beta.41", "browserify": "^13.1.1", "bundle-collapser": "^1.2.1", "chai": "^4.1.0", - "chalk": "^2.0.0", - "charcodes": "0.0.10", + "chalk": "^2.3.2", + "charcodes": "^0.1.0", "derequire": "^2.0.2", - "eslint": "^4.5.0", + "enhanced-resolve": "^3.0.0", + "eslint": "^4.18.2", "eslint-config-babel": "^7.0.2", "eslint-plugin-flowtype": "^2.20.0", "eslint-plugin-prettier": "^2.5.0", - "flow-bin": "^0.59.0", + "flow-bin": "^0.66.0", "graceful-fs": "^4.1.11", "gulp": "^3.9.0", - "gulp-babel": "^8.0.0-beta.0", + "gulp-babel": "^8.0.0-beta.2", "gulp-filter": "^5.1.0", "gulp-newer": "^1.0.0", "gulp-plumber": "^1.0.1", @@ -44,24 +45,22 @@ "gulp-util": "^3.0.7", "gulp-watch": "^4.3.5", "husky": "^0.14.3", + "jest": "^22.4.2", "lerna": "2.0.0", "lerna-changelog": "^0.5.0", "lint-staged": "^6.0.1", "lodash": "^4.2.0", "merge-stream": "^1.0.1", - "mocha": "^3.0.0", - "nyc": "^11.0.3", "output-file-sync": "^2.0.0", - "prettier": "1.10.2", + "prettier": "1.11.1", "pump": "^1.0.2", "rimraf": "^2.4.3", "rollup-plugin-babel": "^4.0.0-beta.0", "rollup-plugin-node-resolve": "^3.0.2", "rollup-stream": "^1.24.1", - "semver": "^5.0.0", + "test262-stream": "^1.1.0", "through2": "^2.0.0", "uglify-js": "^2.4.16", - "util.promisify": "^1.0.0", "vinyl-buffer": "^1.0.1", "vinyl-source-stream": "^2.0.0", "webpack": "^3.4.1", @@ -73,20 +72,45 @@ "npm": ">= 2.x <= 5.x", "yarn": ">=0.27.5 || >=1.0.0-20170811" }, - "nyc": { - "all": true, - "exclude": [ - "scripts/*.js", - "packages/*/test/**", - "packages/babel-standalone/**", - "codemods/*/test/**" - ], - "sourceMap": false, - "instrument": false - }, "lint-staged": { "*.js": [ "eslint --format=codeframe --rulesdir='./scripts/eslint_rules'" ] + }, + "jest": { + "collectCoverageFrom": [ + "packages/*/src/**/*.mjs", + "packages/*/src/**/*.js", + "codemods/*/src/**/*.mjs", + "codemods/*/src/**/*.js" + ], + "testRegex": "./(packages|codemods)/[^/]+/test/.+\\.m?js$", + "testPathIgnorePatterns": [ + "/node_modules/", + "/test/fixtures/", + "/test/debug-fixtures/", + "/babylon/test/expressions/", + "/test/tmp/", + "/test/__data__/", + "/test/helpers/", + "/test/warning\\.js", + "/build/", + "_browser\\.js" + ], + "testEnvironment": "node", + "setupTestFrameworkScriptFile": "/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/" + ], + "modulePathIgnorePatterns": [ + "/test/fixtures/", + "/test/tmp/", + "/test/__data__/", + "/build/" + ] } } diff --git a/packages/README.md b/packages/README.md index 07b340f2bfd6d..7c3f1ab8d6433 100644 --- a/packages/README.md +++ b/packages/README.md @@ -13,15 +13,15 @@ A monorepo, muhahahahahaha. See the [monorepo design doc](/doc/design/monorepo.m | Package | Version | Dependencies | |--------|-------|------------| -| [`@babel/core`](/packages/babel-core) | [![npm](https://img.shields.io/npm/v/babel-core.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-core) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-core)](https://david-dm.org/babel/babel?path=packages/babel-core) | -| [`babylon`](https://github.com/babel/babel/tree/master/packages/babylon) | [![npm](https://img.shields.io/npm/v/babylon.svg?maxAge=2592000)](https://www.npmjs.com/package/babylon) | [![Dependency Status](https://david-dm.org/babel/babylon.svg)](https://david-dm.org/babel/babylon) | -| [`@babel/traverse`](/packages/babel-traverse) | [![npm](https://img.shields.io/npm/v/babel-traverse.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-traverse) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-traverse)](https://david-dm.org/babel/babel?path=packages/babel-traverse) | -| [`@babel/generator`](/packages/babel-generator) | [![npm](https://img.shields.io/npm/v/babel-generator.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-generator) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-generator)](https://david-dm.org/babel/babel?path=packages/babel-generator) | +| [`@babel/core`](/packages/babel-core) | [![npm](https://img.shields.io/npm/v/@babel/core.svg?maxAge=2592000)](https://www.npmjs.com/package/@babel/core) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-core)](https://david-dm.org/babel/babel?path=packages/babel-core) | +| [`babylon`](/packages/babylon) | [![npm](https://img.shields.io/npm/v/babylon.svg?maxAge=2592000)](https://www.npmjs.com/package/babylon) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babylon)](https://david-dm.org/babel/babel?path=packages/babylon) | +| [`@babel/traverse`](/packages/babel-traverse) | [![npm](https://img.shields.io/npm/v/@babel/traverse.svg?maxAge=2592000)](https://www.npmjs.com/package/@babel/traverse) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-traverse)](https://david-dm.org/babel/babel?path=packages/babel-traverse) | +| [`@babel/generator`](/packages/babel-generator) | [![npm](https://img.shields.io/npm/v/@babel/generator.svg?maxAge=2592000)](https://www.npmjs.com/package/@babel/generator) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-generator)](https://david-dm.org/babel/babel?path=packages/babel-generator) | [`@babel/core`](/packages/babel-core) is the Babel compiler itself; it exposes the `babel.transform` method, where `transformedCode = transform(src).code`. The compiler can be broken down into 3 parts: -- The parser: [`babylon`](https://github.com/babel/babel/tree/master/packages/babylon) +- The parser: [`babylon`](/packages/babylon) - The transformer[s]: All the plugins/presets - These all use [`@babel/traverse`](/packages/babel-traverse) to traverse through the AST - The generator: [`@babel/generator`](/packages/babel-generator) @@ -36,18 +36,18 @@ Check out the [`babel-handbook`](https://github.com/thejameskyle/babel-handbook/ | Package | Version | Dependencies | |--------|-------|------------| -| [`@babel/cli`](/packages/babel-cli) | [![npm](https://img.shields.io/npm/v/babel-cli.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-cli) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-cli)](https://david-dm.org/babel/babel?path=packages/babel-cli) | -| [`@babel/types`](/packages/babel-types) | [![npm](https://img.shields.io/npm/v/babel-types.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-types) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-types)](https://david-dm.org/babel/babel?path=packages/babel-types) | -| [`@babel/polyfill`](/packages/babel-polyfill) | [![npm](https://img.shields.io/npm/v/babel-polyfill.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-polyfill) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-polyfill)](https://david-dm.org/babel/babel?path=packages/babel-polyfill) | -| [`@babel/runtime`](/packages/babel-runtime) | [![npm](https://img.shields.io/npm/v/babel-runtime.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-runtime) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-runtime)](https://david-dm.org/babel/babel?path=packages/babel-runtime) | -| [`@babel/register`](/packages/babel-register) | [![npm](https://img.shields.io/npm/v/babel-register.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-register) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-register)](https://david-dm.org/babel/babel?path=packages/babel-register) | -| [`@babel/template`](/packages/babel-template) | [![npm](https://img.shields.io/npm/v/babel-template.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-template) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-template)](https://david-dm.org/babel/babel?path=packages/babel-template) | -| [`@babel/helpers`](/packages/babel-helpers) | [![npm](https://img.shields.io/npm/v/babel-helpers.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-helpers) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-helpers)](https://david-dm.org/babel/babel?path=packages/babel-helpers) | -| [`@babel/code-frame`](/packages/babel-code-frame) | [![npm](https://img.shields.io/npm/v/babel-code-frame.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-code-frame) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-code-frame)](https://david-dm.org/babel/babel?path=packages/babel-code-frame) | +| [`@babel/cli`](/packages/babel-cli) | [![npm](https://img.shields.io/npm/v/@babel/cli.svg?maxAge=2592000)](https://www.npmjs.com/package/@babel/cli) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-cli)](https://david-dm.org/babel/babel?path=packages/babel-cli) | +| [`@babel/types`](/packages/babel-types) | [![npm](https://img.shields.io/npm/v/@babel/types.svg?maxAge=2592000)](https://www.npmjs.com/package/@babel/types) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-types)](https://david-dm.org/babel/babel?path=packages/babel-types) | +| [`@babel/polyfill`](/packages/babel-polyfill) | [![npm](https://img.shields.io/npm/v/@babel/polyfill.svg?maxAge=2592000)](https://www.npmjs.com/package/@babel/polyfill) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-polyfill)](https://david-dm.org/babel/babel?path=packages/babel-polyfill) | +| [`@babel/runtime`](/packages/babel-runtime) | [![npm](https://img.shields.io/npm/v/@babel/runtime.svg?maxAge=2592000)](https://www.npmjs.com/package/@babel/runtime) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-runtime)](https://david-dm.org/babel/babel?path=packages/babel-runtime) | +| [`@babel/register`](/packages/babel-register) | [![npm](https://img.shields.io/npm/v/@babel/register.svg?maxAge=2592000)](https://www.npmjs.com/package/@babel/register) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-register)](https://david-dm.org/babel/babel?path=packages/babel-register) | +| [`@babel/template`](/packages/babel-template) | [![npm](https://img.shields.io/npm/v/@babel/template.svg?maxAge=2592000)](https://www.npmjs.com/package/@babel/template) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-template)](https://david-dm.org/babel/babel?path=packages/babel-template) | +| [`@babel/helpers`](/packages/babel-helpers) | [![npm](https://img.shields.io/npm/v/@babel/helpers.svg?maxAge=2592000)](https://www.npmjs.com/package/@babel/helpers) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-helpers)](https://david-dm.org/babel/babel?path=packages/babel-helpers) | +| [`@babel/code-frame`](/packages/babel-code-frame) | [![npm](https://img.shields.io/npm/v/@babel/code-frame.svg?maxAge=2592000)](https://www.npmjs.com/package/@babel/code-frame) | [![Dependency Status](https://david-dm.org/babel/babel.svg?path=packages/babel-code-frame)](https://david-dm.org/babel/babel?path=packages/babel-code-frame) | - [`@babel/cli`](/packages/babel-cli) is the CLI tool that runs `@babel/core` and helps with outputting to a directory, a file, stdout and more (also includes `@babel/node` cli). Check out the [docs](https://babeljs.io/docs/usage/cli/). - [`@babel/types`](/packages/babel-types) is used to validate, build and change AST nodes. -- [`@babel/polyfill`](/packages/babel-polyfill) is [literally a wrapper](https://github.com/babel/babel/blob/master/packages/babel-polyfill/src/index.js) around [`core-js`](https://github.com/zloirock/core-js) and [regenerator-runtime](https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime). Check out the [docs](https://babeljs.io/docs/usage/polyfill/). +- [`@babel/polyfill`](/packages/babel-polyfill) is [literally a wrapper](/packages/babel-polyfill/src/index.js) around [`core-js`](https://github.com/zloirock/core-js) and [regenerator-runtime](https://github.com/facebook/regenerator/tree/master/packages/regenerator-runtime). Check out the [docs](https://babeljs.io/docs/usage/polyfill/). - [`@babel/runtime`](/packages/babel-runtime) is similar to the polyfill except that it doesn't modify the global scope and is to be used with [`@babel/plugin-transform-runtime`](/packages/babel-plugin-transform-runtime) (usually in library/plugin code). Check out the [docs](https://babeljs.io/docs/plugins/transform-runtime/). - [`@babel/register`](/packages/babel-register) is a way to automatically compile files with Babel on the fly by binding to Node.js `require`. Check out the [docs](http://babeljs.io/docs/usage/require/). - [`@babel/template`](/packages/babel-template) is a helper function that allows constructing AST nodes from a string presentation of the code; this eliminates the tedium of using `@babel/types` for building AST nodes. @@ -62,7 +62,7 @@ The transformer[s] used in Babel are the independent pieces of code that transfo | Package | Version | Dependencies | Description | |--------|-------|------------|---| -| [`@babel/preset-env`](https://github.com/babel/babel-preset-env) | [![npm](https://img.shields.io/npm/v/babel-preset-env.svg?maxAge=2592000)](https://www.npmjs.com/package/babel-preset-env) | [![Dependency Status](https://david-dm.org/babel/babel-preset-env.svg)](https://david-dm.org/babel/babel-preset-env) | automatically determines plugins and polyfills you need based on your supported environments | +| [`@babel/preset-env`](/packages/babel-preset-env) | [![npm](https://img.shields.io/npm/v/@babel/preset-env.svg?maxAge=2592000)](https://www.npmjs.com/package/@babel/preset-env) | [![Dependency Status](https://david-dm.org/babel/babel/status.svg?path=packages/babel-preset-env)](https://david-dm.org/babel/babel?path=packages/babel-preset-env) | automatically determines plugins and polyfills you need based on your supported environments | > You can find community maintained presets on [npm](https://www.npmjs.com/search?q=babel-preset) diff --git a/packages/babel-cli/package.json b/packages/babel-cli/package.json index 8260d9814ef80..1e8722c2758f0 100644 --- a/packages/babel-cli/package.json +++ b/packages/babel-cli/package.json @@ -1,6 +1,6 @@ { "name": "@babel/cli", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Babel command line.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -29,11 +29,11 @@ "chokidar": "^1.6.1" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-fixtures": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-fixtures": "7.0.0-beta.42" }, "bin": { "babel": "./bin/babel.js", diff --git a/packages/babel-cli/src/babel/dir.js b/packages/babel-cli/src/babel/dir.js index ce00f14d858f8..e03daf9cf450e 100644 --- a/packages/babel-cli/src/babel/dir.js +++ b/packages/babel-cli/src/babel/dir.js @@ -6,6 +6,8 @@ import fs from "fs"; import * as util from "./util"; +let compiledFiles = 0; + export default function(commander, filenames, opts) { function write(src, relative, base, callback) { if (typeof base === "function") { @@ -26,7 +28,6 @@ export default function(commander, filenames, opts) { defaults( { sourceFileName: slash(path.relative(dest + "/..", src)), - sourceMapTarget: path.basename(relative), }, opts, ), @@ -42,12 +43,15 @@ export default function(commander, filenames, opts) { ) { const mapLoc = dest + ".map"; res.code = util.addSourceMappingUrl(res.code, mapLoc); + res.map.file = path.basename(relative); outputFileSync(mapLoc, JSON.stringify(res.map)); } outputFileSync(dest, res.code); util.chmod(src, dest); + compiledFiles += 1; + util.log(src + " -> " + dest); return callback(null, true); }, @@ -59,6 +63,13 @@ export default function(commander, filenames, opts) { return path.join(commander.outDir, filename); } + function outputDestFolder(outDir) { + const outDirPath = path.resolve(outDir); + if (!fs.existsSync(outDirPath)) { + fs.mkdirSync(outDirPath); + } + } + function handleFile(src, filename, base, callback) { if (typeof base === "function") { callback = base; @@ -78,6 +89,11 @@ export default function(commander, filenames, opts) { } function sequentialHandleFile(files, dirname, index, callback) { + if (files.length === 0) { + outputDestFolder(commander.outDir); + return; + } + if (typeof index === "function") { callback = index; index = 0; @@ -125,10 +141,17 @@ export default function(commander, filenames, opts) { const filename = filenames[index]; handle(filename, function(err) { - if (err) throw err; + if (err) throw new Error(err); index++; if (index !== filenames.length) { sequentialHandle(filenames, index); + } else { + util.log( + `🎉 Successfully compiled ${compiledFiles} ${ + compiledFiles > 1 ? "files" : "file" + } with Babel.`, + true, + ); } }); } diff --git a/packages/babel-cli/src/babel/file.js b/packages/babel-cli/src/babel/file.js index 9a08545b76595..def6aa3eb7d11 100644 --- a/packages/babel-cli/src/babel/file.js +++ b/packages/babel-cli/src/babel/file.js @@ -16,7 +16,10 @@ export default function(commander, filenames, opts) { const buildResult = function() { const map = new sourceMap.SourceMapGenerator({ - file: path.basename(commander.outFile || "") || "stdout", + file: + commander.sourceMapTarget || + path.basename(commander.outFile || "") || + "stdout", sourceRoot: opts.sourceRoot, }); diff --git a/packages/babel-cli/src/babel/index.js b/packages/babel-cli/src/babel/index.js index 606f5b33cd026..68a4c9b80e45d 100755 --- a/packages/babel-cli/src/babel/index.js +++ b/packages/babel-cli/src/babel/index.js @@ -163,7 +163,7 @@ commander.option( "--include-dotfiles", "Include dotfiles when compiling and copying non-compilable files", ); -commander.option("-q, --quiet", "Don't log anything"); +commander.option("--verbose", "Log everything"); commander.option( "--delete-dir-on-start", "Delete the out directory before compilation", @@ -221,6 +221,17 @@ if (commander.deleteDirOnStart && !commander.outDir) { errors.push("--delete-dir-on-start requires --out-dir"); } +if ( + !commander.outDir && + filenames.length === 0 && + typeof commander.filename !== "string" && + commander.babelrc !== false +) { + errors.push( + "stdin compilation requires either -f/--filename [filename] or --no-babelrc", + ); +} + if (errors.length) { console.error(errors.join(". ")); process.exit(2); @@ -243,11 +254,12 @@ delete opts.outFile; delete opts.outDir; delete opts.copyFiles; delete opts.includeDotfiles; -delete opts.quiet; +delete opts.verbose; delete opts.configFile; delete opts.deleteDirOnStart; delete opts.keepFileExtension; delete opts.relative; +delete opts.sourceMapTarget; // Commander will default the "--no-" arguments to true, but we want to leave them undefined so that // @babel/core can handle the default-assignment logic on its own. diff --git a/packages/babel-cli/src/babel/util.js b/packages/babel-cli/src/babel/util.js index a08580578a49c..d2b1c7795856d 100644 --- a/packages/babel-cli/src/babel/util.js +++ b/packages/babel-cli/src/babel/util.js @@ -46,8 +46,8 @@ export function addSourceMappingUrl(code, loc) { return code + "\n//# sourceMappingURL=" + path.basename(loc); } -export function log(msg) { - if (!commander.quiet) console.log(msg); +export function log(msg, force) { + if (force === true || commander.verbose) console.log(msg); } export function transform(filename, code, opts, callback) { @@ -63,7 +63,7 @@ export function compile(filename, opts, callback) { if (err) { if (commander.watch) { console.error(err); - return callback(null, { ignored: true }); + return callback(null, null); } else { return callback(err); } diff --git a/packages/babel-cli/test/fixtures/babel/--config-file babelrc nocomment/options.json b/packages/babel-cli/test/fixtures/babel/--config-file babelrc nocomment/options.json index 40288838f2047..a5d9f81b4756e 100644 --- a/packages/babel-cli/test/fixtures/babel/--config-file babelrc nocomment/options.json +++ b/packages/babel-cli/test/fixtures/babel/--config-file babelrc nocomment/options.json @@ -1,3 +1,3 @@ { - "args": ["--config-file", "../.othername_babelrc"] -} \ No newline at end of file + "args": ["--config-file", "../.othername_babelrc", "-f", "file.js"] +} diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/options.json index 630fe96c37590..729a051678e27 100644 --- a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/options.json +++ b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/options.json @@ -4,6 +4,7 @@ "--out-dir", "lib", "--copy-files", "--include-dotfiles", - "--ignore", "src/foo" + "--ignore", "src/foo", + "--verbose" ] } diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/stdout.txt index 6a861c56743bf..4c36e94a0a235 100644 --- a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore/stdout.txt @@ -1 +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 --include-dotfiles with only/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/options.json index 11a257f17477a..64034dfa62daf 100644 --- a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/options.json +++ b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/options.json @@ -4,6 +4,7 @@ "--out-dir", "lib", "--copy-files", "--include-dotfiles", - "--only", "src/foo" + "--only", "src/foo", + "--verbose" ] } diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/stdout.txt index 10cf3c8b56193..f6e3f3a3ade64 100644 --- a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/stdout.txt @@ -1,2 +1,3 @@ src/foo/.foo.js -> lib/foo/.foo.js src/foo/bar.js -> lib/foo/bar.js +🎉 Successfully compiled 2 files with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/options.json index 977282bb22f0f..4d90f91ad5f4e 100644 --- a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/options.json +++ b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/options.json @@ -1,3 +1,3 @@ { - "args": ["src", "--out-dir", "lib", "--copy-files", "--include-dotfiles"] + "args": ["src", "--out-dir", "lib", "--copy-files", "--include-dotfiles", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/stdout.txt index 0b10e8a19514c..fdc15905a3bbf 100644 --- a/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/stdout.txt @@ -1,3 +1,4 @@ src/.foo.js -> lib/.foo.js src/bar/index.js -> lib/bar/index.js src/foo/foo.js -> lib/foo/foo.js +🎉 Successfully compiled 3 files with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore/options.json index 184b645047024..c5551001db26e 100644 --- a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore/options.json +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore/options.json @@ -3,6 +3,7 @@ "src", "--out-dir", "lib", "--copy-files", - "--ignore", "src/foo/*" + "--ignore", "src/foo/*", + "--verbose" ] } diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore/stdout.txt index 6a861c56743bf..4c36e94a0a235 100644 --- a/packages/babel-cli/test/fixtures/babel/--copy-files with ignore/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with ignore/stdout.txt @@ -1 +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/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files with only/options.json index 668ea26458345..a1c2f38e399eb 100644 --- a/packages/babel-cli/test/fixtures/babel/--copy-files with only/options.json +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with only/options.json @@ -3,6 +3,7 @@ "src", "--out-dir", "lib", "--copy-files", - "--only", "src/foo/*" + "--only", "src/foo/*", + "--verbose" ] } diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files with only/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files with only/stdout.txt index e0a4d292bbbeb..2021cfb5e6039 100644 --- a/packages/babel-cli/test/fixtures/babel/--copy-files with only/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/--copy-files with only/stdout.txt @@ -1 +1,2 @@ src/foo/bar.js -> lib/foo/bar.js +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files/options.json b/packages/babel-cli/test/fixtures/babel/--copy-files/options.json index 68814a2001596..c328b7ff8d234 100644 --- a/packages/babel-cli/test/fixtures/babel/--copy-files/options.json +++ b/packages/babel-cli/test/fixtures/babel/--copy-files/options.json @@ -1,3 +1,3 @@ { - "args": ["src", "--out-dir", "lib", "--copy-files"] + "args": ["src", "--out-dir", "lib", "--copy-files", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/--copy-files/stdout.txt b/packages/babel-cli/test/fixtures/babel/--copy-files/stdout.txt index 4a85f7008cf34..80351563d03d6 100644 --- a/packages/babel-cli/test/fixtures/babel/--copy-files/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/--copy-files/stdout.txt @@ -1,2 +1,3 @@ src/bar/index.js -> lib/bar/index.js src/foo/foo.js -> lib/foo/foo.js +🎉 Successfully compiled 2 files with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--ignore complete/options.json b/packages/babel-cli/test/fixtures/babel/--ignore complete/options.json index b4c4db71f38be..e273636154d4f 100644 --- a/packages/babel-cli/test/fixtures/babel/--ignore complete/options.json +++ b/packages/babel-cli/test/fixtures/babel/--ignore complete/options.json @@ -1,3 +1,3 @@ { - "args": ["src", "--out-dir", "lib", "--ignore", "src/bar"] + "args": ["src", "--out-dir", "lib", "--ignore", "src/bar", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/--ignore complete/stdout.txt b/packages/babel-cli/test/fixtures/babel/--ignore complete/stdout.txt index 437c95684152a..0d15bf2ae095a 100644 --- a/packages/babel-cli/test/fixtures/babel/--ignore complete/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/--ignore complete/stdout.txt @@ -1 +1,2 @@ src/foobar/foo.js -> lib/foobar/foo.js +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--ignore glob/options.json b/packages/babel-cli/test/fixtures/babel/--ignore glob/options.json index 8c15a2b28c51b..7d99d8d040d5a 100644 --- a/packages/babel-cli/test/fixtures/babel/--ignore glob/options.json +++ b/packages/babel-cli/test/fixtures/babel/--ignore glob/options.json @@ -1,3 +1,3 @@ { - "args": ["src", "--out-dir", "lib", "--ignore", "**/*.foo.js"] + "args": ["src", "--out-dir", "lib", "--ignore", "**/*.foo.js", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/--ignore glob/stdout.txt b/packages/babel-cli/test/fixtures/babel/--ignore glob/stdout.txt index 22e2f9915714d..03b326e512c3a 100644 --- a/packages/babel-cli/test/fixtures/babel/--ignore glob/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/--ignore glob/stdout.txt @@ -2,3 +2,4 @@ src/a.js -> lib/a.js src/b.js -> lib/b.js src/baz/c.js -> lib/baz/c.js src/foo.js -> lib/foo.js +🎉 Successfully compiled 4 files with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--ignore/options.json b/packages/babel-cli/test/fixtures/babel/--ignore/options.json index 1911426f62ba9..3673f5a490dad 100644 --- a/packages/babel-cli/test/fixtures/babel/--ignore/options.json +++ b/packages/babel-cli/test/fixtures/babel/--ignore/options.json @@ -1,3 +1,3 @@ { - "args": ["src", "--out-dir", "lib", "--ignore", "src/foo/*"] + "args": ["src", "--out-dir", "lib", "--ignore", "src/foo/*", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/--ignore/stdout.txt b/packages/babel-cli/test/fixtures/babel/--ignore/stdout.txt index 1eb8f922d18f7..1c0cc552e31b0 100644 --- a/packages/babel-cli/test/fixtures/babel/--ignore/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/--ignore/stdout.txt @@ -1 +1,2 @@ src/bar/index.js -> lib/bar/index.js +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--only glob/options.json b/packages/babel-cli/test/fixtures/babel/--only glob/options.json index 8066c21c83984..48cb01f4e5b18 100644 --- a/packages/babel-cli/test/fixtures/babel/--only glob/options.json +++ b/packages/babel-cli/test/fixtures/babel/--only glob/options.json @@ -1,3 +1,3 @@ { - "args": ["src", "--out-dir", "lib", "--only", "**/*.foo.js"] + "args": ["src", "--out-dir", "lib", "--only", "**/*.foo.js", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/--only glob/stdout.txt b/packages/babel-cli/test/fixtures/babel/--only glob/stdout.txt index ff1917afe9bf3..a5c024b79339d 100644 --- a/packages/babel-cli/test/fixtures/babel/--only glob/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/--only glob/stdout.txt @@ -1,2 +1,3 @@ src/a.foo.js -> lib/a.foo.js src/baz/b.foo.js -> lib/baz/b.foo.js +🎉 Successfully compiled 2 files with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/--only/options.json b/packages/babel-cli/test/fixtures/babel/--only/options.json index 7b05f3fb824c6..16a8c29b33bb7 100644 --- a/packages/babel-cli/test/fixtures/babel/--only/options.json +++ b/packages/babel-cli/test/fixtures/babel/--only/options.json @@ -1,3 +1,3 @@ { - "args": ["src", "--out-dir", "lib", "--only", "src/bar/*"] + "args": ["src", "--out-dir", "lib", "--only", "src/bar/*", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/--only/stdout.txt b/packages/babel-cli/test/fixtures/babel/--only/stdout.txt index 1eb8f922d18f7..1c0cc552e31b0 100644 --- a/packages/babel-cli/test/fixtures/babel/--only/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/--only/stdout.txt @@ -1 +1,2 @@ src/bar/index.js -> lib/bar/index.js +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --copy-files/options.json b/packages/babel-cli/test/fixtures/babel/dir --out-dir --copy-files/options.json index 68814a2001596..c328b7ff8d234 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --copy-files/options.json +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --copy-files/options.json @@ -1,3 +1,3 @@ { - "args": ["src", "--out-dir", "lib", "--copy-files"] + "args": ["src", "--out-dir", "lib", "--copy-files", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --copy-files/stdout.txt b/packages/babel-cli/test/fixtures/babel/dir --out-dir --copy-files/stdout.txt index 6ef9b7ad4df28..b690683b8428e 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --copy-files/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --copy-files/stdout.txt @@ -1 +1,2 @@ src/foo.js -> lib/foo.js +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --keep-file-extension/options.json b/packages/babel-cli/test/fixtures/babel/dir --out-dir --keep-file-extension/options.json index 887810a2b82c9..2a0df371e55eb 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --keep-file-extension/options.json +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --keep-file-extension/options.json @@ -1,3 +1,3 @@ { - "args": ["src", "--out-dir", "lib", "--keep-file-extension"] + "args": ["src", "--out-dir", "lib", "--keep-file-extension", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --keep-file-extension/stdout.txt b/packages/babel-cli/test/fixtures/babel/dir --out-dir --keep-file-extension/stdout.txt index 9d19a99d25add..ab55e4731f6d2 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --keep-file-extension/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --keep-file-extension/stdout.txt @@ -1,2 +1,3 @@ src/bar.mjs -> lib/bar.mjs src/foo.js -> lib/foo.js +🎉 Successfully compiled 2 files with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --relative/options.json b/packages/babel-cli/test/fixtures/babel/dir --out-dir --relative/options.json index a05b1cfc2e9ba..45b79c66e8109 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --relative/options.json +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --relative/options.json @@ -1,3 +1,3 @@ { - "args": ["**/src", "--out-dir", "../lib", "--relative"] + "args": ["**/src", "--out-dir", "../lib", "--relative", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --relative/stdout.txt b/packages/babel-cli/test/fixtures/babel/dir --out-dir --relative/stdout.txt index 8215dd3c4ce65..ced29141cd942 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --relative/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --relative/stdout.txt @@ -2,3 +2,4 @@ package1/src/bar/bar1.js -> package1/lib/bar/bar1.js package1/src/foo1.js -> package1/lib/foo1.js package2/src/bar/bar2.js -> package2/lib/bar/bar2.js package2/src/foo2.js -> package2/lib/foo2.js +🎉 Successfully compiled 4 files with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/options.json b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/options.json index a8ab8839618bb..73170caecde00 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/options.json +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/options.json @@ -1,3 +1,3 @@ { - "args": ["src", "--source-maps", "inline", "--out-dir", "lib"] + "args": ["src", "--source-maps", "inline", "--out-dir", "lib", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/out-files/lib/bar/bar.js b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/out-files/lib/bar/bar.js index 8216b06eeb6b8..7bc139ae8a2fa 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/out-files/lib/bar/bar.js +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/out-files/lib/bar/bar.js @@ -7,4 +7,4 @@ function _classCallCheck(instance, Constructor) { if (!_instanceof(instance, Con var Test = function Test() { _classCallCheck(this, Test); }; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9iYXIvYmFyLmpzIl0sIm5hbWVzIjpbIlRlc3QiXSwibWFwcGluZ3MiOiI7Ozs7OztJQUFNQSxJIiwiZmlsZSI6ImJhci5qcyIsInNvdXJjZXNDb250ZW50IjpbImNsYXNzIFRlc3Qge1xuXG59Il19 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9iYXIvYmFyLmpzIl0sIm5hbWVzIjpbIlRlc3QiXSwibWFwcGluZ3MiOiI7Ozs7OztJQUFNQSxJIiwic291cmNlc0NvbnRlbnQiOlsiY2xhc3MgVGVzdCB7XG5cbn0iXX0= diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/out-files/lib/foo.js b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/out-files/lib/foo.js index 6439e69a2f219..a7df874e439c8 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/out-files/lib/foo.js +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/out-files/lib/foo.js @@ -3,4 +3,4 @@ arr.map(function (x) { return x * MULTIPLIER; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9mb28uanMiXSwibmFtZXMiOlsiYXJyIiwibWFwIiwieCIsIk1VTFRJUExJRVIiXSwibWFwcGluZ3MiOiI7O0FBQUFBLElBQUlDLEdBQUosQ0FBUTtBQUFBLFNBQUtDLElBQUlDLFVBQVQ7QUFBQSxDQUFSIiwiZmlsZSI6ImZvby5qcyIsInNvdXJjZXNDb250ZW50IjpbImFyci5tYXAoeCA9PiB4ICogTVVMVElQTElFUik7Il19 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9mb28uanMiXSwibmFtZXMiOlsiYXJyIiwibWFwIiwieCIsIk1VTFRJUExJRVIiXSwibWFwcGluZ3MiOiI7O0FBQUFBLElBQUlDLEdBQUosQ0FBUTtBQUFBLFNBQUtDLElBQUlDLFVBQVQ7QUFBQSxDQUFSIiwic291cmNlc0NvbnRlbnQiOlsiYXJyLm1hcCh4ID0+IHggKiBNVUxUSVBMSUVSKTsiXX0= diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/stdout.txt b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/stdout.txt index a3d53cf84adea..04928a9cbfed2 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps inline/stdout.txt @@ -1,2 +1,3 @@ src/bar/bar.js -> lib/bar/bar.js src/foo.js -> lib/foo.js +🎉 Successfully compiled 2 files with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/options.json b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/options.json index e7e56fba3134f..682964ac91f89 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/options.json +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/options.json @@ -1,3 +1,3 @@ { - "args": ["src", "--source-maps", "--out-dir", "lib"] + "args": ["src", "--source-maps", "--out-dir", "lib", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/out-files/lib/bar/bar.js.map b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/out-files/lib/bar/bar.js.map index a970cba9440cf..99078be50b8a3 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/out-files/lib/bar/bar.js.map +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/out-files/lib/bar/bar.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../src/bar/bar.js"],"names":["Test"],"mappings":";;;;;;IAAMA,I","file":"bar.js","sourcesContent":["class Test {\n\n}"]} +{"version":3,"sources":["../../src/bar/bar.js"],"names":["Test"],"mappings":";;;;;;IAAMA,I","sourcesContent":["class Test {\n\n}"],"file":"bar.js"} diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/out-files/lib/foo.js.map b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/out-files/lib/foo.js.map index a97ad9e88f10c..595013088ca27 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/out-files/lib/foo.js.map +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/out-files/lib/foo.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/foo.js"],"names":["arr","map","x","MULTIPLIER"],"mappings":";;AAAAA,IAAIC,GAAJ,CAAQ;AAAA,SAAKC,IAAIC,UAAT;AAAA,CAAR","file":"foo.js","sourcesContent":["arr.map(x => x * MULTIPLIER);"]} +{"version":3,"sources":["../src/foo.js"],"names":["arr","map","x","MULTIPLIER"],"mappings":";;AAAAA,IAAIC,GAAJ,CAAQ;AAAA,SAAKC,IAAIC,UAAT;AAAA,CAAR","sourcesContent":["arr.map(x => x * MULTIPLIER);"],"file":"foo.js"} diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/stdout.txt b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/stdout.txt index a3d53cf84adea..04928a9cbfed2 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --source-maps/stdout.txt @@ -1,2 +1,3 @@ src/bar/bar.js -> lib/bar/bar.js src/foo.js -> lib/foo.js +🎉 Successfully compiled 2 files with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/in-files/src/bar/bar.js b/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/in-files/src/bar/bar.js new file mode 100644 index 0000000000000..45842c5e26744 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/in-files/src/bar/bar.js @@ -0,0 +1,3 @@ +class Test { + +} diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/in-files/src/foo.js b/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/in-files/src/foo.js new file mode 100644 index 0000000000000..4bc9539528d45 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/in-files/src/foo.js @@ -0,0 +1 @@ +arr.map(x => x * MULTIPLIER); diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/options.json b/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/options.json new file mode 100644 index 0000000000000..e9f6da4434450 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/options.json @@ -0,0 +1,3 @@ +{ + "args": ["src", "--out-dir", "lib", "--verbose"] +} diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/out-files/lib/bar/bar.js b/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/out-files/lib/bar/bar.js new file mode 100644 index 0000000000000..0381c2a965d90 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/out-files/lib/bar/bar.js @@ -0,0 +1,9 @@ +"use strict"; + +function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } } + +function _classCallCheck(instance, Constructor) { if (!_instanceof(instance, Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Test = function Test() { + _classCallCheck(this, Test); +}; diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/out-files/lib/foo.js b/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/out-files/lib/foo.js new file mode 100644 index 0000000000000..ae4557e57bc3d --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/out-files/lib/foo.js @@ -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 --verbose/stdout.txt b/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/stdout.txt new file mode 100644 index 0000000000000..04928a9cbfed2 --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir --verbose/stdout.txt @@ -0,0 +1,3 @@ +src/bar/bar.js -> lib/bar/bar.js +src/foo.js -> lib/foo.js +🎉 Successfully compiled 2 files with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/dir --out-dir/stdout.txt b/packages/babel-cli/test/fixtures/babel/dir --out-dir/stdout.txt index a3d53cf84adea..15992c65fdcef 100644 --- a/packages/babel-cli/test/fixtures/babel/dir --out-dir/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/dir --out-dir/stdout.txt @@ -1,2 +1 @@ -src/bar/bar.js -> lib/bar/bar.js -src/foo.js -> lib/foo.js +🎉 Successfully compiled 2 files with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/empty dir --out-dir/in-files/src/.gitkeep b/packages/babel-cli/test/fixtures/babel/empty dir --out-dir/in-files/src/.gitkeep new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/packages/babel-cli/test/fixtures/babel/empty dir --out-dir/options.json b/packages/babel-cli/test/fixtures/babel/empty dir --out-dir/options.json new file mode 100644 index 0000000000000..0aeb1496b74ee --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/empty dir --out-dir/options.json @@ -0,0 +1,3 @@ +{ + "args": ["src", "--out-dir", "lib"] +} diff --git a/packages/babel-cli/test/fixtures/babel/empty dir --out-dir/out-files/src/.gitkeep b/packages/babel-cli/test/fixtures/babel/empty dir --out-dir/out-files/src/.gitkeep new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/packages/babel-cli/test/fixtures/babel/empty dir --out-dir/stdout.txt b/packages/babel-cli/test/fixtures/babel/empty dir --out-dir/stdout.txt new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/packages/babel-cli/test/fixtures/babel/filename --out-dir --relative/options.json b/packages/babel-cli/test/fixtures/babel/filename --out-dir --relative/options.json index c583027328b3f..c2fdbb1b69c0b 100644 --- a/packages/babel-cli/test/fixtures/babel/filename --out-dir --relative/options.json +++ b/packages/babel-cli/test/fixtures/babel/filename --out-dir --relative/options.json @@ -1,3 +1,3 @@ { - "args": ["src/foo.js", "--out-dir", "../lib", "--relative"] + "args": ["src/foo.js", "--out-dir", "../lib", "--relative", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/filename --out-dir --relative/stdout.txt b/packages/babel-cli/test/fixtures/babel/filename --out-dir --relative/stdout.txt index 6ef9b7ad4df28..b690683b8428e 100644 --- a/packages/babel-cli/test/fixtures/babel/filename --out-dir --relative/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/filename --out-dir --relative/stdout.txt @@ -1 +1,2 @@ src/foo.js -> lib/foo.js +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/filename --out-dir/options.json b/packages/babel-cli/test/fixtures/babel/filename --out-dir/options.json index bd4747099a411..f466c8dcceb59 100644 --- a/packages/babel-cli/test/fixtures/babel/filename --out-dir/options.json +++ b/packages/babel-cli/test/fixtures/babel/filename --out-dir/options.json @@ -1,3 +1,3 @@ { - "args": ["src/foo.js", "--out-dir", "lib"] + "args": ["src/foo.js", "--out-dir", "lib", "--verbose"] } diff --git a/packages/babel-cli/test/fixtures/babel/filename --out-dir/stdout.txt b/packages/babel-cli/test/fixtures/babel/filename --out-dir/stdout.txt index 6ef9b7ad4df28..b690683b8428e 100644 --- a/packages/babel-cli/test/fixtures/babel/filename --out-dir/stdout.txt +++ b/packages/babel-cli/test/fixtures/babel/filename --out-dir/stdout.txt @@ -1 +1,2 @@ src/foo.js -> lib/foo.js +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-cli/test/fixtures/babel/stdin --out-file/options.json b/packages/babel-cli/test/fixtures/babel/stdin --out-file/options.json index 5c5b1a4baae88..7c157aa203bcd 100644 --- a/packages/babel-cli/test/fixtures/babel/stdin --out-file/options.json +++ b/packages/babel-cli/test/fixtures/babel/stdin --out-file/options.json @@ -1,3 +1,3 @@ { - "args": ["--out-file", "script.js"] + "args": ["--out-file", "script.js", "-f", "file.js"] } diff --git a/packages/babel-cli/test/fixtures/babel/stdin/options.json b/packages/babel-cli/test/fixtures/babel/stdin/options.json new file mode 100644 index 0000000000000..a9f1532c7173a --- /dev/null +++ b/packages/babel-cli/test/fixtures/babel/stdin/options.json @@ -0,0 +1,3 @@ +{ + "args": ["-f", "file.js"] +} diff --git a/packages/babel-cli/test/index.js b/packages/babel-cli/test/index.js index 83142accb5693..7fe80bc7feced 100644 --- a/packages/babel-cli/test/index.js +++ b/packages/babel-cli/test/index.js @@ -122,7 +122,13 @@ const buildTest = function(binName, testName, opts) { const binLoc = path.join(__dirname, "../lib", binName); return function(callback) { - clear(); + 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]; @@ -160,6 +166,7 @@ const buildTest = function(binName, testName, opts) { args.map(arg => `"${arg}"`).join(" ") + ": " + err.message; } + process.chdir(dir); callback(err); }); @@ -170,13 +177,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; diff --git a/packages/babel-code-frame/package.json b/packages/babel-code-frame/package.json index 3f376522abb5e..58b486da085d7 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Generate errors that contain a code frame that point to source locations.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -8,11 +8,10 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-code-frame", "main": "lib/index.js", "dependencies": { - "chalk": "^2.0.0", - "esutils": "^2.0.2", - "js-tokens": "^3.0.0" + "@babel/highlight": "7.0.0-beta.42" }, "devDependencies": { + "chalk": "^2.0.0", "strip-ansi": "^4.0.0" } } diff --git a/packages/babel-code-frame/src/index.js b/packages/babel-code-frame/src/index.js index c8da91a5ae8c9..70237db65192f 100644 --- a/packages/babel-code-frame/src/index.js +++ b/packages/babel-code-frame/src/index.js @@ -1,6 +1,4 @@ -import jsTokens, { matchToToken } from "js-tokens"; -import esutils from "esutils"; -import Chalk from "chalk"; +import highlight, { shouldHighlight, getChalk } from "@babel/highlight"; let deprecationWarningShown = false; @@ -15,21 +13,10 @@ type NodeLocation = { }; /** - * Chalk styles for token types. + * Chalk styles for code frame token types. */ - function getDefs(chalk) { return { - keyword: chalk.cyan, - capitalized: chalk.yellow, - jsx_tag: chalk.yellow, - punctuator: chalk.yellow, - // bracket: intentionally omitted. - number: chalk.magenta, - string: chalk.green, - regex: chalk.magenta, - comment: chalk.grey, - invalid: chalk.white.bgRed.bold, gutter: chalk.grey, marker: chalk.red.bold, message: chalk.red.bold, @@ -42,76 +29,6 @@ function getDefs(chalk) { const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; -/** - * RegExp to test for what seems to be a JSX tag name. - */ - -const JSX_TAG = /^[a-z][\w-]*$/i; - -/** - * RegExp to test for the three types of brackets. - */ - -const BRACKET = /^[()[\]{}]$/; - -/** - * Get the type of token, specifying punctuator type. - */ - -function getTokenType(match) { - const [offset, text] = match.slice(-2); - const token = matchToToken(match); - - if (token.type === "name") { - if (esutils.keyword.isReservedWordES6(token.value)) { - return "keyword"; - } - - if ( - JSX_TAG.test(token.value) && - (text[offset - 1] === "<" || text.substr(offset - 2, 2) == " colorize(str)) - .join("\n"); - } else { - return args[0]; - } - }); -} - /** * Extract what lines should be marked and highlighted. */ @@ -127,9 +44,7 @@ function getMarkerLines( loc.start, ); const endLoc: Location = Object.assign({}, startLoc, loc.end); - const linesAbove = opts.linesAbove || 2; - const linesBelow = opts.linesBelow || 3; - + const { linesAbove = 2, linesBelow = 3 } = opts || {}; const startLine = startLoc.line; const startColumn = startLoc.column; const endLine = endLoc.line; @@ -188,16 +103,13 @@ export function codeFrameColumns( opts: Object = {}, ): string { const highlighted = - (opts.highlightCode && Chalk.supportsColor) || opts.forceColor; - let chalk = Chalk; - if (opts.forceColor) { - chalk = new Chalk.constructor({ enabled: true, level: 1 }); - } + (opts.highlightCode || opts.forceColor) && shouldHighlight(opts); + const chalk = getChalk(opts); + const defs = getDefs(chalk); const maybeHighlight = (chalkFn, string) => { return highlighted ? chalkFn(string) : string; }; - const defs = getDefs(chalk); - if (highlighted) rawLines = highlight(defs, rawLines); + if (highlighted) rawLines = highlight(rawLines, opts); const lines = rawLines.split(NEWLINE); const { start, end, markerLines } = getMarkerLines(loc, lines, opts); @@ -268,15 +180,17 @@ export default function( if (!deprecationWarningShown) { deprecationWarningShown = true; - const deprecationError = new Error( - "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.", - ); - deprecationError.name = "DeprecationWarning"; + const message = + "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; if (process.emitWarning) { - process.emitWarning(deprecationError); + // A string is directly supplied to emitWarning, because when supplying an + // Error object node throws in the tests because of different contexts + process.emitWarning(message, "DeprecationWarning"); } else { - console.warn(deprecationError); + const deprecationError = new Error(message); + deprecationError.name = "DeprecationWarning"; + console.warn(new Error(message)); } } diff --git a/packages/babel-code-frame/test/index.js b/packages/babel-code-frame/test/index.js index 7f097ce77396a..c06214c5b4e52 100644 --- a/packages/babel-code-frame/test/index.js +++ b/packages/babel-code-frame/test/index.js @@ -1,13 +1,11 @@ -import assert from "assert"; import chalk from "chalk"; import stripAnsi from "strip-ansi"; import codeFrame, { codeFrameColumns } from ".."; describe("@babel/code-frame", function() { - it("basic usage", function() { + test("basic usage", function() { const rawLines = ["class Foo {", " constructor()", "};"].join("\n"); - assert.equal( - codeFrame(rawLines, 2, 16), + expect(codeFrame(rawLines, 2, 16)).toEqual( [ " 1 | class Foo {", "> 2 | constructor()", @@ -17,15 +15,14 @@ describe("@babel/code-frame", function() { ); }); - it("optional column number", function() { + test("optional column number", function() { const rawLines = ["class Foo {", " constructor()", "};"].join("\n"); - assert.equal( - codeFrame(rawLines, 2, null), + expect(codeFrame(rawLines, 2, null)).toEqual( [" 1 | class Foo {", "> 2 | constructor()", " 3 | };"].join("\n"), ); }); - it("maximum context lines and padding", function() { + test("maximum context lines and padding", function() { const rawLines = [ "/**", " * Sums two numbers.", @@ -39,8 +36,7 @@ describe("@babel/code-frame", function() { " return a + b", "}", ].join("\n"); - assert.equal( - codeFrame(rawLines, 7, 2), + expect(codeFrame(rawLines, 7, 2)).toEqual( [ " 5 | * @param b Number", " 6 | * @returns Number", @@ -53,7 +49,7 @@ describe("@babel/code-frame", function() { ); }); - it("no unnecessary padding due to one-off errors", function() { + test("no unnecessary padding due to one-off errors", function() { const rawLines = [ "/**", " * Sums two numbers.", @@ -67,8 +63,7 @@ describe("@babel/code-frame", function() { " return a + b", "}", ].join("\n"); - assert.equal( - codeFrame(rawLines, 6, 2), + expect(codeFrame(rawLines, 6, 2)).toEqual( [ " 4 | * @param a Number", " 5 | * @param b Number", @@ -81,14 +76,13 @@ describe("@babel/code-frame", function() { ); }); - it("tabs", function() { + test("tabs", function() { const rawLines = [ "\tclass Foo {", "\t \t\t constructor\t(\t)", "\t};", ].join("\n"); - assert.equal( - codeFrame(rawLines, 2, 25), + expect(codeFrame(rawLines, 2, 25)).toEqual( [ " 1 | \tclass Foo {", "> 2 | \t \t\t constructor\t(\t)", @@ -98,18 +92,17 @@ describe("@babel/code-frame", function() { ); }); - it("opts.highlightCode", function() { + test("opts.highlightCode", function() { const rawLines = "console.log('babel')"; const result = codeFrame(rawLines, 1, 9, { highlightCode: true }); const stripped = stripAnsi(result); - assert.ok(result.length > stripped.length); - assert.equal( - stripped, + expect(result.length).toBeGreaterThan(stripped.length); + expect(stripped).toEqual( ["> 1 | console.log('babel')", " | ^"].join("\n"), ); }); - it("opts.linesAbove", function() { + test("opts.linesAbove", function() { const rawLines = [ "/**", " * Sums two numbers.", @@ -123,8 +116,7 @@ describe("@babel/code-frame", function() { " return a + b", "}", ].join("\n"); - assert.equal( - codeFrame(rawLines, 7, 2, { linesAbove: 1 }), + expect(codeFrame(rawLines, 7, 2, { linesAbove: 1 })).toEqual( [ " 6 | * @returns Number", "> 7 | */", @@ -136,7 +128,7 @@ describe("@babel/code-frame", function() { ); }); - it("opts.linesBelow", function() { + test("opts.linesBelow", function() { const rawLines = [ "/**", " * Sums two numbers.", @@ -150,8 +142,7 @@ describe("@babel/code-frame", function() { " return a + b", "}", ].join("\n"); - assert.equal( - codeFrame(rawLines, 7, 2, { linesBelow: 1 }), + expect(codeFrame(rawLines, 7, 2, { linesBelow: 1 })).toEqual( [ " 5 | * @param b Number", " 6 | * @returns Number", @@ -162,7 +153,7 @@ describe("@babel/code-frame", function() { ); }); - it("opts.linesAbove and opts.linesBelow", function() { + test("opts.linesAbove and opts.linesBelow", function() { const rawLines = [ "/**", " * Sums two numbers.", @@ -176,25 +167,75 @@ describe("@babel/code-frame", function() { " return a + b", "}", ].join("\n"); - assert.equal( - codeFrame(rawLines, 7, 2, { linesAbove: 1, linesBelow: 1 }), + expect(codeFrame(rawLines, 7, 2, { linesAbove: 1, linesBelow: 1 })).toEqual( [" 6 | * @returns Number", "> 7 | */", " | ^", " 8 | "].join( "\n", ), ); }); - it("opts.forceColor", function() { + test("opts.linesAbove no lines above", function() { + const rawLines = [ + "class Foo {", + " constructor() {", + " console.log(arguments);", + " }", + "};", + ].join("\n"); + expect( + codeFrameColumns(rawLines, { start: { line: 2 } }, { linesAbove: 0 }), + ).toEqual( + [ + "> 2 | constructor() {", + " 3 | console.log(arguments);", + " 4 | }", + " 5 | };", + ].join("\n"), + ); + }); + + test("opts.linesBelow no lines below", function() { + const rawLines = [ + "class Foo {", + " constructor() {", + " console.log(arguments);", + " }", + "};", + ].join("\n"); + expect( + codeFrameColumns(rawLines, { start: { line: 2 } }, { linesBelow: 0 }), + ).toEqual([" 1 | class Foo {", "> 2 | constructor() {"].join("\n")); + }); + + test("opts.linesBelow single line", function() { + const rawLines = [ + "class Foo {", + " constructor() {", + " console.log(arguments);", + " }", + "};", + ].join("\n"); + expect( + codeFrameColumns( + rawLines, + { start: { line: 2 } }, + { linesAbove: 0, linesBelow: 0 }, + ), + ).toEqual(["> 2 | constructor() {"].join("\n")); + }); + + test("opts.forceColor", function() { const marker = chalk.red.bold; const gutter = chalk.grey; const rawLines = ["", "", "", ""].join("\n"); - assert.equal( + expect( codeFrame(rawLines, 3, null, { linesAbove: 1, linesBelow: 1, forceColor: true, }), + ).toEqual( chalk.reset( [ " " + gutter(" 2 | "), @@ -205,10 +246,11 @@ describe("@babel/code-frame", function() { ); }); - it("basic usage, new API", function() { + test("basic usage, new API", function() { const rawLines = ["class Foo {", " constructor()", "};"].join("\n"); - assert.equal( + expect( codeFrameColumns(rawLines, { start: { line: 2, column: 16 } }), + ).toEqual( [ " 1 | class Foo {", "> 2 | constructor()", @@ -218,13 +260,14 @@ describe("@babel/code-frame", function() { ); }); - it("mark multiple columns", function() { + test("mark multiple columns", function() { const rawLines = ["class Foo {", " constructor()", "};"].join("\n"); - assert.equal( + expect( codeFrameColumns(rawLines, { start: { line: 2, column: 3 }, end: { line: 2, column: 16 }, }), + ).toEqual( [ " 1 | class Foo {", "> 2 | constructor()", @@ -234,15 +277,16 @@ describe("@babel/code-frame", function() { ); }); - it("mark multiple columns across lines", function() { + test("mark multiple columns across lines", function() { const rawLines = ["class Foo {", " constructor() {", " }", "};"].join( "\n", ); - assert.equal( + expect( codeFrameColumns(rawLines, { start: { line: 2, column: 17 }, end: { line: 3, column: 3 }, }), + ).toEqual( [ " 1 | class Foo {", "> 2 | constructor() {", @@ -254,7 +298,7 @@ describe("@babel/code-frame", function() { ); }); - it("mark multiple columns across multiple lines", function() { + test("mark multiple columns across multiple lines", function() { const rawLines = [ "class Foo {", " constructor() {", @@ -262,11 +306,12 @@ describe("@babel/code-frame", function() { " }", "};", ].join("\n"); - assert.equal( + expect( codeFrameColumns(rawLines, { start: { line: 2, column: 17 }, end: { line: 4, column: 3 }, }), + ).toEqual( [ " 1 | class Foo {", "> 2 | constructor() {", @@ -280,7 +325,7 @@ describe("@babel/code-frame", function() { ); }); - it("mark across multiple lines without columns", function() { + test("mark across multiple lines without columns", function() { const rawLines = [ "class Foo {", " constructor() {", @@ -288,8 +333,9 @@ describe("@babel/code-frame", function() { " }", "};", ].join("\n"); - assert.equal( + expect( codeFrameColumns(rawLines, { start: { line: 2 }, end: { line: 4 } }), + ).toEqual( [ " 1 | class Foo {", "> 2 | constructor() {", @@ -300,9 +346,9 @@ describe("@babel/code-frame", function() { ); }); - it("opts.message", function() { + test("opts.message", function() { const rawLines = ["class Foo {", " constructor()", "};"].join("\n"); - assert.equal( + expect( codeFrameColumns( rawLines, { start: { line: 2, column: 16 } }, @@ -310,6 +356,7 @@ describe("@babel/code-frame", function() { message: "Missing {", }, ), + ).toEqual( [ " 1 | class Foo {", "> 2 | constructor()", @@ -319,9 +366,9 @@ describe("@babel/code-frame", function() { ); }); - it("opts.message without column", function() { + test("opts.message without column", function() { const rawLines = ["class Foo {", " constructor()", "};"].join("\n"); - assert.equal( + expect( codeFrameColumns( rawLines, { start: { line: 2 } }, @@ -329,6 +376,7 @@ describe("@babel/code-frame", function() { message: "Missing {", }, ), + ).toEqual( [ " Missing {", " 1 | class Foo {", @@ -338,7 +386,7 @@ describe("@babel/code-frame", function() { ); }); - it("opts.message with multiple lines", function() { + test("opts.message with multiple lines", function() { const rawLines = [ "class Foo {", " constructor() {", @@ -346,7 +394,7 @@ describe("@babel/code-frame", function() { " }", "};", ].join("\n"); - assert.equal( + expect( codeFrameColumns( rawLines, { @@ -357,6 +405,7 @@ describe("@babel/code-frame", function() { message: "something about the constructor body", }, ), + ).toEqual( [ " 1 | class Foo {", "> 2 | constructor() {", @@ -370,7 +419,7 @@ describe("@babel/code-frame", function() { ); }); - it("opts.message with multiple lines without columns", function() { + test("opts.message with multiple lines without columns", function() { const rawLines = [ "class Foo {", " constructor() {", @@ -378,7 +427,7 @@ describe("@babel/code-frame", function() { " }", "};", ].join("\n"); - assert.equal( + expect( codeFrameColumns( rawLines, { start: { line: 2 }, end: { line: 4 } }, @@ -386,6 +435,7 @@ describe("@babel/code-frame", function() { message: "something about the constructor body", }, ), + ).toEqual( [ " something about the constructor body", " 1 | class Foo {", diff --git a/packages/babel-core/README.md b/packages/babel-core/README.md index 24262bec47d69..8814930519cde 100644 --- a/packages/babel-core/README.md +++ b/packages/babel-core/README.md @@ -93,7 +93,7 @@ babel.transformFileSync("filename.js", options).code; ``` -## babel.transformFromAst(ast: Object, code?: string, [options?](#options): Object, callback: Function) +## babel.transformFromAst(ast: Object, code?: string, [options?](#options): Object, callback: Function): FileNode | null Given an [AST](https://astexplorer.net/), transform it. @@ -123,6 +123,79 @@ const parsedAst = babylon.parse(sourceCode, { allowReturnOutsideFunction: true } const { code, map, ast } = babel.transformFromAstSync(parsedAst, sourceCode, options); ``` +## babel.parse(code: string, [options?](#options): Object) + +Given some code, parse it using Babel's standard behavior. Referenced presets and +plugins will be loaded such that optional syntax plugins are automatically +enabled. + + +## Advanced APIs + +Many systems that wrap Babel like to automatically inject plugins and presets, +or override options. To accomplish this goal, Babel exposes several functions +that aid in loading the configuration part-way without transforming. + +### babel.loadOptions([options?](#options): Object) + +Resolve Babel's options fully, resulting in an options object where: + +* `opts.plugins` is a full list of `Plugin` instances. +* `opts.presets` is empty and all presets are flattened into `opts`. +* It can be safely passed back to Babel. Fields like `babelrc` have been set to + false so that later calls to Babel will not make a second attempt to load + config files. + +`Plugin` instances aren't meant to be manipulated directly, but often +callers will serialize this `opts` to JSON to use it as a cache key representing +the options Babel has received. Caching on this isn't 100% guaranteed to +invalidate properly, but it is the best we have at the moment. + + +### babel.loadPartialConfig([options?](#options): Object): PartialConfig + +To allow systems to easily manipulate and validate a user's config, this function +resolves the plugins and presets and proceeds no further. The expectation is +that callers will take the config's `.options`, manipulate it as then see fit +and pass it back to Babel again. + +* `babelrc: string | void` - The path of the `.babelrc` file, if there was one. +* `babelignore: string | void` - The path of the `.babelignore` file, if there was one. +* `options: ValidatedOptions` - The partially resolved options, which can be manipulated and passed back to Babel again. + * `plugins: Array` - See below. + * `presets: Array` - See below. + * It can be safely passed back to Babel. Fields like `babelrc` have been set + to false so that later calls to Babel will not make a second attempt to + load config files. +* `hasFilesystemConfig(): boolean` - Check if the resolved config loaded any settings from the filesystem. + +[`ConfigItem`](#configitem-type) instances expose properties to introspect the values, but each +item should be treated as immutable. If changes are desired, the item should be +removed from the list and replaced with either a normal Babel config value, or +with a replacement item created by `babel.createConfigItem`. See that +function for information about `ConfigItem` fields. + + +### babel.createConfigItem(value: string | {} | Function | [string | {} | Function, {} | void], { dirname?: string, type?: "preset" | "plugin" }): ConfigItem + +Allows build tooling to create and cache config items up front. If this function +is called multiple times for a given plugin, Babel will call the plugin's function itself +multiple times. If you have a clear set of expected plugins and presets to +inject, pre-constructing the config items would be recommended. + + +### `ConfigItem` type + +Each `ConfigItem` exposes all of the information Babel knows. The fields are: + +* `value: {} | Function` - The resolved value of the plugin. +* `options: {} | void` - The options object passed to the plugin. +* `dirname: string` - The path that the options are relative to. +* `name: string | void` - The name that the user gave the plugin instance, e.g. `plugins: [ ['env', {}, 'my-env'] ]` +* `file: Object | void` - Information about the plugin's file, if Babel knows it. + * `request: string` - The file that the user requested, e.g. `"@babel/env"` + * `resolved: string` - The full path of the resolved file, e.g. `"/tmp/node_modules/@babel/preset-env/lib/index.js"` + ## Options @@ -169,7 +242,6 @@ Following is a table of the options you can use: | `shouldPrintComment` | `null` | An optional callback that controls whether a comment should be output or not. Called as `shouldPrintComment(commentContents)`. **NOTE:** This overrides the `comment` option when used | | `sourceFileName` | `(filenameRelative)` | Set `sources[0]` on returned source map | | `sourceMaps` | `false` | If truthy, adds a `map` property to returned output. If set to `"inline"`, a comment with a sourceMappingURL directive is added to the bottom of the returned code. If set to `"both"` then a `map` property is returned as well as a source map comment appended. **This does not emit sourcemap files by itself!** To have sourcemaps emitted using the CLI, you must pass it the `--source-maps` option | -| `sourceMapTarget` | `(filenameRelative)` | Set `file` on returned source map | | `sourceRoot` | `(moduleRoot)` | The root from which all sources are relative | | `sourceType` | `"module"` | Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". `"unambiguous"` will make Babel attempt to _guess_, based on the presence of ES6 `import` or `export` statements. Files with ES6 `import`s and `export`s are considered `"module"` and are otherwise `"script"`. | | `wrapPluginVisitorMethod`| `null` | An optional callback that can be used to wrap visitor methods. **NOTE:** This is useful for things like introspection, and not really needed for implementing anything. Called as `wrapPluginVisitorMethod(pluginAlias, visitorType, callback)`. diff --git a/packages/babel-core/package.json b/packages/babel-core/package.json index d7cd127d161c4..c282d6e681847 100644 --- a/packages/babel-core/package.json +++ b/packages/babel-core/package.json @@ -1,6 +1,6 @@ { "name": "@babel/core", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Babel compiler core.", "main": "./lib/index.js", "author": "Sebastian McKenzie ", @@ -28,23 +28,24 @@ "./lib/transform-file-sync.js": "./lib/transform-file-sync-browser.js" }, "dependencies": { - "@babel/code-frame": "7.0.0-beta.39", - "@babel/generator": "7.0.0-beta.39", - "@babel/helpers": "7.0.0-beta.39", - "@babel/template": "7.0.0-beta.39", - "@babel/traverse": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39", - "babylon": "7.0.0-beta.39", + "@babel/code-frame": "7.0.0-beta.42", + "@babel/generator": "7.0.0-beta.42", + "@babel/helpers": "7.0.0-beta.42", + "@babel/template": "7.0.0-beta.42", + "@babel/traverse": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42", + "babylon": "7.0.0-beta.42", "convert-source-map": "^1.1.0", - "debug": "^3.0.1", + "debug": "^3.1.0", "json5": "^0.5.0", "lodash": "^4.2.0", "micromatch": "^2.3.11", "resolve": "^1.3.2", + "semver": "^5.4.1", "source-map": "^0.5.0" }, "devDependencies": { - "@babel/helper-transform-fixture-test-runner": "7.0.0-beta.39", - "@babel/register": "7.0.0-beta.39" + "@babel/helper-transform-fixture-test-runner": "7.0.0-beta.42", + "@babel/register": "7.0.0-beta.42" } } diff --git a/packages/babel-core/src/config/caching.js b/packages/babel-core/src/config/caching.js index b9703560b54e1..7c3a28bda215e 100644 --- a/packages/babel-core/src/config/caching.js +++ b/packages/babel-core/src/config/caching.js @@ -1,6 +1,6 @@ // @flow -type SimpleCacheConfigurator = SimpleCacheConfiguratorFn & +export type SimpleCacheConfigurator = SimpleCacheConfiguratorFn & SimpleCacheConfiguratorObj; type SimpleCacheConfiguratorFn = { diff --git a/packages/babel-core/src/config/config-chain.js b/packages/babel-core/src/config/config-chain.js index 60e062d3f8f84..cf0e3eaf017d0 100644 --- a/packages/babel-core/src/config/config-chain.js +++ b/packages/babel-core/src/config/config-chain.js @@ -13,10 +13,10 @@ import { const debug = buildDebug("babel:config:config-chain"); import { - findBabelrc, - findBabelignore, + findRelativeConfig, loadConfig, type ConfigFile, + type IgnoreFile, } from "./files"; import { makeWeakCache, makeStrongCache } from "./caching"; @@ -104,14 +104,18 @@ const loadPresetOverridesEnvDescriptors = makeWeakCache( ), ); +export type RootConfigChain = ConfigChain & { + babelrc: ConfigFile | void, + ignore: IgnoreFile | void, +}; + /** * Build a config chain for Babel's full root configuration. */ export function buildRootChain( - cwd: string, opts: ValidatedOptions, context: ConfigContext, -): ConfigChain | null { +): RootConfigChain | null { const programmaticChain = loadProgrammaticChain( { options: opts, @@ -121,26 +125,24 @@ export function buildRootChain( ); if (!programmaticChain) return null; + let ignore, babelrc; + const fileChain = emptyChain(); // resolve all .babelrc files if (opts.babelrc !== false && context.filename !== null) { const filename = context.filename; - const babelignoreFile = findBabelignore(filename); - if ( - babelignoreFile && - shouldIgnore( - context, - babelignoreFile.ignore, - null, - babelignoreFile.dirname, - ) - ) { + + ({ ignore, config: babelrc } = findRelativeConfig( + filename, + context.envName, + )); + + if (ignore && shouldIgnore(context, ignore.ignore, null, ignore.dirname)) { return null; } - const babelrcFile = findBabelrc(filename, context.envName); - if (babelrcFile) { - const result = loadFileChain(babelrcFile, context); + if (babelrc) { + const result = loadFileChain(babelrc, context); if (!result) return null; mergeChain(fileChain, result); @@ -158,6 +160,8 @@ export function buildRootChain( plugins: dedupDescriptors(chain.plugins), presets: dedupDescriptors(chain.presets), options: chain.options.map(o => normalizeOptions(o)), + ignore: ignore || undefined, + babelrc: babelrc || undefined, }; } diff --git a/packages/babel-core/src/config/config-descriptors.js b/packages/babel-core/src/config/config-descriptors.js index 6b31c640d2aed..d5bf311149d91 100644 --- a/packages/babel-core/src/config/config-descriptors.js +++ b/packages/babel-core/src/config/config-descriptors.js @@ -2,6 +2,8 @@ import { loadPlugin, loadPreset } from "./files"; +import { getItemDescriptor } from "./item"; + import { makeWeakCache, makeStrongCache, @@ -33,6 +35,10 @@ export type UnloadedDescriptor = { dirname: string, alias: string, ownPass?: boolean, + file?: { + request: string, + resolved: string, + } | void, }; export type ValidatedFile = { @@ -152,16 +158,11 @@ function createDescriptors( ownPass?: boolean, ): Array { const descriptors = items.map((item, index) => - createDescriptor( - item, - type === "plugin" ? loadPlugin : loadPreset, - dirname, - { - index, - alias, - ownPass: !!ownPass, - }, - ), + createDescriptor(item, dirname, { + type, + alias: `${alias}$${index}`, + ownPass: !!ownPass, + }), ); assertNoDuplicates(descriptors); @@ -172,20 +173,24 @@ function createDescriptors( /** * Given a plugin/preset item, resolve it into a standard format. */ -function createDescriptor( +export function createDescriptor( pair: PluginItem, - resolver, - dirname, + dirname: string, { - index, + type, alias, ownPass, }: { - index: number, + type?: "plugin" | "preset", alias: string, ownPass?: boolean, }, ): UnloadedDescriptor { + const desc = getItemDescriptor(pair); + if (desc) { + return desc; + } + let name; let options; let value = pair; @@ -198,9 +203,23 @@ function createDescriptor( } } + let file = undefined; let filepath = null; if (typeof value === "string") { + if (typeof type !== "string") { + throw new Error( + "To resolve a string-based item, the type of item must be given", + ); + } + const resolver = type === "plugin" ? loadPlugin : loadPreset; + const request = value; + ({ filepath, value } = resolver(value, dirname)); + + file = { + request, + resolved: filepath, + }; } if (!value) { @@ -226,17 +245,18 @@ function createDescriptor( // config object, because it can be useful to define them in nested // configuration contexts. throw new Error( - "Plugin/Preset files are not allowed to export objects, only functions.", + `Plugin/Preset files are not allowed to export objects, only functions. In ${filepath}`, ); } return { name, - alias: filepath || `${alias}$${index}`, + alias: filepath || alias, value, options, dirname, ownPass, + file, }; } diff --git a/packages/babel-core/src/config/files/configuration.js b/packages/babel-core/src/config/files/configuration.js index 5617f3e4738b6..c1a55cc598538 100644 --- a/packages/babel-core/src/config/files/configuration.js +++ b/packages/babel-core/src/config/files/configuration.js @@ -6,6 +6,7 @@ import fs from "fs"; import json5 from "json5"; import resolve from "resolve"; import { makeStrongCache, type CacheConfigurator } from "../caching"; +import makeAPI from "../helpers/config-api"; const debug = buildDebug("babel:config:loading:files:configuration"); @@ -21,61 +22,58 @@ export type IgnoreFile = { ignore: Array, }; +export type RelativeConfig = { + config: ConfigFile | null, + ignore: IgnoreFile | null, +}; + const BABELRC_FILENAME = ".babelrc"; const BABELRC_JS_FILENAME = ".babelrc.js"; const PACKAGE_FILENAME = "package.json"; const BABELIGNORE_FILENAME = ".babelignore"; -export function findBabelrc( +export function findRelativeConfig( filepath: string, envName: string, -): ConfigFile | null { +): RelativeConfig { + let config = null; + let ignore = null; + const dirname = path.dirname(filepath); let loc = dirname; while (true) { - const conf = [ - BABELRC_FILENAME, - BABELRC_JS_FILENAME, - PACKAGE_FILENAME, - ].reduce((previousConfig: ConfigFile | null, name) => { - const filepath = path.join(loc, name); - const config = readConfig(filepath, envName); - - 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); + if (!config) { + config = [BABELRC_FILENAME, BABELRC_JS_FILENAME, PACKAGE_FILENAME].reduce( + (previousConfig: ConfigFile | null, name) => { + const filepath = path.join(loc, name); + const config = readConfig(filepath, envName); + + 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, + ); - if (conf) { - debug("Found configuration %o from %o.", conf.filepath, dirname); - return conf; + if (config) { + debug("Found configuration %o from %o.", config.filepath, dirname); + } } - const nextLoc = path.dirname(loc); - if (loc === nextLoc) break; - loc = nextLoc; - } - - return null; -} - -export function findBabelignore(filepath: string): IgnoreFile | null { - const dirname = path.dirname(filepath); - let loc = dirname; - while (true) { - const ignoreLoc = path.join(loc, BABELIGNORE_FILENAME); - const ignore = readIgnoreConfig(ignoreLoc); + if (!ignore) { + const ignoreLoc = path.join(loc, BABELIGNORE_FILENAME); + ignore = readIgnoreConfig(ignoreLoc); - if (ignore) { - debug("Found ignore %o from %o.", ignore.filepath, dirname); - return ignore; + if (ignore) { + debug("Found ignore %o from %o.", ignore.filepath, dirname); + } } const nextLoc = path.dirname(loc); @@ -83,7 +81,7 @@ export function findBabelignore(filepath: string): IgnoreFile | null { loc = nextLoc; } - return null; + return { config, ignore }; } export function loadConfig( @@ -106,7 +104,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) { +function readConfig(filepath, envName): ConfigFile | null { return path.extname(filepath) === ".js" ? readConfigJS(filepath, { envName }) : readConfigFile(filepath); @@ -153,12 +151,7 @@ const readConfigJS = makeStrongCache( } if (typeof options === "function") { - options = options({ - cache: cache.simple(), - // Expose ".env()" so people can easily get the same env that we expose using the "env" key. - env: () => cache.using(data => data.envName), - async: () => false, - }); + options = options(makeAPI(cache)); if (!cache.configured()) throwConfigError(); } diff --git a/packages/babel-core/src/config/files/index-browser.js b/packages/babel-core/src/config/files/index-browser.js index bcd6b439a029f..4e5cb5fe62189 100644 --- a/packages/babel-core/src/config/files/index-browser.js +++ b/packages/babel-core/src/config/files/index-browser.js @@ -1,27 +1,14 @@ // @flow -export type ConfigFile = { - filepath: string, - dirname: string, - options: {}, -}; +import type { ConfigFile, IgnoreFile, RelativeConfig } from "./configuration"; -export type IgnoreFile = { - filepath: string, - dirname: string, - ignore: Array, -}; +export type { ConfigFile, IgnoreFile, RelativeConfig }; -export function findBabelrc( +export function findRelativeConfig( filepath: string, envName: string, // eslint-disable-line no-unused-vars -): ConfigFile | null { - return null; -} - -// eslint-disable-next-line no-unused-vars -export function findBabelignore(filepath: string): IgnoreFile | null { - return null; +): RelativeConfig { + return { config: null, ignore: null }; } export function loadConfig(name: string, dirname: string): ConfigFile { diff --git a/packages/babel-core/src/config/full.js b/packages/babel-core/src/config/full.js new file mode 100644 index 0000000000000..0ae4ade63bc8c --- /dev/null +++ b/packages/babel-core/src/config/full.js @@ -0,0 +1,299 @@ +// @flow + +import { mergeOptions } from "./util"; +import * as context from "../index"; +import Plugin from "./plugin"; +import { getItemDescriptor } from "./item"; +import { + buildPresetChain, + type ConfigContext, + type ConfigChain, + type PresetInstance, +} from "./config-chain"; +import type { UnloadedDescriptor } from "./config-descriptors"; +import traverse from "@babel/traverse"; +import { makeWeakCache, type CacheConfigurator } from "./caching"; +import { validate } from "./validation/options"; +import { validatePluginObject } from "./validation/plugins"; +import makeAPI from "./helpers/config-api"; + +import loadPrivatePartialConfig from "./partial"; + +type LoadedDescriptor = { + value: {}, + options: {}, + dirname: string, + alias: string, +}; + +export type { InputOptions } from "./validation/options"; + +export type ResolvedConfig = { + options: Object, + passes: PluginPasses, +}; + +export type { Plugin }; +export type PluginPassList = Array; +export type PluginPasses = Array; + +// Context not including filename since it is used in places that cannot +// process 'ignore'/'only' and other filename-based logic. +type SimpleContext = { + envName: string, +}; + +export default function loadFullConfig( + inputOpts: mixed, +): ResolvedConfig | null { + const result = loadPrivatePartialConfig(inputOpts); + if (!result) { + return null; + } + const { options, context } = result; + + const optionDefaults = {}; + const passes = [[]]; + try { + const { plugins, presets } = options; + + if (!plugins || !presets) { + throw new Error("Assertion failure - plugins and presets exist"); + } + + const ignored = (function recurseDescriptors( + config: { + plugins: Array, + presets: Array, + }, + pass: Array, + ) { + const plugins = config.plugins.map(descriptor => { + return loadPluginDescriptor(descriptor, context); + }); + const presets = config.presets.map(descriptor => { + return { + preset: loadPresetDescriptor(descriptor, context), + pass: descriptor.ownPass ? [] : pass, + }; + }); + + // resolve presets + if (presets.length > 0) { + // The passes are created in the same order as the preset list, but are inserted before any + // existing additional passes. + passes.splice( + 1, + 0, + ...presets.map(o => o.pass).filter(p => p !== pass), + ); + + for (const { preset, pass } of presets) { + if (!preset) return true; + + const ignored = recurseDescriptors( + { + plugins: preset.plugins, + presets: preset.presets, + }, + pass, + ); + if (ignored) return true; + + preset.options.forEach(opts => { + mergeOptions(optionDefaults, opts); + }); + } + } + + // resolve plugins + if (plugins.length > 0) { + pass.unshift(...plugins); + } + })( + { + plugins: plugins.map(item => { + const desc = getItemDescriptor(item); + if (!desc) { + throw new Error("Assertion failure - must be config item"); + } + + return desc; + }), + presets: presets.map(item => { + const desc = getItemDescriptor(item); + if (!desc) { + throw new Error("Assertion failure - must be config item"); + } + + return desc; + }), + }, + passes[0], + ); + + if (ignored) return null; + } catch (e) { + // There are a few case where thrown errors will try to annotate themselves multiple times, so + // to keep things simple we just bail out if re-wrapping the message. + if (!/^\[BABEL\]/.test(e.message)) { + e.message = `[BABEL] ${context.filename || "unknown"}: ${e.message}`; + } + + throw e; + } + + const opts: Object = optionDefaults; + mergeOptions(opts, options); + + opts.plugins = passes[0]; + opts.presets = passes + .slice(1) + .filter(plugins => plugins.length > 0) + .map(plugins => ({ plugins })); + opts.passPerPreset = opts.presets.length > 0; + + return { + 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 = Object.assign({}, 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 (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.`, + ); + } + + return { value: item, options, dirname, alias }; + }, +); + +/** + * Instantiate a plugin for the given descriptor, returning the plugin/options pair. + */ +function loadPluginDescriptor( + descriptor: UnloadedDescriptor, + context: SimpleContext, +): Plugin { + if (descriptor.value instanceof Plugin) { + if (descriptor.options) { + throw new Error( + "Passed options to an existing Plugin instance will not work.", + ); + } + + return descriptor.value; + } + + return instantiatePlugin(loadDescriptor(descriptor, context), context); +} + +const instantiatePlugin = makeWeakCache( + ( + { value, options, dirname, alias }: LoadedDescriptor, + cache: CacheConfigurator, + ): Plugin => { + const pluginObj = validatePluginObject(value); + + const plugin = Object.assign({}, pluginObj); + if (plugin.visitor) { + plugin.visitor = traverse.explode(Object.assign({}, plugin.visitor)); + } + + if (plugin.inherits) { + const inheritsDescriptor = { + name: undefined, + alias: `${alias}$inherits`, + value: plugin.inherits, + options, + dirname, + }; + + // If the inherited plugin changes, reinstantiate this plugin. + const inherits = cache.invalidate(data => + loadPluginDescriptor(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 || {}, + ]); + } + + return new Plugin(plugin, options, alias); + }, +); + +/** + * Generate a config object that will act as the root of a new nested config. + */ +const loadPresetDescriptor = ( + descriptor: UnloadedDescriptor, + context: ConfigContext, +): ConfigChain | null => { + return buildPresetChain( + instantiatePreset(loadDescriptor(descriptor, context)), + context, + ); +}; + +const instantiatePreset = makeWeakCache( + ({ value, dirname, alias }: LoadedDescriptor): PresetInstance => { + return { + options: validate("preset", value), + alias, + dirname, + }; + }, +); + +function chain(a, b) { + const fns = [a, b].filter(Boolean); + if (fns.length <= 1) return fns[0]; + + return function(...args) { + for (const fn of fns) { + fn.apply(this, args); + } + }; +} diff --git a/packages/babel-core/src/config/helpers/config-api.js b/packages/babel-core/src/config/helpers/config-api.js new file mode 100644 index 0000000000000..da14c22eebf51 --- /dev/null +++ b/packages/babel-core/src/config/helpers/config-api.js @@ -0,0 +1,91 @@ +// @flow + +import semver from "semver"; +import { version as coreVersion } from "../../"; +import type { CacheConfigurator, SimpleCacheConfigurator } from "../caching"; + +type EnvFunction = { + (): string, + ((string) => T): T, + (string): boolean, + (Array): boolean, +}; + +export type PluginAPI = { + version: string, + cache: SimpleCacheConfigurator, + env: EnvFunction, + async: () => boolean, + assertVersion: typeof assertVersion, +}; + +export default function makeAPI( + cache: CacheConfigurator<{ envName: string }>, +): PluginAPI { + const env: any = value => + cache.using(data => { + if (typeof value === "undefined") return data.envName; + if (typeof value === "function") return value(data.envName); + if (!Array.isArray(value)) value = [value]; + + return value.some(entry => { + if (typeof entry !== "string") { + throw new Error("Unexpected non-string value"); + } + return entry === data.envName; + }); + }); + + return { + version: coreVersion, + cache: cache.simple(), + // Expose ".env()" so people can easily get the same env that we expose using the "env" key. + env, + async: () => false, + assertVersion, + }; +} + +function assertVersion(range: string | number): void { + if (typeof range === "number") { + if (!Number.isInteger(range)) { + throw new Error("Expected string or integer value."); + } + range = `^${range}.0.0-0`; + } + if (typeof range !== "string") { + throw new Error("Expected string or integer value."); + } + + if (semver.satisfies(coreVersion, range)) return; + + const limit = Error.stackTraceLimit; + + if (typeof limit === "number" && limit < 25) { + // Bump up the limit if needed so that users are more likely + // to be able to see what is calling Babel. + Error.stackTraceLimit = 25; + } + + const err = new Error( + `Requires Babel "${range}", but was loaded with "${coreVersion}". ` + + `If you are sure you have a compatible version of @babel/core, ` + + `it is likely that something in your build process is loading the ` + + `wrong version. Inspect the stack trace of this error to look for ` + + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + + `to see what is calling Babel.`, + ); + + if (typeof limit === "number") { + Error.stackTraceLimit = limit; + } + + throw Object.assign( + err, + ({ + code: "BABEL_VERSION_UNSUPPORTED", + version: coreVersion, + range, + }: any), + ); +} diff --git a/packages/babel-core/src/config/index.js b/packages/babel-core/src/config/index.js index 6a770e5aca314..734855c7bb24e 100644 --- a/packages/babel-core/src/config/index.js +++ b/packages/babel-core/src/config/index.js @@ -1,306 +1,26 @@ // @flow -import path from "path"; -import * as context from "../index"; -import Plugin from "./plugin"; -import merge from "lodash/merge"; -import { - buildRootChain, - buildPresetChain, - type ConfigContext, - type ConfigChain, - type PresetInstance, -} from "./config-chain"; -import type { UnloadedDescriptor } from "./config-descriptors"; -import traverse from "@babel/traverse"; -import clone from "lodash/clone"; -import { makeWeakCache, type CacheConfigurator } from "./caching"; -import { getEnv } from "./helpers/environment"; -import { validate } from "./validation/options"; -import { validatePluginObject } from "./validation/plugins"; - -type LoadedDescriptor = { - value: {}, - options: {}, - dirname: string, - alias: string, -}; - -export type { InputOptions } from "./validation/options"; - -export type ResolvedConfig = { - options: Object, - passes: PluginPasses, -}; - -export type { Plugin }; -export type PluginPassList = Array; -export type PluginPasses = Array; - -// Context not including filename since it is used in places that cannot -// process 'ignore'/'only' and other filename-based logic. -type SimpleContext = { - envName: string, -}; - -export default function loadConfig(inputOpts: mixed): ResolvedConfig | null { - if ( - inputOpts != null && - (typeof inputOpts !== "object" || Array.isArray(inputOpts)) - ) { - throw new Error("Babel options must be an object, null, or undefined"); - } - - const args = inputOpts ? validate("arguments", inputOpts) : {}; - - const { envName = getEnv(), cwd = "." } = args; - const absoluteCwd = path.resolve(cwd); - - const context: ConfigContext = { - filename: args.filename ? path.resolve(cwd, args.filename) : null, - cwd: absoluteCwd, - envName, - }; - - const configChain = buildRootChain(absoluteCwd, args, context); - if (!configChain) return null; - - const optionDefaults = {}; - const options = {}; - const passes = [[]]; - try { - const ignored = (function recurseDescriptors( - config: { - plugins: Array, - presets: Array, - }, - pass: Array, - ) { - const plugins = config.plugins.map(descriptor => - loadPluginDescriptor(descriptor, context), - ); - const presets = config.presets.map(descriptor => { - return { - preset: loadPresetDescriptor(descriptor, context), - pass: descriptor.ownPass ? [] : pass, - }; - }); - - // resolve presets - if (presets.length > 0) { - // The passes are created in the same order as the preset list, but are inserted before any - // existing additional passes. - passes.splice( - 1, - 0, - ...presets.map(o => o.pass).filter(p => p !== pass), - ); - - for (const { preset, pass } of presets) { - if (!preset) return true; - - const ignored = recurseDescriptors( - { - plugins: preset.plugins, - presets: preset.presets, - }, - pass, - ); - if (ignored) return true; - - preset.options.forEach(opts => { - merge(optionDefaults, opts); - }); - } - } - - // resolve plugins - if (plugins.length > 0) { - pass.unshift(...plugins); - } - })( - { - plugins: configChain.plugins, - presets: configChain.presets, - }, - passes[0], - ); - - if (ignored) return null; - - configChain.options.forEach(opts => { - merge(options, opts); - }); - } catch (e) { - // There are a few case where thrown errors will try to annotate themselves multiple times, so - // to keep things simple we just bail out if re-wrapping the message. - if (!/^\[BABEL\]/.test(e.message)) { - e.message = `[BABEL] ${args.filename || "unknown"}: ${e.message}`; - } - - throw e; - } - - const opts: Object = merge(optionDefaults, options); - - // Tack the passes onto the object itself so that, if this object is passed back to Babel a second time, - // it will be in the right structure to not change behavior. - opts.babelrc = false; - opts.plugins = passes[0]; - opts.presets = passes - .slice(1) - .filter(plugins => plugins.length > 0) - .map(plugins => ({ plugins })); - opts.passPerPreset = opts.presets.length > 0; - opts.envName = envName; - opts.cwd = absoluteCwd; - - return { - options: opts, - passes: passes, - }; +import loadFullConfig from "./full"; +export type { + ResolvedConfig, + InputOptions, + PluginPasses, + Plugin, +} from "./full"; + +export { loadFullConfig as default }; +export { loadPartialConfig } from "./partial"; +export type { PartialConfig } from "./partial"; + +export function loadOptions(opts: {}): Object | null { + const config = loadFullConfig(opts); + + return config ? config.options : null; } -/** - * 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 = Object.assign(Object.create(context), { - cache: cache.simple(), - env: () => cache.using(data => data.envName), - async: () => false, - }); - - 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 (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.`, - ); - } - - return { value: item, options, dirname, alias }; - }, -); - -/** - * Instantiate a plugin for the given descriptor, returning the plugin/options pair. - */ -function loadPluginDescriptor( - descriptor: UnloadedDescriptor, - context: SimpleContext, -): Plugin { - if (descriptor.value instanceof Plugin) { - if (descriptor.options) { - throw new Error( - "Passed options to an existing Plugin instance will not work.", - ); - } - - return descriptor.value; +// For easier backward-compatibility, provide an API like the one we exposed in Babel 6. +export class OptionManager { + init(opts: {}) { + return loadOptions(opts); } - - return instantiatePlugin(loadDescriptor(descriptor, context), context); -} - -const instantiatePlugin = makeWeakCache( - ( - { value, options, dirname, alias }: LoadedDescriptor, - cache: CacheConfigurator, - ): Plugin => { - const pluginObj = validatePluginObject(value); - - const plugin = Object.assign({}, pluginObj); - if (plugin.visitor) { - plugin.visitor = traverse.explode(clone(plugin.visitor)); - } - - if (plugin.inherits) { - const inheritsDescriptor = { - name: undefined, - alias: `${alias}$inherits`, - value: plugin.inherits, - options, - dirname, - }; - - // If the inherited plugin changes, reinstantiate this plugin. - const inherits = cache.invalidate(data => - loadPluginDescriptor(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 || {}, - ]); - } - - return new Plugin(plugin, options, alias); - }, -); - -/** - * Generate a config object that will act as the root of a new nested config. - */ -const loadPresetDescriptor = ( - descriptor: UnloadedDescriptor, - context: ConfigContext, -): ConfigChain | null => { - return buildPresetChain( - instantiatePreset(loadDescriptor(descriptor, context)), - context, - ); -}; - -const instantiatePreset = makeWeakCache( - ({ value, dirname, alias }: LoadedDescriptor): PresetInstance => { - return { - options: validate("preset", value), - alias, - dirname, - }; - }, -); - -function chain(a, b) { - const fns = [a, b].filter(Boolean); - if (fns.length <= 1) return fns[0]; - - return function(...args) { - for (const fn of fns) { - fn.apply(this, args); - } - }; } diff --git a/packages/babel-core/src/config/item.js b/packages/babel-core/src/config/item.js new file mode 100644 index 0000000000000..ab9b51207ee96 --- /dev/null +++ b/packages/babel-core/src/config/item.js @@ -0,0 +1,128 @@ +// @flow + +import type { PluginTarget, PluginOptions } from "./validation/options"; + +import path from "path"; +import { + createDescriptor, + type UnloadedDescriptor, +} from "./config-descriptors"; + +export function createItemFromDescriptor(desc: UnloadedDescriptor): ConfigItem { + return new ConfigItem(desc); +} + +/** + * Create a config item using the same value format used in Babel's config + * files. Items returned from this function should be cached by the caller + * ideally, as recreating the config item will mean re-resolving the item + * and re-evaluating the plugin/preset function. + */ +export function createConfigItem( + value: + | PluginTarget + | [PluginTarget, PluginOptions] + | [PluginTarget, PluginOptions, string | void], + { + dirname = ".", + type, + }: { + dirname?: string, + type?: "preset" | "plugin", + } = {}, +): ConfigItem { + const descriptor = createDescriptor(value, path.resolve(dirname), { + type, + alias: "programmatic item", + }); + + return createItemFromDescriptor(descriptor); +} + +export function getItemDescriptor(item: mixed): UnloadedDescriptor | void { + if (item instanceof ConfigItem) { + return item._descriptor; + } + + return undefined; +} + +export type { ConfigItem }; + +/** + * A public representation of a plugin/preset that will _eventually_ be load. + * Users can use this to interact with the results of a loaded Babel + * configuration. + * + * Any changes to public properties of this class should be considered a + * breaking change to Babel's API. + */ +class ConfigItem { + /** + * The private underlying descriptor that Babel actually cares about. + * If you access this, you are a bad person. + */ + _descriptor: UnloadedDescriptor; + + /** + * The resolved value of the item itself. + */ + value: {} | Function; + + /** + * The options, if any, that were passed to the item. + * Mutating this will lead to undefined behavior. If you need + */ + options: {} | void; + + /** + * The directory that the options for this item are relative to. + */ + dirname: string; + + /** + * Get the name of the plugin, if the user gave it one. + */ + name: string | void; + + /** + * Data about the file that the item was loaded from, if Babel knows it. + */ + file: { + // The requested path, e.g. "@babel/env". + request: string, + + // The resolved absolute path of the file. + resolved: string, + } | void; + + constructor(descriptor: UnloadedDescriptor) { + // Make people less likely to stumble onto this if they are exploring + // programmatically, and also make sure that if people happen to + // pass the item through JSON.stringify, it doesn't show up. + this._descriptor = descriptor; + Object.defineProperty(this, "_descriptor", ({ enumerable: false }: any)); + + if (this._descriptor.options === false) { + throw new Error("Assertion failure - unexpected false options"); + } + + this.value = this._descriptor.value; + this.options = this._descriptor.options; + this.dirname = this._descriptor.dirname; + this.name = this._descriptor.name; + this.file = this._descriptor.file + ? { + request: this._descriptor.file.request, + resolved: this._descriptor.file.resolved, + } + : undefined; + + // Freeze the object to make it clear that people shouldn't expect mutating + // this object to do anything. A new item should be created if they want + // to change something. + Object.freeze(this); + } +} + +Object.freeze(ConfigItem.prototype); diff --git a/packages/babel-core/src/config/partial.js b/packages/babel-core/src/config/partial.js new file mode 100644 index 0000000000000..83d0d08086b68 --- /dev/null +++ b/packages/babel-core/src/config/partial.js @@ -0,0 +1,128 @@ +// @flow + +import path from "path"; +import Plugin from "./plugin"; +import { mergeOptions } from "./util"; +import { createItemFromDescriptor } from "./item"; +import { buildRootChain, type ConfigContext } from "./config-chain"; +import { getEnv } from "./helpers/environment"; +import { validate, type ValidatedOptions } from "./validation/options"; + +import type { ConfigFile, IgnoreFile } from "./files"; + +export default function loadPrivatePartialConfig( + inputOpts: mixed, +): { + options: ValidatedOptions, + context: ConfigContext, + ignore: IgnoreFile | void, + babelrc: ConfigFile | void, +} | null { + if ( + inputOpts != null && + (typeof inputOpts !== "object" || Array.isArray(inputOpts)) + ) { + throw new Error("Babel options must be an object, null, or undefined"); + } + + const args = inputOpts ? validate("arguments", inputOpts) : {}; + + const { envName = getEnv(), cwd = "." } = args; + const absoluteCwd = path.resolve(cwd); + + const context: ConfigContext = { + filename: args.filename ? path.resolve(cwd, args.filename) : null, + cwd: absoluteCwd, + envName, + }; + + const configChain = buildRootChain(args, context); + if (!configChain) return null; + + const options = {}; + configChain.options.forEach(opts => { + mergeOptions(options, opts); + }); + + // Tack the passes onto the object itself so that, if this object is + // passed back to Babel a second time, it will be in the right structure + // to not change behavior. + options.babelrc = false; + options.envName = envName; + options.cwd = absoluteCwd; + options.passPerPreset = false; + + options.plugins = configChain.plugins.map(descriptor => + createItemFromDescriptor(descriptor), + ); + options.presets = configChain.presets.map(descriptor => + createItemFromDescriptor(descriptor), + ); + + return { + options, + context, + ignore: configChain.ignore, + babelrc: configChain.babelrc, + }; +} + +export function loadPartialConfig(inputOpts: mixed): PartialConfig | null { + const result = loadPrivatePartialConfig(inputOpts); + if (!result) return null; + + const { options, babelrc, ignore } = result; + + (options.plugins || []).forEach(item => { + if (item.value instanceof Plugin) { + throw new Error( + "Passing cached plugin instances is not supported in " + + "babel.loadPartialConfig()", + ); + } + }); + + return new PartialConfig( + options, + babelrc ? babelrc.filepath : undefined, + ignore ? ignore.filepath : undefined, + ); +} + +export type { PartialConfig }; + +class PartialConfig { + /** + * These properties are public, so any changes to them should be considered + * a breaking change to Babel's API. + */ + options: ValidatedOptions; + babelrc: string | void; + babelignore: string | void; + + constructor( + options: ValidatedOptions, + babelrc: string | void, + ignore: string | void, + ) { + this.options = options; + this.babelignore = ignore; + this.babelrc = babelrc; + + // Freeze since this is a public API and it should be extremely obvious that + // reassigning properties on here does nothing. + Object.freeze(this); + } + + /** + * Returns true if their is a config file in the filesystem for this config. + * + * While this only means .babelrc(.mjs)?/package.json#babel right now, it + * may well expand in the future, so using this is recommended vs checking + * this.babelrc directly. + */ + hasFilesystemConfig(): boolean { + return this.babelrc !== undefined; + } +} +Object.freeze(PartialConfig.prototype); diff --git a/packages/babel-core/src/config/util.js b/packages/babel-core/src/config/util.js new file mode 100644 index 0000000000000..f64975216db38 --- /dev/null +++ b/packages/babel-core/src/config/util.js @@ -0,0 +1,30 @@ +// @flow + +import type { ValidatedOptions } from "./validation/options"; + +export function mergeOptions( + target: ValidatedOptions, + source: ValidatedOptions, +): void { + for (const k of Object.keys(source)) { + if (k === "parserOpts" && source.parserOpts) { + const parserOpts = source.parserOpts; + const targetObj = (target.parserOpts = target.parserOpts || {}); + mergeDefaultFields(targetObj, parserOpts); + } else if (k === "generatorOpts" && source.generatorOpts) { + const generatorOpts = source.generatorOpts; + const targetObj = (target.generatorOpts = target.generatorOpts || {}); + mergeDefaultFields(targetObj, generatorOpts); + } else { + const val = source[k]; + if (val !== undefined) target[k] = (val: any); + } + } +} + +function mergeDefaultFields(target: T, source: T) { + for (const k of Object.keys(source)) { + const val = source[k]; + if (val !== undefined) target[k] = (val: any); + } +} diff --git a/packages/babel-core/src/config/validation/option-assertions.js b/packages/babel-core/src/config/validation/option-assertions.js index c6330e717630d..97b860f016b3c 100644 --- a/packages/babel-core/src/config/validation/option-assertions.js +++ b/packages/babel-core/src/config/validation/option-assertions.js @@ -140,6 +140,8 @@ export function assertConfigApplicableTest( key: string, value: mixed, ): ConfigApplicableTest | void { + if (value === undefined) return value; + if (Array.isArray(value)) { value.forEach((item, i) => { if (!checkValidTest(item)) { diff --git a/packages/babel-core/src/config/validation/options.js b/packages/babel-core/src/config/validation/options.js index 96b51f73ef441..290d326d5bd27 100644 --- a/packages/babel-core/src/config/validation/options.js +++ b/packages/babel-core/src/config/validation/options.js @@ -1,5 +1,8 @@ // @flow +import type { ConfigItem } from "../item"; +import Plugin from "../plugin"; + import removed from "./removed"; import { assertString, @@ -116,9 +119,6 @@ const COMMON_VALIDATORS: ValidatorSet = { sourceMap: (assertSourceMaps: Validator< $PropertyType, >), - sourceMapTarget: (assertString: Validator< - $PropertyType, - >), sourceFileName: (assertString: Validator< $PropertyType, >), @@ -189,7 +189,6 @@ export type ValidatedOptions = { // Sourcemap generation options. sourceMaps?: SourceMapsOption, sourceMap?: SourceMapsOption, - sourceMapTarget?: string, sourceFileName?: string, sourceRoot?: string, @@ -214,10 +213,11 @@ export type IgnoreList = $ReadOnlyArray; export type PluginOptions = {} | void | false; export type PluginTarget = string | {} | Function; export type PluginItem = + | ConfigItem | Plugin | PluginTarget | [PluginTarget, PluginOptions] - | [PluginTarget, PluginOptions, string]; + | [PluginTarget, PluginOptions, string | void]; export type PluginList = $ReadOnlyArray; export type OverridesList = Array; diff --git a/packages/babel-core/src/config/validation/removed.js b/packages/babel-core/src/config/validation/removed.js index 09885afec3fc5..165bc4049f505 100644 --- a/packages/babel-core/src/config/validation/removed.js +++ b/packages/babel-core/src/config/validation/removed.js @@ -44,7 +44,8 @@ export default { message: "Put the specific transforms you want in the `plugins` option", }, sourceMapName: { - message: "Use the `sourceMapTarget` option", + message: + "The `sourceMapName` option has been removed because it makes more sense for the tooling that calls Babel to assign `map.file` themselves.", }, stage: { message: @@ -64,4 +65,10 @@ export default { message: "Generated plugin metadata is always included in the output result", }, + + sourceMapTarget: { + version: 6, + message: + "The `sourceMapTarget` option has been removed because it makes more sense for the tooling that calls Babel to assign `map.file` themselves.", + }, }; diff --git a/packages/babel-core/src/index.js b/packages/babel-core/src/index.js index 7b30f15dbbd07..d6a3e80cac66e 100644 --- a/packages/babel-core/src/index.js +++ b/packages/babel-core/src/index.js @@ -13,20 +13,9 @@ export * as types from "@babel/types"; export { default as traverse } from "@babel/traverse"; export { default as template } from "@babel/template"; -import loadConfig from "./config"; +export { loadPartialConfig, loadOptions, OptionManager } from "./config"; -export function loadOptions(opts: {}): Object | null { - const config = loadConfig(opts); - - return config ? config.options : null; -} - -// For easier backward-compatibility, provide an API like the one we exposed in Babel 6. -export class OptionManager { - init(opts: {}) { - return loadOptions(opts); - } -} +export { createConfigItem } from "./config/item"; export function Plugin(alias: string) { throw new Error( diff --git a/packages/babel-core/src/parse.js b/packages/babel-core/src/parse.js index 1a7e2231a3067..94e7284520ebe 100644 --- a/packages/babel-core/src/parse.js +++ b/packages/babel-core/src/parse.js @@ -1,6 +1,6 @@ // @flow -import loadConfig, { InputOptions } from "./config"; +import loadConfig, { type InputOptions } from "./config"; import normalizeFile from "./transformation/normalize-file"; import normalizeOptions from "./transformation/normalize-opts"; diff --git a/packages/babel-core/src/tools/build-external-helpers.js b/packages/babel-core/src/tools/build-external-helpers.js index 2b6eba92a16e1..c6aa2bf6d21a1 100644 --- a/packages/babel-core/src/tools/build-external-helpers.js +++ b/packages/babel-core/src/tools/build-external-helpers.js @@ -3,19 +3,22 @@ import generator from "@babel/generator"; import template from "@babel/template"; import * as t from "@babel/types"; -const buildUmdWrapper = template(` - (function (root, factory) { - if (typeof define === "function" && define.amd) { - define(AMD_ARGUMENTS, factory); - } else if (typeof exports === "object") { - factory(COMMON_ARGUMENTS); - } else { - factory(BROWSER_ARGUMENTS); - } - })(UMD_ROOT, function (FACTORY_PARAMETERS) { - FACTORY_BODY - }); -`); +// Wrapped to avoid wasting time parsing this when almost no-one uses +// build-external-helpers. +const buildUmdWrapper = replacements => + template` + (function (root, factory) { + if (typeof define === "function" && define.amd) { + define(AMD_ARGUMENTS, factory); + } else if (typeof exports === "object") { + factory(COMMON_ARGUMENTS); + } else { + factory(BROWSER_ARGUMENTS); + } + })(UMD_ROOT, function (FACTORY_PARAMETERS) { + FACTORY_BODY + }); + `(replacements); function buildGlobal(whitelist) { const namespace = t.identifier("babelHelpers"); diff --git a/packages/babel-core/src/transformation/index.js b/packages/babel-core/src/transformation/index.js index a40b12f42cc00..8174f7bd8228f 100644 --- a/packages/babel-core/src/transformation/index.js +++ b/packages/babel-core/src/transformation/index.js @@ -64,9 +64,10 @@ export function runSync( return { metadata: file.metadata, options: opts, - ast: opts.ast !== false ? file.ast : null, + ast: opts.ast === true ? file.ast : null, code: outputCode === undefined ? null : outputCode, map: outputMap === undefined ? null : outputMap, + sourceType: file.ast.program.sourceType, }; } diff --git a/packages/babel-core/src/transformation/normalize-file.js b/packages/babel-core/src/transformation/normalize-file.js index 2ff27aadaf0dd..2ea1e034eda4c 100644 --- a/packages/babel-core/src/transformation/normalize-file.js +++ b/packages/babel-core/src/transformation/normalize-file.js @@ -89,6 +89,12 @@ function parser(pluginPasses, options, code) { } 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."; + } + const { loc, missingPlugin } = err; if (loc) { const codeFrame = codeFrameColumns( diff --git a/packages/babel-core/src/transformation/normalize-opts.js b/packages/babel-core/src/transformation/normalize-opts.js index f224ff01ee13a..6cd0f32447f1d 100644 --- a/packages/babel-core/src/transformation/normalize-opts.js +++ b/packages/babel-core/src/transformation/normalize-opts.js @@ -15,7 +15,6 @@ export default function normalizeOptions(config: ResolvedConfig): {} { sourceRoot = moduleRoot, sourceFileName = filenameRelative, - sourceMapTarget = filenameRelative, comments = true, compact = "auto", @@ -47,7 +46,6 @@ export default function normalizeOptions(config: ResolvedConfig): {} { // Source-map generation flags. sourceMaps, - sourceMapTarget, sourceRoot, sourceFileName, }, diff --git a/packages/babel-core/src/transformation/util/missing-plugin-helper.js b/packages/babel-core/src/transformation/util/missing-plugin-helper.js index 0d029e71eb581..c595e178a1231 100644 --- a/packages/babel-core/src/transformation/util/missing-plugin-helper.js +++ b/packages/babel-core/src/transformation/util/missing-plugin-helper.js @@ -113,6 +113,16 @@ const pluginNameMap = { url: "https://git.io/vb4yd", }, }, + logicalAssignment: { + syntax: { + name: "@babel/plugin-syntax-logical-assignment-operators", + url: "https://git.io/vAlBp", + }, + transform: { + name: "@babel/plugin-proposal-logical-assignment-operators", + url: "https://git.io/vAlRe", + }, + }, nullishCoalescingOperator: { syntax: { name: "@babel/plugin-syntax-nullish-coalescing-operator", diff --git a/packages/babel-core/test/api.js b/packages/babel-core/test/api.js index a38ae5913cce6..101a184089c9d 100644 --- a/packages/babel-core/test/api.js +++ b/packages/babel-core/test/api.js @@ -1,16 +1,15 @@ import * as babel from "../lib/index"; import sourceMap from "source-map"; -import assert from "assert"; import path from "path"; import Plugin from "../lib/config/plugin"; import generator from "@babel/generator"; function assertIgnored(result) { - assert.ok(!result); + expect(result).toBeFalsy(); } function assertNotIgnored(result) { - assert.ok(!result.ignored); + expect(result.ignored).toBeFalsy(); } // shim @@ -34,6 +33,7 @@ describe("parser and generator options", function() { function newTransform(string) { return babel.transform(string, { + ast: true, parserOpts: { parser: recast.parse, plugins: ["flow"], @@ -47,25 +47,28 @@ describe("parser and generator options", function() { it("options", function() { const string = "original;"; - assert.deepEqual(newTransform(string).ast, babel.transform(string).ast); - assert.equal(newTransform(string).code, string); + expect(newTransform(string).ast).toEqual( + babel.transform(string, { ast: true }).ast, + ); + expect(newTransform(string).code).toBe(string); }); it("experimental syntax", function() { const experimental = "var a: number = 1;"; - assert.deepEqual( - newTransform(experimental).ast, + expect(newTransform(experimental).ast).toEqual( babel.transform(experimental, { + ast: true, parserOpts: { plugins: ["flow"], }, }).ast, ); - assert.equal(newTransform(experimental).code, experimental); + expect(newTransform(experimental).code).toBe(experimental); function newTransformWithPlugins(string) { return babel.transform(string, { + ast: true, plugins: [__dirname + "/../../babel-plugin-syntax-flow"], parserOpts: { parser: recast.parse, @@ -76,43 +79,41 @@ describe("parser and generator options", function() { }); } - assert.deepEqual( - newTransformWithPlugins(experimental).ast, + expect(newTransformWithPlugins(experimental).ast).toEqual( babel.transform(experimental, { + ast: true, parserOpts: { plugins: ["flow"], }, }).ast, ); - assert.equal(newTransformWithPlugins(experimental).code, experimental); + expect(newTransformWithPlugins(experimental).code).toBe(experimental); }); it("other options", function() { const experimental = "if (true) {\n import a from 'a';\n}"; - assert.notEqual( - newTransform(experimental).ast, + expect(newTransform(experimental).ast).not.toBe( babel.transform(experimental, { + ast: true, parserOpts: { allowImportExportEverywhere: true, }, }).ast, ); - assert.equal(newTransform(experimental).code, experimental); + expect(newTransform(experimental).code).toBe(experimental); }); }); describe("api", function() { it("exposes the resolvePlugin method", function() { - assert.throws( - () => babel.resolvePlugin("nonexistent-plugin"), + expect(() => babel.resolvePlugin("nonexistent-plugin")).toThrow( /Cannot find module 'babel-plugin-nonexistent-plugin'/, ); }); it("exposes the resolvePreset method", function() { - assert.throws( - () => babel.resolvePreset("nonexistent-preset"), + expect(() => babel.resolvePreset("nonexistent-preset")).toThrow( /Cannot find module 'babel-preset-nonexistent-preset'/, ); }); @@ -127,9 +128,9 @@ describe("api", function() { res, ) { if (err) return done(err); - assert.equal(res.code, "foo();"); + expect(res.code).toBe("foo();"); // keep user options untouched - assert.deepEqual(options, { babelrc: false }); + expect(options).toEqual({ babelrc: false }); done(); }); }); @@ -139,20 +140,19 @@ describe("api", function() { babelrc: false, }; Object.freeze(options); - assert.equal( + expect( babel.transformFileSync(__dirname + "/fixtures/api/file.js", options) .code, - "foo();", - ); - assert.deepEqual(options, { babelrc: false }); + ).toBe("foo();"); + expect(options).toEqual({ babelrc: false }); }); it("options throw on falsy true", function() { - return assert.throws(function() { + return expect(function() { babel.transform("", { plugins: [__dirname + "/../../babel-plugin-syntax-jsx", false], }); - }, /.plugins\[1\] must be a string, object, function/); + }).toThrow(/.plugins\[1\] must be a string, object, function/); }); it("options merge backwards", function() { @@ -160,9 +160,8 @@ describe("api", function() { presets: [__dirname + "/../../babel-preset-es2015"], plugins: [__dirname + "/../../babel-plugin-syntax-jsx"], }).then(function(result) { - assert.ok( - result.options.plugins[0].manipulateOptions.toString().indexOf("jsx") >= - 0, + expect(result.options.plugins[0].manipulateOptions.toString()).toEqual( + expect.stringContaining("jsx"), ); }); }); @@ -177,7 +176,7 @@ describe("api", function() { return callback; } - assert.equal(visitorType, "enter"); + expect(visitorType).toBe("enter"); return function() { calledIntercept++; @@ -197,8 +196,8 @@ describe("api", function() { ], }); - assert.equal(calledRaw, 4); - assert.equal(calledIntercept, 4); + expect(calledRaw).toBe(4); + expect(calledIntercept).toBe(4); }); it("pass per preset", function() { @@ -206,6 +205,7 @@ describe("api", function() { function execTest(passPerPreset) { return babel.transform("type Foo = number; let x = (y): Foo => y;", { + sourceType: "script", passPerPreset: passPerPreset, presets: [ // First preset with our plugin, "before" @@ -257,9 +257,9 @@ describe("api", function() { let result = execTest(true); - assert.equal(aliasBaseType, "NumberTypeAnnotation"); + expect(aliasBaseType).toBe("NumberTypeAnnotation"); - assert.deepEqual(result.code, "var x = function x(y) {\n return y;\n};"); + expect(result.code).toBe("var x = function x(y) {\n return y;\n};"); // 2. passPerPreset: false @@ -267,9 +267,9 @@ describe("api", function() { result = execTest(false); - assert.equal(aliasBaseType, null); + expect(aliasBaseType).toBeNull(); - assert.deepEqual(result.code, "var x = function x(y) {\n return y;\n};"); + expect(result.code).toBe("var x = function x(y) {\n return y;\n};"); }); it("complex plugin and preset ordering", function() { @@ -290,6 +290,9 @@ describe("api", function() { return { plugins: [pushPlugin(str)] }; } + const oldEnv = process.env.BABEL_ENV; + process.env.BABEL_ENV = "development"; + const result = babel.transform("", { filename: path.join( __dirname, @@ -307,8 +310,13 @@ describe("api", function() { }, }); - assert.equal( - result.code, + if (oldEnv === undefined) { + delete process.env.BABEL_ENV; + } else { + process.env.BABEL_ENV = oldEnv; + } + + expect(result.code).toBe( [ "thirteen;", "fourteen;", @@ -356,7 +364,7 @@ describe("api", function() { }, ); - assert.deepEqual( + expect( [ "function _classCallCheck(instance, Constructor) {", " if (!(instance instanceof Constructor)) {", @@ -368,36 +376,46 @@ describe("api", function() { " _classCallCheck(this, Foo);", "};", ].join("\n"), - result.code, - ); + ).toBe(result.code); const consumer = new sourceMap.SourceMapConsumer(result.map); - assert.deepEqual( + expect( consumer.originalPositionFor({ line: 7, column: 4, }), - { - name: null, - source: "stdout", - line: 1, - column: 6, - }, - ); + ).toEqual({ + name: null, + source: "stdout", + line: 1, + column: 6, + }); }); it("code option false", function() { return transformAsync("foo('bar');", { code: false }).then(function( result, ) { - assert.ok(!result.code); + expect(result.code).toBeFalsy(); }); }); it("ast option false", function() { return transformAsync("foo('bar');", { ast: false }).then(function(result) { - assert.ok(!result.ast); + expect(result.ast).toBeFalsy(); + }); + }); + + it("ast option true", function() { + return transformAsync("foo('bar');", { ast: true }).then(function(result) { + expect(result.ast).toBeTruthy(); + }); + }); + + it("ast option default", function() { + return transformAsync("foo('bar');").then(function(result) { + expect(result.ast).toBeFalsy(); }); }); @@ -425,8 +443,7 @@ describe("api", function() { }, ], }).then(function(result) { - assert.equal( - result.code, + expect(result.code).toBe( "/*before*/\nstart;\n\n/*after*/\nclass Foo {}\n\n/*before*/\nend;\n\n/*after*/", ); }); @@ -514,14 +531,14 @@ describe("api", function() { const oldBabelEnv = process.env.BABEL_ENV; const oldNodeEnv = process.env.NODE_ENV; - setup(function() { + beforeEach(function() { // Tests need to run with the default and specific values for these. They // need to be cleared for each test. delete process.env.BABEL_ENV; delete process.env.NODE_ENV; }); - suiteTeardown(function() { + afterAll(function() { process.env.BABEL_ENV = oldBabelEnv; process.env.NODE_ENV = oldNodeEnv; }); @@ -533,7 +550,7 @@ describe("api", function() { }, }); - assert.equal(result.options.comments, false); + expect(result.options.comments).toBe(false); }); it("BABEL_ENV", function() { @@ -543,7 +560,7 @@ describe("api", function() { foo: { comments: false }, }, }); - assert.equal(result.options.comments, false); + expect(result.options.comments).toBe(false); }); it("NODE_ENV", function() { @@ -553,7 +570,7 @@ describe("api", function() { foo: { comments: false }, }, }); - assert.equal(result.options.comments, false); + expect(result.options.comments).toBe(false); }); }); @@ -578,25 +595,25 @@ describe("api", function() { it("all", function() { const script = babel.buildExternalHelpers(); - assert.ok(script.indexOf("classCallCheck") >= -1); - assert.ok(script.indexOf("inherits") >= 0); + expect(script).toEqual(expect.stringContaining("classCallCheck")); + expect(script).toEqual(expect.stringContaining("inherits")); }); it("whitelist", function() { const script = babel.buildExternalHelpers(["inherits"]); - assert.ok(script.indexOf("classCallCheck") === -1); - assert.ok(script.indexOf("inherits") >= 0); + expect(script).not.toEqual(expect.stringContaining("classCallCheck")); + expect(script).toEqual(expect.stringContaining("inherits")); }); it("empty whitelist", function() { const script = babel.buildExternalHelpers([]); - assert.ok(script.indexOf("classCallCheck") === -1); - assert.ok(script.indexOf("inherits") === -1); + expect(script).not.toEqual(expect.stringContaining("classCallCheck")); + expect(script).not.toEqual(expect.stringContaining("inherits")); }); it("underscored", function() { const script = babel.buildExternalHelpers(["typeof"]); - assert.ok(script.indexOf("typeof") >= 0); + expect(script).toEqual(expect.stringContaining("typeof")); }); }); @@ -610,16 +627,12 @@ describe("api", function() { __dirname + "/fixtures/api/parsing-errors/only-syntax/file.js", options, function(err) { - assert.ok( - RegExp( - "Support for the experimental syntax 'dynamicImport' isn't currently enabled \\(1:9\\):", - ).exec(err.message), + expect(err.message).toMatch( + "Support for the experimental syntax 'dynamicImport' isn't currently enabled (1:9)", ); - assert.ok( - RegExp( - "Add @babel/plugin-syntax-dynamic-import \\(https://git.io/vb4Sv\\) to the " + - "'plugins' section of your Babel config to enable parsing.", - ).exec(err.message), + 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.", ); done(); }, @@ -631,16 +644,12 @@ describe("api", function() { __dirname + "/fixtures/api/parsing-errors/syntax-and-transform/file.js", options, function(err) { - assert.ok( - RegExp( - "Support for the experimental syntax 'asyncGenerators' isn't currently enabled \\(1:15\\):", - ).exec(err.message), + expect(err.message).toMatch( + "Support for the experimental syntax 'asyncGenerators' isn't currently enabled (1:15):", ); - assert.ok( - RegExp( - "Add @babel/plugin-proposal-async-generator-functions \\(https://git.io/vb4yp\\) to the " + - "'plugins' section of your Babel config to enable transformation.", - ).exec(err.message), + expect(err.message).toMatch( + "Add @babel/plugin-proposal-async-generator-functions (https://git.io/vb4yp) to the " + + "'plugins' section of your Babel config to enable transformation.", ); done(); }, diff --git a/packages/babel-core/test/browserify.js b/packages/babel-core/test/browserify.js index df0090344340b..2d200bb1ce2f6 100644 --- a/packages/babel-core/test/browserify.js +++ b/packages/babel-core/test/browserify.js @@ -1,5 +1,4 @@ import browserify from "browserify"; -import assert from "assert"; import path from "path"; import vm from "vm"; @@ -11,7 +10,7 @@ describe("browserify", function() { bundler.bundle(function(err, bundle) { if (err) return done(err); - assert.ok(bundle.length, "bundle output code"); + expect(bundle.length).toBeTruthy(); // ensure that the code runs without throwing an exception vm.runInNewContext("var global = this;\n" + bundle, {}); diff --git a/packages/babel-core/test/caching-api.js b/packages/babel-core/test/caching-api.js index 9daee26fdc895..0318759fe8612 100644 --- a/packages/babel-core/test/caching-api.js +++ b/packages/babel-core/test/caching-api.js @@ -1,4 +1,3 @@ -import assert from "assert"; import { makeStrongCache } from "../lib/config/caching"; describe("caching API", () => { @@ -10,13 +9,13 @@ describe("caching API", () => { return { arg, count: count++ }; }); - assert.deepEqual(fn("one"), { arg: "one", count: 0 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", count: 0 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", count: 1 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", count: 1 }); + expect(fn("two")).toBe(fn("two")); - assert.notEqual(fn("one"), fn("two")); + expect(fn("one")).not.toEqual(fn("two")); }); it("should allow disabling caching with .never()", () => { @@ -27,15 +26,15 @@ describe("caching API", () => { return { arg, count: count++ }; }); - assert.deepEqual(fn("one"), { arg: "one", count: 0 }); - assert.deepEqual(fn("one"), { arg: "one", count: 1 }); - assert.notEqual(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", count: 0 }); + expect(fn("one")).toEqual({ arg: "one", count: 1 }); + expect(fn("one")).not.toEqual(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", count: 4 }); - assert.deepEqual(fn("two"), { arg: "two", count: 5 }); - assert.notEqual(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", count: 4 }); + expect(fn("two")).toEqual({ arg: "two", count: 5 }); + expect(fn("two")).not.toEqual(fn("two")); - assert.notEqual(fn("one"), fn("two")); + expect(fn("one")).not.toEqual(fn("two")); }); it("should allow caching based on a value with .using(fn)", () => { @@ -48,35 +47,35 @@ describe("caching API", () => { return { arg, val, count: count++ }; }); - assert.deepEqual(fn("one"), { arg: "one", val: "default", count: 0 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", val: "default", count: 0 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", val: "default", count: 1 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", val: "default", count: 1 }); + expect(fn("two")).toBe(fn("two")); other = "new"; - assert.deepEqual(fn("one"), { arg: "one", val: "new", count: 2 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", val: "new", count: 2 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", val: "new", count: 3 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", val: "new", count: 3 }); + expect(fn("two")).toBe(fn("two")); other = "default"; - assert.deepEqual(fn("one"), { arg: "one", val: "default", count: 0 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", val: "default", count: 0 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", val: "default", count: 1 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", val: "default", count: 1 }); + expect(fn("two")).toBe(fn("two")); other = "new"; - assert.deepEqual(fn("one"), { arg: "one", val: "new", count: 2 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", val: "new", count: 2 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", val: "new", count: 3 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", val: "new", count: 3 }); + expect(fn("two")).toBe(fn("two")); }); it("should allow invalidation based on a value with .invalidate(fn)", () => { @@ -89,35 +88,35 @@ describe("caching API", () => { return { arg, val, count: count++ }; }); - assert.deepEqual(fn("one"), { arg: "one", val: "default", count: 0 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", val: "default", count: 0 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", val: "default", count: 1 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", val: "default", count: 1 }); + expect(fn("two")).toBe(fn("two")); other = "new"; - assert.deepEqual(fn("one"), { arg: "one", val: "new", count: 2 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", val: "new", count: 2 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", val: "new", count: 3 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", val: "new", count: 3 }); + expect(fn("two")).toBe(fn("two")); other = "default"; - assert.deepEqual(fn("one"), { arg: "one", val: "default", count: 4 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", val: "default", count: 4 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", val: "default", count: 5 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", val: "default", count: 5 }); + expect(fn("two")).toBe(fn("two")); other = "new"; - assert.deepEqual(fn("one"), { arg: "one", val: "new", count: 6 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", val: "new", count: 6 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", val: "new", count: 7 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", val: "new", count: 7 }); + expect(fn("two")).toBe(fn("two")); }); it("should allow invalidation with .using and .invalidate", () => { @@ -132,93 +131,93 @@ describe("caching API", () => { return { arg, val, val2, count: count++ }; }); - assert.deepEqual(fn("one"), { + expect(fn("one")).toEqual({ arg: "one", val: "default", val2: "another", count: 0, }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { + expect(fn("two")).toEqual({ arg: "two", val: "default", val2: "another", count: 1, }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toBe(fn("two")); other = "new"; - assert.deepEqual(fn("one"), { + expect(fn("one")).toEqual({ arg: "one", val: "new", val2: "another", count: 2, }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { + expect(fn("two")).toEqual({ arg: "two", val: "new", val2: "another", count: 3, }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toBe(fn("two")); other = "default"; - assert.deepEqual(fn("one"), { + expect(fn("one")).toEqual({ arg: "one", val: "default", val2: "another", count: 4, }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { + expect(fn("two")).toEqual({ arg: "two", val: "default", val2: "another", count: 5, }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toBe(fn("two")); other = "new"; - assert.deepEqual(fn("one"), { + expect(fn("one")).toEqual({ arg: "one", val: "new", val2: "another", count: 6, }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { + expect(fn("two")).toEqual({ arg: "two", val: "new", val2: "another", count: 7, }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toBe(fn("two")); another = "second"; - assert.deepEqual(fn("one"), { + expect(fn("one")).toEqual({ arg: "one", val: "new", val2: "second", count: 8, }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { + expect(fn("two")).toEqual({ arg: "two", val: "new", val2: "second", count: 9, }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toBe(fn("two")); }); it("should auto-permacache by default", () => { @@ -226,13 +225,13 @@ describe("caching API", () => { const fn = makeStrongCache(arg => ({ arg, count: count++ })); - assert.deepEqual(fn("one"), { arg: "one", count: 0 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", count: 0 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", count: 1 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", count: 1 }); + expect(fn("two")).toBe(fn("two")); - assert.notEqual(fn("one"), fn("two")); + expect(fn("one")).not.toEqual(fn("two")); }); it("should throw if you set permacaching and use .using", () => { @@ -242,7 +241,7 @@ describe("caching API", () => { cache.using(() => null); }); - assert.throws(() => fn(), /Caching has already been configured/); + expect(() => fn()).toThrow(/Caching has already been configured/); }); it("should throw if you set permacaching and use .invalidate", () => { @@ -252,7 +251,7 @@ describe("caching API", () => { cache.invalidate(() => null); }); - assert.throws(() => fn(), /Caching has already been configured/); + expect(() => fn()).toThrow(/Caching has already been configured/); }); it("should throw if you set permacaching and use .never", () => { @@ -262,7 +261,7 @@ describe("caching API", () => { cache.never(); }); - assert.throws(() => fn(), /Caching has already been configured/); + expect(() => fn()).toThrow(/Caching has already been configured/); }); it("should throw if you set no caching and use .using", () => { @@ -272,7 +271,7 @@ describe("caching API", () => { cache.using(() => null); }); - assert.throws(() => fn(), /Caching has already been configured/); + expect(() => fn()).toThrow(/Caching has already been configured/); }); it("should throw if you set no caching and use .invalidate", () => { @@ -282,7 +281,7 @@ describe("caching API", () => { cache.invalidate(() => null); }); - assert.throws(() => fn(), /Caching has already been configured/); + expect(() => fn()).toThrow(/Caching has already been configured/); }); it("should throw if you set no caching and use .never", () => { @@ -292,14 +291,13 @@ describe("caching API", () => { cache.using(() => null); }); - assert.throws(() => fn(), /Caching has already been configured/); + expect(() => fn()).toThrow(/Caching has already been configured/); }); it("should throw if you configure .forever after exiting", () => { const fn = makeStrongCache((arg, cache) => cache); - assert.throws( - () => fn().forever(), + expect(() => fn().forever()).toThrow( /Cannot change caching after evaluation/, ); }); @@ -307,14 +305,15 @@ describe("caching API", () => { it("should throw if you configure .never after exiting", () => { const fn = makeStrongCache((arg, cache) => cache); - assert.throws(() => fn().never(), /Cannot change caching after evaluation/); + expect(() => fn().never()).toThrow( + /Cannot change caching after evaluation/, + ); }); it("should throw if you configure .using after exiting", () => { const fn = makeStrongCache((arg, cache) => cache); - assert.throws( - () => fn().using(() => null), + expect(() => fn().using(() => null)).toThrow( /Cannot change caching after evaluation/, ); }); @@ -322,8 +321,7 @@ describe("caching API", () => { it("should throw if you configure .invalidate after exiting", () => { const fn = makeStrongCache((arg, cache) => cache); - assert.throws( - () => fn().invalidate(() => null), + expect(() => fn().invalidate(() => null)).toThrow( /Cannot change caching after evaluation/, ); }); @@ -339,13 +337,13 @@ describe("caching API", () => { return { arg, count: count++ }; }); - assert.deepEqual(fn("one"), { arg: "one", count: 0 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", count: 0 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", count: 1 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", count: 1 }); + expect(fn("two")).toBe(fn("two")); - assert.notEqual(fn("one"), fn("two")); + expect(fn("one")).not.toEqual(fn("two")); }); it("should allow disabling caching with cache(false)", () => { @@ -358,15 +356,15 @@ describe("caching API", () => { return { arg, count: count++ }; }); - assert.deepEqual(fn("one"), { arg: "one", count: 0 }); - assert.deepEqual(fn("one"), { arg: "one", count: 1 }); - assert.notEqual(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", count: 0 }); + expect(fn("one")).toEqual({ arg: "one", count: 1 }); + expect(fn("one")).not.toEqual(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", count: 4 }); - assert.deepEqual(fn("two"), { arg: "two", count: 5 }); - assert.notEqual(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", count: 4 }); + expect(fn("two")).toEqual({ arg: "two", count: 5 }); + expect(fn("two")).not.toEqual(fn("two")); - assert.notEqual(fn("one"), fn("two")); + expect(fn("one")).not.toEqual(fn("two")); }); it("should allow caching based on a value with cache(fn)", () => { @@ -381,35 +379,35 @@ describe("caching API", () => { return { arg, val, count: count++ }; }); - assert.deepEqual(fn("one"), { arg: "one", val: "default", count: 0 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", val: "default", count: 0 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", val: "default", count: 1 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", val: "default", count: 1 }); + expect(fn("two")).toBe(fn("two")); other = "new"; - assert.deepEqual(fn("one"), { arg: "one", val: "new", count: 2 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", val: "new", count: 2 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", val: "new", count: 3 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", val: "new", count: 3 }); + expect(fn("two")).toBe(fn("two")); other = "default"; - assert.deepEqual(fn("one"), { arg: "one", val: "default", count: 0 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", val: "default", count: 0 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", val: "default", count: 1 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", val: "default", count: 1 }); + expect(fn("two")).toBe(fn("two")); other = "new"; - assert.deepEqual(fn("one"), { arg: "one", val: "new", count: 2 }); - assert.equal(fn("one"), fn("one")); + expect(fn("one")).toEqual({ arg: "one", val: "new", count: 2 }); + expect(fn("one")).toBe(fn("one")); - assert.deepEqual(fn("two"), { arg: "two", val: "new", count: 3 }); - assert.equal(fn("two"), fn("two")); + expect(fn("two")).toEqual({ arg: "two", val: "new", count: 3 }); + expect(fn("two")).toBe(fn("two")); }); }); }); diff --git a/packages/babel-core/test/config-chain.js b/packages/babel-core/test/config-chain.js index f40ae9989b59b..06cd44f5a75a2 100644 --- a/packages/babel-core/test/config-chain.js +++ b/packages/babel-core/test/config-chain.js @@ -1,4 +1,3 @@ -import assert from "assert"; import fs from "fs"; import path from "path"; import { loadOptions } from "../lib"; @@ -18,7 +17,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process matching RegExp values", () => { @@ -29,7 +28,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process matching function values", () => { @@ -40,7 +39,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process non-matching string values", () => { @@ -51,7 +50,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process non-matching RegExp values", () => { @@ -62,7 +61,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process non-matching function values", () => { @@ -73,7 +72,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); }); @@ -86,7 +85,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process matching RegExp values", () => { @@ -97,7 +96,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process matching function values", () => { @@ -108,7 +107,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process non-matching string values", () => { @@ -119,7 +118,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process non-matching RegExp values", () => { @@ -130,7 +129,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process non-matching function values", () => { @@ -141,7 +140,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); }); }); @@ -156,7 +155,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process matching RegExp values", () => { @@ -167,7 +166,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process matching function values", () => { @@ -178,7 +177,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process non-matching string values", () => { @@ -189,7 +188,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process non-matching RegExp values", () => { @@ -200,7 +199,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process non-matching function values", () => { @@ -211,7 +210,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); }); @@ -224,7 +223,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process matching RegExp values", () => { @@ -235,7 +234,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process matching function values", () => { @@ -246,7 +245,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process non-matching string values", () => { @@ -257,7 +256,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process non-matching RegExp values", () => { @@ -268,7 +267,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process non-matching function values", () => { @@ -279,7 +278,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); }); }); @@ -294,7 +293,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process matching RegExp values", () => { @@ -305,7 +304,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process matching function values", () => { @@ -316,7 +315,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process non-matching string values", () => { @@ -327,7 +326,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process non-matching RegExp values", () => { @@ -338,7 +337,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process non-matching function values", () => { @@ -349,7 +348,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); }); @@ -362,7 +361,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process matching RegExp values", () => { @@ -373,7 +372,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process matching function values", () => { @@ -384,7 +383,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, undefined); + expect(opts.comments).toBeUndefined(); }); it("should process non-matching string values", () => { @@ -395,7 +394,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process non-matching RegExp values", () => { @@ -406,7 +405,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); it("should process non-matching function values", () => { @@ -417,7 +416,7 @@ describe("buildConfigChain", function() { comments: true, }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); }); }); @@ -437,7 +436,7 @@ describe("buildConfigChain", function() { ], }); - assert.equal(opts, null); + expect(opts).toBeNull(); }); it("should not ignore files that don't match", () => { @@ -450,7 +449,7 @@ describe("buildConfigChain", function() { ], }); - assert.notEqual(opts, null); + expect(opts).not.toBeNull(); }); }); @@ -465,7 +464,7 @@ describe("buildConfigChain", function() { ], }); - assert.equal(opts, null); + expect(opts).toBeNull(); }); it("should not ignore files that match", () => { @@ -478,7 +477,7 @@ describe("buildConfigChain", function() { ], }); - assert.notEqual(opts, null); + expect(opts).not.toBeNull(); }); }); @@ -491,7 +490,7 @@ describe("buildConfigChain", function() { only: [], }); - assert.equal(opts, null); + expect(opts).toBeNull(); }); it("should ignore files that match ignore and also only", () => { @@ -502,7 +501,7 @@ describe("buildConfigChain", function() { only: [fixture("nonexistant-fake", "src.js")], }); - assert.equal(opts, null); + expect(opts).toBeNull(); }); it("should not ignore files that match only and not ignore", () => { @@ -512,7 +511,7 @@ describe("buildConfigChain", function() { only: [fixture("nonexistant-fake", "src.js")], }); - assert.notEqual(opts, null); + expect(opts).not.toBeNull(); }); it("should not ignore files when no ignore/only are specified", () => { @@ -521,7 +520,7 @@ describe("buildConfigChain", function() { babelrc: false, }); - assert.notEqual(opts, null); + expect(opts).not.toBeNull(); }); it("should allow negation of only", () => { @@ -533,7 +532,7 @@ describe("buildConfigChain", function() { fixture("nonexistant-fake", "other.js"), ], }); - assert.equal(opts1, null); + expect(opts1).toBeNull(); const opts2 = loadOptions({ filename: fixture("nonexistant-fake", "src.js"), @@ -543,7 +542,7 @@ describe("buildConfigChain", function() { fixture("nonexistant-fake", "src.js"), ], }); - assert.notEqual(opts2, null); + expect(opts2).not.toBeNull(); const opts3 = loadOptions({ filename: fixture("nonexistant-fake", "folder", "src.js"), @@ -553,7 +552,7 @@ describe("buildConfigChain", function() { fixture("nonexistant-fake", "folder"), ], }); - assert.notEqual(opts3, null); + expect(opts3).not.toBeNull(); }); it("should allow negation of ignore", () => { @@ -565,7 +564,7 @@ describe("buildConfigChain", function() { fixture("nonexistant-fake"), ], }); - assert.equal(opts1, null); + expect(opts1).toBeNull(); // Tests disabled pending https://github.com/babel/babel/issues/6907 // const opts2 = loadOptions({ @@ -603,9 +602,9 @@ describe("buildConfigChain", function() { inputOpts.plugins = plugins2; const opts2 = loadOptions(inputOpts); - assert.equal(opts1.plugins.length, 1); - assert.equal(opts2.plugins.length, 1); - assert.notEqual(opts1.plugins[0], opts2.plugins[1]); + expect(opts1.plugins).toHaveLength(1); + expect(opts2.plugins).toHaveLength(1); + expect(opts1.plugins[0]).not.toBe(opts2.plugins[1]); }); it("should cache the env plugins by identity", () => { @@ -628,9 +627,9 @@ describe("buildConfigChain", function() { }, }); - assert.equal(opts1.plugins.length, 1); - assert.equal(opts2.plugins.length, 1); - assert.equal(opts1.plugins[0], opts2.plugins[0]); + expect(opts1.plugins).toHaveLength(1); + expect(opts2.plugins).toHaveLength(1); + expect(opts1.plugins[0]).toBe(opts2.plugins[0]); }); it("should cache the env presets by identity", () => { @@ -653,9 +652,9 @@ describe("buildConfigChain", function() { }, }); - assert.equal(opts1.plugins.length, 1); - assert.equal(opts2.plugins.length, 1); - assert.equal(opts1.plugins[0], opts2.plugins[0]); + expect(opts1.plugins).toHaveLength(1); + expect(opts2.plugins).toHaveLength(1); + expect(opts1.plugins[0]).toBe(opts2.plugins[0]); }); it("should cache the plugin options by identity", () => { @@ -664,9 +663,9 @@ describe("buildConfigChain", function() { const opts1 = loadOptions({ plugins }); const opts2 = loadOptions({ plugins }); - assert.equal(opts1.plugins.length, 1); - assert.equal(opts2.plugins.length, 1); - assert.equal(opts1.plugins[0], opts2.plugins[0]); + expect(opts1.plugins).toHaveLength(1); + expect(opts2.plugins).toHaveLength(1); + expect(opts1.plugins[0]).toBe(opts2.plugins[0]); }); it("should cache the presets options by identity", () => { @@ -675,9 +674,9 @@ describe("buildConfigChain", function() { const opts1 = loadOptions({ presets }); const opts2 = loadOptions({ presets }); - assert.equal(opts1.plugins.length, 1); - assert.equal(opts2.plugins.length, 1); - assert.strictEqual(opts1.plugins[0], opts2.plugins[0]); + expect(opts1.plugins).toHaveLength(1); + expect(opts2.plugins).toHaveLength(1); + expect(opts1.plugins[0]).toBe(opts2.plugins[0]); }); it("should not cache the presets options with passPerPreset", () => { @@ -687,11 +686,11 @@ describe("buildConfigChain", function() { const opts2 = loadOptions({ presets, passPerPreset: true }); const opts3 = loadOptions({ presets, passPerPreset: false }); - assert.equal(opts1.plugins.length, 1); - assert.equal(opts2.plugins.length, 0); - assert.equal(opts3.plugins.length, 1); + expect(opts1.plugins).toHaveLength(1); + expect(opts2.plugins).toHaveLength(0); + expect(opts3.plugins).toHaveLength(1); - assert.strictEqual(opts1.plugins[0], opts3.plugins[0]); + expect(opts1.plugins[0]).toBe(opts3.plugins[0]); }); }); @@ -727,16 +726,16 @@ describe("buildConfigChain", function() { const opts3 = loadOptions({ filename }); const opts4 = loadOptions({ filename }); - assert.equal(opts1.plugins.length, 1); - assert.equal(opts2.plugins.length, 1); - assert.equal(opts1.plugins[0], opts2.plugins[0]); + expect(opts1.plugins).toHaveLength(1); + expect(opts2.plugins).toHaveLength(1); + expect(opts1.plugins[0]).toBe(opts2.plugins[0]); - assert.equal(opts3.plugins.length, 1); - assert.equal(opts4.plugins.length, 1); - assert.equal(opts3.plugins[0], opts4.plugins[0]); + expect(opts1.plugins).toHaveLength(1); + expect(opts2.plugins).toHaveLength(1); + expect(opts3.plugins[0]).toBe(opts4.plugins[0]); // Identity changed after touch(). - assert.notEqual(opts1.plugins[0], opts3.plugins[0]); + expect(opts1.plugins[0]).not.toBe(opts3.plugins[0]); }); it("should cache .babelrc files by mtime", () => { @@ -761,16 +760,16 @@ describe("buildConfigChain", function() { const opts3 = loadOptions({ filename }); const opts4 = loadOptions({ filename }); - assert.equal(opts1.plugins.length, 1); - assert.equal(opts2.plugins.length, 1); - assert.equal(opts1.plugins[0], opts2.plugins[0]); + expect(opts1.plugins).toHaveLength(1); + expect(opts2.plugins).toHaveLength(1); + expect(opts1.plugins[0]).toBe(opts2.plugins[0]); - assert.equal(opts3.plugins.length, 1); - assert.equal(opts4.plugins.length, 1); - assert.equal(opts3.plugins[0], opts4.plugins[0]); + expect(opts3.plugins).toHaveLength(1); + expect(opts4.plugins).toHaveLength(1); + expect(opts3.plugins[0]).toBe(opts4.plugins[0]); // Identity changed after touch(). - assert.notEqual(opts1.plugins[0], opts3.plugins[0]); + expect(opts1.plugins[0]).not.toBe(opts3.plugins[0]); }); it("should cache .babelrc.js files programmable behavior", () => { @@ -787,16 +786,16 @@ describe("buildConfigChain", function() { const opts3 = loadOptions({ filename, envName: "new-env" }); const opts4 = loadOptions({ filename, envName: "new-env" }); - assert.equal(opts1.plugins.length, 1); - assert.equal(opts2.plugins.length, 1); - assert.equal(opts1.plugins[0], opts2.plugins[0]); + expect(opts1.plugins).toHaveLength(1); + expect(opts2.plugins).toHaveLength(1); + expect(opts1.plugins[0]).toBe(opts2.plugins[0]); - assert.equal(opts3.plugins.length, 1); - assert.equal(opts4.plugins.length, 1); - assert.equal(opts3.plugins[0], opts4.plugins[0]); + expect(opts3.plugins).toHaveLength(1); + expect(opts4.plugins).toHaveLength(1); + expect(opts3.plugins[0]).toBe(opts4.plugins[0]); // Identity changed with different .env - assert.notEqual(opts1.plugins[0], opts3.plugins[0]); + expect(opts1.plugins[0]).not.toBe(opts3.plugins[0]); }); }); }); @@ -815,7 +814,7 @@ describe("buildConfigChain", function() { ], }); - assert.equal(opts.comments, false); + expect(opts.comments).toBe(false); }); it("should not apply non-matching overrides over base configs", () => { @@ -831,7 +830,7 @@ describe("buildConfigChain", function() { ], }); - assert.equal(opts.comments, true); + expect(opts.comments).toBe(true); }); }); @@ -844,11 +843,24 @@ describe("buildConfigChain", function() { plugins: [], presets: [], }); + const realEnv = process.env.NODE_ENV; + const realBabelEnv = process.env.BABEL_ENV; + + beforeAll(() => { + delete process.env.NODE_ENV; + delete process.env.BABEL_ENV; + }); + afterAll(() => { + if (realEnv) { + process.env.NODE_ENV = realEnv; + process.env.NODE_ENV = realBabelEnv; + } + }); it("should load .babelrc", () => { const filename = fixture("config-files", "babelrc", "src.js"); - assert.deepEqual(loadOptions({ filename }), { + expect(loadOptions({ filename })).toEqual({ ...getDefaults(), filename, comments: true, @@ -858,7 +870,7 @@ describe("buildConfigChain", function() { it("should load .babelrc.js", () => { const filename = fixture("config-files", "babelrc-js", "src.js"); - assert.deepEqual(loadOptions({ filename }), { + expect(loadOptions({ filename })).toEqual({ ...getDefaults(), filename, comments: true, @@ -868,7 +880,7 @@ describe("buildConfigChain", function() { it("should load package.json#babel", () => { const filename = fixture("config-files", "pkg", "src.js"); - assert.deepEqual(loadOptions({ filename }), { + expect(loadOptions({ filename })).toEqual({ ...getDefaults(), filename, comments: true, @@ -878,14 +890,13 @@ describe("buildConfigChain", function() { it("should load .babelignore", () => { const filename = fixture("config-files", "babelignore", "src.js"); - assert.deepEqual(loadOptions({ filename }), null); + expect(loadOptions({ filename })).toBeNull(); }); it("should throw if there are both .babelrc and .babelrc.js", () => { const filename = fixture("config-files", "both-babelrc", "src.js"); - assert.throws( - () => loadOptions({ filename }), + expect(() => loadOptions({ filename })).toThrow( /Multiple configuration files found/, ); }); @@ -893,8 +904,7 @@ describe("buildConfigChain", function() { it("should throw if there are both .babelrc and package.json", () => { const filename = fixture("config-files", "pkg-babelrc", "src.js"); - assert.throws( - () => loadOptions({ filename }), + expect(() => loadOptions({ filename })).toThrow( /Multiple configuration files found/, ); }); @@ -902,8 +912,7 @@ describe("buildConfigChain", function() { it("should throw if there are both .babelrc.js and package.json", () => { const filename = fixture("config-files", "pkg-babelrc-js", "src.js"); - assert.throws( - () => loadOptions({ filename }), + expect(() => loadOptions({ filename })).toThrow( /Multiple configuration files found/, ); }); @@ -911,7 +920,7 @@ describe("buildConfigChain", function() { it("should ignore package.json without a 'babel' property", () => { const filename = fixture("config-files", "pkg-ignored", "src.js"); - assert.deepEqual(loadOptions({ filename }), { + expect(loadOptions({ filename })).toEqual({ ...getDefaults(), filename, comments: true, @@ -921,8 +930,7 @@ describe("buildConfigChain", function() { it("should show helpful errors for .babelrc", () => { const filename = fixture("config-files", "babelrc-error", "src.js"); - assert.throws( - () => loadOptions({ filename }), + expect(() => loadOptions({ filename })).toThrow( /Error while parsing config - /, ); }); @@ -930,14 +938,13 @@ describe("buildConfigChain", function() { it("should show helpful errors for .babelrc.js", () => { const filename = fixture("config-files", "babelrc-js-error", "src.js"); - assert.throws(() => loadOptions({ filename }), /Babelrc threw an error/); + expect(() => loadOptions({ filename })).toThrow(/Babelrc threw an error/); }); it("should show helpful errors for package.json", () => { const filename = fixture("config-files", "pkg-error", "src.js"); - assert.throws( - () => loadOptions({ filename }), + expect(() => loadOptions({ filename })).toThrow( /Error while parsing JSON - /, ); }); diff --git a/packages/babel-core/test/config-loading.js b/packages/babel-core/test/config-loading.js index 130cdb386a9e1..c2787f39c2104 100644 --- a/packages/babel-core/test/config-loading.js +++ b/packages/babel-core/test/config-loading.js @@ -1,6 +1,5 @@ import loadConfig from "../lib/config"; import path from "path"; -import { expect } from "chai"; describe("@babel/core config loading", () => { const FILEPATH = path.join( @@ -41,7 +40,7 @@ describe("@babel/core config loading", () => { const opts = makeOpts(); const options1 = loadConfig(opts).options; - expect(options1.plugins.map(p => p.key)).to.eql([ + expect(options1.plugins.map(p => p.key)).toEqual([ "plugin1", "plugin2", "plugin6", @@ -51,16 +50,16 @@ describe("@babel/core config loading", () => { ]); const options2 = loadConfig(opts).options; - expect(options2.plugins.length).to.equal(options1.plugins.length); + expect(options2.plugins.length).toBe(options1.plugins.length); for (let i = 0; i < options2.plugins.length; i++) { - expect(options2.plugins[i]).to.equal(options1.plugins[i]); + expect(options2.plugins[i]).toBe(options1.plugins[i]); } }); it("should load and cache the config for unique opts objects", () => { const options1 = loadConfig(makeOpts(true)).options; - expect(options1.plugins.map(p => p.key)).to.eql([ + expect(options1.plugins.map(p => p.key)).toEqual([ "plugin1", "plugin2", "plugin4", @@ -68,10 +67,10 @@ describe("@babel/core config loading", () => { ]); const options2 = loadConfig(makeOpts(true)).options; - expect(options2.plugins.length).to.equal(options1.plugins.length); + expect(options2.plugins.length).toBe(options1.plugins.length); for (let i = 0; i < options2.plugins.length; i++) { - expect(options2.plugins[i]).to.equal(options1.plugins[i]); + expect(options2.plugins[i]).toBe(options1.plugins[i]); } }); @@ -83,26 +82,26 @@ describe("@babel/core config loading", () => { process.env.INVALIDATE_PLUGIN1 = true; const options2 = loadConfig(opts).options; - expect(options2.plugins.length).to.equal(options1.plugins.length); + expect(options2.plugins.length).toBe(options1.plugins.length); for (let i = 0; i < options1.plugins.length; i++) { if (i === 0) { - expect(options2.plugins[i]).not.to.equal(options1.plugins[i]); + expect(options2.plugins[i]).not.toBe(options1.plugins[i]); } else { - expect(options2.plugins[i]).to.equal(options1.plugins[i]); + expect(options2.plugins[i]).toBe(options1.plugins[i]); } } process.env.INVALIDATE_PLUGIN3 = true; const options3 = loadConfig(opts).options; - expect(options3.plugins.length).to.equal(options1.plugins.length); + expect(options3.plugins.length).toBe(options1.plugins.length); for (let i = 0; i < options1.plugins.length; i++) { if (i === 0 || i === 5) { - expect(options3.plugins[i]).not.to.equal(options1.plugins[i]); + expect(options3.plugins[i]).not.toBe(options1.plugins[i]); } else { - expect(options3.plugins[i]).to.equal(options1.plugins[i]); + expect(options3.plugins[i]).toBe(options1.plugins[i]); } } }); @@ -115,26 +114,26 @@ describe("@babel/core config loading", () => { process.env.INVALIDATE_PRESET1 = true; const options2 = loadConfig(opts).options; - expect(options2.plugins.length).to.equal(options1.plugins.length); + expect(options2.plugins.length).toBe(options1.plugins.length); for (let i = 0; i < options1.plugins.length; i++) { if (i === 5) { - expect(options2.plugins[i]).not.to.equal(options1.plugins[i]); + expect(options2.plugins[i]).not.toBe(options1.plugins[i]); } else { - expect(options2.plugins[i]).to.equal(options1.plugins[i]); + expect(options2.plugins[i]).toBe(options1.plugins[i]); } } process.env.INVALIDATE_PRESET2 = true; const options3 = loadConfig(opts).options; - expect(options3.plugins.length).to.equal(options1.plugins.length); + expect(options3.plugins.length).toBe(options1.plugins.length); for (let i = 0; i < options1.plugins.length; i++) { if (i === 4 || i === 5) { - expect(options3.plugins[i]).not.to.equal(options1.plugins[i]); + expect(options3.plugins[i]).not.toBe(options1.plugins[i]); } else { - expect(options3.plugins[i]).to.equal(options1.plugins[i]); + expect(options3.plugins[i]).toBe(options1.plugins[i]); } } }); @@ -147,13 +146,13 @@ describe("@babel/core config loading", () => { process.env.INVALIDATE_BABELRC = true; const options2 = loadConfig(opts).options; - expect(options2.plugins.length).to.equal(options1.plugins.length); + expect(options2.plugins.length).toBe(options1.plugins.length); for (let i = 0; i < options1.plugins.length; i++) { if (i === 0 || i === 1 || i === 4 || i === 5 || i === 6) { - expect(options2.plugins[i]).not.to.equal(options1.plugins[i]); + expect(options2.plugins[i]).not.toBe(options1.plugins[i]); } else { - expect(options2.plugins[i]).to.equal(options1.plugins[i]); + expect(options2.plugins[i]).toBe(options1.plugins[i]); } } }); @@ -166,10 +165,10 @@ describe("@babel/core config loading", () => { const options1 = loadConfig(opts).options; const options2 = loadConfig(Object.assign({}, opts)).options; - expect(options2.plugins.length).to.equal(options1.plugins.length); + expect(options2.plugins.length).toBe(options1.plugins.length); for (let i = 0; i < options2.plugins.length; i++) { - expect(options2.plugins[i]).to.equal(options1.plugins[i]); + expect(options2.plugins[i]).toBe(options1.plugins[i]); } }); @@ -182,13 +181,13 @@ describe("@babel/core config loading", () => { ...opts, plugins: opts.plugins.slice(), }).options; - expect(options2.plugins.length).to.equal(options1.plugins.length); + expect(options2.plugins.length).toBe(options1.plugins.length); for (let i = 0; i < options2.plugins.length; i++) { if (i === 2) { - expect(options2.plugins[i]).not.to.equal(options1.plugins[i]); + expect(options2.plugins[i]).not.toBe(options1.plugins[i]); } else { - expect(options2.plugins[i]).to.equal(options1.plugins[i]); + expect(options2.plugins[i]).toBe(options1.plugins[i]); } } }); @@ -202,13 +201,13 @@ describe("@babel/core config loading", () => { ...opts, presets: opts.presets.slice(), }).options; - expect(options2.plugins.length).to.equal(options1.plugins.length); + expect(options2.plugins.length).toBe(options1.plugins.length); for (let i = 0; i < options2.plugins.length; i++) { if (i === 3) { - expect(options2.plugins[i]).not.to.equal(options1.plugins[i]); + expect(options2.plugins[i]).not.toBe(options1.plugins[i]); } else { - expect(options2.plugins[i]).to.equal(options1.plugins[i]); + expect(options2.plugins[i]).toBe(options1.plugins[i]); } } }); @@ -221,13 +220,13 @@ describe("@babel/core config loading", () => { process.env.INVALIDATE_PLUGIN6 = true; const options2 = loadConfig(opts).options; - expect(options2.plugins.length).to.equal(options1.plugins.length); + expect(options2.plugins.length).toBe(options1.plugins.length); for (let i = 0; i < options1.plugins.length; i++) { if (i === 2) { - expect(options2.plugins[i]).not.to.equal(options1.plugins[i]); + expect(options2.plugins[i]).not.toBe(options1.plugins[i]); } else { - expect(options2.plugins[i]).to.equal(options1.plugins[i]); + expect(options2.plugins[i]).toBe(options1.plugins[i]); } } }); @@ -240,13 +239,13 @@ describe("@babel/core config loading", () => { process.env.INVALIDATE_PRESET3 = true; const options2 = loadConfig(opts).options; - expect(options2.plugins.length).to.equal(options1.plugins.length); + expect(options2.plugins.length).toBe(options1.plugins.length); for (let i = 0; i < options1.plugins.length; i++) { if (i === 3) { - expect(options2.plugins[i]).not.to.equal(options1.plugins[i]); + expect(options2.plugins[i]).not.toBe(options1.plugins[i]); } else { - expect(options2.plugins[i]).to.equal(options1.plugins[i]); + expect(options2.plugins[i]).toBe(options1.plugins[i]); } } }); diff --git a/packages/babel-core/test/evaluation.js b/packages/babel-core/test/evaluation.js index 5b1ea38b80119..2462b8c64e079 100644 --- a/packages/babel-core/test/evaluation.js +++ b/packages/babel-core/test/evaluation.js @@ -1,5 +1,4 @@ import traverse from "@babel/traverse"; -import assert from "assert"; import { parse } from "babylon"; describe("evaluation", function() { @@ -9,8 +8,8 @@ describe("evaluation", function() { visitor[type] = function(path) { const evaluate = path.evaluate(); - assert.equal(evaluate.confident, !notConfident); - assert.deepEqual(evaluate.value, value); + expect(evaluate.confident).toEqual(!notConfident); + expect(evaluate.value).toEqual(value); }; traverse( diff --git a/packages/babel-core/test/fixtures/parse/output.json b/packages/babel-core/test/fixtures/parse/output.json index 7c9e1c3f4d303..42395528d1566 100644 --- a/packages/babel-core/test/fixtures/parse/output.json +++ b/packages/babel-core/test/fixtures/parse/output.json @@ -1,29 +1,29 @@ { "type": "File", "start": 0, - "end": 90, + "end": 91, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 6, - "column": 1 + "line": 7, + "column": 0 } }, "program": { "type": "Program", "start": 0, - "end": 90, + "end": 91, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 6, - "column": 1 + "line": 7, + "column": 0 } }, "sourceType": "module", diff --git a/packages/babel-core/test/fixtures/plugins/nested-if-alternate/exec.js b/packages/babel-core/test/fixtures/plugins/nested-if-alternate/exec.js index 6bc6fccc2d7ac..769189edddab9 100644 --- a/packages/babel-core/test/fixtures/plugins/nested-if-alternate/exec.js +++ b/packages/babel-core/test/fixtures/plugins/nested-if-alternate/exec.js @@ -18,4 +18,4 @@ var res = transform('', { ], }); -assert.equal(eval(res.code), 23); +expect(eval(res.code)).toBe(23); diff --git a/packages/babel-core/test/fixtures/transformation/misc/enforce-newline-modules-blacklist/input.js b/packages/babel-core/test/fixtures/transformation/misc/enforce-newline-modules-blacklist/input.mjs similarity index 100% rename from packages/babel-core/test/fixtures/transformation/misc/enforce-newline-modules-blacklist/input.js rename to packages/babel-core/test/fixtures/transformation/misc/enforce-newline-modules-blacklist/input.mjs diff --git a/packages/babel-core/test/fixtures/transformation/misc/enforce-newline-modules-blacklist/output.js b/packages/babel-core/test/fixtures/transformation/misc/enforce-newline-modules-blacklist/output.mjs similarity index 100% rename from packages/babel-core/test/fixtures/transformation/misc/enforce-newline-modules-blacklist/output.js rename to packages/babel-core/test/fixtures/transformation/misc/enforce-newline-modules-blacklist/output.mjs diff --git a/packages/babel-core/test/fixtures/transformation/misc/regression-2892/input.js b/packages/babel-core/test/fixtures/transformation/misc/regression-2892/input.mjs similarity index 100% rename from packages/babel-core/test/fixtures/transformation/misc/regression-2892/input.js rename to packages/babel-core/test/fixtures/transformation/misc/regression-2892/input.mjs diff --git a/packages/babel-core/test/fixtures/transformation/misc/regression-7064/exec.js b/packages/babel-core/test/fixtures/transformation/misc/regression-7064/exec.js index 9b94389c6b519..c43064d0594af 100644 --- a/packages/babel-core/test/fixtures/transformation/misc/regression-7064/exec.js +++ b/packages/babel-core/test/fixtures/transformation/misc/regression-7064/exec.js @@ -2,20 +2,20 @@ class Bar { test() { // pass (() => { - assert.strictEqual(this.constructor, Bar); + expect(this.constructor).toBe(Bar); })(); // pass (() => { - assert.strictEqual(this.constructor, Bar); + expect(this.constructor).toBe(Bar); }).call(this); (async () => { - assert.strictEqual(this.constructor, Bar); + expect(this.constructor).toBe(Bar); })(); (async () => { - assert.strictEqual(this.constructor, Bar); + expect(this.constructor).toBe(Bar); }).call(this); } } diff --git a/packages/babel-core/test/fixtures/transformation/regenerator/default-parameters/exec.js b/packages/babel-core/test/fixtures/transformation/regenerator/default-parameters/exec.js index 571a83fe25ddb..cbaba7dd4a740 100644 --- a/packages/babel-core/test/fixtures/transformation/regenerator/default-parameters/exec.js +++ b/packages/babel-core/test/fixtures/transformation/regenerator/default-parameters/exec.js @@ -2,5 +2,5 @@ function* foo(bar = "bar") { return bar; } -assert.deepEqual(foo().next().value, "bar"); -assert.deepEqual(foo("foo").next().value, "foo"); +expect(foo().next().value).toBe("bar"); +expect(foo("foo").next().value).toBe("foo"); diff --git a/packages/babel-core/test/fixtures/transformation/regenerator/destructuring-parameters/exec.js b/packages/babel-core/test/fixtures/transformation/regenerator/destructuring-parameters/exec.js index a434cfd15cc14..8212ec7af66f6 100644 --- a/packages/babel-core/test/fixtures/transformation/regenerator/destructuring-parameters/exec.js +++ b/packages/babel-core/test/fixtures/transformation/regenerator/destructuring-parameters/exec.js @@ -2,4 +2,4 @@ function* foo({ bar }) { return bar; } -assert(foo({ bar: "bar" }).next().value, "bar"); +expect(foo({ bar: "bar" }).next().value).toBe("bar"); diff --git a/packages/babel-core/test/fixtures/transformation/regenerator/destructuring/exec.js b/packages/babel-core/test/fixtures/transformation/regenerator/destructuring/exec.js index f07586643a692..47138063fbc92 100644 --- a/packages/babel-core/test/fixtures/transformation/regenerator/destructuring/exec.js +++ b/packages/babel-core/test/fixtures/transformation/regenerator/destructuring/exec.js @@ -3,14 +3,14 @@ function* foo() { return bar; } -assert.equal(foo().next().value, "bar"); +expect(foo().next().value).toBe("bar");; function* foo2({ bar = 0 }) { return bar; } -assert.equal(foo2({ bar: undefined }).next().value, 0); -assert.equal(foo2({ bar: 3 }).next().value, 3); +expect(foo2({ bar: undefined }).next().value).toBe(0); +expect(foo2({ bar: 3 }).next().value).toBe(3); function* foo3() { loop: @@ -44,14 +44,14 @@ function* foo3() { var gen3 = foo3(); -assert.equal(gen3.next().value, "iteration"); -assert.equal(gen3.next({what: "one", value: 3}).done, false); -assert.equal(gen3.next({what: "one", value: 2}).done, true); +expect(gen3.next().value).toBe("iteration"); +expect(gen3.next({what: "one", value: 3}).done).toBe(false); +expect(gen3.next({what: "one", value: 2}).done).toBe(true); var gen4 = foo3(); -assert.equal(gen4.next().value, "iteration"); -assert.equal(gen4.next({what: "two", value: "sometext"}).done, true); +expect(gen4.next().value).toBe("iteration"); +expect(gen4.next({what: "two", value: "sometext"}).done).toBe(true); var gen5 = foo3(); -assert.equal(gen5.next().value, "iteration"); -assert.equal(gen5.next({what: "three"}).done, true); +expect(gen5.next().value).toBe("iteration"); +expect(gen5.next({what: "three"}).done).toBe(true); diff --git a/packages/babel-core/test/fixtures/transformation/regenerator/rest-parameters/exec.js b/packages/babel-core/test/fixtures/transformation/regenerator/rest-parameters/exec.js index 22a902435d163..046f0c411f70b 100644 --- a/packages/babel-core/test/fixtures/transformation/regenerator/rest-parameters/exec.js +++ b/packages/babel-core/test/fixtures/transformation/regenerator/rest-parameters/exec.js @@ -2,4 +2,4 @@ function* foo(...items) { return items; } -assert.deepEqual(foo(1, 2, 3).next().value, [1, 2, 3]); +expect(foo(1, 2, 3).next().value).toEqual([1, 2, 3]); diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/full/source-map.json b/packages/babel-core/test/fixtures/transformation/source-maps/full/source-map.json index 93aa0c2509bfc..77952227eacfe 100644 --- a/packages/babel-core/test/fixtures/transformation/source-maps/full/source-map.json +++ b/packages/babel-core/test/fixtures/transformation/source-maps/full/source-map.json @@ -1,6 +1,5 @@ { "version": 3, - "file": "source-maps/full/output.js", "sources": ["source-maps/full/input.js"], "names": [ "arr", diff --git a/packages/babel-core/test/fixtures/transformation/source-maps/inline/output.js b/packages/babel-core/test/fixtures/transformation/source-maps/inline/output.js index d297120507820..4d7c7ba70f2b6 100644 --- a/packages/babel-core/test/fixtures/transformation/source-maps/inline/output.js +++ b/packages/babel-core/test/fixtures/transformation/source-maps/inline/output.js @@ -1,4 +1,4 @@ arr.map(function (x) { return x * x; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNvdXJjZS1tYXBzL2lubGluZS9pbnB1dC5qcyJdLCJuYW1lcyI6WyJhcnIiLCJtYXAiLCJ4Il0sIm1hcHBpbmdzIjoiQUFBQUEsSUFBSUMsR0FBSixDQUFRO0FBQUEsU0FBS0MsSUFBSUEsQ0FBVDtBQUFBLENBQVIiLCJmaWxlIjoic291cmNlLW1hcHMvaW5saW5lL291dHB1dC5qcyIsInNvdXJjZXNDb250ZW50IjpbImFyci5tYXAoeCA9PiB4ICogeCk7Il19 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNvdXJjZS1tYXBzL2lubGluZS9pbnB1dC5qcyJdLCJuYW1lcyI6WyJhcnIiLCJtYXAiLCJ4Il0sIm1hcHBpbmdzIjoiQUFBQUEsSUFBSUMsR0FBSixDQUFRO0FBQUEsU0FBS0MsSUFBSUEsQ0FBVDtBQUFBLENBQVIiLCJzb3VyY2VzQ29udGVudCI6WyJhcnIubWFwKHggPT4geCAqIHgpOyJdfQ== diff --git a/packages/babel-core/test/option-manager.js b/packages/babel-core/test/option-manager.js index dd1d5df74ba47..774b4f01ed1af 100644 --- a/packages/babel-core/test/option-manager.js +++ b/packages/babel-core/test/option-manager.js @@ -1,14 +1,13 @@ -import assert from "assert"; import { loadOptions } from "../lib"; import path from "path"; describe("option-manager", () => { it("throws for babel 5 plugin", () => { - return assert.throws(() => { + return expect(() => { loadOptions({ plugins: [({ Plugin }) => new Plugin("object-assign", {})], }); - }, /Babel 5 plugin is being run with an unsupported Babel/); + }).toThrow(/Babel 5 plugin is being run with an unsupported Babel/); }); describe("config plugin/preset flattening and overriding", () => { @@ -24,12 +23,12 @@ describe("option-manager", () => { it("should throw if a plugin is repeated", () => { const { calls, plugin } = makePlugin(); - assert.throws(() => { + expect(() => { loadOptions({ plugins: [plugin, plugin], }); - }, /Duplicate plugin\/preset detected/); - assert.deepEqual(calls, []); + }).toThrow(/Duplicate plugin\/preset detected/); + expect(calls).toEqual([]); }); it("should not throw if a repeated plugin has a different name", () => { @@ -39,8 +38,8 @@ describe("option-manager", () => { loadOptions({ plugins: [[plugin1, { arg: 1 }], [plugin2, { arg: 2 }, "some-name"]], }); - assert.deepEqual(calls1, [{ arg: 1 }]); - assert.deepEqual(calls2, [{ arg: 2 }]); + expect(calls1).toEqual([{ arg: 1 }]); + expect(calls2).toEqual([{ arg: 2 }]); }); it("should merge .env[] plugins with parent presets", () => { @@ -56,19 +55,19 @@ describe("option-manager", () => { }, }, }); - assert.deepEqual(calls1, [{ arg: 3 }]); - assert.deepEqual(calls2, [{ arg: 2 }]); + expect(calls1).toEqual([{ arg: 3 }]); + expect(calls2).toEqual([{ arg: 2 }]); }); it("should throw if a preset is repeated", () => { const { calls, plugin: preset } = makePlugin(); - assert.throws(() => { + expect(() => { loadOptions({ presets: [preset, preset], - }); - }, /Duplicate plugin\/preset detected/); - assert.deepEqual(calls, []); + }).toThrow(/Duplicate plugin\/preset detected/); + }); + expect(calls).toEqual([]); }); it("should not throw if a repeated preset has a different name", () => { @@ -78,8 +77,8 @@ describe("option-manager", () => { loadOptions({ presets: [[preset1, { arg: 1 }], [preset2, { arg: 2 }, "some-name"]], }); - assert.deepEqual(calls1, [{ arg: 1 }]); - assert.deepEqual(calls2, [{ arg: 2 }]); + expect(calls1).toEqual([{ arg: 1 }]); + expect(calls2).toEqual([{ arg: 2 }]); }); it("should merge .env[] presets with parent presets", () => { @@ -95,8 +94,8 @@ describe("option-manager", () => { }, }, }); - assert.deepEqual(calls1, [{ arg: 3 }]); - assert.deepEqual(calls2, [{ arg: 2 }]); + expect(calls1).toEqual([{ arg: 3 }]); + expect(calls2).toEqual([{ arg: 2 }]); }); it("should not merge .env[] presets with parent presets when passPerPreset", () => { @@ -113,41 +112,42 @@ describe("option-manager", () => { }, }, }); - assert.deepEqual(calls1, [{ arg: 1 }, { arg: 3 }]); - assert.deepEqual(calls2, [{ arg: 2 }]); + expect(calls1).toEqual([{ arg: 1 }, { arg: 3 }]); + expect(calls2).toEqual([{ arg: 2 }]); }); }); describe("mergeOptions", () => { it("throws for removed babel 5 options", () => { - return assert.throws(() => { + return expect(() => { loadOptions({ randomOption: true, }); - }, /Unknown option: .randomOption/); + }).toThrow(/Unknown option: .randomOption/); }); it("throws for removed babel 5 options", () => { - return assert.throws( - () => { - loadOptions({ - auxiliaryComment: true, - blacklist: true, - }); - }, + return expect(() => { + loadOptions({ + auxiliaryComment: true, + blacklist: true, + }); + }).toThrow( // eslint-disable-next-line max-len /Using removed Babel 5 option: .auxiliaryComment - Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`/, ); }); it("throws for resolved but erroring preset", () => { - return assert.throws(() => { + return expect(() => { loadOptions({ presets: [ path.join(__dirname, "fixtures/option-manager/not-a-preset"), ], }); - }, /While processing: .*option-manager(?:\/|\\\\)not-a-preset\.js/); + }).toThrow( + /While processing: .*option-manager(?:\/|\\\\)not-a-preset\.js/, + ); }); }); @@ -160,23 +160,21 @@ describe("option-manager", () => { ], }); - assert.equal(true, Array.isArray(options.plugins)); - assert.equal(1, options.plugins.length); - assert.equal(0, options.presets.length); + expect(Array.isArray(options.plugins)).toBe(true); + expect(options.plugins).toHaveLength(1); + expect(options.presets).toHaveLength(0); }); } function presetThrowsTest(name, msg) { it(name, function() { - assert.throws( - () => - loadOptions({ - presets: [ - path.join(__dirname, "fixtures/option-manager/presets", name), - ], - }), - msg, - ); + expect(() => + loadOptions({ + presets: [ + path.join(__dirname, "fixtures/option-manager/presets", name), + ], + }), + ).toThrow(msg); }); } diff --git a/packages/babel-core/test/parse.js b/packages/babel-core/test/parse.js index 5663107f043b5..f64ebe968ea7f 100644 --- a/packages/babel-core/test/parse.js +++ b/packages/babel-core/test/parse.js @@ -1,4 +1,3 @@ -import assert from "assert"; import fs from "fs"; import path from "path"; import { parse } from "../lib"; @@ -10,16 +9,20 @@ function fixture(...args) { describe("parse", function() { it("should parse using configuration from .babelrc when a filename is provided", function() { const input = fs.readFileSync(fixture("input.js"), "utf8"); - const output = fs.readFileSync(fixture("output.json"), "utf8"); - assert( - parse(input, { filename: fixture("input.js"), cwd: fixture() }), - output, - ); + const output = require(fixture("output")); + + const result = parse(input, { + filename: fixture("input.js"), + cwd: fixture(), + }); + expect(JSON.parse(JSON.stringify(result))).toEqual(output); }); it("should parse using passed in configuration", function() { const input = fs.readFileSync(fixture("input.js"), "utf8"); - const output = fs.readFileSync(fixture("output.json"), "utf8"); - assert(parse(input, { parserOpts: { plugins: ["decorators"] } }), output); + const output = require(fixture("output.json")); + + const result = parse(input, { parserOpts: { plugins: ["decorators"] } }); + expect(JSON.parse(JSON.stringify(result))).toEqual(output); }); }); diff --git a/packages/babel-core/test/path.js b/packages/babel-core/test/path.js index 7e68d893a0513..eba8db9c1e8f1 100644 --- a/packages/babel-core/test/path.js +++ b/packages/babel-core/test/path.js @@ -1,6 +1,5 @@ import { transform } from "../lib/index"; import Plugin from "../lib/config/plugin"; -import chai from "chai"; describe("traversal path", function() { it("replaceWithSourceString", function() { @@ -18,7 +17,7 @@ describe("traversal path", function() { ], }).code; - chai.expect(actualCode).to.be.equal("console.whatever();"); + expect(actualCode).toBe("console.whatever();"); }); it("replaceWith (arrow expression body to block statement body)", function() { @@ -47,7 +46,7 @@ describe("traversal path", function() { ], }).code; - chai.expect(actualCode).to.be.equal("var fn = () => {\n return true;\n};"); + expect(actualCode).toBe("var fn = () => {\n return true;\n};"); }); it("replaceWith (arrow block statement body to expression body)", function() { @@ -68,7 +67,7 @@ describe("traversal path", function() { ], }).code; - chai.expect(actualCode).to.be.equal("var fn = () => true;"); + expect(actualCode).toBe("var fn = () => true;"); }); it("replaceWith (for-in left expression to variable declaration)", function() { @@ -98,7 +97,7 @@ describe("traversal path", function() { ], }).code; - chai.expect(actualCode).to.be.equal("for (var KEY in right);"); + expect(actualCode).toBe("for (var KEY in right);"); }); it("replaceWith (for-in left variable declaration to expression)", function() { @@ -119,7 +118,7 @@ describe("traversal path", function() { ], }).code; - chai.expect(actualCode).to.be.equal("for (KEY in right);"); + expect(actualCode).toBe("for (KEY in right);"); }); it("replaceWith (for-loop left expression to variable declaration)", function() { @@ -149,7 +148,7 @@ describe("traversal path", function() { ], }).code; - chai.expect(actualCode).to.be.equal("for (var KEY;;);"); + expect(actualCode).toBe("for (var KEY;;);"); }); it("replaceWith (for-loop left variable declaration to expression)", function() { @@ -170,6 +169,6 @@ describe("traversal path", function() { ], }).code; - chai.expect(actualCode).to.be.equal("for (KEY;;);"); + expect(actualCode).toBe("for (KEY;;);"); }); }); diff --git a/packages/babel-core/test/resolution.js b/packages/babel-core/test/resolution.js index cf95e0fc433aa..7829af16cdb5b 100644 --- a/packages/babel-core/test/resolution.js +++ b/packages/babel-core/test/resolution.js @@ -1,17 +1,17 @@ -import assert from "assert"; import * as babel from "../lib/index"; import path from "path"; describe("addon resolution", function() { const base = path.join(__dirname, "fixtures", "resolution"); + let cwd; beforeEach(function() { - this.cwd = process.cwd(); + cwd = process.cwd(); process.chdir(base); }); afterEach(function() { - process.chdir(this.cwd); + process.chdir(cwd); }); it("should find module: presets", function() { @@ -237,102 +237,114 @@ describe("addon resolution", function() { it("should throw about module: usage for presets", function() { process.chdir("throw-module-paths"); - assert.throws(() => { + expect(() => { babel.transform("", { filename: "filename.js", babelrc: false, presets: ["foo"], }); // eslint-disable-next-line max-len - }, /Cannot find module 'babel-preset-foo'.*\n- If you want to resolve "foo", use "module:foo"/); + }).toThrow( + /Cannot find module 'babel-preset-foo'.*\n- If you want to resolve "foo", use "module:foo"/, + ); }); it("should throw about module: usage for plugins", function() { process.chdir("throw-module-paths"); - assert.throws(() => { + expect(() => { babel.transform("", { filename: "filename.js", babelrc: false, plugins: ["foo"], }); // eslint-disable-next-line max-len - }, /Cannot find module 'babel-plugin-foo'.*\n- If you want to resolve "foo", use "module:foo"/); + }).toThrow( + /Cannot find module 'babel-plugin-foo'.*\n- If you want to resolve "foo", use "module:foo"/, + ); }); it("should throw about @babel usage for presets", function() { process.chdir("throw-babel-paths"); - assert.throws(() => { + expect(() => { babel.transform("", { filename: "filename.js", babelrc: false, presets: ["foo"], }); // eslint-disable-next-line max-len - }, /Cannot find module 'babel-preset-foo'.*\n- Did you mean "@babel\/foo"\?/); + }).toThrow( + /Cannot find module 'babel-preset-foo'.*\n- Did you mean "@babel\/foo"\?/, + ); }); it("should throw about @babel usage for plugins", function() { process.chdir("throw-babel-paths"); - assert.throws(() => { + expect(() => { babel.transform("", { filename: "filename.js", babelrc: false, plugins: ["foo"], }); // eslint-disable-next-line max-len - }, /Cannot find module 'babel-plugin-foo'.*\n- Did you mean "@babel\/foo"\?/); + }).toThrow( + /Cannot find module 'babel-plugin-foo'.*\n- Did you mean "@babel\/foo"\?/, + ); }); it("should throw about passing a preset as a plugin", function() { process.chdir("throw-opposite-paths"); - assert.throws(() => { + expect(() => { babel.transform("", { filename: "filename.js", babelrc: false, presets: ["testplugin"], }); // eslint-disable-next-line max-len - }, /Cannot find module 'babel-preset-testplugin'.*\n- Did you accidentally pass a preset as a plugin\?/); + }).toThrow( + /Cannot find module 'babel-preset-testplugin'.*\n- Did you accidentally pass a preset as a plugin\?/, + ); }); it("should throw about passing a plugin as a preset", function() { process.chdir("throw-opposite-paths"); - assert.throws(() => { + expect(() => { babel.transform("", { filename: "filename.js", babelrc: false, plugins: ["testpreset"], }); // eslint-disable-next-line max-len - }, /Cannot find module 'babel-plugin-testpreset'.*\n- Did you accidentally pass a plugin as a preset\?/); + }).toThrow( + /Cannot find module 'babel-plugin-testpreset'.*\n- Did you accidentally pass a plugin as a preset\?/, + ); }); it("should throw about missing presets", function() { process.chdir("throw-missing-paths"); - assert.throws(() => { + expect(() => { babel.transform("", { filename: "filename.js", babelrc: false, presets: ["foo"], }); - }, /Cannot find module 'babel-preset-foo'/); + }).toThrow(/Cannot find module 'babel-preset-foo'/); }); it("should throw about missing plugins", function() { process.chdir("throw-missing-paths"); - assert.throws(() => { + expect(() => { babel.transform("", { filename: "filename.js", babelrc: false, plugins: ["foo"], }); - }, /Cannot find module 'babel-plugin-foo'/); + }).toThrow(/Cannot find module 'babel-plugin-foo'/); }); }); diff --git a/packages/babel-generator/README.md b/packages/babel-generator/README.md index 6d461291c1143..44725b6047a2c 100644 --- a/packages/babel-generator/README.md +++ b/packages/babel-generator/README.md @@ -1,6 +1,6 @@ # @babel/generator -> Turns an AST into code. +> Turns a [Babylon AST](https://github.com/babel/babel/blob/master/packages/babylon/ast/spec.md) into code. ## Install @@ -43,7 +43,6 @@ Options for source maps: name | type | default | description -----------------------|----------|-----------------|-------------------------------------------------------------------------- sourceMaps | boolean | `false` | Enable generating source maps -sourceMapTarget | string | | The filename of the generated code that the source map will be associated with sourceRoot | string | | A root for all relative URLs in the source map sourceFileName | string | | The filename for the source code (i.e. the code in the `code` argument). This will only be used if `code` is a string. diff --git a/packages/babel-generator/package.json b/packages/babel-generator/package.json index 9258dabe810f5..3ba7b6f566d86 100644 --- a/packages/babel-generator/package.json +++ b/packages/babel-generator/package.json @@ -1,6 +1,6 @@ { "name": "@babel/generator", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Turns an AST into code.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -11,14 +11,14 @@ "lib" ], "dependencies": { - "@babel/types": "7.0.0-beta.39", + "@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" }, "devDependencies": { - "@babel/helper-fixtures": "7.0.0-beta.39", - "babylon": "7.0.0-beta.39" + "@babel/helper-fixtures": "7.0.0-beta.42", + "babylon": "7.0.0-beta.42" } } diff --git a/packages/babel-generator/src/generators/classes.js b/packages/babel-generator/src/generators/classes.js index fa83be944c5c6..1649cdee39dc6 100644 --- a/packages/babel-generator/src/generators/classes.js +++ b/packages/babel-generator/src/generators/classes.js @@ -99,10 +99,13 @@ export function ClassProperty(node: Object) { this.print(node.key, node); } + // TS if (node.optional) { - // TS this.token("?"); } + if (node.definite) { + this.token("!"); + } this.print(node.typeAnnotation, node); if (node.value) { diff --git a/packages/babel-generator/src/generators/statements.js b/packages/babel-generator/src/generators/statements.js index c3644a4c9303b..e410092a9ed10 100644 --- a/packages/babel-generator/src/generators/statements.js +++ b/packages/babel-generator/src/generators/statements.js @@ -290,6 +290,7 @@ export function VariableDeclaration(node: Object, parent: Object) { export function VariableDeclarator(node: Object) { this.print(node.id, node); + if (node.definite) this.token("!"); // TS this.print(node.id.typeAnnotation, node); if (node.init) { this.space(); diff --git a/packages/babel-generator/src/generators/typescript.js b/packages/babel-generator/src/generators/typescript.js index d628617171afb..1dca58c2adfd2 100644 --- a/packages/babel-generator/src/generators/typescript.js +++ b/packages/babel-generator/src/generators/typescript.js @@ -256,6 +256,28 @@ export function tsPrintUnionOrIntersectionType(node, sep) { }); } +export function TSConditionalType(node) { + this.print(node.checkType); + this.space(); + this.word("extends"); + this.space(); + this.print(node.extendsType); + this.space(); + this.token("?"); + this.space(); + this.print(node.trueType); + this.space(); + this.token(":"); + this.space(); + this.print(node.falseType); +} + +export function TSInferType(node) { + this.token("infer"); + this.space(); + this.print(node.typeParameter); +} + export function TSParenthesizedType(node) { this.token("("); this.print(node.typeAnnotation, node); diff --git a/packages/babel-generator/src/node/whitespace.js b/packages/babel-generator/src/node/whitespace.js index 63770fa36f001..ecc467b6cf859 100644 --- a/packages/babel-generator/src/node/whitespace.js +++ b/packages/babel-generator/src/node/whitespace.js @@ -1,4 +1,3 @@ -import map from "lodash/map"; import * as t from "@babel/types"; type WhitespaceObject = { @@ -220,7 +219,7 @@ export const list = { */ VariableDeclaration(node: Object): Array { - return map(node.declarations, "init"); + return node.declarations.map(decl => decl.init); }, /** diff --git a/packages/babel-generator/src/source-map.js b/packages/babel-generator/src/source-map.js index c2a41642826be..cbdbe8af89275 100644 --- a/packages/babel-generator/src/source-map.js +++ b/packages/babel-generator/src/source-map.js @@ -19,7 +19,6 @@ export default class SourceMap { get() { if (!this._cachedMap) { const map = (this._cachedMap = new sourceMap.SourceMapGenerator({ - file: this._opts.sourceMapTarget, sourceRoot: this._opts.sourceRoot, })); diff --git a/packages/babel-generator/test/fixtures/flow/variance/actual.js b/packages/babel-generator/test/fixtures/flow/variance/input.js similarity index 100% rename from packages/babel-generator/test/fixtures/flow/variance/actual.js rename to packages/babel-generator/test/fixtures/flow/variance/input.js diff --git a/packages/babel-generator/test/fixtures/flow/variance/expected.js b/packages/babel-generator/test/fixtures/flow/variance/output.js similarity index 100% rename from packages/babel-generator/test/fixtures/flow/variance/expected.js rename to packages/babel-generator/test/fixtures/flow/variance/output.js diff --git a/packages/babel-generator/test/fixtures/typescript/class-properties/input.js b/packages/babel-generator/test/fixtures/typescript/class-properties/input.js index 8c0ad68965879..51413533ae042 100644 --- a/packages/babel-generator/test/fixtures/typescript/class-properties/input.js +++ b/packages/babel-generator/test/fixtures/typescript/class-properties/input.js @@ -3,4 +3,6 @@ class C { x?; x: number; x: number = 1; + x!; + x!: number; } diff --git a/packages/babel-generator/test/fixtures/typescript/class-properties/output.js b/packages/babel-generator/test/fixtures/typescript/class-properties/output.js index 6ae9081d49760..7318dc2f1d1de 100644 --- a/packages/babel-generator/test/fixtures/typescript/class-properties/output.js +++ b/packages/babel-generator/test/fixtures/typescript/class-properties/output.js @@ -3,4 +3,6 @@ class C { x?; x: number; x: number = 1; + x!; + x!: number; } \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/typescript/types-conditional-infer/input.js b/packages/babel-generator/test/fixtures/typescript/types-conditional-infer/input.js new file mode 100644 index 0000000000000..fc9bc48546e6a --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/types-conditional-infer/input.js @@ -0,0 +1 @@ +type Element = T extends (infer U)[] ? U : T; diff --git a/packages/babel-generator/test/fixtures/typescript/types-conditional-infer/output.js b/packages/babel-generator/test/fixtures/typescript/types-conditional-infer/output.js new file mode 100644 index 0000000000000..aab1028e50368 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/types-conditional-infer/output.js @@ -0,0 +1 @@ +type Element = T extends (infer U)[] ? U : T; \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/typescript/types-conditional/input.js b/packages/babel-generator/test/fixtures/typescript/types-conditional/input.js new file mode 100644 index 0000000000000..c776486898189 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/types-conditional/input.js @@ -0,0 +1 @@ +let x: number extends string ? boolean : null; diff --git a/packages/babel-generator/test/fixtures/typescript/types-conditional/output.js b/packages/babel-generator/test/fixtures/typescript/types-conditional/output.js new file mode 100644 index 0000000000000..79c94be2c94e0 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/types-conditional/output.js @@ -0,0 +1 @@ +let x: number extends string ? boolean : null; \ No newline at end of file diff --git a/packages/babel-generator/test/fixtures/typescript/variable-declarator-exclamation/input.js b/packages/babel-generator/test/fixtures/typescript/variable-declarator-exclamation/input.js new file mode 100644 index 0000000000000..f27135a2b9f0d --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/variable-declarator-exclamation/input.js @@ -0,0 +1 @@ +let x!: number; diff --git a/packages/babel-generator/test/fixtures/typescript/variable-declarator-exclamation/output.js b/packages/babel-generator/test/fixtures/typescript/variable-declarator-exclamation/output.js new file mode 100644 index 0000000000000..73cac9cc10de8 --- /dev/null +++ b/packages/babel-generator/test/fixtures/typescript/variable-declarator-exclamation/output.js @@ -0,0 +1 @@ +let x!: number; \ No newline at end of file diff --git a/packages/babel-generator/test/index.js b/packages/babel-generator/test/index.js index 99b5955222b71..ffb88113583cb 100644 --- a/packages/babel-generator/test/index.js +++ b/packages/babel-generator/test/index.js @@ -328,6 +328,23 @@ describe("programmatic generation", function() { ); }); + it("flow object exact", function() { + const objectStatement = t.objectTypeAnnotation( + [t.objectTypeProperty(t.identifier("bar"), t.stringTypeAnnotation())], + null, + null, + true, + ); + + const output = generate(objectStatement).code; + assert.equal( + output, + `{| + bar: string +|}`, + ); + }); + it("flow object indentation with empty leading ObjectTypeProperty", function() { const objectStatement = t.objectTypeAnnotation( [], diff --git a/packages/babel-helper-annotate-as-pure/package.json b/packages/babel-helper-annotate-as-pure/package.json index 6bb214050cad7..21f7ca5c74aad 100644 --- a/packages/babel-helper-annotate-as-pure/package.json +++ b/packages/babel-helper-annotate-as-pure/package.json @@ -1,11 +1,11 @@ { "name": "@babel/helper-annotate-as-pure", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "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", "main": "lib/index.js", "dependencies": { - "@babel/types": "7.0.0-beta.39" + "@babel/types": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-bindify-decorators/package.json b/packages/babel-helper-bindify-decorators/package.json index d143a9276b73b..71cb9b3e41467 100644 --- a/packages/babel-helper-bindify-decorators/package.json +++ b/packages/babel-helper-bindify-decorators/package.json @@ -1,12 +1,12 @@ { "name": "@babel/helper-bindify-decorators", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Helper function to bindify decorators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-bindify-decorators", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/traverse": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39" + "@babel/traverse": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42" } } 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 f53038d2f2af7..873612218e36d 100644 --- a/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json +++ b/packages/babel-helper-builder-binary-assignment-operator-visitor/package.json @@ -1,12 +1,12 @@ { "name": "@babel/helper-builder-binary-assignment-operator-visitor", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "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", "main": "lib/index.js", "dependencies": { - "@babel/helper-explode-assignable-expression": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39" + "@babel/helper-explode-assignable-expression": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-builder-react-jsx/package.json b/packages/babel-helper-builder-react-jsx/package.json index 0e8e5ce139aa5..fb31510c6e35e 100644 --- a/packages/babel-helper-builder-react-jsx/package.json +++ b/packages/babel-helper-builder-react-jsx/package.json @@ -1,12 +1,12 @@ { "name": "@babel/helper-builder-react-jsx", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Helper function to build react jsx", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-builder-react-jsx", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/types": "7.0.0-beta.39", + "@babel/types": "7.0.0-beta.42", "esutils": "^2.0.0" } } diff --git a/packages/babel-helper-call-delegate/package.json b/packages/babel-helper-call-delegate/package.json index 255e5d7ebffaf..8c4e50b866c04 100644 --- a/packages/babel-helper-call-delegate/package.json +++ b/packages/babel-helper-call-delegate/package.json @@ -1,13 +1,13 @@ { "name": "@babel/helper-call-delegate", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Helper function to call delegate", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-call-delegate", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/helper-hoist-variables": "7.0.0-beta.39", - "@babel/traverse": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39" + "@babel/helper-hoist-variables": "7.0.0-beta.42", + "@babel/traverse": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-define-map/package.json b/packages/babel-helper-define-map/package.json index d936e06961fe3..a7b0fbb7baa3c 100644 --- a/packages/babel-helper-define-map/package.json +++ b/packages/babel-helper-define-map/package.json @@ -1,13 +1,13 @@ { "name": "@babel/helper-define-map", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Helper function to define a map", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-define-map", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/helper-function-name": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39", + "@babel/helper-function-name": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42", "lodash": "^4.2.0" } } diff --git a/packages/babel-helper-explode-assignable-expression/package.json b/packages/babel-helper-explode-assignable-expression/package.json index 3f059837dca2a..167b452a66780 100644 --- a/packages/babel-helper-explode-assignable-expression/package.json +++ b/packages/babel-helper-explode-assignable-expression/package.json @@ -1,12 +1,12 @@ { "name": "@babel/helper-explode-assignable-expression", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Helper function to explode an assignable expression", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-assignable-expression", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/traverse": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39" + "@babel/traverse": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-explode-class/package.json b/packages/babel-helper-explode-class/package.json index 4bc47dcafaf03..69eefb4a722e8 100644 --- a/packages/babel-helper-explode-class/package.json +++ b/packages/babel-helper-explode-class/package.json @@ -1,13 +1,13 @@ { "name": "@babel/helper-explode-class", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Helper function to explode class", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-explode-class", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/helper-bindify-decorators": "7.0.0-beta.39", - "@babel/traverse": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39" + "@babel/helper-bindify-decorators": "7.0.0-beta.42", + "@babel/traverse": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-fixtures/package.json b/packages/babel-helper-fixtures/package.json index e56efdeac32b1..2247812667b0c 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Helper function to support fixtures", "author": "Sebastian McKenzie ", "license": "MIT", diff --git a/packages/babel-helper-fixtures/src/index.js b/packages/babel-helper-fixtures/src/index.js index da22a14ec695b..dcf01d8b6118b 100644 --- a/packages/babel-helper-fixtures/src/index.js +++ b/packages/babel-helper-fixtures/src/index.js @@ -124,6 +124,7 @@ export default function get(entryLoc): Array { if (ext !== ".js" && ext !== ".mjs") return; execLoc = taskDir; + execLocAlias = suiteName + "/" + taskName; } if (resolve.relative(expectLoc + "on")) { diff --git a/packages/babel-helper-function-name/package.json b/packages/babel-helper-function-name/package.json index 4685e974dc834..98a6e34997e28 100644 --- a/packages/babel-helper-function-name/package.json +++ b/packages/babel-helper-function-name/package.json @@ -1,13 +1,13 @@ { "name": "@babel/helper-function-name", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "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", "main": "lib/index.js", "dependencies": { - "@babel/helper-get-function-arity": "7.0.0-beta.39", - "@babel/template": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39" + "@babel/helper-get-function-arity": "7.0.0-beta.42", + "@babel/template": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-get-function-arity/package.json b/packages/babel-helper-get-function-arity/package.json index ed9d8db85a592..e33b125d89e33 100644 --- a/packages/babel-helper-get-function-arity/package.json +++ b/packages/babel-helper-get-function-arity/package.json @@ -1,11 +1,11 @@ { "name": "@babel/helper-get-function-arity", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Helper function to get function arity", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-get-function-arity", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/types": "7.0.0-beta.39" + "@babel/types": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-hoist-variables/package.json b/packages/babel-helper-hoist-variables/package.json index 9c6214b086015..8fdf06f5f4ae1 100644 --- a/packages/babel-helper-hoist-variables/package.json +++ b/packages/babel-helper-hoist-variables/package.json @@ -1,11 +1,11 @@ { "name": "@babel/helper-hoist-variables", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Helper function to hoist variables", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-hoist-variables", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/types": "7.0.0-beta.39" + "@babel/types": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-module-imports/package.json b/packages/babel-helper-module-imports/package.json index 53a311f8ace41..1c6613ea8e1b1 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-beta.39", + "version": "7.0.0-beta.42", "description": "Babel helper functions for inserting module loads", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", @@ -8,10 +8,10 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-module-imports", "main": "lib/index.js", "dependencies": { - "@babel/types": "7.0.0-beta.39", + "@babel/types": "7.0.0-beta.42", "lodash": "^4.2.0" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-module-imports/src/import-injector.js b/packages/babel-helper-module-imports/src/import-injector.js index 33b46a12cb932..bd1214c54b0f2 100644 --- a/packages/babel-helper-module-imports/src/import-injector.js +++ b/packages/babel-helper-module-imports/src/import-injector.js @@ -209,7 +209,7 @@ export default class ImportInjector { // to a variable. let name = nameHint || importName; - const isMod = isModule(this._programPath, true); + const isMod = isModule(this._programPath); const isModuleForNode = isMod && importingInterop === "node"; const isModuleForBabel = isMod && importingInterop === "babel"; diff --git a/packages/babel-helper-module-imports/src/is-module.js b/packages/babel-helper-module-imports/src/is-module.js index 8e20fb2472d44..39cff11148d88 100644 --- a/packages/babel-helper-module-imports/src/is-module.js +++ b/packages/babel-helper-module-imports/src/is-module.js @@ -1,11 +1,7 @@ /** - * A small utility to check if a file qualifies as a module, based on a few - * possible conditions. + * A small utility to check if a file qualifies as a module. */ -export default function isModule( - path: NodePath, - requireUnambiguous: boolean = false, -) { +export default function isModule(path: NodePath) { const { sourceType } = path.node; if (sourceType !== "module" && sourceType !== "script") { throw path.buildCodeFrameError( @@ -13,19 +9,5 @@ export default function isModule( ); } - const filename = path.hub.file.opts.filename; - if (/\.mjs$/.test(filename)) { - requireUnambiguous = false; - } - - return ( - path.node.sourceType === "module" && - (!requireUnambiguous || isUnambiguousModule(path)) - ); -} - -// This approach is not ideal. It is here to preserve compatibility for now, -// but really this should just return true or be deleted. -function isUnambiguousModule(path) { - return path.get("body").some(p => p.isModuleDeclaration()); + return path.node.sourceType === "module"; } diff --git a/packages/babel-helper-module-transforms/package.json b/packages/babel-helper-module-transforms/package.json index 5386d614c12ad..0c5f8fcc9edca 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Babel helper functions for implementing ES6 module transformations", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", @@ -8,10 +8,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-beta.39", - "@babel/helper-simple-access": "7.0.0-beta.39", - "@babel/template": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39", + "@babel/helper-module-imports": "7.0.0-beta.42", + "@babel/helper-simple-access": "7.0.0-beta.42", + "@babel/helper-split-export-declaration": "7.0.0-beta.42", + "@babel/template": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42", "lodash": "^4.2.0" } } diff --git a/packages/babel-helper-module-transforms/src/index.js b/packages/babel-helper-module-transforms/src/index.js index ce07b94e4abea..859b63989fe3b 100644 --- a/packages/babel-helper-module-transforms/src/index.js +++ b/packages/babel-helper-module-transforms/src/index.js @@ -22,7 +22,16 @@ export { hasExports, isSideEffectImport, isModule }; */ export function rewriteModuleStatementsAndPrepareHeader( path: NodePath, - { exportName, strict, allowTopLevelThis, strictMode, loose, noInterop, lazy }, + { + exportName, + strict, + allowTopLevelThis, + strictMode, + loose, + noInterop, + lazy, + esNamespaceOnly, + }, ) { assert(isModule(path), "Cannot process module statements in a script"); path.node.sourceType = "script"; @@ -31,6 +40,7 @@ export function rewriteModuleStatementsAndPrepareHeader( noInterop, loose, lazy, + esNamespaceOnly, }); if (!allowTopLevelThis) { diff --git a/packages/babel-helper-module-transforms/src/normalize-and-load-metadata.js b/packages/babel-helper-module-transforms/src/normalize-and-load-metadata.js index c937ab5e61f91..8ffda284447e3 100644 --- a/packages/babel-helper-module-transforms/src/normalize-and-load-metadata.js +++ b/packages/babel-helper-module-transforms/src/normalize-and-load-metadata.js @@ -1,6 +1,6 @@ import { basename, extname } from "path"; -import * as t from "@babel/types"; +import splitExportDeclaration from "@babel/helper-split-export-declaration"; export type ModuleMetadata = { exportName: string, @@ -86,7 +86,12 @@ export function isSideEffectImport(source: SourceModuleMetadata) { export default function normalizeModuleAndLoadMetadata( programPath: NodePath, exportName?: string, - { noInterop = false, loose = false, lazy = false } = {}, + { + noInterop = false, + loose = false, + lazy = false, + esNamespaceOnly = false, + } = {}, ): ModuleMetadata { if (!exportName) { exportName = programPath.scope.generateUidIdentifier("exports").name; @@ -107,6 +112,16 @@ export default function normalizeModuleAndLoadMetadata( } if (noInterop) metadata.interop = "none"; + else if (esNamespaceOnly) { + // Both the default and namespace interops pass through __esModule + // objects, but the namespace interop is used to enable Babel's + // destructuring-like interop behavior for normal CommonJS. + // Since some tooling has started to remove that behavior, we expose + // it as the `esNamespace` option. + if (metadata.interop === "namespace") { + metadata.interop = "default"; + } + } } return { @@ -399,35 +414,7 @@ function nameAnonymousExports(programPath: NodePath) { // Name anonymous exported locals. programPath.get("body").forEach(child => { if (!child.isExportDefaultDeclaration()) return; - - // export default foo; - const declaration = child.get("declaration"); - if (declaration.isFunctionDeclaration()) { - if (!declaration.node.id) { - declaration.node.id = declaration.scope.generateUidIdentifier( - "default", - ); - } - } else if (declaration.isClassDeclaration()) { - if (!declaration.node.id) { - declaration.node.id = declaration.scope.generateUidIdentifier( - "default", - ); - } - } else { - const id = declaration.scope.generateUidIdentifier("default"); - const namedDecl = t.exportNamedDeclaration(null, [ - t.exportSpecifier(t.identifier(id.name), t.identifier("default")), - ]); - namedDecl._blockHoist = child.node._blockHoist; - - const varDecl = t.variableDeclaration("var", [ - t.variableDeclarator(id, declaration.node), - ]); - varDecl._blockHoist = child.node._blockHoist; - - child.replaceWithMultiple([namedDecl, varDecl]); - } + splitExportDeclaration(child); }); } 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 484633d75aee7..e73bb05dad1c6 100644 --- a/packages/babel-helper-module-transforms/src/rewrite-live-references.js +++ b/packages/babel-helper-module-transforms/src/rewrite-live-references.js @@ -112,6 +112,7 @@ const rewriteBindingInitVisitor = { Object.keys(path.getOuterBindingIdentifiers()).forEach(localName => { const exportNames = exported.get(localName) || []; + if (exportNames.length > 0) { const statement = t.expressionStatement( buildBindingExportAssignmentExpression( @@ -180,7 +181,13 @@ const rewriteReferencesVisitor = { if (importData) { const ref = buildImportReference(importData, path.node); - if (path.parentPath.isCallExpression({ callee: path.node })) { + // Preserve the binding location so that sourcemaps are nicer. + ref.loc = path.node.loc; + + if ( + path.parentPath.isCallExpression({ callee: path.node }) && + t.isMemberExpression(ref) + ) { path.replaceWith(t.sequenceExpression([t.numericLiteral(0), ref])); } else if (path.isJSXIdentifier() && t.isMemberExpression(ref)) { const { object, property } = ref; @@ -195,6 +202,10 @@ const rewriteReferencesVisitor = { } requeueInParent(path); + + // The path could have been replaced with an identifier that would + // otherwise be re-visited, so we skip processing its children. + path.skip(); } }, diff --git a/packages/babel-helper-optimise-call-expression/package.json b/packages/babel-helper-optimise-call-expression/package.json index 04a326324cab7..ba193c58a4d63 100644 --- a/packages/babel-helper-optimise-call-expression/package.json +++ b/packages/babel-helper-optimise-call-expression/package.json @@ -1,11 +1,11 @@ { "name": "@babel/helper-optimise-call-expression", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Helper function to optimise call expression", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-optimise-call-expression", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/types": "7.0.0-beta.39" + "@babel/types": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-plugin-test-runner/package.json b/packages/babel-helper-plugin-test-runner/package.json index 44a03fd3ccfa0..f4149ee340cb5 100644 --- a/packages/babel-helper-plugin-test-runner/package.json +++ b/packages/babel-helper-plugin-test-runner/package.json @@ -1,11 +1,11 @@ { "name": "@babel/helper-plugin-test-runner", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Helper function to support test runner", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-test-runner", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/helper-transform-fixture-test-runner": "7.0.0-beta.39" + "@babel/helper-transform-fixture-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-plugin-utils/package.json b/packages/babel-helper-plugin-utils/package.json new file mode 100644 index 0000000000000..f23d4bccf37fe --- /dev/null +++ b/packages/babel-helper-plugin-utils/package.json @@ -0,0 +1,10 @@ +{ + "name": "@babel/helper-plugin-utils", + "version": "7.0.0-beta.42", + "description": "General utilities for plugins to use", + "author": "Logan Smyth ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-plugin-utils", + "main": "lib/index.js" +} diff --git a/packages/babel-helper-plugin-utils/src/README.md b/packages/babel-helper-plugin-utils/src/README.md new file mode 100644 index 0000000000000..4079c2d4e6cf0 --- /dev/null +++ b/packages/babel-helper-plugin-utils/src/README.md @@ -0,0 +1,41 @@ +# @babel/helper-plugin-utils + +The intention of this module is to provide a place for us to expose a +standardized API layer over top of what Babel's core API provides on its own. + +This is not aiming to implement APIs that are missing on a given Babel version, +but it is means to provide clear error messages if a plugin is run on a version +of Babel that doesn't have the APIs that the plugin is trying to use. + +Every one of Babel's core plugins and presets will use this module, and ideally +because of that its size should be kept to a miminum because this may or may +not be deduplicated when installed. + + +## Usage + +```js +import { declare } from "@babel/helper-plugin-utils"; + +export default declare((api, options, dirname) => { + return {}; +}); +``` + + +## What this does + +Currently, this plugin provides a few services to ensure that plugins function +well-enough to throw useful errors. + +### `options` is always passed + +Babel 6 does not pass a second parameter. This frequently means that plugins +written for Babel 7 that use `options` will attempt to destructure options +out of an `undefined` value. By supplying the default, we avoid that risk. + +### `api.assertVersion` always exists + +Babel 6 and early betas of Babel 7 do not have `assertVersion`, so this +wrapper ensures that it exists and throws a useful error message when not +supplied by Babel itself. diff --git a/packages/babel-helper-plugin-utils/src/index.js b/packages/babel-helper-plugin-utils/src/index.js new file mode 100644 index 0000000000000..e8534608d821b --- /dev/null +++ b/packages/babel-helper-plugin-utils/src/index.js @@ -0,0 +1,92 @@ +export function declare(builder) { + return (api, options, dirname) => { + if (!api.assertVersion) { + // Inject a custom version of 'assertVersion' for Babel 6 and early + // versions of Babel 7's beta that didn't have it. + api = Object.assign(copyApiObject(api), { + assertVersion(range) { + throwVersionError(range, api.version); + }, + }); + } + + return builder(api, options || {}, dirname); + }; +} + +function copyApiObject(api) { + // Babel >= 7 <= beta.41 passed the API as a new object that had + // babel/core as the prototype. While slightly faster, it also + // means that the Object.assign copy below fails. Rather than + // keep complexity, the Babel 6 behavior has been reverted and this + // normalizes all that for Babel 7. + let proto = null; + if (typeof api.version === "string" && /^7\./.test(api.version)) { + proto = Object.getPrototypeOf(api); + if ( + proto && + (!has(proto, "version") || + !has(proto, "transform") || + !has(proto, "template") || + !has(proto, "types")) + ) { + proto = null; + } + } + + return Object.assign({}, proto, api); +} + +function has(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); +} + +function throwVersionError(range, version) { + if (typeof range === "number") { + if (!Number.isInteger(range)) { + throw new Error("Expected string or integer value."); + } + range = `^${range}.0.0-0`; + } + if (typeof range !== "string") { + throw new Error("Expected string or integer value."); + } + + const limit = Error.stackTraceLimit; + + if (typeof limit === "number" && limit < 25) { + // Bump up the limit if needed so that users are more likely + // to be able to see what is calling Babel. + Error.stackTraceLimit = 25; + } + + let err; + if (version.slice(0, 2) === "7.") { + err = new Error( + `Requires Babel "^7.0.0-beta.41", but was loaded with "${version}". ` + + `You'll need to update your @babel/core version.`, + ); + } else { + err = new Error( + `Requires Babel "${range}", but was loaded with "${version}". ` + + `If you are sure you have a compatible version of @babel/core, ` + + `it is likely that something in your build process is loading the ` + + `wrong version. Inspect the stack trace of this error to look for ` + + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + + `to see what is calling Babel.`, + ); + } + + if (typeof limit === "number") { + Error.stackTraceLimit = limit; + } + + throw Object.assign( + err, + ({ + code: "BABEL_VERSION_UNSUPPORTED", + version, + range, + }: any), + ); +} diff --git a/packages/babel-helper-regex/package.json b/packages/babel-helper-regex/package.json index 182b097f64a69..0dbde8c7665ce 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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 36279493b6133..1920da530ccf9 100644 --- a/packages/babel-helper-remap-async-to-generator/package.json +++ b/packages/babel-helper-remap-async-to-generator/package.json @@ -1,15 +1,15 @@ { "name": "@babel/helper-remap-async-to-generator", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "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", "main": "lib/index.js", "dependencies": { - "@babel/helper-annotate-as-pure": "7.0.0-beta.39", - "@babel/helper-wrap-function": "7.0.0-beta.39", - "@babel/template": "7.0.0-beta.39", - "@babel/traverse": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39" + "@babel/helper-annotate-as-pure": "7.0.0-beta.42", + "@babel/helper-wrap-function": "7.0.0-beta.42", + "@babel/template": "7.0.0-beta.42", + "@babel/traverse": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-remap-async-to-generator/src/index.js b/packages/babel-helper-remap-async-to-generator/src/index.js index 4bebf1eb3ae07..635b0876c22fd 100644 --- a/packages/babel-helper-remap-async-to-generator/src/index.js +++ b/packages/babel-helper-remap-async-to-generator/src/index.js @@ -4,7 +4,6 @@ import type { NodePath } from "@babel/traverse"; import wrapFunction from "@babel/helper-wrap-function"; import annotateAsPure from "@babel/helper-annotate-as-pure"; import * as t from "@babel/types"; -import rewriteForAwait from "./for-await"; const awaitVisitor = { Function(path) { @@ -27,44 +26,13 @@ const awaitVisitor = { ), ); }, - - ForOfStatement(path, { file, wrapAwait }) { - const { node } = path; - if (!node.await) return; - - const build = rewriteForAwait(path, { - getAsyncIterator: file.addHelper("asyncIterator"), - wrapAwait, - }); - - const { declar, loop } = build; - const block = loop.body; - - // ensure that it's a block so we can take all its statements - path.ensureBlock(); - - // add the value declaration to the new loop body - if (declar) { - block.body.push(declar); - } - - // push the rest of the original loop body onto our new body - block.body = block.body.concat(node.body.body); - - t.inherits(loop, node); - t.inherits(loop.body, node.body); - - if (build.replaceParent) { - path.parentPath.replaceWithMultiple(build.node); - } else { - path.replaceWithMultiple(build.node); - } - }, }; -export default function(path: NodePath, file: Object, helpers: Object) { +export default function( + path: NodePath, + helpers: { wrapAsync: Object, wrapAwait: Object }, +) { path.traverse(awaitVisitor, { - file, wrapAwait: helpers.wrapAwait, }); diff --git a/packages/babel-helper-replace-supers/package.json b/packages/babel-helper-replace-supers/package.json index 24ff964752bbd..e9d02fe5deb08 100644 --- a/packages/babel-helper-replace-supers/package.json +++ b/packages/babel-helper-replace-supers/package.json @@ -1,14 +1,14 @@ { "name": "@babel/helper-replace-supers", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Helper function to replace supers", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-replace-supers", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/helper-optimise-call-expression": "7.0.0-beta.39", - "@babel/template": "7.0.0-beta.39", - "@babel/traverse": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39" + "@babel/helper-optimise-call-expression": "7.0.0-beta.42", + "@babel/template": "7.0.0-beta.42", + "@babel/traverse": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-simple-access/package.json b/packages/babel-helper-simple-access/package.json index 146ba722fa1b8..033603a4f7a73 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Babel helper for ensuring that access to a given value is performed through simple accesses", "author": "Logan Smyth ", "homepage": "https://babeljs.io/", @@ -8,8 +8,8 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-simple-access", "main": "lib/index.js", "dependencies": { - "@babel/template": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39", + "@babel/template": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42", "lodash": "^4.2.0" } } diff --git a/packages/babel-helper-simple-access/src/index.js b/packages/babel-helper-simple-access/src/index.js index 4d3ec6a9223f4..b26404223cc35 100644 --- a/packages/babel-helper-simple-access/src/index.js +++ b/packages/babel-helper-simple-access/src/index.js @@ -29,8 +29,9 @@ const simpleAssignmentVisitor = { (path.parentPath.isExpressionStatement() && !path.isCompletionRecord()) ) { // ++i => (i += 1); + const operator = path.node.operator == "++" ? "+=" : "-="; path.replaceWith( - t.assignmentExpression("+=", arg.node, t.numericLiteral(1)), + t.assignmentExpression(operator, arg.node, t.numericLiteral(1)), ); } else { const varName = path.scope.generateDeclaredUidIdentifier("old").name; diff --git a/packages/babel-helper-split-export-declaration/.npmignore b/packages/babel-helper-split-export-declaration/.npmignore new file mode 100644 index 0000000000000..f9806945836eb --- /dev/null +++ b/packages/babel-helper-split-export-declaration/.npmignore @@ -0,0 +1,3 @@ +src +test +*.log diff --git a/packages/babel-helper-split-export-declaration/README.md b/packages/babel-helper-split-export-declaration/README.md new file mode 100644 index 0000000000000..195f151e9229b --- /dev/null +++ b/packages/babel-helper-split-export-declaration/README.md @@ -0,0 +1,23 @@ +# @babel/helper-split-export-declaration + +## API + +```js +declare export default splitExportDeclaration(path: NodePath); +``` + +## Usage + +```js +import traverse from "@babel/traverse"; +import splitExportDeclaration from "@babel/helper-split-export-declaration"; + +// ... + +traverse(file, { + ExportDefaultDeclaration(path) { + if (!path.get("declaration").isClassDeclaration()) return; + splitExportDeclaration(path); + }, +}); +``` diff --git a/packages/babel-helper-split-export-declaration/package.json b/packages/babel-helper-split-export-declaration/package.json new file mode 100644 index 0000000000000..33211a5dd9464 --- /dev/null +++ b/packages/babel-helper-split-export-declaration/package.json @@ -0,0 +1,11 @@ +{ + "name": "@babel/helper-split-export-declaration", + "version": "7.0.0-beta.42", + "description": "", + "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-split-export-declaration", + "license": "MIT", + "main": "lib/index.js", + "dependencies": { + "@babel/types": "7.0.0-beta.42" + } +} diff --git a/packages/babel-helper-split-export-declaration/src/index.js b/packages/babel-helper-split-export-declaration/src/index.js new file mode 100644 index 0000000000000..ffbf52243a057 --- /dev/null +++ b/packages/babel-helper-split-export-declaration/src/index.js @@ -0,0 +1,76 @@ +import * as t from "@babel/types"; + +export default function splitExportDeclaration(exportDeclaration) { + if (!exportDeclaration.isExportDeclaration()) { + throw new Error("Only export declarations can be splitted."); + } + + // build specifiers that point back to this export declaration + const isDefault = exportDeclaration.isExportDefaultDeclaration(); + const declaration = exportDeclaration.get("declaration"); + const isClassDeclaration = declaration.isClassDeclaration(); + + if (isDefault) { + const standaloneDeclaration = + declaration.isFunctionDeclaration() || isClassDeclaration; + + const scope = declaration.isScope() + ? declaration.scope.parent + : declaration.scope; + + let id = declaration.node.id; + let needBindingRegistration = false; + + if (!id) { + needBindingRegistration = true; + + id = scope.generateUidIdentifier("default"); + + if ( + standaloneDeclaration || + declaration.isFunctionExpression() || + declaration.isClassExpression() + ) { + declaration.node.id = t.cloneNode(id); + } + } + + const updatedDeclaration = standaloneDeclaration + ? declaration + : t.variableDeclaration("var", [ + t.variableDeclarator(t.cloneNode(id), declaration.node), + ]); + + const updatedExportDeclaration = t.exportNamedDeclaration(null, [ + t.exportSpecifier(t.cloneNode(id), t.identifier("default")), + ]); + + exportDeclaration.insertAfter(updatedExportDeclaration); + exportDeclaration.replaceWith(updatedDeclaration); + + if (needBindingRegistration) { + scope.registerBinding( + isClassDeclaration ? "let" : "var", + exportDeclaration, + ); + } + + return exportDeclaration; + } + + if (exportDeclaration.get("specifiers").length > 0) { + throw new Error("It doesn't make sense to split exported specifiers."); + } + + const bindingIdentifiers = declaration.getOuterBindingIdentifiers(); + + const specifiers = Object.keys(bindingIdentifiers).map(name => { + return t.exportSpecifier(t.identifier(name), t.identifier(name)); + }); + + const aliasDeclar = t.exportNamedDeclaration(null, specifiers); + + exportDeclaration.insertAfter(aliasDeclar); + exportDeclaration.replaceWith(declaration.node); + return exportDeclaration; +} diff --git a/packages/babel-helper-transform-fixture-test-runner/package.json b/packages/babel-helper-transform-fixture-test-runner/package.json index 122039dc6b57a..e5667e1383115 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Transform test runner for @babel/helper-fixtures module", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -8,11 +8,13 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-transform-fixture-test-runner", "main": "lib/index.js", "dependencies": { - "@babel/code-frame": "7.0.0-beta.39", - "@babel/core": "7.0.0-beta.39", - "@babel/helper-fixtures": "7.0.0-beta.39", - "@babel/polyfill": "7.0.0-beta.39", + "@babel/code-frame": "7.0.0-beta.42", + "@babel/core": "7.0.0-beta.42", + "@babel/helper-fixtures": "7.0.0-beta.42", + "@babel/polyfill": "7.0.0-beta.42", "chai": "^4.1.0", + "jest": "^22.4.2", + "jest-diff": "^22.4.0", "lodash": "^4.2.0", "resolve": "^1.3.2", "source-map": "^0.5.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 40652a0f8c3d5..71a3f9e5e531c 100644 --- a/packages/babel-helper-transform-fixture-test-runner/src/index.js +++ b/packages/babel-helper-transform-fixture-test-runner/src/index.js @@ -1,4 +1,4 @@ -/* eslint-env mocha */ +/* eslint-env jest */ import * as babel from "@babel/core"; import { buildExternalHelpers } from "@babel/core"; import getFixtures from "@babel/helper-fixtures"; @@ -11,11 +11,12 @@ import extend from "lodash/extend"; import merge from "lodash/merge"; import resolve from "resolve"; import assert from "assert"; -import chai from "chai"; import fs from "fs"; import path from "path"; import vm from "vm"; +import diff from "jest-diff"; + const moduleCache = {}; const testContext = vm.createContext({ ...helpers, @@ -23,6 +24,7 @@ const testContext = vm.createContext({ transform: babel.transform, setTimeout: setTimeout, setImmediate: setImmediate, + expect, }); testContext.global = testContext; @@ -321,7 +323,7 @@ function checkDuplicatedNodes(ast) { function run(task) { const actual = task.actual; - const expect = task.expect; + const expected = task.expect; const exec = task.exec; const opts = task.options; const optionsDir = task.optionsDir; @@ -330,6 +332,10 @@ function run(task) { const newOpts = merge( { filename: self.loc, + filenameRelative: self.filename, + sourceFileName: self.filename, + sourceType: "script", + babelrc: false, }, opts, ); @@ -375,29 +381,47 @@ function run(task) { } let actualCode = actual.code; - const expectCode = expect.code; + const expectCode = expected.code; if (!execCode || actualCode) { result = babel.transform(actualCode, getOpts(actual)); checkDuplicatedNodes(result.ast); if ( - !expect.code && + !expected.code && result.code && !opts.throws && - fs.statSync(path.dirname(expect.loc)).isDirectory() && + fs.statSync(path.dirname(expected.loc)).isDirectory() && !process.env.CI ) { - console.log(`New test file created: ${expect.loc}`); - fs.writeFileSync(expect.loc, `${result.code}\n`); + const expectedFile = expected.loc.replace( + /\.m?js$/, + result.sourceType === "module" ? ".mjs" : ".js", + ); + + console.log(`New test file created: ${expectedFile}`); + fs.writeFileSync(expectedFile, `${result.code}\n`); + + if (expected.loc !== expectedFile) { + try { + fs.unlinkSync(expected.loc); + } catch (e) {} + } } else { actualCode = result.code.trim(); - chai - .expect(actualCode) - .to.be.equal(expectCode, actual.loc + " !== " + expect.loc); + expect(actualCode).toEqualFile({ + filename: expected.loc, + code: expectCode, + }); + + if (actualCode) { + expect(expected.loc).toMatch( + result.sourceType === "module" ? /\.mjs$/ : /\.js$/, + ); + } } } if (task.sourceMap) { - chai.expect(result.map).to.deep.equal(task.sourceMap); + expect(result.map).toEqual(task.sourceMap); } if (task.sourceMappings) { @@ -406,10 +430,8 @@ function run(task) { task.sourceMappings.forEach(function(mapping) { const actual = mapping.original; - const expect = consumer.originalPositionFor(mapping.generated); - chai - .expect({ line: expect.line, column: expect.column }) - .to.deep.equal(actual); + const expected = consumer.originalPositionFor(mapping.generated); + expect({ line: expected.line, column: expected.column }).toEqual(actual); }); } @@ -418,6 +440,28 @@ function run(task) { } } +const toEqualFile = () => ({ + compare: (actual, { filename, code }) => { + const pass = actual === code; + return { + pass, + message: () => { + const diffString = diff(code, actual, { + expand: false, + }); + return ( + `Expected ${filename} to match transform output.\n` + + `To autogenerate a passing version of this file, delete the file and re-run the tests.\n\n` + + `Diff:\n\n${diffString}` + ); + }, + }; + }, + negativeCompare: () => { + throw new Error("Negation unsupported"); + }, +}); + export default function( fixturesLoc: string, name: string, @@ -431,6 +475,10 @@ export default function( if (includes(suiteOpts.ignoreSuites, testSuite.title)) continue; describe(name + "/" + testSuite.title, function() { + jest.addMatchers({ + toEqualFile, + }); + for (const task of testSuite.tests) { if ( includes(suiteOpts.ignoreTasks, task.title) || @@ -448,10 +496,6 @@ export default function( } defaults(task.options, { - filenameRelative: task.expect.filename, - sourceFileName: task.actual.filename, - sourceMapTarget: task.expect.filename, - babelrc: false, sourceMap: !!(task.sourceMappings || task.sourceMap), }); diff --git a/packages/babel-helper-wrap-function/package.json b/packages/babel-helper-wrap-function/package.json index 5235d225611f7..e0ba12ea172f9 100644 --- a/packages/babel-helper-wrap-function/package.json +++ b/packages/babel-helper-wrap-function/package.json @@ -1,14 +1,14 @@ { "name": "@babel/helper-wrap-function", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Helper to wrap functions inside a function call.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-wrap-function", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/helper-function-name": "7.0.0-beta.39", - "@babel/template": "7.0.0-beta.39", - "@babel/traverse": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39" + "@babel/helper-function-name": "7.0.0-beta.42", + "@babel/template": "7.0.0-beta.42", + "@babel/traverse": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42" } } diff --git a/packages/babel-helpers/package.json b/packages/babel-helpers/package.json index 6aa3f80ac7dec..8c6e85c94f843 100644 --- a/packages/babel-helpers/package.json +++ b/packages/babel-helpers/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helpers", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Collection of helper functions used by Babel transforms.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -8,11 +8,11 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-helpers", "main": "lib/index.js", "dependencies": { - "@babel/template": "7.0.0-beta.39", - "@babel/traverse": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39" + "@babel/template": "7.0.0-beta.42", + "@babel/traverse": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42" }, "devDependencies": { - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-helpers/src/helpers.js b/packages/babel-helpers/src/helpers.js index 3f0689e8ba1d1..b8dfe9119a571 100644 --- a/packages/babel-helpers/src/helpers.js +++ b/packages/babel-helpers/src/helpers.js @@ -5,11 +5,7 @@ import template from "@babel/template"; const helpers = {}; export default helpers; -// Helpers never include placeholders, so we disable placeholder pattern -// matching to allow us to use pattern-like variable names. -const defineHelper = template.program({ placeholderPattern: false }); - -helpers.typeof = defineHelper(` +helpers.typeof = () => template.program.ast` export default function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { return typeof obj; }; @@ -23,9 +19,9 @@ helpers.typeof = defineHelper(` return _typeof(obj); } -`); +`; -helpers.jsx = defineHelper(` +helpers.jsx = () => template.program.ast` var REACT_ELEMENT_TYPE; export default function _createRawReactElement(type, props, key, children) { @@ -72,9 +68,9 @@ helpers.jsx = defineHelper(` _owner: null, }; } -`); +`; -helpers.asyncIterator = defineHelper(` +helpers.asyncIterator = () => template.program.ast` export default function _asyncIterator(iterable) { if (typeof Symbol === "function") { if (Symbol.asyncIterator) { @@ -87,15 +83,15 @@ helpers.asyncIterator = defineHelper(` } throw new TypeError("Object is not async iterable"); } -`); +`; -helpers.AwaitValue = defineHelper(` +helpers.AwaitValue = () => template.program.ast` export default function _AwaitValue(value) { this.wrapped = value; } -`); +`; -helpers.AsyncGenerator = defineHelper(` +helpers.AsyncGenerator = () => template.program.ast` import AwaitValue from "AwaitValue"; export default function AsyncGenerator(gen) { @@ -177,9 +173,9 @@ helpers.AsyncGenerator = defineHelper(` AsyncGenerator.prototype.next = function (arg) { return this._invoke("next", arg); }; AsyncGenerator.prototype.throw = function (arg) { return this._invoke("throw", arg); }; AsyncGenerator.prototype.return = function (arg) { return this._invoke("return", arg); }; -`); +`; -helpers.wrapAsyncGenerator = defineHelper(` +helpers.wrapAsyncGenerator = () => template.program.ast` import AsyncGenerator from "AsyncGenerator"; export default function _wrapAsyncGenerator(fn) { @@ -187,17 +183,17 @@ helpers.wrapAsyncGenerator = defineHelper(` return new AsyncGenerator(fn.apply(this, arguments)); }; } -`); +`; -helpers.awaitAsyncGenerator = defineHelper(` +helpers.awaitAsyncGenerator = () => template.program.ast` import AwaitValue from "AwaitValue"; export default function _awaitAsyncGenerator(value) { return new AwaitValue(value); } -`); +`; -helpers.asyncGeneratorDelegate = defineHelper(` +helpers.asyncGeneratorDelegate = () => template.program.ast` export default function _asyncGeneratorDelegate(inner, awaitWrap) { var iter = {}, waiting = false; @@ -237,9 +233,9 @@ helpers.asyncGeneratorDelegate = defineHelper(` return iter; } -`); +`; -helpers.asyncToGenerator = defineHelper(` +helpers.asyncToGenerator = () => template.program.ast` export default function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; @@ -267,17 +263,17 @@ helpers.asyncToGenerator = defineHelper(` }); }; } -`); +`; -helpers.classCallCheck = defineHelper(` +helpers.classCallCheck = () => template.program.ast` export default function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -`); +`; -helpers.createClass = defineHelper(` +helpers.createClass = () => template.program.ast` function _defineProperties(target, props) { for (var i = 0; i < props.length; i ++) { var descriptor = props[i]; @@ -293,9 +289,9 @@ helpers.createClass = defineHelper(` if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -`); +`; -helpers.defineEnumerableProperties = defineHelper(` +helpers.defineEnumerableProperties = () => template.program.ast` export default function _defineEnumerableProperties(obj, descs) { for (var key in descs) { var desc = descs[key]; @@ -319,9 +315,9 @@ helpers.defineEnumerableProperties = defineHelper(` } return obj; } -`); +`; -helpers.defaults = defineHelper(` +helpers.defaults = () => template.program.ast` export default function _defaults(obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { @@ -333,9 +329,9 @@ helpers.defaults = defineHelper(` } return obj; } -`); +`; -helpers.defineProperty = defineHelper(` +helpers.defineProperty = () => template.program.ast` export default function _defineProperty(obj, key, value) { // Shortcircuit the slow defineProperty path when possible. // We are trying to avoid issues where setters defined on the @@ -354,9 +350,9 @@ helpers.defineProperty = defineHelper(` } return obj; } -`); +`; -helpers.extends = defineHelper(` +helpers.extends = () => template.program.ast` export default function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { @@ -372,9 +368,29 @@ helpers.extends = defineHelper(` return _extends.apply(this, arguments); } -`); +`; + +helpers.objectSpread = () => template.program.ast` + import defineProperty from "defineProperty"; -helpers.get = defineHelper(` + 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); + if (typeof Object.getOwnPropertySymbols === 'function') { + ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) { + return Object.getOwnPropertyDescriptor(source, sym).enumerable; + })); + } + ownKeys.forEach(function(key) { + defineProperty(target, key, source[key]); + }); + } + return target; + } +`; + +helpers.get = () => template.program.ast` export default function _get(object, property, receiver) { if (object === null) object = Function.prototype; @@ -400,9 +416,9 @@ helpers.get = defineHelper(` return getter.call(receiver); } } -`); +`; -helpers.inherits = defineHelper(` +helpers.inherits = () => template.program.ast` export default function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); @@ -417,62 +433,73 @@ helpers.inherits = defineHelper(` }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -`); +`; -helpers.inheritsLoose = defineHelper(` +helpers.inheritsLoose = () => template.program.ast` export default function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } -`); +`; // Based on https://github.com/WebReflection/babel-plugin-transform-builtin-classes -helpers.wrapNativeSuper = defineHelper(` - var _gPO = Object.getPrototypeOf || function _gPO(o) { return o.__proto__ }; - var _sPO = Object.setPrototypeOf || function _sPO(o, p) { o.__proto__ = p; return o }; - var _construct = (typeof Reflect === "object" && Reflect.construct) || - function _construct(Parent, args, Class) { - var Constructor, a = [null]; - a.push.apply(a, args); - Constructor = Parent.bind.apply(Parent, a); - return _sPO(new Constructor, Class.prototype); - }; - - var _cache = typeof Map === "function" && new Map(); +helpers.wrapNativeSuper = () => template.program.ast` + function _gPO(o) { + _gPO = Object.getPrototypeOf || function _gPO(o) { return o.__proto__ }; + return _gPO(o); + } + function _sPO(o, p) { + _sPO = Object.setPrototypeOf || function _sPO(o, p) { o.__proto__ = p; return o }; + return _sPO(o, p); + } + function _construct(Parent, args, Class) { + _construct = (typeof Reflect === "object" && Reflect.construct) || + function _construct(Parent, args, Class) { + var Constructor, a = [null]; + a.push.apply(a, args); + Constructor = Parent.bind.apply(Parent, a); + return _sPO(new Constructor, Class.prototype); + }; + return _construct(Parent, args, Class); + } export default function _wrapNativeSuper(Class) { - if (typeof Class !== "function") { - throw new TypeError("Super expression must either be null or a function"); - } + var _cache = typeof Map === "function" ? new Map() : undefined; - if (typeof _cache !== "undefined") { - if (_cache.has(Class)) return _cache.get(Class); - _cache.set(Class, Wrapper); + _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + _cache.set(Class, Wrapper); + } + function Wrapper() {} + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true, + } + }); + return _sPO( + Wrapper, + _sPO( + function Super() { + return _construct(Class, arguments, _gPO(this).constructor); + }, + Class + ) + ); } - function Wrapper() {} - Wrapper.prototype = Object.create(Class.prototype, { - constructor: { - value: Wrapper, - enumerable: false, - writeable: true, - configurable: true, - } - }); - return _sPO( - Wrapper, - _sPO( - function Super() { - return _construct(Class, arguments, _gPO(this).constructor); - }, - Class - ) - ); - } -`); - -helpers.instanceof = defineHelper(` + return _wrapNativeSuper(Class) + } +`; + +helpers.instanceof = () => template.program.ast` export default function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); @@ -480,15 +507,15 @@ helpers.instanceof = defineHelper(` return left instanceof right; } } -`); +`; -helpers.interopRequireDefault = defineHelper(` +helpers.interopRequireDefault = () => template.program.ast` export default function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -`); +`; -helpers.interopRequireWildcard = defineHelper(` +helpers.interopRequireWildcard = () => template.program.ast` export default function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; @@ -512,23 +539,23 @@ helpers.interopRequireWildcard = defineHelper(` return newObj; } } -`); +`; -helpers.newArrowCheck = defineHelper(` +helpers.newArrowCheck = () => template.program.ast` export default function _newArrowCheck(innerThis, boundThis) { if (innerThis !== boundThis) { throw new TypeError("Cannot instantiate an arrow function"); } } -`); +`; -helpers.objectDestructuringEmpty = defineHelper(` +helpers.objectDestructuringEmpty = () => template.program.ast` export default function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); } -`); +`; -helpers.objectWithoutProperties = defineHelper(` +helpers.objectWithoutProperties = () => template.program.ast` export default function _objectWithoutProperties(source, excluded) { if (source == null) return {}; @@ -554,33 +581,29 @@ helpers.objectWithoutProperties = defineHelper(` return target; } -`); +`; -helpers.assertThisInitialized = defineHelper(` +helpers.assertThisInitialized = () => template.program.ast` export default function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -`); +`; + +helpers.possibleConstructorReturn = () => template.program.ast` + import assertThisInitialized from "assertThisInitialized"; -helpers.possibleConstructorReturn = defineHelper(` export default function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } - // TODO: Should just be - // import assertThisInitialized from "assertThisInitialized"; - // return assertThisInitialized(self); - if (self === void 0) { - throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - } - return self; + return assertThisInitialized(self); } -`); +`; -helpers.set = defineHelper(` +helpers.set = () => template.program.ast` export default function _set(object, property, value, receiver) { var desc = Object.getOwnPropertyDescriptor(object, property); @@ -602,88 +625,26 @@ helpers.set = defineHelper(` return value; } -`); - -helpers.slicedToArray = defineHelper(` - // Broken out into a separate function to avoid deoptimizations due to the try/catch for the - // array iterator case. - function _sliceIterator(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 :( - // - // _n = _iteratorNormalCompletion - // _d = _didIteratorError - // _e = _iteratorError - // _i = _iterator - // _s = _step - - 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; - } +`; - export default function _slicedToArray(arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if (Symbol.iterator in Object(arr)) { - return _sliceIterator(arr, i); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - } -`); - -helpers.slicedToArrayLoose = defineHelper(` - export default function _slicedToArrayLoose(arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if (Symbol.iterator in Object(arr)) { - var _arr = []; - for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { - _arr.push(_step.value); - if (i && _arr.length === i) break; - } - return _arr; - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - } -`); - -helpers.taggedTemplateLiteral = defineHelper(` +helpers.taggedTemplateLiteral = () => template.program.ast` export default function _taggedTemplateLiteral(strings, raw) { + if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } -`); +`; -helpers.taggedTemplateLiteralLoose = defineHelper(` +helpers.taggedTemplateLiteralLoose = () => template.program.ast` export default function _taggedTemplateLiteralLoose(strings, raw) { + if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; } -`); +`; -helpers.temporalRef = defineHelper(` +helpers.temporalRef = () => template.program.ast` import undef from "temporalUndefined"; export default function _temporalRef(val, name) { @@ -693,42 +654,147 @@ helpers.temporalRef = defineHelper(` return val; } } -`); +`; -helpers.readOnlyError = defineHelper(` +helpers.readOnlyError = () => template.program.ast` export default function _readOnlyError(name) { throw new Error("\\"" + name + "\\" is read-only"); } -`); +`; -helpers.classNameTDZError = defineHelper(` +helpers.classNameTDZError = () => template.program.ast` export default function _classNameTDZError(name) { throw new Error("Class \\"" + name + "\\" cannot be referenced in computed property keys."); } -`); +`; -helpers.temporalUndefined = defineHelper(` +helpers.temporalUndefined = () => template.program.ast` export default {}; -`); +`; + +helpers.slicedToArray = () => template.program.ast` + import arrayWithHoles from "arrayWithHoles"; + import iterableToArrayLimit from "iterableToArrayLimit"; + import nonIterableRest from "nonIterableRest"; + + export default function _slicedToArray(arr, i) { + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest(); + } +`; + +helpers.slicedToArrayLoose = () => template.program.ast` + import arrayWithHoles from "arrayWithHoles"; + import iterableToArrayLimitLoose from "iterableToArrayLimitLoose"; + import nonIterableRest from "nonIterableRest"; + + export default function _slicedToArrayLoose(arr, i) { + return arrayWithHoles(arr) || iterableToArrayLimitLoose(arr, i) || nonIterableRest(); + } +`; + +helpers.toArray = () => template.program.ast` + import arrayWithHoles from "arrayWithHoles"; + import iterableToArray from "iterableToArray"; + import nonIterableRest from "nonIterableRest"; -helpers.toArray = defineHelper(` export default function _toArray(arr) { - return Array.isArray(arr) ? arr : Array.from(arr); + return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest(); } -`); +`; + +helpers.toConsumableArray = () => template.program.ast` + import arrayWithoutHoles from "arrayWithoutHoles"; + import iterableToArray from "iterableToArray"; + import nonIterableSpread from "nonIterableSpread"; -helpers.toConsumableArray = defineHelper(` export default function _toConsumableArray(arr) { + return arrayWithoutHoles(arr) || iterableToArray(arr) || nonIterableSpread(); + } +`; + +helpers.arrayWithoutHoles = () => template.program.ast` + export default function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; - } else { - return Array.from(arr); } } -`); +`; + +helpers.arrayWithHoles = () => template.program.ast` + export default function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return arr; + } +`; + +helpers.iterableToArray = () => template.program.ast` + export default function _iterableToArray(iter) { + if ( + Symbol.iterator in Object(iter) || + Object.prototype.toString.call(iter) === "[object Arguments]" + ) return Array.from(iter); + } +`; + +helpers.iterableToArrayLimit = () => template.program.ast` + 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 :( + // + // _n = _iteratorNormalCompletion + // _d = _didIteratorError + // _e = _iteratorError + // _i = _iterator + // _s = _step + + 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; + } +`; + +helpers.iterableToArrayLimitLoose = () => template.program.ast` + export default function _iterableToArrayLimitLoose(arr, i) { + var _arr = []; + for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { + _arr.push(_step.value); + if (i && _arr.length === i) break; + } + return _arr; + } +`; + +helpers.nonIterableSpread = () => template.program.ast` + export default function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance"); + } +`; + +helpers.nonIterableRest = () => template.program.ast` + export default function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } +`; -helpers.skipFirstGeneratorNext = defineHelper(` +helpers.skipFirstGeneratorNext = () => template.program.ast` export default function _skipFirstGeneratorNext(fn) { return function () { var it = fn.apply(this, arguments); @@ -736,9 +802,9 @@ helpers.skipFirstGeneratorNext = defineHelper(` return it; } } -`); +`; -helpers.toPropertyKey = defineHelper(` +helpers.toPropertyKey = () => template.program.ast` export default function _toPropertyKey(key) { if (typeof key === "symbol") { return key; @@ -746,13 +812,13 @@ helpers.toPropertyKey = defineHelper(` return String(key); } } -`); +`; /** * Add a helper that will throw a useful error if the transform fails to detect the class * property assignment, so users know something failed. */ -helpers.initializerWarningHelper = defineHelper(` +helpers.initializerWarningHelper = () => template.program.ast` export default function _initializerWarningHelper(descriptor, context){ throw new Error( 'Decorating class property failed. Please ensure that ' + @@ -761,12 +827,12 @@ helpers.initializerWarningHelper = defineHelper(` 'the next major version of decorators in stage 2.' ); } -`); +`; /** * Add a helper to call as a replacement for class property definition. */ -helpers.initializerDefineProperty = defineHelper(` +helpers.initializerDefineProperty = () => template.program.ast` export default function _initializerDefineProperty(target, property, descriptor, context){ if (!descriptor) return; @@ -777,13 +843,13 @@ helpers.initializerDefineProperty = defineHelper(` value: descriptor.initializer ? descriptor.initializer.call(context) : void 0, }); } -`); +`; /** * Add a helper to take an initial descriptor, apply some decorators to it, and optionally * define the property. */ -helpers.applyDecoratedDescriptor = defineHelper(` +helpers.applyDecoratedDescriptor = () => template.program.ast` export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context){ var desc = {}; Object['ke' + 'ys'](descriptor).forEach(function(key){ @@ -813,4 +879,4 @@ helpers.applyDecoratedDescriptor = defineHelper(` return desc; } -`); +`; diff --git a/packages/babel-highlight/.npmignore b/packages/babel-highlight/.npmignore new file mode 100644 index 0000000000000..f9806945836eb --- /dev/null +++ b/packages/babel-highlight/.npmignore @@ -0,0 +1,3 @@ +src +test +*.log diff --git a/packages/babel-highlight/README.md b/packages/babel-highlight/README.md new file mode 100644 index 0000000000000..36143844eb010 --- /dev/null +++ b/packages/babel-highlight/README.md @@ -0,0 +1,41 @@ +# @babel/highlight + +> Syntax highlight JavaScript strings for output in terminals. + +## Install + +```sh +npm install --save @babel/highlight +``` + +## Usage + +```js +import highlight from "@babel/highlight"; + +const code = `class Foo { + constructor() +}`; + +const result = highlight(code); + +console.log(result); +``` + +```js +class Foo { + constructor() +} +``` + +By default, `highlight` will not highlight your code if your terminal does not support color. To force colors, pass `{ forceColor: true }` as the second argument to `highlight`. + +```js +import highlight from "@babel/highlight"; + +const code = `class Foo { + constructor() +}`; + +const result = highlight(code, { forceColor: true }); +``` diff --git a/packages/babel-highlight/package.json b/packages/babel-highlight/package.json new file mode 100644 index 0000000000000..805c86a084df0 --- /dev/null +++ b/packages/babel-highlight/package.json @@ -0,0 +1,18 @@ +{ + "name": "@babel/highlight", + "version": "7.0.0-beta.42", + "description": "Syntax highlight JavaScript strings for output in terminals.", + "author": "suchipi ", + "homepage": "https://babeljs.io/", + "license": "MIT", + "repository": "https://github.com/babel/babel/tree/master/packages/babel-highlight", + "main": "lib/index.js", + "dependencies": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^3.0.0" + }, + "devDependencies": { + "strip-ansi": "^4.0.0" + } +} diff --git a/packages/babel-highlight/src/index.js b/packages/babel-highlight/src/index.js new file mode 100644 index 0000000000000..cc98a49f85a31 --- /dev/null +++ b/packages/babel-highlight/src/index.js @@ -0,0 +1,127 @@ +import jsTokens, { matchToToken } from "js-tokens"; +import esutils from "esutils"; +import Chalk from "chalk"; + +/** + * Chalk styles for token types. + */ +function getDefs(chalk) { + return { + keyword: chalk.cyan, + capitalized: chalk.yellow, + jsx_tag: chalk.yellow, + punctuator: chalk.yellow, + // bracket: intentionally omitted. + number: chalk.magenta, + string: chalk.green, + regex: chalk.magenta, + comment: chalk.grey, + invalid: chalk.white.bgRed.bold, + }; +} + +/** + * RegExp to test for newlines in terminal. + */ +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; + +/** + * RegExp to test for what seems to be a JSX tag name. + */ +const JSX_TAG = /^[a-z][\w-]*$/i; + +/** + * RegExp to test for the three types of brackets. + */ +const BRACKET = /^[()[\]{}]$/; + +/** + * Get the type of token, specifying punctuator type. + */ +function getTokenType(match) { + const [offset, text] = match.slice(-2); + const token = matchToToken(match); + + if (token.type === "name") { + if (esutils.keyword.isReservedWordES6(token.value)) { + return "keyword"; + } + + if ( + JSX_TAG.test(token.value) && + (text[offset - 1] === "<" || text.substr(offset - 2, 2) == " colorize(str)) + .join("\n"); + } else { + return args[0]; + } + }); +} + +type Options = { + forceColor?: boolean, +}; + +/** + * Whether the code should be highlighted given the passed options. + */ +export function shouldHighlight(options: Options): boolean { + return Chalk.supportsColor || options.forceColor; +} + +/** + * The Chalk instance that should be used given the passed options. + */ +export function getChalk(options: Options) { + let chalk = Chalk; + if (options.forceColor) { + chalk = new Chalk.constructor({ enabled: true, level: 1 }); + } + return chalk; +} + +/** + * Highlight `code`. + */ +export default function highlight(code: string, options: Options = {}): string { + if (shouldHighlight(options)) { + const chalk = getChalk(options); + const defs = getDefs(chalk); + return highlightTokens(defs, code); + } else { + return code; + } +} diff --git a/packages/babel-highlight/test/index.js b/packages/babel-highlight/test/index.js new file mode 100644 index 0000000000000..774fbcd669b33 --- /dev/null +++ b/packages/babel-highlight/test/index.js @@ -0,0 +1,118 @@ +import assert from "assert"; +import chalk from "chalk"; +import stripAnsi from "strip-ansi"; +import highlight, { shouldHighlight, getChalk } from ".."; + +describe("@babel/highlight", function() { + function stubColorSupport(supported) { + let originalSupportsColor; + beforeEach(function() { + originalSupportsColor = chalk.supportsColor; + chalk.supportsColor = supported; + }); + + afterEach(function() { + chalk.supportsColor = originalSupportsColor; + }); + } + + describe("highlight", function() { + describe("when colors are supported", function() { + stubColorSupport(true); + + it("highlights code", function() { + const code = "console.log('hi')"; + const result = highlight(code); + const stripped = stripAnsi(result); + assert.ok(result.length > stripped.length); + assert.equal(stripped, code); + }); + }); + + describe("when colors are not supported", function() { + stubColorSupport(false); + + it("does not attempt to highlight code", function() { + const code = "console.log('hi')"; + const result = highlight(code); + const stripped = stripAnsi(result); + assert.ok(result.length === stripped.length); + assert.equal(result, code); + }); + + describe("and the forceColor option is passed", function() { + it("highlights the code anyway", function() { + const code = "console.log('hi')"; + const result = highlight(code, { forceColor: true }); + const stripped = stripAnsi(result); + assert.ok(result.length > stripped.length); + assert.equal(stripped, code); + }); + }); + }); + }); + + describe("shouldHighlight", function() { + describe("when colors are supported", function() { + stubColorSupport(true); + + it("returns true", function() { + assert.ok(shouldHighlight({})); + }); + }); + + describe("when colors are not supported", function() { + stubColorSupport(false); + + it("returns false", function() { + assert.ok(!shouldHighlight({})); + }); + + describe("and the forceColor option is passed", function() { + it("returns true", function() { + assert.ok(shouldHighlight({ forceColor: true })); + }); + }); + }); + }); + + describe("getChalk", function() { + describe("when colors are supported", function() { + stubColorSupport(true); + + describe("when forceColor is not passed", function() { + it("returns a Chalk instance", function() { + assert.equal(getChalk({}).constructor, chalk.constructor); + }); + }); + + describe("when forceColor is passed", function() { + it("returns a Chalk instance", function() { + assert.equal( + getChalk({ forceColor: true }).constructor, + chalk.constructor, + ); + }); + }); + }); + + describe("when colors are supported", function() { + stubColorSupport(true); + + describe("when forceColor is not passed", function() { + it("returns a Chalk instance", function() { + assert.equal(getChalk({}).constructor, chalk.constructor); + }); + }); + + describe("when forceColor is passed", function() { + it("returns a Chalk instance", function() { + assert.equal( + getChalk({ forceColor: true }).constructor, + chalk.constructor, + ); + }); + }); + }); + }); +}); diff --git a/packages/babel-node/package.json b/packages/babel-node/package.json index d038f0248585f..5861359cd82bc 100644 --- a/packages/babel-node/package.json +++ b/packages/babel-node/package.json @@ -1,6 +1,6 @@ { "name": "@babel/node", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Babel command line", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -16,8 +16,8 @@ "compiler" ], "dependencies": { - "@babel/polyfill": "7.0.0-beta.39", - "@babel/register": "7.0.0-beta.39", + "@babel/polyfill": "7.0.0-beta.42", + "@babel/register": "7.0.0-beta.42", "commander": "^2.8.1", "fs-readdir-recursive": "^1.0.0", "lodash": "^4.2.0", @@ -25,11 +25,11 @@ "v8flags": "^3.0.0" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-fixtures": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-fixtures": "7.0.0-beta.42" }, "bin": { "babel-node": "./bin/babel-node.js" diff --git a/packages/babel-node/src/babel-node.js b/packages/babel-node/src/babel-node.js index cc1ed88c32c51..31e3634a1a8ae 100755 --- a/packages/babel-node/src/babel-node.js +++ b/packages/babel-node/src/babel-node.js @@ -46,6 +46,7 @@ getV8Flags(function(err, v8Flags) { case "--debug": case "--debug-brk": case "--inspect": + case "--inspect-brk": args.unshift(arg); break; @@ -94,5 +95,9 @@ getV8Flags(function(err, v8Flags) { } }); }); + process.on("SIGINT", () => { + proc.kill("SIGINT"); + process.exit(1); + }); } }); diff --git a/packages/babel-node/test/index.js b/packages/babel-node/test/index.js index 6e48f0f2abb29..4643475255e80 100644 --- a/packages/babel-node/test/index.js +++ b/packages/babel-node/test/index.js @@ -177,6 +177,16 @@ fs.readdirSync(fixtureLoc).forEach(function(binName) { const suiteLoc = path.join(fixtureLoc, binName); describe("bin/" + binName, function() { + let cwd; + + beforeEach(() => { + cwd = process.cwd(); + }); + + afterEach(() => { + process.chdir(cwd); + }); + fs.readdirSync(suiteLoc).forEach(function(testName) { if (testName[0] === ".") return; diff --git a/packages/babel-plugin-external-helpers/package.json b/packages/babel-plugin-external-helpers/package.json index cb7ab8253dcb6..dada76aed7c57 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-external-helpers/src/index.js b/packages/babel-plugin-external-helpers/src/index.js index d11c7f19a0ee6..219da24f9b35b 100644 --- a/packages/babel-plugin-external-helpers/src/index.js +++ b/packages/babel-plugin-external-helpers/src/index.js @@ -1,9 +1,12 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { pre(file) { file.set("helpersNamespace", t.identifier("babelHelpers")); }, }; -} +}); diff --git a/packages/babel-plugin-proposal-async-generator-functions/package.json b/packages/babel-plugin-proposal-async-generator-functions/package.json index 84cabee44325f..926ce0bc694ea 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,14 +9,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-remap-async-to-generator": "7.0.0-beta.39", - "@babel/plugin-syntax-async-generators": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/helper-remap-async-to-generator": "7.0.0-beta.42", + "@babel/plugin-syntax-async-generators": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-helper-remap-async-to-generator/src/for-await.js b/packages/babel-plugin-proposal-async-generator-functions/src/for-await.js similarity index 75% rename from packages/babel-helper-remap-async-to-generator/src/for-await.js rename to packages/babel-plugin-proposal-async-generator-functions/src/for-await.js index b9b55b615fff0..4763b2854ccf9 100644 --- a/packages/babel-helper-remap-async-to-generator/src/for-await.js +++ b/packages/babel-plugin-proposal-async-generator-functions/src/for-await.js @@ -1,8 +1,7 @@ -import * as t from "@babel/types"; -import template from "@babel/template"; +import { types as t, template } from "@babel/core"; -const awaitTemplate = ` - function* wrapper() { +const buildForAwait = template(` + async function wrapper() { var ITERATOR_COMPLETION = true; var ITERATOR_HAD_ERROR_KEY = false; var ITERATOR_ERROR_KEY; @@ -10,9 +9,9 @@ const awaitTemplate = ` for ( var ITERATOR_KEY = GET_ITERATOR(OBJECT), STEP_KEY, STEP_VALUE; ( - STEP_KEY = yield AWAIT(ITERATOR_KEY.next()), + STEP_KEY = await ITERATOR_KEY.next(), ITERATOR_COMPLETION = STEP_KEY.done, - STEP_VALUE = yield AWAIT(STEP_KEY.value), + STEP_VALUE = await STEP_KEY.value, !ITERATOR_COMPLETION ); ITERATOR_COMPLETION = true) { @@ -23,7 +22,7 @@ const awaitTemplate = ` } finally { try { if (!ITERATOR_COMPLETION && ITERATOR_KEY.return != null) { - yield AWAIT(ITERATOR_KEY.return()); + await ITERATOR_KEY.return(); } } finally { if (ITERATOR_HAD_ERROR_KEY) { @@ -32,13 +31,9 @@ const awaitTemplate = ` } } } -`; -const buildForAwait = template(awaitTemplate); -const buildForAwaitWithoutWrapping = template( - awaitTemplate.replace(/\bAWAIT\b/g, ""), -); +`); -export default function(path, { getAsyncIterator, wrapAwait }) { +export default function(path, { getAsyncIterator }) { const { node, scope, parent } = path; const stepKey = scope.generateUidIdentifier("step"); @@ -57,9 +52,7 @@ export default function(path, { getAsyncIterator, wrapAwait }) { t.variableDeclarator(left.declarations[0].id, stepValue), ]); } - - const build = wrapAwait ? buildForAwait : buildForAwaitWithoutWrapping; - let template = build({ + let template = buildForAwait({ ITERATOR_HAD_ERROR_KEY: scope.generateUidIdentifier("didIteratorError"), ITERATOR_COMPLETION: scope.generateUidIdentifier( "iteratorNormalCompletion", @@ -70,10 +63,9 @@ export default function(path, { getAsyncIterator, wrapAwait }) { OBJECT: node.right, STEP_VALUE: stepValue, STEP_KEY: stepKey, - ...(wrapAwait ? { AWAIT: wrapAwait } : {}), }); - // remove generator function wrapper + // remove async function wrapper template = template.body.body; const isLabeledParent = t.isLabeledStatement(parent); diff --git a/packages/babel-plugin-proposal-async-generator-functions/src/index.js b/packages/babel-plugin-proposal-async-generator-functions/src/index.js index 4c55a9787eaee..f68cdaa6a282e 100644 --- a/packages/babel-plugin-proposal-async-generator-functions/src/index.js +++ b/packages/babel-plugin-proposal-async-generator-functions/src/index.js @@ -1,8 +1,12 @@ +import { declare } from "@babel/helper-plugin-utils"; import remapAsyncToGenerator from "@babel/helper-remap-async-to-generator"; import syntaxAsyncGenerators from "@babel/plugin-syntax-async-generators"; import { types as t } from "@babel/core"; +import rewriteForAwait from "./for-await"; + +export default declare(api => { + api.assertVersion(7); -export default function() { const yieldStarVisitor = { Function(path) { path.skip(); @@ -18,19 +22,74 @@ export default function() { }, }; + const forAwaitVisitor = { + Function(path) { + path.skip(); + }, + + ForOfStatement(path, { file }) { + const { node } = path; + if (!node.await) return; + + const build = rewriteForAwait(path, { + getAsyncIterator: file.addHelper("asyncIterator"), + }); + + const { declar, loop } = build; + const block = loop.body; + + // ensure that it's a block so we can take all its statements + path.ensureBlock(); + + // add the value declaration to the new loop body + if (declar) { + block.body.push(declar); + } + + // push the rest of the original loop body onto our new body + block.body = block.body.concat(node.body.body); + + t.inherits(loop, node); + t.inherits(loop.body, node.body); + + if (build.replaceParent) { + path.parentPath.replaceWithMultiple(build.node); + } else { + path.replaceWithMultiple(build.node); + } + }, + }; + + const visitor = { + Function(path, state) { + if (!path.node.async) return; + + path.traverse(forAwaitVisitor, state); + + if (!path.node.generator) return; + + path.traverse(yieldStarVisitor, state); + + remapAsyncToGenerator(path, { + wrapAsync: state.addHelper("wrapAsyncGenerator"), + wrapAwait: state.addHelper("awaitAsyncGenerator"), + }); + }, + }; + return { inherits: syntaxAsyncGenerators, visitor: { - Function(path, state) { - if (!path.node.async || !path.node.generator) return; - - path.traverse(yieldStarVisitor, state); - - remapAsyncToGenerator(path, state.file, { - wrapAsync: state.addHelper("wrapAsyncGenerator"), - wrapAwait: state.addHelper("awaitAsyncGenerator"), - }); + Program(path, state) { + // We need to traverse the ast here (instead of just vising Function + // in the top level visitor) because for-await needs to run before the + // async-to-generator plugin. This is because for-await is transpiled + // using "await" expressions, which are then converted to "yield". + // + // This is bad for performance, but plugin ordering will allow as to + // directly visit Function in the top level visitor. + path.traverse(visitor, state); }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/for-await/async-function-no-transform/input.js b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/for-await/async-function-no-transform/input.js new file mode 100644 index 0000000000000..daedfaf473635 --- /dev/null +++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/for-await/async-function-no-transform/input.js @@ -0,0 +1,3 @@ +async function foo() { + for await (const x of y) {} +} diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/for-await/async-function-no-transform/options.json b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/for-await/async-function-no-transform/options.json new file mode 100644 index 0000000000000..5adee4863d3d9 --- /dev/null +++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/for-await/async-function-no-transform/options.json @@ -0,0 +1,6 @@ +{ + "plugins": [ + "external-helpers", + "proposal-async-generator-functions" + ] +} diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/for-await/async-function-no-transform/output.js b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/for-await/async-function-no-transform/output.js new file mode 100644 index 0000000000000..d7801fa319365 --- /dev/null +++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/for-await/async-function-no-transform/output.js @@ -0,0 +1,25 @@ +async function foo() { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + + var _iteratorError; + + try { + for (var _iterator = babelHelpers.asyncIterator(y), _step, _value; _step = await _iterator.next(), _iteratorNormalCompletion = _step.done, _value = await _step.value, !_iteratorNormalCompletion; _iteratorNormalCompletion = true) { + const x = _value; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return != null) { + await _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } +} diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/5880/input.js b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/regression/5880/input.js similarity index 100% rename from packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/5880/input.js rename to packages/babel-plugin-proposal-async-generator-functions/test/fixtures/regression/5880/input.js diff --git a/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/regression/5880/options.json b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/regression/5880/options.json new file mode 100644 index 0000000000000..94063e0c4f2ab --- /dev/null +++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/regression/5880/options.json @@ -0,0 +1,7 @@ +{ + "plugins": [ + "external-helpers", + "proposal-async-generator-functions", + "transform-destructuring" + ] +} diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/5880/output.js b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/regression/5880/output.js similarity index 75% rename from packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/5880/output.js rename to packages/babel-plugin-proposal-async-generator-functions/test/fixtures/regression/5880/output.js index f6c0f06d9ce1f..4b9e652d6cbcc 100644 --- a/packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/5880/output.js +++ b/packages/babel-plugin-proposal-async-generator-functions/test/fixtures/regression/5880/output.js @@ -1,11 +1,11 @@ -babelHelpers.asyncToGenerator(function* () { +(async () => { var _iteratorNormalCompletion = true; var _didIteratorError = false; var _iteratorError; try { - for (var _iterator = babelHelpers.asyncIterator(iterable), _step, _value; _step = yield _iterator.next(), _iteratorNormalCompletion = _step.done, _value = yield _step.value, !_iteratorNormalCompletion; _iteratorNormalCompletion = true) { + for (var _iterator = babelHelpers.asyncIterator(iterable), _step, _value; _step = await _iterator.next(), _iteratorNormalCompletion = _step.done, _value = await _step.value, !_iteratorNormalCompletion; _iteratorNormalCompletion = true) { const _value2 = _value, _value3 = babelHelpers.slicedToArray(_value2, 1), value = _value3[0]; @@ -16,7 +16,7 @@ babelHelpers.asyncToGenerator(function* () { } finally { try { if (!_iteratorNormalCompletion && _iterator.return != null) { - yield _iterator.return(); + await _iterator.return(); } } finally { if (_didIteratorError) { diff --git a/packages/babel-plugin-proposal-class-properties/package.json b/packages/babel-plugin-proposal-class-properties/package.json index f38009fb302cb..c0616ffaa56ac 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,14 +9,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-function-name": "7.0.0-beta.39", - "@babel/plugin-syntax-class-properties": "7.0.0-beta.39" + "@babel/helper-function-name": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-class-properties": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-proposal-class-properties/src/index.js b/packages/babel-plugin-proposal-class-properties/src/index.js index 38ecd56fbd894..a826b310ea19c 100644 --- a/packages/babel-plugin-proposal-class-properties/src/index.js +++ b/packages/babel-plugin-proposal-class-properties/src/index.js @@ -1,8 +1,11 @@ +import { declare } from "@babel/helper-plugin-utils"; import nameFunction from "@babel/helper-function-name"; import syntaxClassProperties from "@babel/plugin-syntax-class-properties"; import { template, types as t } from "@babel/core"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { loose } = options; const findBareSupers = { @@ -247,4 +250,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/general/non-block-arrow-func/input.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/general/non-block-arrow-func/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/general/non-block-arrow-func/input.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/general/non-block-arrow-func/input.mjs diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/general/non-block-arrow-func/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/general/non-block-arrow-func/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/general/non-block-arrow-func/output.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/general/non-block-arrow-func/output.mjs diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T2983/input.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T2983/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T2983/input.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T2983/input.mjs diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T2983/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T2983/output.mjs similarity index 67% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T2983/output.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T2983/output.mjs index 221316a2f1a6d..8eadb530f3506 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T2983/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T2983/output.mjs @@ -9,15 +9,15 @@ call((_temp = _class = function _class() { value: true }), _temp)); -var _class2 = function _class2() { - babelHelpers.classCallCheck(this, _class2); +var _default = function _default() { + babelHelpers.classCallCheck(this, _default); }; -Object.defineProperty(_class2, "test", { +Object.defineProperty(_default, "test", { configurable: true, enumerable: true, writable: true, value: true }); -export { _class2 as default }; +export { _default as default }; ; diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T7364/input.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T7364/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T7364/input.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T7364/input.mjs diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T7364/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T7364/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T7364/output.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/general/regression-T7364/output.mjs diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/general/static-export/input.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/general/static-export/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/general/static-export/input.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/general/static-export/input.mjs diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/general/static-export/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/general/static-export/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/general/static-export/output.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/general/static-export/output.mjs diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/loose/non-block-arrow-func/input.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/loose/non-block-arrow-func/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/loose/non-block-arrow-func/input.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/loose/non-block-arrow-func/input.mjs diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/loose/non-block-arrow-func/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/loose/non-block-arrow-func/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/loose/non-block-arrow-func/output.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/loose/non-block-arrow-func/output.mjs diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/loose/static-export/input.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/loose/static-export/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/loose/static-export/input.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/loose/static-export/input.mjs diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/loose/static-export/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/loose/static-export/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/loose/static-export/output.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/loose/static-export/output.mjs diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/6154/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/6154/output.js index c272ca164bf88..5561d047d73a5 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/6154/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/6154/output.js @@ -2,7 +2,7 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } } -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T2983/input.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T2983/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T2983/input.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T2983/input.mjs diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T2983/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T2983/output.mjs similarity index 51% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T2983/output.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T2983/output.mjs index 1ab8d181d8351..371191a12b3dd 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T2983/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T2983/output.mjs @@ -4,10 +4,10 @@ call((_temp = _class = function _class() { babelHelpers.classCallCheck(this, _class); }, _class.test = true, _temp)); -var _class2 = function _class2() { - babelHelpers.classCallCheck(this, _class2); +var _default = function _default() { + babelHelpers.classCallCheck(this, _default); }; -_class2.test = true; -export { _class2 as default }; +_default.test = true; +export { _default as default }; ; diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T7364/input.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T7364/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T7364/input.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T7364/input.mjs diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T7364/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T7364/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T7364/output.js rename to packages/babel-plugin-proposal-class-properties/test/fixtures/regression/T7364/output.mjs diff --git a/packages/babel-plugin-proposal-decorators/package.json b/packages/babel-plugin-proposal-decorators/package.json index 08637a557ba99..081f3ea25e6bf 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.0.0-beta.39", + "version": "7.0.0-beta.42", "author": "Logan Smyth ", "license": "MIT", "description": "Compile class and object decorators to ES5", @@ -12,13 +12,14 @@ "decorators" ], "dependencies": { - "@babel/plugin-syntax-decorators": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-decorators": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-proposal-decorators/src/index.js b/packages/babel-plugin-proposal-decorators/src/index.js index 67884c13023ce..fee3f43d6b246 100644 --- a/packages/babel-plugin-proposal-decorators/src/index.js +++ b/packages/babel-plugin-proposal-decorators/src/index.js @@ -1,5 +1,6 @@ // Fork of https://github.com/loganfsmyth/babel-plugin-proposal-decorators-legacy +import { declare } from "@babel/helper-plugin-utils"; import syntaxDecorators from "@babel/plugin-syntax-decorators"; import { template, types as t } from "@babel/core"; @@ -26,7 +27,9 @@ const buildGetObjectInitializer = template(` }) `); -export default function() { +export default declare(api => { + api.assertVersion(7); + const WARNING_CALLS = new WeakSet(); /** @@ -276,4 +279,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/class-export-default/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/class-export-default/exec.mjs similarity index 100% rename from packages/babel-plugin-proposal-decorators/test/fixtures/class-export-default/exec.js rename to packages/babel-plugin-proposal-decorators/test/fixtures/class-export-default/exec.mjs diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/class-decorators/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/class-decorators/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/class-decorators/input.js rename to packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/class-decorators/input.mjs diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/class-decorators/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/class-decorators/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/class-decorators/output.js rename to packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/class-decorators/output.mjs diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/method-decorators/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/method-decorators/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/method-decorators/input.js rename to packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/method-decorators/input.mjs diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/method-decorators/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/method-decorators/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/method-decorators/output.js rename to packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/method-decorators/output.mjs diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/no-decorators/input.js b/packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/no-decorators/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/no-decorators/input.js rename to packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/no-decorators/input.mjs diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/no-decorators/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/no-decorators/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/no-decorators/output.js rename to packages/babel-plugin-proposal-decorators/test/fixtures/decl-to-expression/no-decorators/output.mjs diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/regression/7030/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/regression/7030/output.js index b47a62b382feb..c21f2cdab1528 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/regression/7030/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/regression/7030/output.js @@ -4,7 +4,9 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat function _classCallCheck(instance, Constructor) { if (!_instanceof(instance, Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } diff --git a/packages/babel-plugin-proposal-do-expressions/README.md b/packages/babel-plugin-proposal-do-expressions/README.md index cc5c3aabc84c4..177c9dc22e42f 100644 --- a/packages/babel-plugin-proposal-do-expressions/README.md +++ b/packages/babel-plugin-proposal-do-expressions/README.md @@ -113,6 +113,6 @@ require("@babel/core").transform("code", { ``` ## References -- [Proposal](http://wiki.ecmascript.org/doku.php?id=strawman:do_expressions) +- [Proposal](https://github.com/tc39/proposal-do-expressions) - [You Don't Know JS](https://github.com/getify/You-Dont-Know-JS/blob/master/types%20%26%20grammar/ch5.md#statement-completion-values) - Very handy for conditions inside JSX: [reactjs/react-future#35](https://github.com/reactjs/react-future/issues/35#issuecomment-120009203) diff --git a/packages/babel-plugin-proposal-do-expressions/package.json b/packages/babel-plugin-proposal-do-expressions/package.json index 0a14c10866c6e..60d83441a2648 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile do expressions to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-do-expressions", "license": "MIT", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-do-expressions": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-do-expressions": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-proposal-do-expressions/src/index.js b/packages/babel-plugin-proposal-do-expressions/src/index.js index 731ddbb22ad2b..b9e8d6180ab95 100644 --- a/packages/babel-plugin-proposal-do-expressions/src/index.js +++ b/packages/babel-plugin-proposal-do-expressions/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxDoExpressions from "@babel/plugin-syntax-do-expressions"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { inherits: syntaxDoExpressions, @@ -17,4 +20,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-export-default-from/package.json b/packages/babel-plugin-proposal-export-default-from/package.json index ad1b8ab112101..51a40c332ab74 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile export default to ES2015", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-export-default-from", "license": "MIT", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-export-default-from": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-export-default-from": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-proposal-export-default-from/src/index.js b/packages/babel-plugin-proposal-export-default-from/src/index.js index c5c226f80bd11..204bdaa2e431b 100644 --- a/packages/babel-plugin-proposal-export-default-from/src/index.js +++ b/packages/babel-plugin-proposal-export-default-from/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxExportDefaultFrom from "@babel/plugin-syntax-export-default-from"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { inherits: syntaxExportDefaultFrom, @@ -33,4 +36,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-compound-es6/input.js b/packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-compound-es6/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-compound-es6/input.js rename to packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-compound-es6/input.mjs diff --git a/packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-compound-es6/output.js b/packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-compound-es6/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-compound-es6/output.js rename to packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-compound-es6/output.mjs diff --git a/packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-es6/input.js b/packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-es6/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-es6/input.js rename to packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-es6/input.mjs diff --git a/packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-es6/output.js b/packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-es6/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-es6/output.js rename to packages/babel-plugin-proposal-export-default-from/test/fixtures/export-default/default-es6/output.mjs diff --git a/packages/babel-plugin-proposal-export-namespace-from/package.json b/packages/babel-plugin-proposal-export-namespace-from/package.json index 3b8dc633d2d69..f1c055bab8389 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile export namespace to ES2015", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-export-namespace-from", "license": "MIT", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-export-namespace-from": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-export-namespace-from": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-proposal-export-namespace-from/src/index.js b/packages/babel-plugin-proposal-export-namespace-from/src/index.js index ec07791bebb19..3d9e4f48126b0 100644 --- a/packages/babel-plugin-proposal-export-namespace-from/src/index.js +++ b/packages/babel-plugin-proposal-export-namespace-from/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxExportNamespaceFrom from "@babel/plugin-syntax-export-namespace-from"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { inherits: syntaxExportNamespaceFrom, @@ -43,4 +46,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-compound-es6/input.js b/packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-compound-es6/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-compound-es6/input.js rename to packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-compound-es6/input.mjs diff --git a/packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-compound-es6/output.js b/packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-compound-es6/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-compound-es6/output.js rename to packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-compound-es6/output.mjs diff --git a/packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-default/input.js b/packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-default/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-default/input.js rename to packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-default/input.mjs diff --git a/packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-default/output.js b/packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-default/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-default/output.js rename to packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-default/output.mjs diff --git a/packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-es6/input.js b/packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-es6/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-es6/input.js rename to packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-es6/input.mjs diff --git a/packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-es6/output.js b/packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-es6/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-es6/output.js rename to packages/babel-plugin-proposal-export-namespace-from/test/fixtures/export-namespace/namespace-es6/output.mjs diff --git a/packages/babel-plugin-proposal-function-bind/package.json b/packages/babel-plugin-proposal-function-bind/package.json index a85836d6a5d6f..7fdd8cec7422d 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile function bind operator to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-function-bind", "license": "MIT", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-function-bind": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-function-bind": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-proposal-function-bind/src/index.js b/packages/babel-plugin-proposal-function-bind/src/index.js index ca9939d039d0b..57a6a759e3503 100644 --- a/packages/babel-plugin-proposal-function-bind/src/index.js +++ b/packages/babel-plugin-proposal-function-bind/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxFunctionBind from "@babel/plugin-syntax-function-bind"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + function getTempId(scope) { let id = scope.path.getData("functionBind"); if (id) return id; @@ -60,4 +63,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/complex-call/input.js b/packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/complex-call/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/complex-call/input.js rename to packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/complex-call/input.mjs diff --git a/packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/complex-call/output.js b/packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/complex-call/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/complex-call/output.js rename to packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/complex-call/output.mjs diff --git a/packages/babel-plugin-proposal-function-bind/test/fixtures/regression/6458/input.js b/packages/babel-plugin-proposal-function-bind/test/fixtures/regression/6458/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-function-bind/test/fixtures/regression/6458/input.js rename to packages/babel-plugin-proposal-function-bind/test/fixtures/regression/6458/input.mjs diff --git a/packages/babel-plugin-proposal-function-sent/package.json b/packages/babel-plugin-proposal-function-sent/package.json index ed80377e06c67..96ade28156593 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile the function.sent meta propety to valid ES2015 code", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-function-sent", "license": "MIT", @@ -9,14 +9,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-wrap-function": "7.0.0-beta.39", - "@babel/plugin-syntax-function-sent": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/helper-wrap-function": "7.0.0-beta.42", + "@babel/plugin-syntax-function-sent": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-proposal-function-sent/src/index.js b/packages/babel-plugin-proposal-function-sent/src/index.js index 008f8dc88fc61..16237e0ac40c2 100644 --- a/packages/babel-plugin-proposal-function-sent/src/index.js +++ b/packages/babel-plugin-proposal-function-sent/src/index.js @@ -1,8 +1,11 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxFunctionSent from "@babel/plugin-syntax-function-sent"; import wrapFunction from "@babel/helper-wrap-function"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + const isFunctionSent = node => t.isIdentifier(node.meta, { name: "function" }) && t.isIdentifier(node.property, { name: "sent" }); @@ -57,4 +60,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-anonymous/input.js b/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-anonymous/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-anonymous/input.js rename to packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-anonymous/input.mjs diff --git a/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-anonymous/output.js b/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-anonymous/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-anonymous/output.js rename to packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-anonymous/output.mjs diff --git a/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-named/input.js b/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-named/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-named/input.js rename to packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-named/input.mjs diff --git a/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-named/output.js b/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-named/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-named/output.js rename to packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export-default-named/output.mjs diff --git a/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export/input.js b/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export/input.js rename to packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export/input.mjs diff --git a/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export/output.js b/packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export/output.js rename to packages/babel-plugin-proposal-function-sent/test/fixtures/generator-kinds/export/output.mjs diff --git a/packages/babel-plugin-proposal-logical-assignment-operators/.npmignore b/packages/babel-plugin-proposal-logical-assignment-operators/.npmignore new file mode 100644 index 0000000000000..f9806945836eb --- /dev/null +++ b/packages/babel-plugin-proposal-logical-assignment-operators/.npmignore @@ -0,0 +1,3 @@ +src +test +*.log diff --git a/packages/babel-plugin-proposal-logical-assignment-operators/README.md b/packages/babel-plugin-proposal-logical-assignment-operators/README.md new file mode 100644 index 0000000000000..26fbaddfb7742 --- /dev/null +++ b/packages/babel-plugin-proposal-logical-assignment-operators/README.md @@ -0,0 +1,63 @@ +# @babel/plugin-proposal-logical-assignment-operator + +> Transforms logical assignment operators into short-circuited assignments + +## Example + +**In** + +```javascript +a ||= b; +obj.a.b ||= c; + +a &&= b; +obj.a.b &&= c; +``` + +**Out** + +```javascript +var _obj$a, _obj$a2; + +a || (a = b); +(_obj$a = obj.a).b || (_obj$a.b = c); + +a && (a = b); +(_obj$a2 = obj.a).b && (_obj$a2.b = c); +``` + +## Installation + +```sh +npm install --save-dev @babel/plugin-proposal-logical-assignment-operators +``` + +## Usage + +### Via `.babelrc` (Recommended) + +**.babelrc** + +```json +{ + "plugins": ["@babel/plugin-proposal-logical-assignment-operators"] +} +``` + +### Via CLI + +```sh +babel --plugins @babel/plugin-proposal-logical-assignment-operators script.js +``` + +### Via Node API + +```javascript +require("@babel/core").transform("code", { + plugins: ["@babel/plugin-proposal-logical-assignment-operators"] +}); +``` + +## References + +* [Proposal: Logical Assignment Operators](https://github.com/jridgewell/proposal-logical-assignment-operators) diff --git a/packages/babel-plugin-proposal-logical-assignment-operators/package.json b/packages/babel-plugin-proposal-logical-assignment-operators/package.json new file mode 100644 index 0000000000000..d1547eb140dd7 --- /dev/null +++ b/packages/babel-plugin-proposal-logical-assignment-operators/package.json @@ -0,0 +1,22 @@ +{ + "name": "@babel/plugin-proposal-logical-assignment-operators", + "version": "7.0.0-beta.42", + "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", + "main": "lib", + "keywords": [ + "babel-plugin" + ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-logical-assignment-operators": "7.0.0-beta.42" + }, + "peerDependencies": { + "@babel/core": "7.0.0-beta.42" + }, + "devDependencies": { + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" + } +} diff --git a/packages/babel-plugin-proposal-logical-assignment-operators/src/index.js b/packages/babel-plugin-proposal-logical-assignment-operators/src/index.js new file mode 100644 index 0000000000000..8c3c2e15f020f --- /dev/null +++ b/packages/babel-plugin-proposal-logical-assignment-operators/src/index.js @@ -0,0 +1,45 @@ +import { declare } from "@babel/helper-plugin-utils"; +import syntaxLogicalAssignmentOperators from "@babel/plugin-syntax-logical-assignment-operators"; +import { types as t } from "@babel/core"; + +export default declare(api => { + api.assertVersion(7); + + return { + inherits: syntaxLogicalAssignmentOperators, + + visitor: { + AssignmentExpression(path) { + const { node, scope } = path; + const { operator, left, right } = node; + if (operator !== "||=" && operator !== "&&=") { + return; + } + + let ref; + if (t.isMemberExpression(left)) { + const { object } = left; + const memo = scope.maybeGenerateMemoised(object); + if (memo) { + path + .get("left.object") + .replaceWith( + t.assignmentExpression("=", t.cloneNode(memo), object), + ); + + ref = t.cloneNode(left); + ref.object = t.cloneNode(memo); + } + } + + path.replaceWith( + t.logicalExpression( + operator.slice(0, -1), + left, + t.assignmentExpression("=", ref || t.cloneNode(left), right), + ), + ); + }, + }, + }; +}); diff --git a/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/general-semantics/exec.js b/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/general-semantics/exec.js new file mode 100644 index 0000000000000..57865464cd716 --- /dev/null +++ b/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/general-semantics/exec.js @@ -0,0 +1,40 @@ +var x = 0; +var sets = 0; +var obj = { + get x() { + return x; + }, + + set x(value) { + sets++; + x = value; + }, +}; + +assert.equal(obj.x ||= 1, 1); +assert.equal(sets, 1); +assert.equal(obj.x ||= 2, 1); +assert.equal(sets, 1); + +assert.equal(obj.x &&= 0, 0); +assert.equal(sets, 2); +assert.equal(obj.x &&= 3, 0); +assert.equal(sets, 2); + +var gets = 0; +var deep = { + get obj() { + gets++; + return obj; + }, +}; + +assert.equal(deep.obj.x ||= 1, 1); +assert.equal(gets, 1); +assert.equal(deep.obj.x ||= 2, 1); +assert.equal(gets, 2); + +assert.equal(deep.obj.x &&= 0, 0); +assert.equal(gets, 3); +assert.equal(deep.obj.x &&= 3, 0); +assert.equal(gets, 4); diff --git a/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/general-semantics/input.js b/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/general-semantics/input.js new file mode 100644 index 0000000000000..57865464cd716 --- /dev/null +++ b/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/general-semantics/input.js @@ -0,0 +1,40 @@ +var x = 0; +var sets = 0; +var obj = { + get x() { + return x; + }, + + set x(value) { + sets++; + x = value; + }, +}; + +assert.equal(obj.x ||= 1, 1); +assert.equal(sets, 1); +assert.equal(obj.x ||= 2, 1); +assert.equal(sets, 1); + +assert.equal(obj.x &&= 0, 0); +assert.equal(sets, 2); +assert.equal(obj.x &&= 3, 0); +assert.equal(sets, 2); + +var gets = 0; +var deep = { + get obj() { + gets++; + return obj; + }, +}; + +assert.equal(deep.obj.x ||= 1, 1); +assert.equal(gets, 1); +assert.equal(deep.obj.x ||= 2, 1); +assert.equal(gets, 2); + +assert.equal(deep.obj.x &&= 0, 0); +assert.equal(gets, 3); +assert.equal(deep.obj.x &&= 3, 0); +assert.equal(gets, 4); diff --git a/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/general-semantics/options.json b/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/general-semantics/options.json new file mode 100644 index 0000000000000..259c77d8e49cf --- /dev/null +++ b/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/general-semantics/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["proposal-logical-assignment-operators"] +} diff --git a/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/general-semantics/output.js b/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/general-semantics/output.js new file mode 100644 index 0000000000000..fb5c9b38b482f --- /dev/null +++ b/packages/babel-plugin-proposal-logical-assignment-operators/test/fixtures/logical-assignment/general-semantics/output.js @@ -0,0 +1,39 @@ +var _deep$obj, _deep$obj2, _deep$obj3, _deep$obj4; + +var x = 0; +var sets = 0; +var obj = { + get x() { + return x; + }, + + set x(value) { + sets++; + x = value; + } + +}; +assert.equal(obj.x || (obj.x = 1), 1); +assert.equal(sets, 1); +assert.equal(obj.x || (obj.x = 2), 1); +assert.equal(sets, 1); +assert.equal(obj.x && (obj.x = 0), 0); +assert.equal(sets, 2); +assert.equal(obj.x && (obj.x = 3), 0); +assert.equal(sets, 2); +var gets = 0; +var deep = { + get obj() { + gets++; + return obj; + } + +}; +assert.equal((_deep$obj = deep.obj).x || (_deep$obj.x = 1), 1); +assert.equal(gets, 1); +assert.equal((_deep$obj2 = deep.obj).x || (_deep$obj2.x = 2), 1); +assert.equal(gets, 2); +assert.equal((_deep$obj3 = deep.obj).x && (_deep$obj3.x = 0), 0); +assert.equal(gets, 3); +assert.equal((_deep$obj4 = deep.obj).x && (_deep$obj4.x = 3), 0); +assert.equal(gets, 4); diff --git a/packages/babel-plugin-proposal-logical-assignment-operators/test/index.js b/packages/babel-plugin-proposal-logical-assignment-operators/test/index.js new file mode 100644 index 0000000000000..1b534b8fc64af --- /dev/null +++ b/packages/babel-plugin-proposal-logical-assignment-operators/test/index.js @@ -0,0 +1,3 @@ +import runner from "@babel/helper-plugin-test-runner"; + +runner(__dirname); diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/README.md b/packages/babel-plugin-proposal-nullish-coalescing-operator/README.md index d433354f269b2..2b01b5f2a864f 100644 --- a/packages/babel-plugin-proposal-nullish-coalescing-operator/README.md +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/README.md @@ -60,7 +60,7 @@ require("@babel/core").transform("code", { `boolean`, defaults to `false`. When `true`, this transform will pretend `document.all` does not exist, -and perform loose equality checks with `null` instead of string equality checks +and perform loose equality checks with `null` instead of strict equality checks against both `null` and `undefined`. #### Example diff --git a/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json b/packages/babel-plugin-proposal-nullish-coalescing-operator/package.json index 383ce8994cc0b..ceeb90295f8ea 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Remove nullish coalescing operator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-nullish-coalescing-opearator", "license": "MIT", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-nullish-coalescing-operator": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-nullish-coalescing-operator": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } 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 b9469081af355..454b4c057a8c7 100644 --- a/packages/babel-plugin-proposal-nullish-coalescing-operator/src/index.js +++ b/packages/babel-plugin-proposal-nullish-coalescing-operator/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxNullishCoalescingOperator from "@babel/plugin-syntax-nullish-coalescing-operator"; import { types as t } from "@babel/core"; -export default function(api, { loose = false }) { +export default declare((api, { loose = false }) => { + api.assertVersion(7); + return { inherits: syntaxNullishCoalescingOperator, @@ -43,4 +46,4 @@ export default function(api, { loose = false }) { }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-numeric-separator/package.json b/packages/babel-plugin-proposal-numeric-separator/package.json index a386ac4fd28e4..1ce1d3b838d50 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-numeric-separator": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-numeric-separator": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-proposal-numeric-separator/src/index.js b/packages/babel-plugin-proposal-numeric-separator/src/index.js index d81cc3f98f885..822ade1b8c4de 100644 --- a/packages/babel-plugin-proposal-numeric-separator/src/index.js +++ b/packages/babel-plugin-proposal-numeric-separator/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxNumericSeparator from "@babel/plugin-syntax-numeric-separator"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + function replaceNumberArg({ node }) { if (node.callee.name !== "Number") { return; @@ -29,4 +32,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-object-rest-spread/README.md b/packages/babel-plugin-proposal-object-rest-spread/README.md index f5beaa4df9819..9c1b785b94bcb 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/README.md +++ b/packages/babel-plugin-proposal-object-rest-spread/README.md @@ -54,18 +54,33 @@ require("@babel/core").transform("code", { ## Options +By default, this plugin will produce spec compliant code by using Babel's `objectSpread` helper. + +### `loose` + +`boolean`, defaults to `false`. + +Enabling this option will use Babel's `extends` helper, which is basically the same as `Object.assign` (see `useBuiltIns` below to use it directly). + +:warning: Please keep in mind that even if they're almost equivalent, there's an important difference between spread and `Object.assign`: **spread _defines_ new properties, while `Object.assign()` _sets_ them**, so using this mode might produce unexpected results in some cases. + +For detailed information please check out [Spread VS. Object.assign](http://2ality.com/2016/10/rest-spread-properties.html#spreading-objects-versus-objectassign) and [Assigning VS. defining properties](http://exploringjs.com/es6/ch_oop-besides-classes.html#sec_assigning-vs-defining-properties). + + ### `useBuiltIns` `boolean`, defaults to `false`. -By default, this plugin uses Babel's `extends` helper which polyfills `Object.assign`. Enabling this option will use `Object.assign` directly. +Enabling this option will use `Object.assign` directly instead of the Babel's `extends` helper. + +##### Example **.babelrc** ```json { "plugins": [ - ["@babel/plugin-proposal-object-rest-spread", { "useBuiltIns": true }] + ["@babel/plugin-proposal-object-rest-spread", { "loose": true, "useBuiltIns": true }] ] } ``` @@ -86,3 +101,5 @@ z = Object.assign({ x }, y); * [Proposal: Object Rest/Spread Properties for ECMAScript](https://github.com/sebmarkbage/ecmascript-rest-spread) * [Spec](http://sebmarkbage.github.io/ecmascript-rest-spread) +* [Spread VS. Object.assign](http://2ality.com/2016/10/rest-spread-properties.html#spreading-objects-versus-objectassign) +* [Assigning VS. defining properties](http://exploringjs.com/es6/ch_oop-besides-classes.html#sec_assigning-vs-defining-properties) diff --git a/packages/babel-plugin-proposal-object-rest-spread/package.json b/packages/babel-plugin-proposal-object-rest-spread/package.json index 49a5e00e20c7c..07bffb5b3b6ef 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } 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 7b9d854555fe1..d43a5a7b11d6f 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/src/index.js +++ b/packages/babel-plugin-proposal-object-rest-spread/src/index.js @@ -1,21 +1,46 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxObjectRestSpread from "@babel/plugin-syntax-object-rest-spread"; import { types as t } from "@babel/core"; -export default function(api, opts) { - const { useBuiltIns = false } = opts; - if (typeof useBuiltIns !== "boolean") { - throw new Error(".useBuiltIns must be a boolean, or undefined"); +export default declare((api, opts) => { + api.assertVersion(7); + + const { useBuiltIns = false, loose = false } = opts; + + if (typeof loose !== "boolean") { + throw new Error(".loose must be a boolean, or undefined"); + } + + function getExtendsHelper(file) { + return useBuiltIns + ? t.memberExpression(t.identifier("Object"), t.identifier("assign")) + : file.addHelper("extends"); } function hasRestElement(path) { let foundRestElement = false; + visitRestElements(path, () => { + foundRestElement = true; + path.stop(); + }); + return foundRestElement; + } + + function visitRestElements(path, visitor) { path.traverse({ - RestElement() { - foundRestElement = true; - path.stop(); + Expression(path) { + const parentType = path.parent.type; + if ( + (parentType == "AssignmentPattern" && path.key === "right") || + (parentType == "ObjectProperty" && + path.parent.computed && + path.key === "key") + ) { + path.skip(); + } }, + RestElement: visitor, }); - return foundRestElement; } function hasSpread(node) { @@ -78,6 +103,17 @@ export default function(api, opts) { const impureComputedPropertyDeclarators = replaceImpureComputedKeys(path); const { keys, allLiteral } = extractNormalizedKeys(path); + if (keys.length === 0) { + return [ + impureComputedPropertyDeclarators, + restElement.argument, + t.callExpression(getExtendsHelper(file), [ + t.objectExpression([]), + t.cloneNode(objRef), + ]), + ]; + } + let keyExpression; if (!allLiteral) { // map to toPropertyKey to handle the possible non-string values @@ -146,108 +182,102 @@ export default function(api, opts) { } let insertionPath = path; + const originalPath = path; + + visitRestElements(path.get("id"), 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; + } - path.get("id").traverse( - { - RestElement(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; - } - - if ( - // skip single-property case, e.g. - // const { ...x } = foo(); - // since the RHS will not be duplicated - this.originalPath.node.id.properties.length > 1 && - !t.isIdentifier(this.originalPath.node.init) - ) { - // const { a, ...b } = foo(); - // to avoid calling foo() twice, as a first step convert it to: - // const _foo = foo(), - // { a, ...b } = _foo; - const initRef = path.scope.generateUidIdentifierBasedOnNode( - this.originalPath.node.init, - "ref", - ); - // insert _foo = foo() - this.originalPath.insertBefore( - t.variableDeclarator(initRef, this.originalPath.node.init), - ); - // replace foo() with _foo - this.originalPath.replaceWith( - t.variableDeclarator( - this.originalPath.node.id, - t.cloneNode(initRef), - ), - ); - - return; - } - - let ref = this.originalPath.node.init; - const refPropertyPath = []; - let kind; - - path.findParent(path => { - if (path.isObjectProperty()) { - refPropertyPath.unshift(path.node.key.name); - } 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 objectPatternPath = path.findParent(path => - path.isObjectPattern(), - ); - const [ - impureComputedPropertyDeclarators, - argument, - callExpression, - ] = createObjectSpread(objectPatternPath, file, ref); - - t.assertIdentifier(argument); - - insertionPath.insertBefore(impureComputedPropertyDeclarators); - - insertionPath.insertAfter( - t.variableDeclarator(argument, callExpression), - ); - - insertionPath = insertionPath.getSibling(insertionPath.key + 1); - - path.scope.registerBinding(kind, insertionPath); - - if (objectPatternPath.node.properties.length === 0) { - objectPatternPath - .findParent( - path => - path.isObjectProperty() || path.isVariableDeclarator(), - ) - .remove(); - } - }, - }, - { - originalPath: path, - }, - ); + if ( + // skip single-property case, e.g. + // const { ...x } = foo(); + // since the RHS will not be duplicated + originalPath.node.id.properties.length > 1 && + !t.isIdentifier(originalPath.node.init) + ) { + // const { a, ...b } = foo(); + // to avoid calling foo() twice, as a first step convert it to: + // const _foo = foo(), + // { a, ...b } = _foo; + const initRef = path.scope.generateUidIdentifierBasedOnNode( + originalPath.node.init, + "ref", + ); + // insert _foo = foo() + originalPath.insertBefore( + t.variableDeclarator(initRef, originalPath.node.init), + ); + // replace foo() with _foo + originalPath.replaceWith( + t.variableDeclarator(originalPath.node.id, t.cloneNode(initRef)), + ); + + return; + } + + let ref = originalPath.node.init; + const refPropertyPath = []; + let kind; + + path.findParent(path => { + if (path.isObjectProperty()) { + refPropertyPath.unshift(path.node.key.name); + } 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 objectPatternPath = path.findParent(path => + path.isObjectPattern(), + ); + const [ + impureComputedPropertyDeclarators, + argument, + callExpression, + ] = createObjectSpread(objectPatternPath, file, ref); + + t.assertIdentifier(argument); + + insertionPath.insertBefore(impureComputedPropertyDeclarators); + + insertionPath.insertAfter( + t.variableDeclarator(argument, callExpression), + ); + + insertionPath = insertionPath.getSibling(insertionPath.key + 1); + + path.scope.registerBinding(kind, insertionPath); + + if (objectPatternPath.node.properties.length === 0) { + objectPatternPath + .findParent( + path => path.isObjectProperty() || path.isVariableDeclarator(), + ) + .remove(); + } + }); }, // taken from transform-destructuring/src/index.js#visitor // export var { a, ...b } = c; ExportNamedDeclaration(path) { const declaration = path.get("declaration"); if (!declaration.isVariableDeclaration()) return; - if (!hasRestElement(declaration)) return; + + const hasRest = declaration + .get("declarations") + .some(path => hasRestElement(path.get("id"))); + if (!hasRest) return; const specifiers = []; @@ -366,6 +396,10 @@ export default function(api, opts) { props = []; } + if (t.isSpreadElement(path.node.properties[0])) { + args.push(t.objectExpression([])); + } + for (const prop of (path.node.properties: Array)) { if (t.isSpreadElement(prop)) { push(); @@ -377,16 +411,15 @@ export default function(api, opts) { push(); - if (!t.isObjectExpression(args[0])) { - args.unshift(t.objectExpression([])); + let helper; + if (loose) { + helper = getExtendsHelper(file); + } else { + helper = file.addHelper("objectSpread"); } - const helper = useBuiltIns - ? t.memberExpression(t.identifier("Object"), t.identifier("assign")) - : file.addHelper("extends"); - path.replaceWith(t.callExpression(helper, args)); }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/catch-clause/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/catch-clause/output.js index bf49f3ad4e9bd..3d2528632ed1b 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/catch-clause/output.js +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/catch-clause/output.js @@ -1,5 +1,5 @@ try {} catch (_ref) { - let a34 = babelHelpers.objectWithoutProperties(_ref, []); + let a34 = babelHelpers.extends({}, _ref); } try {} catch (_ref2) { diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/duplicate-decl-bug/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/duplicate-decl-bug/output.js index 87abb8f817a16..0be57aba8d68e 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/duplicate-decl-bug/output.js +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/duplicate-decl-bug/output.js @@ -3,5 +3,5 @@ it("es7.objectRestSpread", () => { a: 1, b: 2 }; - let copy = babelHelpers.objectWithoutProperties(original, []); + let copy = babelHelpers.extends({}, original); }); diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/export/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/export/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/export/input.js rename to packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/export/input.mjs diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/export/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/export/output.mjs similarity index 100% rename from packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/export/output.js rename to packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/export/output.mjs diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-computed-key/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-computed-key/input.js new file mode 100644 index 0000000000000..74d87a14954b5 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-computed-key/input.js @@ -0,0 +1,6 @@ +const { + [({ ...rest }) => { + let { ...b } = {}; + }]: a, + [({ ...d } = {})]: c, +} = {}; \ No newline at end of file diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-computed-key/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-computed-key/output.js new file mode 100644 index 0000000000000..fd457cfdc6636 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-computed-key/output.js @@ -0,0 +1,9 @@ +var _ref2; + +const { + [(_ref) => { + let rest = babelHelpers.extends({}, _ref); + let b = babelHelpers.extends({}, {}); + }]: a, + [(_ref2 = {}, ({} = _ref2), d = babelHelpers.extends({}, _ref2), _ref2)]: c +} = {}; diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-default-value/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-default-value/input.js new file mode 100644 index 0000000000000..7537d685b3d87 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-default-value/input.js @@ -0,0 +1,6 @@ +const { + a = ({ ...rest }) => { + let { ...b } = {}; + }, + c = ({ ...d } = {}), +} = {}; \ No newline at end of file diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-default-value/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-default-value/output.js new file mode 100644 index 0000000000000..f1ad422c4de08 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-default-value/output.js @@ -0,0 +1,9 @@ +var _ref2; + +const { + a = (_ref) => { + let rest = babelHelpers.extends({}, _ref); + let b = babelHelpers.extends({}, {}); + }, + c = (_ref2 = {}, ({} = _ref2), d = babelHelpers.extends({}, _ref2), _ref2) +} = {}; diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-order/exec.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-order/exec.js new file mode 100644 index 0000000000000..bdccb5b708b40 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-order/exec.js @@ -0,0 +1,21 @@ +var result = ""; + +var obj = { + get foo() { + result += "foo" + }, + a: { + get bar() { + result += "bar"; + } + }, + b: { + get baz() { + result += "baz"; + } + } +}; + +var { a: { ...bar }, b: { ...baz }, ...foo } = obj; + +assert.strictEqual(result, "barbazfoo"); \ No newline at end of file diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-order/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-order/input.js new file mode 100644 index 0000000000000..76876286cd230 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-order/input.js @@ -0,0 +1 @@ +const { a: { ...bar }, b: { ...baz }, ...foo } = obj; \ No newline at end of file diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-order/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-order/output.js new file mode 100644 index 0000000000000..f9973cfc45a59 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/nested-order/output.js @@ -0,0 +1,3 @@ +const bar = babelHelpers.extends({}, obj.a), + baz = babelHelpers.extends({}, obj.b), + foo = babelHelpers.extends({}, obj); diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/parameters/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/parameters/output.js index 39cbd5c047064..3fcf29325f962 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/parameters/output.js +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/parameters/output.js @@ -1,5 +1,5 @@ function a(_ref) { - let a34 = babelHelpers.objectWithoutProperties(_ref, []); + let a34 = babelHelpers.extends({}, _ref); } function a2(_ref2) { @@ -57,7 +57,7 @@ function a7(_ref8 = {}) { } function a8([_ref9]) { - let a1 = babelHelpers.objectWithoutProperties(_ref9, []); + let a1 = babelHelpers.extends({}, _ref9); } function a9([_ref10]) { @@ -68,7 +68,7 @@ function a9([_ref10]) { } function a10([a1, _ref11]) { - let a2 = babelHelpers.objectWithoutProperties(_ref11, []); + let a2 = babelHelpers.extends({}, _ref11); } // Unchanged diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/variable-destructuring/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/variable-destructuring/output.js index 0bebdd2fa2248..6772f31baf398 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/variable-destructuring/output.js +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-rest/variable-destructuring/output.js @@ -1,10 +1,10 @@ var z = {}; -var x = babelHelpers.objectWithoutProperties(z, []); -var a = babelHelpers.objectWithoutProperties({ +var x = babelHelpers.extends({}, z); +var a = babelHelpers.extends({}, { a: 1 -}, []); -var x = babelHelpers.objectWithoutProperties(a.b, []); -var x = babelHelpers.objectWithoutProperties(a(), []); +}); +var x = babelHelpers.extends({}, a.b); +var x = babelHelpers.extends({}, a()); var { x1 } = z, @@ -36,7 +36,7 @@ let { } } = complex, asdf = babelHelpers.objectWithoutProperties(complex.x, ["a", d].map(babelHelpers.toPropertyKey)), - d = babelHelpers.objectWithoutProperties(complex.y, []), + d = babelHelpers.extends({}, complex.y), g = babelHelpers.objectWithoutProperties(complex, ["x"]); let {} = z, - y4 = babelHelpers.objectWithoutProperties(z.x4, []); + y4 = babelHelpers.extends({}, z.x4); 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 b5926abf94ca9..33939f0e46221 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,9 +1,11 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? 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; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } -z = _extends({ +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; } + +z = _objectSpread({ x }, y); z = { x, - w: _extends({}, y) + w: _objectSpread({}, y) }; diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/expression/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/expression/input.js index e03ef8bdb2f54..2fd31d2ffdace 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/expression/input.js +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/expression/input.js @@ -1 +1,7 @@ ({ x, ...y, a, ...b, c }); + +({ ...Object.prototype }); + +({ ...{ foo: 'bar' } }); + +({ ...{ get foo () { return 'foo' } } }); 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 5d69448744d1f..11eb0dfa987d1 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,9 +1,24 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? 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; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } -_extends({ +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; } + +_objectSpread({ x }, y, { a }, b, { c }); + +_objectSpread({}, Object.prototype); + +_objectSpread({}, { + foo: 'bar' +}); + +_objectSpread({}, { + get foo() { + return 'foo'; + } + +}); diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode-builtins/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode-builtins/input.js new file mode 100644 index 0000000000000..6f0367fb7c701 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode-builtins/input.js @@ -0,0 +1,3 @@ +z = { x, ...y }; + +z = { x, w: { ...y } }; diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode-builtins/options.json b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode-builtins/options.json new file mode 100644 index 0000000000000..9adc9bd0890d2 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode-builtins/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + ["proposal-object-rest-spread", { "loose": true, "useBuiltIns": true }] + ] +} diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode-builtins/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode-builtins/output.js new file mode 100644 index 0000000000000..457fa6a6069d3 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode-builtins/output.js @@ -0,0 +1,7 @@ +z = Object.assign({ + x +}, y); +z = { + x, + w: Object.assign({}, y) +}; diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode/input.js new file mode 100644 index 0000000000000..6f0367fb7c701 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode/input.js @@ -0,0 +1,3 @@ +z = { x, ...y }; + +z = { x, w: { ...y } }; diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode/options.json b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode/options.json new file mode 100644 index 0000000000000..7f3c40b6a6e8e --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + ["proposal-object-rest-spread", { "loose": true }] + ] +} diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode/output.js new file mode 100644 index 0000000000000..b5926abf94ca9 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/loose-mode/output.js @@ -0,0 +1,9 @@ +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } + +z = _extends({ + x +}, y); +z = { + x, + w: _extends({}, y) +}; diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/no-object-assign-exec/exec.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/no-object-assign-exec/exec.js new file mode 100644 index 0000000000000..c3115b2ba17d6 --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/object-spread/no-object-assign-exec/exec.js @@ -0,0 +1,40 @@ +Object.defineProperty(Object.prototype, 'NOSET', { + set(value) { + // noop + }, +}); + +Object.defineProperty(Object.prototype, 'NOWRITE', { + writable: false, + value: 'abc', +}); + +const obj = { NOSET: 123 }; +// this wouldn't work as expected if transformed as Object.assign (or equivalent) +// because those trigger object setters (spread don't) +const objSpread = { ...obj }; + +const obj2 = { NOSET: 123, NOWRITE: 456 }; +// this line would throw `TypeError: Cannot assign to read only property 'NOWRITE'` +// if transformed as Object.assign (or equivalent) because those use *assignment* for creating properties +// (spread defines them) +const obj2Spread = { ...obj2 }; + +assert.deepEqual(obj, objSpread); +assert.deepEqual(obj2, obj2Spread); + +const KEY = Symbol('key'); +const obj3Spread = { ...{ get foo () { return 'bar' } }, [KEY]: 'symbol' }; +assert.equal(Object.getOwnPropertyDescriptor(obj3Spread, 'foo').value, 'bar'); +assert.equal(Object.getOwnPropertyDescriptor(obj3Spread, KEY).value, 'symbol'); + +const obj4Spread = { ...Object.prototype }; +assert.isUndefined(Object.getOwnPropertyDescriptor(obj4Spread, 'hasOwnProperty')); + +assert.doesNotThrow(() => ({ ...null, ...undefined })); + +const o = Object.create(null); +o.a = 'foo'; +o.__proto__ = []; +const o2 = { ...o }; +assert.equal(false, Array.isArray(Object.getPrototypeOf(o2))); 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 73be92643eb77..0bfa38715a446 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,3 +1,5 @@ -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? 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; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } -var z = _extends({}, x); +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; } + +var z = _objectSpread({}, x); diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/T7178/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/T7178/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/T7178/input.js rename to packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/T7178/input.mjs diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/T7178/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/T7178/output.js index 328e6aaa237f7..356e9f948f372 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/T7178/output.js +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/T7178/output.js @@ -5,6 +5,6 @@ var _props = babelHelpers.interopRequireDefault(require("props")); console.log(_props.default); (function () { - const props = babelHelpers.objectWithoutProperties(this.props, []); + const props = babelHelpers.extends({}, this.props); console.log(props); })(); diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-5151/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-5151/output.js index 1018162504987..23255c44a7898 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-5151/output.js +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-5151/output.js @@ -3,7 +3,7 @@ const { } = a, y = babelHelpers.objectWithoutProperties(a, ["x"]), z = foo(y); -const s = babelHelpers.objectWithoutProperties(r, []), +const s = babelHelpers.extends({}, r), t = foo(s); // ordering is preserved var l = foo(), diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7304/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7304/input.mjs similarity index 100% rename from packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7304/input.js rename to packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7304/input.mjs diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7304/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7304/output.js index b0abfb9a44aa3..f162415e914eb 100644 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7304/output.js +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7304/output.js @@ -7,7 +7,7 @@ exports.default = void 0; class _default { method(_ref) { - let object = babelHelpers.objectWithoutProperties(_ref, []); + let object = Object.assign({}, _ref); } } diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7388/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7388/input.js new file mode 100644 index 0000000000000..a311921880c3a --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7388/input.js @@ -0,0 +1,12 @@ +function fn0(obj0) { + const { + fn1 = (obj1 = {}) => { + const { + fn2 = (obj2 = {}) => { + const {a, ...rest} = obj2; + console.log(rest); + } + } = obj1; + } + } = obj0; +} diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7388/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7388/output.js new file mode 100644 index 0000000000000..97254741cbeab --- /dev/null +++ b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/regression/gh-7388/output.js @@ -0,0 +1,15 @@ +function fn0(obj0) { + const { + fn1 = (obj1 = {}) => { + const { + fn2 = (obj2 = {}) => { + const { + a + } = obj2, + rest = babelHelpers.objectWithoutProperties(obj2, ["a"]); + console.log(rest); + } + } = obj1; + } + } = obj0; +} diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/assignment-invalid-option/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/assignment-invalid-option/input.js deleted file mode 100644 index 8d610842d85f6..0000000000000 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/assignment-invalid-option/input.js +++ /dev/null @@ -1 +0,0 @@ -z = { x, ...y }; diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/assignment-invalid-option/options.json b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/assignment-invalid-option/options.json deleted file mode 100644 index b3c8b7856dca2..0000000000000 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/assignment-invalid-option/options.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "plugins": [["proposal-object-rest-spread", { "useBuiltIns": "invalidOption" }]], - "throws": ".useBuiltIns must be a boolean, or undefined" -} diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/assignment-true/input.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/assignment-true/input.js deleted file mode 100644 index 8d610842d85f6..0000000000000 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/assignment-true/input.js +++ /dev/null @@ -1 +0,0 @@ -z = { x, ...y }; diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/assignment-true/output.js b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/assignment-true/output.js deleted file mode 100644 index 0bf9ce91beac0..0000000000000 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/assignment-true/output.js +++ /dev/null @@ -1,3 +0,0 @@ -z = Object.assign({ - x -}, y); diff --git a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/options.json b/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/options.json deleted file mode 100644 index 6efcc3ceb44d4..0000000000000 --- a/packages/babel-plugin-proposal-object-rest-spread/test/fixtures/useBuiltIns/options.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "plugins": [["proposal-object-rest-spread", { "useBuiltIns": true }]] -} diff --git a/packages/babel-plugin-proposal-optional-catch-binding/package.json b/packages/babel-plugin-proposal-optional-catch-binding/package.json index 31f337ef1aaee..8c1b484c906fc 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile optional catch bindings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-catch-binding", "license": "MIT", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-proposal-optional-catch-binding/src/index.js b/packages/babel-plugin-proposal-optional-catch-binding/src/index.js index 8c2758fec20f4..f3f0daa99a0ee 100644 --- a/packages/babel-plugin-proposal-optional-catch-binding/src/index.js +++ b/packages/babel-plugin-proposal-optional-catch-binding/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxOptionalCatchBinding from "@babel/plugin-syntax-optional-catch-binding"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { inherits: syntaxOptionalCatchBinding, @@ -14,4 +17,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-optional-chaining/package.json b/packages/babel-plugin-proposal-optional-chaining/package.json index 3dc2ff74191e8..52b6635f0684a 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-optional-chaining": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-optional-chaining": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-proposal-optional-chaining/src/index.js b/packages/babel-plugin-proposal-optional-chaining/src/index.js index 1a854c082bdbe..0da7c84238bcf 100644 --- a/packages/babel-plugin-proposal-optional-chaining/src/index.js +++ b/packages/babel-plugin-proposal-optional-chaining/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxOptionalChaining from "@babel/plugin-syntax-optional-chaining"; import { types as t } from "@babel/core"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { loose = false } = options; function optional(path, replacementPath) { @@ -136,4 +139,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-pipeline-operator/package.json b/packages/babel-plugin-proposal-pipeline-operator/package.json index 64f11507dbea1..1ea6c1e4b2f53 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Transform pipeline operator into call expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-pipeline-operator", "license": "MIT", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-pipeline-operator": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-pipeline-operator": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-proposal-pipeline-operator/src/index.js b/packages/babel-plugin-proposal-pipeline-operator/src/index.js index e96bd2231a9a4..c56b5c84255d9 100644 --- a/packages/babel-plugin-proposal-pipeline-operator/src/index.js +++ b/packages/babel-plugin-proposal-pipeline-operator/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxPipelineOperator from "@babel/plugin-syntax-pipeline-operator"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { inherits: syntaxPipelineOperator, @@ -57,4 +60,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-throw-expressions/README.md b/packages/babel-plugin-proposal-throw-expressions/README.md index ee7756895e4d5..5ffb4de615e21 100644 --- a/packages/babel-plugin-proposal-throw-expressions/README.md +++ b/packages/babel-plugin-proposal-throw-expressions/README.md @@ -44,4 +44,4 @@ require("@babel/core").transform("code", { ## References -* [Proposal: Numeric Separators](https://github.com/tc39/proposal-throw-expressions) +* [Proposal: ECMAScript throw expressions](https://github.com/tc39/proposal-throw-expressions) diff --git a/packages/babel-plugin-proposal-throw-expressions/package.json b/packages/babel-plugin-proposal-throw-expressions/package.json index be03aa5f59184..b6f5564338ce5 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Wraps Throw Expressions in an IIFE", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-throw-expressions", "license": "MIT", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-throw-expressions": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-throw-expressions": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-proposal-throw-expressions/src/index.js b/packages/babel-plugin-proposal-throw-expressions/src/index.js index f5020492637f8..17cc945784a54 100644 --- a/packages/babel-plugin-proposal-throw-expressions/src/index.js +++ b/packages/babel-plugin-proposal-throw-expressions/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxThrowExpressions from "@babel/plugin-syntax-throw-expressions"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { inherits: syntaxThrowExpressions, @@ -20,4 +23,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-proposal-unicode-property-regex/package.json b/packages/babel-plugin-proposal-unicode-property-regex/package.json index 7d80de17c86a9..d022068127ee9 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile Unicode property escapes in Unicode regular expressions to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -19,14 +19,15 @@ "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-regex": "7.0.0-beta.39", + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/helper-regex": "7.0.0-beta.42", "regexpu-core": "^4.1.3" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } 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 5da0afc52b2df..e48298ed89990 100644 --- a/packages/babel-plugin-proposal-unicode-property-regex/src/index.js +++ b/packages/babel-plugin-proposal-unicode-property-regex/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import rewritePattern from "regexpu-core"; import * as regex from "@babel/helper-regex"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { useUnicodeFlag = true } = options; if (typeof useUnicodeFlag !== "boolean") { throw new Error(".useUnicodeFlag must be a boolean, or undefined"); @@ -24,4 +27,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-syntax-async-generators/package.json b/packages/babel-plugin-syntax-async-generators/package.json index d028fe60513a6..db7f3f8caeca5 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of async generator functions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-async-generators", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-async-generators/src/index.js b/packages/babel-plugin-syntax-async-generators/src/index.js index f94586ed81c03..44e1b1dd52aab 100644 --- a/packages/babel-plugin-syntax-async-generators/src/index.js +++ b/packages/babel-plugin-syntax-async-generators/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("asyncGenerators"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-class-properties/package.json b/packages/babel-plugin-syntax-class-properties/package.json index 64d4df4a8663b..035bb27909794 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of class properties", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-class-properties", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-class-properties/src/index.js b/packages/babel-plugin-syntax-class-properties/src/index.js index 496f07c664764..8f4ee109291a0 100644 --- a/packages/babel-plugin-syntax-class-properties/src/index.js +++ b/packages/babel-plugin-syntax-class-properties/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("classProperties"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-decorators/package.json b/packages/babel-plugin-syntax-decorators/package.json index e8ebfeb0896d2..3b15523f0502a 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of decorators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-decorators", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-decorators/src/index.js b/packages/babel-plugin-syntax-decorators/src/index.js index f29917451a4b4..950d6ebc518bd 100644 --- a/packages/babel-plugin-syntax-decorators/src/index.js +++ b/packages/babel-plugin-syntax-decorators/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("decorators"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-do-expressions/package.json b/packages/babel-plugin-syntax-do-expressions/package.json index 533bb324faf12..e17cb8165c7f5 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of do expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-do-expressions", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-do-expressions/src/index.js b/packages/babel-plugin-syntax-do-expressions/src/index.js index 2b91fd23fdbb5..5105beed9c644 100644 --- a/packages/babel-plugin-syntax-do-expressions/src/index.js +++ b/packages/babel-plugin-syntax-do-expressions/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("doExpressions"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-dynamic-import/package.json b/packages/babel-plugin-syntax-dynamic-import/package.json index 59e7d4ed6b65c..1861f3f02ebb1 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of import()", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-dynamic-import", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-dynamic-import/src/index.js b/packages/babel-plugin-syntax-dynamic-import/src/index.js index bac1815edcea6..bb6dde61e46bd 100644 --- a/packages/babel-plugin-syntax-dynamic-import/src/index.js +++ b/packages/babel-plugin-syntax-dynamic-import/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("dynamicImport"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-export-default-from/package.json b/packages/babel-plugin-syntax-export-default-from/package.json index 43147cffd4067..4b424814c8321 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of export default from", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-export-default-from", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-export-default-from/src/index.js b/packages/babel-plugin-syntax-export-default-from/src/index.js index 6d7a78feea8a5..fcb0b794492c5 100644 --- a/packages/babel-plugin-syntax-export-default-from/src/index.js +++ b/packages/babel-plugin-syntax-export-default-from/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("exportDefaultFrom"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-export-namespace-from/package.json b/packages/babel-plugin-syntax-export-namespace-from/package.json index fd620b2d87720..9fbaf1f774f8e 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of export namespace from", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-export-namespace-from", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-export-namespace-from/src/index.js b/packages/babel-plugin-syntax-export-namespace-from/src/index.js index 15dfac7d900bd..21446499a6a0d 100644 --- a/packages/babel-plugin-syntax-export-namespace-from/src/index.js +++ b/packages/babel-plugin-syntax-export-namespace-from/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("exportNamespaceFrom"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-flow/package.json b/packages/babel-plugin-syntax-flow/package.json index 4b5cae07dbfe1..ec5455dcbd9e9 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of the flow syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-flow", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-flow/src/index.js b/packages/babel-plugin-syntax-flow/src/index.js index 0043b1455fe21..3ad2fbb2db4bc 100644 --- a/packages/babel-plugin-syntax-flow/src/index.js +++ b/packages/babel-plugin-syntax-flow/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("flow"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-function-bind/package.json b/packages/babel-plugin-syntax-function-bind/package.json index e67e82f47d2df..429baea7627b8 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of function bind", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-function-bind", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-function-bind/src/index.js b/packages/babel-plugin-syntax-function-bind/src/index.js index 31ddfa50c6c95..98c5082f88bcf 100644 --- a/packages/babel-plugin-syntax-function-bind/src/index.js +++ b/packages/babel-plugin-syntax-function-bind/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("functionBind"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-function-sent/package.json b/packages/babel-plugin-syntax-function-sent/package.json index 275f71439e62c..78b9a06696b24 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-function-sent/src/index.js b/packages/babel-plugin-syntax-function-sent/src/index.js index 9481f1983a056..cb8471dd4af32 100644 --- a/packages/babel-plugin-syntax-function-sent/src/index.js +++ b/packages/babel-plugin-syntax-function-sent/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("functionSent"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-import-meta/package.json b/packages/babel-plugin-syntax-import-meta/package.json index 2ff574a97aaf2..a762dadc4f92b 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of import.meta", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-import-meta", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-import-meta/src/index.js b/packages/babel-plugin-syntax-import-meta/src/index.js index 0aad339bfc70e..36e22743b08cc 100644 --- a/packages/babel-plugin-syntax-import-meta/src/index.js +++ b/packages/babel-plugin-syntax-import-meta/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("importMeta"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-jsx/package.json b/packages/babel-plugin-syntax-jsx/package.json index 8ceae7f4b0be9..2d2aac8931414 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of jsx", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-jsx", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-jsx/src/index.js b/packages/babel-plugin-syntax-jsx/src/index.js index eb8986ab28abb..3a17865e6dc8f 100644 --- a/packages/babel-plugin-syntax-jsx/src/index.js +++ b/packages/babel-plugin-syntax-jsx/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("jsx"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-logical-assignment-operators/.npmignore b/packages/babel-plugin-syntax-logical-assignment-operators/.npmignore new file mode 100644 index 0000000000000..f9806945836eb --- /dev/null +++ b/packages/babel-plugin-syntax-logical-assignment-operators/.npmignore @@ -0,0 +1,3 @@ +src +test +*.log diff --git a/packages/babel-plugin-syntax-logical-assignment-operators/README.md b/packages/babel-plugin-syntax-logical-assignment-operators/README.md new file mode 100644 index 0000000000000..07c5371cc3b69 --- /dev/null +++ b/packages/babel-plugin-syntax-logical-assignment-operators/README.md @@ -0,0 +1,35 @@ +# @babel/plugin-syntax-logical-assignment-operators + +> Allow parsing of the logical assignment operators. + +## Installation + +```sh +npm install --save-dev @babel/plugin-syntax-logical-assignment-operators +``` + +## Usage + +### Via `.babelrc` (Recommended) + +**.babelrc** + +```json +{ + "plugins": ["@babel/plugin-syntax-logical-assignment-operators"] +} +``` + +### Via CLI + +```sh +babel --plugins @babel/plugin-syntax-logical-assignment-operators script.js +``` + +### Via Node API + +```javascript +require("@babel/core").transform("code", { + plugins: ["@babel/plugin-syntax-logical-assignment-operators"] +}); +``` diff --git a/packages/babel-plugin-syntax-logical-assignment-operators/package.json b/packages/babel-plugin-syntax-logical-assignment-operators/package.json new file mode 100644 index 0000000000000..4f458b777c449 --- /dev/null +++ b/packages/babel-plugin-syntax-logical-assignment-operators/package.json @@ -0,0 +1,20 @@ +{ + "name": "@babel/plugin-syntax-logical-assignment-operators", + "version": "7.0.0-beta.42", + "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", + "main": "lib", + "keywords": [ + "babel-plugin" + ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, + "peerDependencies": { + "@babel/core": "7.0.0-beta.42" + }, + "devDependencies": { + "@babel/core": "7.0.0-beta.42" + } +} diff --git a/packages/babel-plugin-syntax-logical-assignment-operators/src/index.js b/packages/babel-plugin-syntax-logical-assignment-operators/src/index.js new file mode 100644 index 0000000000000..d283645e1cffd --- /dev/null +++ b/packages/babel-plugin-syntax-logical-assignment-operators/src/index.js @@ -0,0 +1,11 @@ +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + + return { + manipulateOptions(opts, parserOpts) { + parserOpts.plugins.push("logicalAssignment"); + }, + }; +}); diff --git a/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json b/packages/babel-plugin-syntax-nullish-coalescing-operator/package.json index 05e8338b84d52..991bcb62b499d 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-nullish-coalescing-operator/src/index.js b/packages/babel-plugin-syntax-nullish-coalescing-operator/src/index.js index d5cf5faa5afce..69578ca419a1d 100644 --- a/packages/babel-plugin-syntax-nullish-coalescing-operator/src/index.js +++ b/packages/babel-plugin-syntax-nullish-coalescing-operator/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("nullishCoalescingOperator"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-numeric-separator/package.json b/packages/babel-plugin-syntax-numeric-separator/package.json index 3764de1b998a2..9c811ec9807bc 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-numeric-separator/src/index.js b/packages/babel-plugin-syntax-numeric-separator/src/index.js index 7d7fbd4f74b82..8a9cd625ed31f 100644 --- a/packages/babel-plugin-syntax-numeric-separator/src/index.js +++ b/packages/babel-plugin-syntax-numeric-separator/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("numericSeparator"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-object-rest-spread/package.json b/packages/babel-plugin-syntax-object-rest-spread/package.json index 43c5a18fcb86c..bf4948b5b923e 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of object rest/spread", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-object-rest-spread", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-object-rest-spread/src/index.js b/packages/babel-plugin-syntax-object-rest-spread/src/index.js index 6eb03aa8195ae..7cd1b759a403b 100644 --- a/packages/babel-plugin-syntax-object-rest-spread/src/index.js +++ b/packages/babel-plugin-syntax-object-rest-spread/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("objectRestSpread"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-optional-catch-binding/package.json b/packages/babel-plugin-syntax-optional-catch-binding/package.json index 704bf69f23fba..46cd999af02f5 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of optional catch bindings", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-catch-binding", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-optional-catch-binding/src/index.js b/packages/babel-plugin-syntax-optional-catch-binding/src/index.js index 769a8df74fd1e..466b78e570f32 100644 --- a/packages/babel-plugin-syntax-optional-catch-binding/src/index.js +++ b/packages/babel-plugin-syntax-optional-catch-binding/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("optionalCatchBinding"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-optional-chaining/package.json b/packages/babel-plugin-syntax-optional-chaining/package.json index 89ea74f7c2a61..5d9fc743e6090 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of optional properties", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-chaining", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-optional-chaining/src/index.js b/packages/babel-plugin-syntax-optional-chaining/src/index.js index 76d014a88a6a6..5677a39ee9d7f 100644 --- a/packages/babel-plugin-syntax-optional-chaining/src/index.js +++ b/packages/babel-plugin-syntax-optional-chaining/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("optionalChaining"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-pipeline-operator/package.json b/packages/babel-plugin-syntax-pipeline-operator/package.json index 9272fb7aa2a96..553efad561591 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of the pipeline operator", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-pipeline-operator", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-pipeline-operator/src/index.js b/packages/babel-plugin-syntax-pipeline-operator/src/index.js index 0021ae691cfc3..c77a915babaed 100644 --- a/packages/babel-plugin-syntax-pipeline-operator/src/index.js +++ b/packages/babel-plugin-syntax-pipeline-operator/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("pipelineOperator"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-throw-expressions/package.json b/packages/babel-plugin-syntax-throw-expressions/package.json index 809ab7e0dead6..ac30d8898b818 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of Throw Expressions", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-throw-expressions", "license": "MIT", @@ -8,10 +8,13 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-throw-expressions/src/index.js b/packages/babel-plugin-syntax-throw-expressions/src/index.js index 72df255074554..62150d3655d00 100644 --- a/packages/babel-plugin-syntax-throw-expressions/src/index.js +++ b/packages/babel-plugin-syntax-throw-expressions/src/index.js @@ -1,7 +1,11 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("throwExpressions"); }, }; -} +}); diff --git a/packages/babel-plugin-syntax-typescript/package.json b/packages/babel-plugin-syntax-typescript/package.json index c06ed54ffeca1..e95f1c55f7383 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Allow parsing of TypeScript syntax", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-typescript", "license": "MIT", @@ -9,10 +9,13 @@ "babel-plugin", "typescript" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-syntax-typescript/src/index.js b/packages/babel-plugin-syntax-typescript/src/index.js index 5dee6ceed19d7..09be2c66a879b 100644 --- a/packages/babel-plugin-syntax-typescript/src/index.js +++ b/packages/babel-plugin-syntax-typescript/src/index.js @@ -1,4 +1,8 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push( @@ -8,4 +12,4 @@ export default function() { ); }, }; -} +}); diff --git a/packages/babel-plugin-transform-arrow-functions/package.json b/packages/babel-plugin-transform-arrow-functions/package.json index ad3817db1a6cd..f23b89d2e70dd 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile ES2015 arrow functions to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-arrow-functions", "license": "MIT", @@ -8,12 +8,15 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39", - "@babel/traverse": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42", + "@babel/traverse": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-arrow-functions/src/index.js b/packages/babel-plugin-transform-arrow-functions/src/index.js index 2f02cd0d94ac7..bc74d0eedf988 100644 --- a/packages/babel-plugin-transform-arrow-functions/src/index.js +++ b/packages/babel-plugin-transform-arrow-functions/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import type NodePath from "@babel/traverse"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { spec } = options; return { visitor: { @@ -20,4 +23,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-async-to-generator/package.json b/packages/babel-plugin-transform-async-to-generator/package.json index f77414b9db728..785c0c89832dd 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Turn async functions into ES2015 generators", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-async-to-generator", "license": "MIT", @@ -9,14 +9,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-module-imports": "7.0.0-beta.39", - "@babel/helper-remap-async-to-generator": "7.0.0-beta.39" + "@babel/helper-module-imports": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/helper-remap-async-to-generator": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-async-to-generator/src/index.js b/packages/babel-plugin-transform-async-to-generator/src/index.js index abb0b11311131..d0aaf7d5c0c17 100644 --- a/packages/babel-plugin-transform-async-to-generator/src/index.js +++ b/packages/babel-plugin-transform-async-to-generator/src/index.js @@ -1,8 +1,11 @@ +import { declare } from "@babel/helper-plugin-utils"; import remapAsyncToGenerator from "@babel/helper-remap-async-to-generator"; import { addNamed } from "@babel/helper-module-imports"; import { types as t } from "@babel/core"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { method, module } = options; if (method && module) { @@ -18,9 +21,7 @@ export default function(api, options) { wrapAsync = state.methodWrapper = addNamed(path, method, module); } - remapAsyncToGenerator(path, state.file, { - wrapAsync, - }); + remapAsyncToGenerator(path, { wrapAsync }); }, }, }; @@ -31,10 +32,10 @@ export default function(api, options) { Function(path, state) { if (!path.node.async || path.node.generator) return; - remapAsyncToGenerator(path, state.file, { + remapAsyncToGenerator(path, { wrapAsync: state.addHelper("asyncToGenerator"), }); }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/shadowed-promise-import/input.js b/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/shadowed-promise-import/input.mjs similarity index 100% rename from packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/shadowed-promise-import/input.js rename to packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/shadowed-promise-import/input.mjs diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/shadowed-promise-import/output.js b/packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/shadowed-promise-import/output.mjs similarity index 100% rename from packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/shadowed-promise-import/output.js rename to packages/babel-plugin-transform-async-to-generator/test/fixtures/async-to-generator/shadowed-promise-import/output.mjs diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/default-arrow-export/input.js b/packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/default-arrow-export/input.mjs similarity index 100% rename from packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/default-arrow-export/input.js rename to packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/default-arrow-export/input.mjs diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/default-export/input.js b/packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/default-export/input.mjs similarity index 100% rename from packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/default-export/input.js rename to packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/default-export/input.mjs diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/import-and-export/input.js b/packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/import-and-export/input.mjs similarity index 100% rename from packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/import-and-export/input.js rename to packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/import-and-export/input.mjs diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/lone-export/input.js b/packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/lone-export/input.mjs similarity index 100% rename from packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/lone-export/input.js rename to packages/babel-plugin-transform-async-to-generator/test/fixtures/export-async/lone-export/input.mjs diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/5880/options.json b/packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/5880/options.json deleted file mode 100644 index 9ed92359fffbf..0000000000000 --- a/packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/5880/options.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "plugins": [ - "external-helpers", - "transform-async-to-generator", - "transform-destructuring", - "syntax-async-generators" - ] -} diff --git a/packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/7178/output.js b/packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/7178/output.js index 509f1f64c90da..834e46ca35ad4 100644 --- a/packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/7178/output.js +++ b/packages/babel-plugin-transform-async-to-generator/test/fixtures/regression/7178/output.js @@ -4,7 +4,9 @@ function action() { return _action.apply(this, arguments); } -var _ref = React.createElement(Contact, { +var _ref = +/*#__PURE__*/ +React.createElement(Contact, { title: title }); diff --git a/packages/babel-plugin-transform-block-scoped-functions/README.md b/packages/babel-plugin-transform-block-scoped-functions/README.md index 835d7424bb690..95985cf600a11 100644 --- a/packages/babel-plugin-transform-block-scoped-functions/README.md +++ b/packages/babel-plugin-transform-block-scoped-functions/README.md @@ -20,11 +20,10 @@ name("Steve"); ```javascript { - var _name = function _name(n) { + let name = function (n) { return n; }; } - name("Steve"); ``` diff --git a/packages/babel-plugin-transform-block-scoped-functions/package.json b/packages/babel-plugin-transform-block-scoped-functions/package.json index 2a99a5048e5e3..cc49f82317a52 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-block-scoped-functions/src/index.js b/packages/babel-plugin-transform-block-scoped-functions/src/index.js index 29d7a141fdc3f..1f1783dc9e86a 100644 --- a/packages/babel-plugin-transform-block-scoped-functions/src/index.js +++ b/packages/babel-plugin-transform-block-scoped-functions/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + function statementList(key, path) { const paths: Array = path.get(key); @@ -41,4 +44,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-block-scoped-functions/test/fixtures/block-scoped-functions/basic/input.js b/packages/babel-plugin-transform-block-scoped-functions/test/fixtures/block-scoped-functions/basic/input.js new file mode 100644 index 0000000000000..fe3cbae18f37d --- /dev/null +++ b/packages/babel-plugin-transform-block-scoped-functions/test/fixtures/block-scoped-functions/basic/input.js @@ -0,0 +1,7 @@ +{ + function name (n) { + return n; + } +} + +name("Steve"); diff --git a/packages/babel-plugin-transform-block-scoped-functions/test/fixtures/block-scoped-functions/basic/options.json b/packages/babel-plugin-transform-block-scoped-functions/test/fixtures/block-scoped-functions/basic/options.json new file mode 100644 index 0000000000000..de68899ab3c2e --- /dev/null +++ b/packages/babel-plugin-transform-block-scoped-functions/test/fixtures/block-scoped-functions/basic/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["transform-block-scoped-functions"] +} diff --git a/packages/babel-plugin-transform-block-scoped-functions/test/fixtures/block-scoped-functions/basic/output.js b/packages/babel-plugin-transform-block-scoped-functions/test/fixtures/block-scoped-functions/basic/output.js new file mode 100644 index 0000000000000..3a82ac158794b --- /dev/null +++ b/packages/babel-plugin-transform-block-scoped-functions/test/fixtures/block-scoped-functions/basic/output.js @@ -0,0 +1,6 @@ +{ + let name = function (n) { + return n; + }; +} +name("Steve"); diff --git a/packages/babel-plugin-transform-block-scoped-functions/test/index.js b/packages/babel-plugin-transform-block-scoped-functions/test/index.js new file mode 100644 index 0000000000000..1b534b8fc64af --- /dev/null +++ b/packages/babel-plugin-transform-block-scoped-functions/test/index.js @@ -0,0 +1,3 @@ +import runner from "@babel/helper-plugin-test-runner"; + +runner(__dirname); diff --git a/packages/babel-plugin-transform-block-scoping/package.json b/packages/babel-plugin-transform-block-scoping/package.json index aaae3d66f39fa..d5bfae9b0aec7 100644 --- a/packages/babel-plugin-transform-block-scoping/package.json +++ b/packages/babel-plugin-transform-block-scoping/package.json @@ -1,21 +1,22 @@ { "name": "@babel/plugin-transform-block-scoping", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "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", "main": "lib/index.js", "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42", "lodash": "^4.2.0" }, "keywords": [ "babel-plugin" ], "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-block-scoping/src/index.js b/packages/babel-plugin-transform-block-scoping/src/index.js index 17349a14bddd2..560368cf0fbf7 100644 --- a/packages/babel-plugin-transform-block-scoping/src/index.js +++ b/packages/babel-plugin-transform-block-scoping/src/index.js @@ -1,3 +1,4 @@ +import { declare } from "@babel/helper-plugin-utils"; import type NodePath from "@babel/traverse"; import type Scope from "@babel/traverse"; import { visitor as tdzVisitor } from "./tdz"; @@ -7,7 +8,9 @@ import { traverse, template, types as t } from "@babel/core"; const DONE = new WeakSet(); -export default function(api, opts) { +export default declare((api, opts) => { + api.assertVersion(7); + const { throwIfClosureRequired = false, tdz: tdzEnabled = false } = opts; if (typeof throwIfClosureRequired !== "boolean") { throw new Error(`.throwIfClosureRequired must be a boolean, or undefined`); @@ -94,7 +97,7 @@ export default function(api, opts) { }, }, }; -} +}); function ignoreBlock(path) { return t.isLoop(path.parent) || t.isCatchClause(path.parent); diff --git a/packages/babel-plugin-transform-block-scoping/test/fixtures/pass/export.js b/packages/babel-plugin-transform-block-scoping/test/fixtures/pass/export.mjs similarity index 100% rename from packages/babel-plugin-transform-block-scoping/test/fixtures/pass/export.js rename to packages/babel-plugin-transform-block-scoping/test/fixtures/pass/export.mjs diff --git a/packages/babel-plugin-transform-classes/package.json b/packages/babel-plugin-transform-classes/package.json index e6d9c2afa1b91..0cdea2967fbe8 100644 --- a/packages/babel-plugin-transform-classes/package.json +++ b/packages/babel-plugin-transform-classes/package.json @@ -1,26 +1,28 @@ { "name": "@babel/plugin-transform-classes", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile ES2015 classes to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-classes", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/helper-annotate-as-pure": "7.0.0-beta.39", - "@babel/helper-define-map": "7.0.0-beta.39", - "@babel/helper-function-name": "7.0.0-beta.39", - "@babel/helper-optimise-call-expression": "7.0.0-beta.39", - "@babel/helper-replace-supers": "7.0.0-beta.39", + "@babel/helper-annotate-as-pure": "7.0.0-beta.42", + "@babel/helper-define-map": "7.0.0-beta.42", + "@babel/helper-function-name": "7.0.0-beta.42", + "@babel/helper-optimise-call-expression": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/helper-replace-supers": "7.0.0-beta.42", + "@babel/helper-split-export-declaration": "7.0.0-beta.42", "globals": "^11.1.0" }, "keywords": [ "babel-plugin" ], "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-classes/src/index.js b/packages/babel-plugin-transform-classes/src/index.js index a93fe739edee4..926d3cce5afb5 100644 --- a/packages/babel-plugin-transform-classes/src/index.js +++ b/packages/babel-plugin-transform-classes/src/index.js @@ -1,7 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import LooseTransformer from "./loose"; import VanillaTransformer from "./vanilla"; import annotateAsPure from "@babel/helper-annotate-as-pure"; import nameFunction from "@babel/helper-function-name"; +import splitExportDeclaration from "@babel/helper-split-export-declaration"; import { types as t } from "@babel/core"; import globals from "globals"; @@ -13,7 +15,9 @@ const builtinClasses = new Set([ ...getBuiltinClasses("browser"), ]); -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { loose } = options; const Constructor = loose ? LooseTransformer : VanillaTransformer; @@ -24,19 +28,7 @@ export default function(api, options) { visitor: { ExportDefaultDeclaration(path) { if (!path.get("declaration").isClassDeclaration()) return; - - const { node } = path; - const ref = - node.declaration.id || path.scope.generateUidIdentifier("class"); - node.declaration.id = ref; - - // Split the class declaration and the export into two separate statements. - path.replaceWith(node.declaration); - path.insertAfter( - t.exportNamedDeclaration(null, [ - t.exportSpecifier(t.cloneNode(ref), t.identifier("default")), - ]), - ); + splitExportDeclaration(path); }, ClassDeclaration(path) { @@ -76,4 +68,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/loose/output.js b/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/loose/output.js index 90a34b02cd602..35bb5541b9093 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/loose/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/loose/output.js @@ -1,14 +1,12 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } -var _gPO = Object.getPrototypeOf || function _gPO(o) { return o.__proto__; }; +function _gPO(o) { _gPO = Object.getPrototypeOf || function _gPO(o) { return o.__proto__; }; return _gPO(o); } -var _sPO = Object.setPrototypeOf || function _sPO(o, p) { o.__proto__ = p; return o; }; +function _sPO(o, p) { _sPO = Object.setPrototypeOf || function _sPO(o, p) { o.__proto__ = p; return o; }; return _sPO(o, p); } -var _construct = typeof Reflect === "object" && Reflect.construct || function _construct(Parent, args, Class) { var Constructor, a = [null]; a.push.apply(a, args); Constructor = Parent.bind.apply(Parent, a); return _sPO(new Constructor(), Class.prototype); }; +function _construct(Parent, args, Class) { _construct = typeof Reflect === "object" && Reflect.construct || function _construct(Parent, args, Class) { var Constructor, a = [null]; a.push.apply(a, args); Constructor = Parent.bind.apply(Parent, a); return _sPO(new Constructor(), Class.prototype); }; return _construct(Parent, args, Class); } -var _cache = typeof Map === "function" && new Map(); - -function _wrapNativeSuper(Class) { if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() {} Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writeable: true, configurable: true } }); return _sPO(Wrapper, _sPO(function Super() { return _construct(Class, arguments, _gPO(this).constructor); }, Class)); } +function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() {} Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _sPO(Wrapper, _sPO(function Super() { return _construct(Class, arguments, _gPO(this).constructor); }, Class)); }; return _wrapNativeSuper(Class); } var List = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/spec/output.js b/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/spec/output.js index b6a5b878b7d84..877197c6617ee 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/spec/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/extend-builtins/spec/output.js @@ -1,18 +1,18 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -var _gPO = Object.getPrototypeOf || function _gPO(o) { return o.__proto__; }; +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var _sPO = Object.setPrototypeOf || function _sPO(o, p) { o.__proto__ = p; return o; }; +function _gPO(o) { _gPO = Object.getPrototypeOf || function _gPO(o) { return o.__proto__; }; return _gPO(o); } -var _construct = typeof Reflect === "object" && Reflect.construct || function _construct(Parent, args, Class) { var Constructor, a = [null]; a.push.apply(a, args); Constructor = Parent.bind.apply(Parent, a); return _sPO(new Constructor(), Class.prototype); }; +function _sPO(o, p) { _sPO = Object.setPrototypeOf || function _sPO(o, p) { o.__proto__ = p; return o; }; return _sPO(o, p); } -var _cache = typeof Map === "function" && new Map(); +function _construct(Parent, args, Class) { _construct = typeof Reflect === "object" && Reflect.construct || function _construct(Parent, args, Class) { var Constructor, a = [null]; a.push.apply(a, args); Constructor = Parent.bind.apply(Parent, a); return _sPO(new Constructor(), Class.prototype); }; return _construct(Parent, args, Class); } -function _wrapNativeSuper(Class) { if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() {} Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writeable: true, configurable: true } }); return _sPO(Wrapper, _sPO(function Super() { return _construct(Class, arguments, _gPO(this).constructor); }, Class)); } +function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() {} Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _sPO(Wrapper, _sPO(function Super() { return _construct(Class, arguments, _gPO(this).constructor); }, Class)); }; return _wrapNativeSuper(Class); } var List = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-classes/test/fixtures/regression/2663/input.js b/packages/babel-plugin-transform-classes/test/fixtures/regression/2663/input.mjs similarity index 100% rename from packages/babel-plugin-transform-classes/test/fixtures/regression/2663/input.js rename to packages/babel-plugin-transform-classes/test/fixtures/regression/2663/input.mjs diff --git a/packages/babel-plugin-transform-classes/test/fixtures/regression/2694/input.js b/packages/babel-plugin-transform-classes/test/fixtures/regression/2694/input.mjs similarity index 100% rename from packages/babel-plugin-transform-classes/test/fixtures/regression/2694/input.js rename to packages/babel-plugin-transform-classes/test/fixtures/regression/2694/input.mjs diff --git a/packages/babel-plugin-transform-classes/test/fixtures/regression/2775/input.js b/packages/babel-plugin-transform-classes/test/fixtures/regression/2775/input.mjs similarity index 100% rename from packages/babel-plugin-transform-classes/test/fixtures/regression/2775/input.js rename to packages/babel-plugin-transform-classes/test/fixtures/regression/2775/input.mjs diff --git a/packages/babel-plugin-transform-classes/test/fixtures/regression/2775/output.js b/packages/babel-plugin-transform-classes/test/fixtures/regression/2775/output.js index 786d7c177df46..599a3a5438d37 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/regression/2775/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/regression/2775/output.js @@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -var _react = babelHelpers.interopRequireWildcard(require("react")); +var _react = babelHelpers.interopRequireDefault(require("react")); var RandomComponent = /*#__PURE__*/ diff --git a/packages/babel-plugin-transform-classes/test/fixtures/regression/2941/input.js b/packages/babel-plugin-transform-classes/test/fixtures/regression/2941/input.mjs similarity index 100% rename from packages/babel-plugin-transform-classes/test/fixtures/regression/2941/input.js rename to packages/babel-plugin-transform-classes/test/fixtures/regression/2941/input.mjs diff --git a/packages/babel-plugin-transform-classes/test/fixtures/regression/2941/output.js b/packages/babel-plugin-transform-classes/test/fixtures/regression/2941/output.js index 3e311d72a65b9..9c148ffe0c530 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/regression/2941/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/regression/2941/output.js @@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", { }); exports.default = void 0; -var _class = function _class() { - babelHelpers.classCallCheck(this, _class); +var _default = function _default() { + babelHelpers.classCallCheck(this, _default); }; -exports.default = _class; +exports.default = _default; diff --git a/packages/babel-plugin-transform-classes/test/fixtures/regression/3028/input.js b/packages/babel-plugin-transform-classes/test/fixtures/regression/3028/input.mjs similarity index 100% rename from packages/babel-plugin-transform-classes/test/fixtures/regression/3028/input.js rename to packages/babel-plugin-transform-classes/test/fixtures/regression/3028/input.mjs diff --git a/packages/babel-plugin-transform-classes/test/fixtures/regression/T6750/input.js b/packages/babel-plugin-transform-classes/test/fixtures/regression/T6750/input.mjs similarity index 100% rename from packages/babel-plugin-transform-classes/test/fixtures/regression/T6750/input.js rename to packages/babel-plugin-transform-classes/test/fixtures/regression/T6750/input.mjs diff --git a/packages/babel-plugin-transform-classes/test/fixtures/regression/T7537/output.js b/packages/babel-plugin-transform-classes/test/fixtures/regression/T7537/output.js index dc8a3c6389a0c..3b47c5925e210 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/regression/T7537/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/regression/T7537/output.js @@ -1,6 +1,8 @@ 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 _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/export-default/input.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/export-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-classes/test/fixtures/spec/export-default/input.js rename to packages/babel-plugin-transform-classes/test/fixtures/spec/export-default/input.mjs diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/export-default/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/export-default/output.mjs similarity index 100% rename from packages/babel-plugin-transform-classes/test/fixtures/spec/export-default/output.js rename to packages/babel-plugin-transform-classes/test/fixtures/spec/export-default/output.mjs diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/export-super-class/input.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/export-super-class/input.mjs similarity index 100% rename from packages/babel-plugin-transform-classes/test/fixtures/spec/export-super-class/input.js rename to packages/babel-plugin-transform-classes/test/fixtures/spec/export-super-class/input.mjs diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/export-super-class/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/export-super-class/output.js deleted file mode 100644 index 7360483607989..0000000000000 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/export-super-class/output.js +++ /dev/null @@ -1,14 +0,0 @@ -var _class = -/*#__PURE__*/ -function (_A) { - babelHelpers.inherits(_class, _A); - - function _class() { - babelHelpers.classCallCheck(this, _class); - return babelHelpers.possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments)); - } - - return _class; -}(A); - -export { _class as default }; diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/export-super-class/output.mjs b/packages/babel-plugin-transform-classes/test/fixtures/spec/export-super-class/output.mjs new file mode 100644 index 0000000000000..6aafe37c5ac59 --- /dev/null +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/export-super-class/output.mjs @@ -0,0 +1,14 @@ +var _default = +/*#__PURE__*/ +function (_A) { + babelHelpers.inherits(_default, _A); + + function _default() { + babelHelpers.classCallCheck(this, _default); + return babelHelpers.possibleConstructorReturn(this, (_default.__proto__ || Object.getPrototypeOf(_default)).apply(this, arguments)); + } + + return _default; +}(A); + +export { _default as default }; diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/name-method-collision/input.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/name-method-collision/input.mjs similarity index 100% rename from packages/babel-plugin-transform-classes/test/fixtures/spec/name-method-collision/input.js rename to packages/babel-plugin-transform-classes/test/fixtures/spec/name-method-collision/input.mjs diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super-inline/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super-inline/output.js index e019eadfd9d24..ef3b23c9b24da 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super-inline/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super-inline/output.js @@ -1,6 +1,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } diff --git a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super/output.js b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super/output.js index 854033398beb9..9413bc4a635e8 100644 --- a/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super/output.js +++ b/packages/babel-plugin-transform-classes/test/fixtures/spec/super-reference-before-bare-super/output.js @@ -1,6 +1,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } diff --git a/packages/babel-plugin-transform-computed-properties/package.json b/packages/babel-plugin-transform-computed-properties/package.json index d9a327256e529..3ae6f1f7df3d9 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile ES2015 computed properties to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-computed-properties", "license": "MIT", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-computed-properties/src/index.js b/packages/babel-plugin-transform-computed-properties/src/index.js index 7fb80c227bb92..e751f50088778 100644 --- a/packages/babel-plugin-transform-computed-properties/src/index.js +++ b/packages/babel-plugin-transform-computed-properties/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import { template, types as t } from "@babel/core"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { loose } = options; const pushComputedProps = loose ? pushComputedPropsLoose @@ -199,4 +202,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-computed-properties/test/fixtures/regression/7144/input.js b/packages/babel-plugin-transform-computed-properties/test/fixtures/regression/7144/input.mjs similarity index 100% rename from packages/babel-plugin-transform-computed-properties/test/fixtures/regression/7144/input.js rename to packages/babel-plugin-transform-computed-properties/test/fixtures/regression/7144/input.mjs diff --git a/packages/babel-plugin-transform-computed-properties/test/fixtures/regression/7144/output.js b/packages/babel-plugin-transform-computed-properties/test/fixtures/regression/7144/output.mjs similarity index 100% rename from packages/babel-plugin-transform-computed-properties/test/fixtures/regression/7144/output.js rename to packages/babel-plugin-transform-computed-properties/test/fixtures/regression/7144/output.mjs diff --git a/packages/babel-plugin-transform-destructuring/README.md b/packages/babel-plugin-transform-destructuring/README.md index 93c9fcdf0c697..33d1677a19597 100644 --- a/packages/babel-plugin-transform-destructuring/README.md +++ b/packages/babel-plugin-transform-destructuring/README.md @@ -51,3 +51,42 @@ require("@babel/core").transform("code", { plugins: ["@babel/plugin-transform-destructuring"] }); ``` + +## Options + +### `loose` + +`boolean`, defaults to `false`. + +Enabling this option will assume that what you want to destructure is an array and won't use `Array.from` on other iterables. + +### `useBuiltIns` + +`boolean`, defaults to `false`. + +Enabling this option will use `Object.assign` directly instead of the Babel's `extends` helper. + +##### Example + +**.babelrc** + +```json +{ + "plugins": [ + ["@babel/plugin-transform-destructuring", { "useBuiltIns": true }] + ] +} +``` + +**In** + +```js +var { ...x } = z; +``` + +**Out** + +```js +var _z = z, + x = Object.assign({}, _z); +``` diff --git a/packages/babel-plugin-transform-destructuring/package.json b/packages/babel-plugin-transform-destructuring/package.json index 7046d1ae856e8..3e829265ab5ad 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile ES2015 destructuring to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-destructuring", "license": "MIT", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-destructuring/src/index.js b/packages/babel-plugin-transform-destructuring/src/index.js index 2308c0af45a41..60dcdcda1bbcb 100644 --- a/packages/babel-plugin-transform-destructuring/src/index.js +++ b/packages/babel-plugin-transform-destructuring/src/index.js @@ -1,13 +1,23 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; -export default function(api, options) { - const { loose = false } = options; +export default declare((api, options) => { + api.assertVersion(7); + + const { loose = false, useBuiltIns = false } = options; + if (typeof loose !== "boolean") { throw new Error(`.loose must be a boolean or undefined`); } const arrayOnlySpread = loose; + function getExtendsHelper(file) { + return useBuiltIns + ? t.memberExpression(t.identifier("Object"), t.identifier("assign")) + : file.addHelper("extends"); + } + /** * Test if a VariableDeclaration's declarations contains any Patterns. */ @@ -108,43 +118,40 @@ export default function(api, options) { } } - pushAssignmentPattern(pattern, valueRef) { + pushAssignmentPattern({ left, right }, valueRef) { // we need to assign the current value of the assignment to avoid evaluating // it more than once + const tempId = this.scope.generateUidIdentifierBasedOnNode(valueRef); - const tempValueRef = this.scope.generateUidBasedOnNode(valueRef); - - const declar = t.variableDeclaration("var", [ - t.variableDeclarator(t.identifier(tempValueRef), valueRef), - ]); - declar._blockHoist = this.blockHoist; - this.nodes.push(declar); - - // + this.nodes.push(this.buildVariableDeclaration(tempId, valueRef)); const tempConditional = t.conditionalExpression( t.binaryExpression( "===", - t.identifier(tempValueRef), + t.cloneNode(tempId), this.scope.buildUndefinedNode(), ), - pattern.right, - t.identifier(tempValueRef), + right, + t.cloneNode(tempId), ); - const left = pattern.left; if (t.isPattern(left)) { - const tempValueDefault = t.expressionStatement( - t.assignmentExpression( - "=", - t.identifier(tempValueRef), - tempConditional, - ), - ); - tempValueDefault._blockHoist = this.blockHoist; + let patternId; + let node; - this.nodes.push(tempValueDefault); - this.push(left, t.identifier(tempValueRef)); + if (this.kind === "const") { + patternId = this.scope.generateUidIdentifier(tempId.name); + node = this.buildVariableDeclaration(patternId, tempConditional); + } else { + patternId = tempId; + + node = t.expressionStatement( + t.assignmentExpression("=", t.cloneNode(tempId), tempConditional), + ); + } + + this.nodes.push(node); + this.push(left, patternId); } else { this.nodes.push(this.buildVariableAssignment(left, tempConditional)); } @@ -172,14 +179,21 @@ export default function(api, options) { keys.push(t.cloneNode(key)); } - keys = t.arrayExpression(keys); + let value; + if (keys.length === 0) { + value = t.callExpression(getExtendsHelper(this), [ + t.objectExpression([]), + t.cloneNode(objRef), + ]); + } else { + keys = t.arrayExpression(keys); - // + value = t.callExpression(this.addHelper("objectWithoutProperties"), [ + t.cloneNode(objRef), + keys, + ]); + } - const value = t.callExpression( - this.addHelper("objectWithoutProperties"), - [t.cloneNode(objRef), keys], - ); this.nodes.push(this.buildVariableAssignment(spreadProp.argument, value)); } @@ -583,4 +597,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/exec.js b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/exec.js new file mode 100644 index 0000000000000..e05920b47f65e --- /dev/null +++ b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/exec.js @@ -0,0 +1,5 @@ +const getState = () => ({}); + +const { data: { courses: oldCourses = [] } = {} } = getState(); + +assert.deepEqual(oldCourses, []); diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/input.js b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/input.js new file mode 100644 index 0000000000000..09e29d6f8b280 --- /dev/null +++ b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/input.js @@ -0,0 +1 @@ +const { data: { courses: oldCourses = [] } = {} } = getState(); diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/options.json b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/options.json new file mode 100644 index 0000000000000..84e28c07f51e9 --- /dev/null +++ b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["transform-destructuring"] +} diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/output.js b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/output.js new file mode 100644 index 0000000000000..708ac3713300b --- /dev/null +++ b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/output.js @@ -0,0 +1,5 @@ +const _getState = getState(), + _getState$data = _getState.data, + _getState$data2 = _getState$data === void 0 ? {} : _getState$data, + _getState$data2$cours = _getState$data2.courses, + oldCourses = _getState$data2$cours === void 0 ? [] : _getState$data2$cours; diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/es7-object-rest-builtins/input.js b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/es7-object-rest-builtins/input.js new file mode 100644 index 0000000000000..20b5387a592e1 --- /dev/null +++ b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/es7-object-rest-builtins/input.js @@ -0,0 +1,7 @@ +var z = {}; +var { ...x } = z; +var { x, ...y } = z; +var { [x]: x, ...y } = z; +(function({ x, ...y }) { }); + +({ x, y, ...z } = o); diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/es7-object-rest-builtins/options.json b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/es7-object-rest-builtins/options.json new file mode 100644 index 0000000000000..a4a5f2d213ea7 --- /dev/null +++ b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/es7-object-rest-builtins/options.json @@ -0,0 +1,11 @@ +{ + "plugins": [ + "external-helpers", + ["transform-destructuring", { "useBuiltIns": true }], + "transform-spread", + "transform-parameters", + "transform-block-scoping", + "proposal-object-rest-spread", + "transform-regenerator" + ] +} diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/es7-object-rest-builtins/output.js b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/es7-object-rest-builtins/output.js new file mode 100644 index 0000000000000..8e8f967908537 --- /dev/null +++ b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/es7-object-rest-builtins/output.js @@ -0,0 +1,20 @@ +var z = {}; +var _z = z, + x = Object.assign({}, _z); +var _z2 = z, + x = _z2.x, + y = babelHelpers.objectWithoutProperties(_z2, ["x"]); +var _z3 = z, + x = _z3[x], + y = babelHelpers.objectWithoutProperties(_z3, [x]); + +(function (_ref) { + var x = _ref.x, + y = babelHelpers.objectWithoutProperties(_ref, ["x"]); +}); + +var _o = o; +x = _o.x; +y = _o.y; +z = babelHelpers.objectWithoutProperties(_o, ["x", "y"]); +_o; diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/es7-object-rest/output.js b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/es7-object-rest/output.js index 5c7315f73b0b3..0729c49dd0e2c 100644 --- a/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/es7-object-rest/output.js +++ b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/es7-object-rest/output.js @@ -1,6 +1,6 @@ var z = {}; var _z = z, - x = babelHelpers.objectWithoutProperties(_z, []); + x = babelHelpers.extends({}, _z); var _z2 = z, x = _z2.x, y = babelHelpers.objectWithoutProperties(_z2, ["x"]); diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/export-variable/input.js b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/export-variable/input.mjs similarity index 100% rename from packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/export-variable/input.js rename to packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/export-variable/input.mjs diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/export-variable/output.js b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/export-variable/output.mjs similarity index 100% rename from packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/export-variable/output.js rename to packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/export-variable/output.mjs diff --git a/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/issue-6373/input.js b/packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/issue-6373/input.mjs similarity index 100% rename from packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/issue-6373/input.js rename to packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/issue-6373/input.mjs diff --git a/packages/babel-plugin-transform-dotall-regex/package.json b/packages/babel-plugin-transform-dotall-regex/package.json index 1600807c7662b..9a1d44e45929d 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile regular expressions using the `s` (`dotAll`) flag to ES5.", "homepage": "https://babeljs.io/", "license": "MIT", @@ -21,14 +21,15 @@ }, "bugs": "https://github.com/babel/babel/issues", "dependencies": { - "@babel/helper-regex": "7.0.0-beta.39", + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/helper-regex": "7.0.0-beta.42", "regexpu-core": "^4.1.3" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-dotall-regex/src/index.js b/packages/babel-plugin-transform-dotall-regex/src/index.js index 4a25982031fbb..e1303cd903117 100644 --- a/packages/babel-plugin-transform-dotall-regex/src/index.js +++ b/packages/babel-plugin-transform-dotall-regex/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import rewritePattern from "regexpu-core"; import * as regex from "@babel/helper-regex"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { RegExpLiteral(path) { @@ -17,4 +20,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-duplicate-keys/package.json b/packages/babel-plugin-transform-duplicate-keys/package.json index 072991a1bd7cd..0875add7e354b 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-duplicate-keys/src/index.js b/packages/babel-plugin-transform-duplicate-keys/src/index.js index 4c80dd0eb4b9c..ff69a0b49f835 100644 --- a/packages/babel-plugin-transform-duplicate-keys/src/index.js +++ b/packages/babel-plugin-transform-duplicate-keys/src/index.js @@ -1,3 +1,4 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; function getName(key) { @@ -7,7 +8,9 @@ function getName(key) { return key.value.toString(); } -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { ObjectExpression(path) { @@ -65,4 +68,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-exponentiation-operator/package.json b/packages/babel-plugin-transform-exponentiation-operator/package.json index be68898cda2fb..b35f0a95f2ef9 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile exponentiation operator to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-exponentiation-operator", "license": "MIT", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "7.0.0-beta.39" + "@babel/helper-builder-binary-assignment-operator-visitor": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-exponentiation-operator/src/index.js b/packages/babel-plugin-transform-exponentiation-operator/src/index.js index 58bc8d38396b7..92fa3a95bc23d 100644 --- a/packages/babel-plugin-transform-exponentiation-operator/src/index.js +++ b/packages/babel-plugin-transform-exponentiation-operator/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import build from "@babel/helper-builder-binary-assignment-operator-visitor"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: build({ operator: "**", @@ -14,4 +17,4 @@ export default function() { }, }), }; -} +}); diff --git a/packages/babel-plugin-transform-flow-comments/package.json b/packages/babel-plugin-transform-flow-comments/package.json index fdd4465dcda96..dea4d0c53d523 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Turn flow type annotations into comments", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-flow-comments", "license": "MIT", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-flow": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-flow": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-flow-comments/src/index.js b/packages/babel-plugin-transform-flow-comments/src/index.js index 6dec27d2880f7..2ea870857ee52 100644 --- a/packages/babel-plugin-transform-flow-comments/src/index.js +++ b/packages/babel-plugin-transform-flow-comments/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxFlow from "@babel/plugin-syntax-flow"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + function wrapInFlowComment(path, parent) { let attach = path.getPrevSibling(); let where = "trailing"; @@ -143,4 +146,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-export/input.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-export/input.mjs similarity index 100% rename from packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-export/input.js rename to packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-export/input.mjs diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-export/output.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-export/output.mjs similarity index 100% rename from packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-export/output.js rename to packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-export/output.mjs diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-type-alias/input.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-type-alias/input.mjs similarity index 100% rename from packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-type-alias/input.js rename to packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-type-alias/input.mjs diff --git a/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-type-alias/output.js b/packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-type-alias/output.mjs similarity index 100% rename from packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-type-alias/output.js rename to packages/babel-plugin-transform-flow-comments/test/fixtures/flow-comments/import-type-alias/output.mjs diff --git a/packages/babel-plugin-transform-flow-strip-types/package.json b/packages/babel-plugin-transform-flow-strip-types/package.json index 4de62870009a6..a6c1f6a8a75a2 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-flow": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-flow": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-flow-strip-types/src/index.js b/packages/babel-plugin-transform-flow-strip-types/src/index.js index 4ec8ab65882de..ae633effd3307 100644 --- a/packages/babel-plugin-transform-flow-strip-types/src/index.js +++ b/packages/babel-plugin-transform-flow-strip-types/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxFlow from "@babel/plugin-syntax-flow"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + const FLOW_DIRECTIVE = "@flow"; let skipStrip = false; @@ -107,4 +110,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/input.js b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/input.mjs similarity index 100% rename from packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/input.js rename to packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/input.mjs diff --git a/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/output.js b/packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/output.mjs similarity index 100% rename from packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/output.js rename to packages/babel-plugin-transform-flow-strip-types/test/fixtures/strip-types/strip-type-annotations/output.mjs diff --git a/packages/babel-plugin-transform-for-of/package.json b/packages/babel-plugin-transform-for-of/package.json index e75567ed2b971..c7cda58c5b49e 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile ES2015 for...of to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-for-of", "license": "MIT", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-for-of/src/index.js b/packages/babel-plugin-transform-for-of/src/index.js index 43503dfc93fd0..01fe2359819e2 100644 --- a/packages/babel-plugin-transform-for-of/src/index.js +++ b/packages/babel-plugin-transform-for-of/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import { template, types as t } from "@babel/core"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { loose, assumeArray } = options; if (loose === true && assumeArray === true) { @@ -332,4 +335,4 @@ export default function(api, options) { node: template, }; } -} +}); diff --git a/packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-amd/input.js b/packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-amd/input.mjs similarity index 100% rename from packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-amd/input.js rename to packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-amd/input.mjs diff --git a/packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-commonjs/input.js b/packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-commonjs/input.mjs similarity index 100% rename from packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-commonjs/input.js rename to packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-commonjs/input.mjs diff --git a/packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-es2015/input.js b/packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-es2015/input.mjs similarity index 100% rename from packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-es2015/input.js rename to packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-es2015/input.mjs diff --git a/packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-es2015/output.js b/packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-es2015/output.mjs similarity index 100% rename from packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-es2015/output.js rename to packages/babel-plugin-transform-for-of/test/fixtures/for-of-as-array/for-of-import-es2015/output.mjs diff --git a/packages/babel-plugin-transform-function-name/package.json b/packages/babel-plugin-transform-function-name/package.json index 6432e8cfe5dd7..c1eb2c436acbd 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-function-name": "7.0.0-beta.39" + "@babel/helper-function-name": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-function-name/src/index.js b/packages/babel-plugin-transform-function-name/src/index.js index 27f626a49a0f9..733a56096aaf7 100644 --- a/packages/babel-plugin-transform-function-name/src/index.js +++ b/packages/babel-plugin-transform-function-name/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import nameFunction from "@babel/helper-function-name"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { FunctionExpression: { @@ -21,4 +24,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/await/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/await/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/await/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/await/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/await/output.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/await/output.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/await/output.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/await/output.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-2/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-2/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-2/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-3/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-3/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-3/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-es3/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-es3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-es3/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-es3/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-amd/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-amd/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-amd/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-amd/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-es6/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-es6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-es6/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-es6/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-es6/output.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-es6/output.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-es6/output.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-es6/output.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-system/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-system/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-system/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-system/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-system/output.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-system/output.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-system/output.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-system/output.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-umd/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-umd/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-umd/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming-module-umd/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/export-default-arrow-renaming/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/export/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/export/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export/output.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export/output.mjs similarity index 99% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/export/output.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/export/output.mjs index 1fff013ff6639..c686b4d026672 100644 --- a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export/output.js +++ b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/export/output.mjs @@ -1,13 +1,14 @@ -export { _whatever as whatever }; -export { _wowzers as default }; var _foo = "yes", foob = "no"; export { _foo as foo, foob }; function _whatever() {} +export { _whatever as whatever }; + function _wowzers() {} +export { _wowzers as default }; var bar = { foo: function foo() { _foo; diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-2/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-2/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-2/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-3/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-3/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-3/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-4/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-4/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-4/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-4/output.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-4/output.mjs similarity index 99% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-4/output.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-4/output.mjs index 9f010a251925f..8ce7e6c3c46d2 100644 --- a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-4/output.js +++ b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules-4/output.mjs @@ -1,7 +1,6 @@ -export { _foo as foo }; - function _foo(bar) {} +export { _foo as foo }; var bar = { foo: function foo() { _foo; diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/function-name/modules/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/issues/5004/input.js b/packages/babel-plugin-transform-function-name/test/fixtures/issues/5004/input.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/issues/5004/input.js rename to packages/babel-plugin-transform-function-name/test/fixtures/issues/5004/input.mjs diff --git a/packages/babel-plugin-transform-function-name/test/fixtures/issues/5004/output.js b/packages/babel-plugin-transform-function-name/test/fixtures/issues/5004/output.mjs similarity index 100% rename from packages/babel-plugin-transform-function-name/test/fixtures/issues/5004/output.js rename to packages/babel-plugin-transform-function-name/test/fixtures/issues/5004/output.mjs diff --git a/packages/babel-plugin-transform-instanceof/package.json b/packages/babel-plugin-transform-instanceof/package.json index 02078b0c25ce0..41c7902e366ea 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "This plugin transforms all the ES2015 'instanceof' methods", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-instanceof", "license": "MIT", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-instanceof/src/index.js b/packages/babel-plugin-transform-instanceof/src/index.js index 4cb516b174291..dc9d402880dcc 100644 --- a/packages/babel-plugin-transform-instanceof/src/index.js +++ b/packages/babel-plugin-transform-instanceof/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { BinaryExpression(path) { @@ -25,4 +28,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-jscript/package.json b/packages/babel-plugin-transform-jscript/package.json index 8aae588da9964..1c83637e0e9f1 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-jscript/src/index.js b/packages/babel-plugin-transform-jscript/src/index.js index 02a5ddeed9d39..868f94c000ada 100644 --- a/packages/babel-plugin-transform-jscript/src/index.js +++ b/packages/babel-plugin-transform-jscript/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { FunctionExpression: { @@ -25,4 +28,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-literals/package.json b/packages/babel-plugin-transform-literals/package.json index f768961fa5e47..ad764cf9f8fbd 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-literals/src/index.js b/packages/babel-plugin-transform-literals/src/index.js index 2d3a30d03dc0a..82c90e8604430 100644 --- a/packages/babel-plugin-transform-literals/src/index.js +++ b/packages/babel-plugin-transform-literals/src/index.js @@ -1,4 +1,8 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { visitor: { NumericLiteral({ node }) { @@ -16,4 +20,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-member-expression-literals/package.json b/packages/babel-plugin-transform-member-expression-literals/package.json index 3632d9cae1a07..22e85a7954eb4 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-member-expression-literals/src/index.js b/packages/babel-plugin-transform-member-expression-literals/src/index.js index 1358af8114730..d31b955247f40 100644 --- a/packages/babel-plugin-transform-member-expression-literals/src/index.js +++ b/packages/babel-plugin-transform-member-expression-literals/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { MemberExpression: { @@ -19,4 +22,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-modules-amd/package.json b/packages/babel-plugin-transform-modules-amd/package.json index e3df229b244b0..f91f087a398e6 100644 --- a/packages/babel-plugin-transform-modules-amd/package.json +++ b/packages/babel-plugin-transform-modules-amd/package.json @@ -1,21 +1,22 @@ { "name": "@babel/plugin-transform-modules-amd", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "This plugin transforms ES2015 modules to AMD", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-amd", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/helper-module-transforms": "7.0.0-beta.39" + "@babel/helper-module-transforms": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42" }, "keywords": [ "babel-plugin" ], "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-modules-amd/src/index.js b/packages/babel-plugin-transform-modules-amd/src/index.js index fe1744f4b31c4..2bceb843c346c 100644 --- a/packages/babel-plugin-transform-modules-amd/src/index.js +++ b/packages/babel-plugin-transform-modules-amd/src/index.js @@ -1,3 +1,4 @@ +import { declare } from "@babel/helper-plugin-utils"; import { isModule, rewriteModuleStatementsAndPrepareHeader, @@ -14,7 +15,9 @@ const buildWrapper = template(` }) `); -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { loose, allowTopLevelThis, strict, strictMode, noInterop } = options; return { visitor: { @@ -97,4 +100,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-10/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-10/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-10/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-10/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-2/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-2/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-3/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-3/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-4/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-4/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-5/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-5/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-6/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-6/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-7/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-7/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-7/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-7/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-8/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-8/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-8/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-8/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-9/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-9/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-9/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default-9/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-2/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-2/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-3/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-3/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-4/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-4/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-5/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-5/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-6/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-6/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-from/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-2/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-2/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-3/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-3/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-4/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-4/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-5/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-5/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-specifier-default/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-specifier-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-specifier-default/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/export-specifier-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/exports-variable/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/exports-variable/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/exports-variable/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/exports-variable/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/get-module-name-option/options.json b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/get-module-name-option/options.json index 6d0cdb5a6f0cc..ef11b00e2ba23 100644 --- a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/get-module-name-option/options.json +++ b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/get-module-name-option/options.json @@ -1,4 +1,5 @@ { + "sourceType": "module", "moduleIds": true, "moduleId": "my custom module name" } diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/hoist-function-exports/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/hoist-function-exports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/hoist-function-exports/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/hoist-function-exports/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/import-order/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/import-order/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/import-order/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/import-order/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-default/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-default/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-glob/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-glob/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-glob/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-glob/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-mixing/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-mixing/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-mixing/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-mixing/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-named/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-named/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/module-name/options.json b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/module-name/options.json index be49a87d0b82f..5b0398abbe6f8 100644 --- a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/module-name/options.json +++ b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/module-name/options.json @@ -1,3 +1,4 @@ { + "sourceType": "module", "moduleIds": true } diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/module-name/output.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/module-name/output.js index a869bce301008..46d5e5e2744dc 100644 --- a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/module-name/output.js +++ b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/module-name/output.js @@ -1,4 +1,4 @@ -define("amd/module-name/output", [], function () { +define("amd/module-name/input", [], function () { "use strict"; foobar(); diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/noInterop-export-from/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/noInterop-export-from/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/noInterop-export-from/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/noInterop-export-from/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/noInterop-import-default-only/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/noInterop-import-default-only/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/noInterop-import-default-only/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/noInterop-import-default-only/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/overview/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/overview/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/overview/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/overview/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/remap/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/amd/remap/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/amd/remap/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/amd/remap/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-10/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-10/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-10/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-10/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-2/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-2/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-3/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-3/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-4/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-4/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-5/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-5/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-6/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-6/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-7/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-7/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-7/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-7/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-8/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-8/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-8/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-8/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-9/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-9/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-9/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default-9/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-2/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-2/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-3/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-3/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-4/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-4/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-5/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-5/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-6/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-6/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-from/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-2/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-2/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-3/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-3/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-4/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-4/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-5/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-5/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-specifier-default/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-specifier-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-specifier-default/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/export-specifier-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/exports-variable/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/exports-variable/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/exports-variable/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/exports-variable/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/get-module-name-option/options.json b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/get-module-name-option/options.json index 0b446c533467a..be939b1999ea6 100644 --- a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/get-module-name-option/options.json +++ b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/get-module-name-option/options.json @@ -1,4 +1,5 @@ { + "sourceType": "module", "moduleIds": true, "moduleId": "my custom module name", "plugins": [ diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/hoist-function-exports/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/hoist-function-exports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/hoist-function-exports/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/hoist-function-exports/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/import-order/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/import-order/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/import-order/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/import-order/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-default/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-default/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-glob/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-glob/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-glob/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-glob/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-mixing/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-mixing/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-mixing/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-mixing/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-named/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-named/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/module-name/options.json b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/module-name/options.json index 7f54a2b7f9feb..c72a7c5942cc4 100644 --- a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/module-name/options.json +++ b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/module-name/options.json @@ -1,4 +1,5 @@ { + "sourceType": "module", "moduleIds": true, "plugins": [ "external-helpers", diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/module-name/output.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/module-name/output.js index 347aadf7a0020..253b4805f7347 100644 --- a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/module-name/output.js +++ b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/module-name/output.js @@ -1,4 +1,4 @@ -define("loose/module-name/output", [], function () { +define("loose/module-name/input", [], function () { "use strict"; foobar(); diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/noInterop-export-from/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/noInterop-export-from/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/noInterop-export-from/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/noInterop-export-from/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/noInterop-import-default-only/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/noInterop-import-default-only/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/noInterop-import-default-only/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/noInterop-import-default-only/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/overview/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/overview/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/overview/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/overview/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/remap/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/loose/remap/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/loose/remap/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/loose/remap/input.mjs diff --git a/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/4192/input.js b/packages/babel-plugin-transform-modules-amd/test/fixtures/regression/4192/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-amd/test/fixtures/regression/4192/input.js rename to packages/babel-plugin-transform-modules-amd/test/fixtures/regression/4192/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/package.json b/packages/babel-plugin-transform-modules-commonjs/package.json index e2c11f7f97141..a6c90fdfaff1b 100644 --- a/packages/babel-plugin-transform-modules-commonjs/package.json +++ b/packages/babel-plugin-transform-modules-commonjs/package.json @@ -1,23 +1,24 @@ { "name": "@babel/plugin-transform-modules-commonjs", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "This plugin transforms ES2015 modules to CommonJS", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-commonjs", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/helper-module-transforms": "7.0.0-beta.39", - "@babel/helper-simple-access": "7.0.0-beta.39" + "@babel/helper-module-transforms": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/helper-simple-access": "7.0.0-beta.42" }, "keywords": [ "babel-plugin" ], "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39", - "@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42", + "@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-modules-commonjs/src/index.js b/packages/babel-plugin-transform-modules-commonjs/src/index.js index 30adf43142be4..6bf6ff4829566 100644 --- a/packages/babel-plugin-transform-modules-commonjs/src/index.js +++ b/packages/babel-plugin-transform-modules-commonjs/src/index.js @@ -1,3 +1,4 @@ +import { declare } from "@babel/helper-plugin-utils"; import { isModule, rewriteModuleStatementsAndPrepareHeader, @@ -9,9 +10,19 @@ import { import simplifyAccess from "@babel/helper-simple-access"; import { template, types as t } from "@babel/core"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { loose, + + // 'true' for non-mjs files to strictly have .default, instead of having + // destructuring-like behavior for their properties. + strictNamespace = false, + + // 'true' for mjs files to strictly have .default, instead of having + // destructuring-like behavior for their properties. + mjsStrictNamespace = true, allowTopLevelThis, strict, strictMode, @@ -29,9 +40,19 @@ export default function(api, options) { throw new Error(`.lazy must be a boolean, array of strings, or a function`); } + if (typeof strictNamespace !== "boolean") { + throw new Error(`.strictNamespace must be a boolean, or undefined`); + } + if (typeof mjsStrictNamespace !== "boolean") { + throw new Error(`.mjsStrictNamespace must be a boolean, or undefined`); + } + const getAssertion = localName => template.expression.ast` (function(){ - throw new Error("The CommonJS '" + "${localName}" + "' variable is not available in ES6 modules."); + throw new Error( + "The CommonJS '" + "${localName}" + "' variable is not available in ES6 modules." + + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + + "Babel config for this file."); })() `; @@ -97,10 +118,8 @@ export default function(api, options) { return { visitor: { Program: { - exit(path) { - // For now this requires unambiguous rather that just sourceType - // because Babel currently parses all files as sourceType:module. - if (!isModule(path, true /* requireUnambiguous */)) return; + exit(path, state) { + if (!isModule(path)) return; // Rename the bindings auto-injected into the scope so there is no // risk of conflict between the bindings. @@ -133,6 +152,11 @@ export default function(api, options) { allowTopLevelThis, noInterop, lazy, + esNamespaceOnly: + typeof state.filename === "string" && + /\.mjs$/.test(state.filename) + ? mjsStrictNamespace + : strictNamespace, }, ); @@ -178,4 +202,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/copied-nodes.js b/packages/babel-plugin-transform-modules-commonjs/test/copied-nodes.js index 4bdcaa89531e2..f28341da50598 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/copied-nodes.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/copied-nodes.js @@ -5,6 +5,7 @@ test("Doesn't use the same object for two different nodes in the AST", function( const code = 'import Foo from "bar"; Foo; Foo;'; const ast = babel.transform(code, { + ast: true, plugins: [[require("../"), { loose: true }]], }).ast; diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/auxiliary-comment/overview/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/auxiliary-comment/overview/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/auxiliary-comment/overview/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/auxiliary-comment/overview/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/auxiliary-comment/overview/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/auxiliary-comment/overview/output.js index 5ce6650470687..dfa19a51ab031 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/auxiliary-comment/overview/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/auxiliary-comment/overview/output.js @@ -31,7 +31,7 @@ _foo2 = babelHelpers.interopRequireDefault(require("foo2")) var /*before*/ -foo2 = babelHelpers.interopRequireWildcard(require("foo3")) +foo2 = babelHelpers.interopRequireDefault(require("foo3")) /*after*/ ; @@ -61,25 +61,49 @@ exports.test2 = test2; /*after*/ /*before*/ -(0, _foo4.bar) +(0, +/*after*/ + +/*before*/ +_foo4 +/*after*/ +. +/*before*/ +bar) /*after*/ ( /*before*/ -_foo2.default +_foo2 +/*after*/ +. +/*before*/ +default /*after*/ , /*before*/ -_foo5.foo +_foo5 +/*after*/ +. +/*before*/ +foo /*after*/ ); /* my comment */ /*before*/ -_foo5.foo +_foo5 +/*after*/ +. +/*before*/ +foo /*after*/ ; /*before*/ -_foo2.default +_foo2 +/*after*/ +. +/*before*/ +default /*after*/ ; diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/disable-strict-mode/strictMode-false/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/disable-strict-mode/strictMode-false/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/disable-strict-mode/strictMode-false/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/disable-strict-mode/strictMode-false/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-10/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-10/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-10/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-10/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-11/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-11/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-11/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-11/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-2/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-2/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-3/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-3/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-4/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-4/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-5/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-5/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-6/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-6/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-7/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-7/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-7/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-7/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-8/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-8/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-8/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-8/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-9/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-9/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-9/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default-9/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-destructured/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-destructured/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-destructured/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-destructured/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-2/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-2/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-3/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-3/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-4/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-4/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-5/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-5/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-6/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-6/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-7/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-7/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-7/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-7/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-8/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-8/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-8/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from-8/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-from/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-2/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-2/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-3/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-3/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-4/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-4/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-5/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-5/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/export-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/exports-variable/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/exports-variable/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/exports-variable/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/exports-variable/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/hoist-function-exports/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/hoist-function-exports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/hoist-function-exports/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/hoist-function-exports/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/illegal-export-esmodule-2/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/illegal-export-esmodule-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/illegal-export-esmodule-2/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/illegal-export-esmodule-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/illegal-export-esmodule/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/illegal-export-esmodule/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/illegal-export-esmodule/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/illegal-export-esmodule/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-default/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-default/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-default/input.mjs 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 f88741ee450f2..f3ae7f097128e 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,5 +1,9 @@ -var _taggedTemplateLiteral = require("@babel/runtime/helpers/taggedTemplateLiteral"); +"use strict"; -var _templateObject = /*#__PURE__*/ _taggedTemplateLiteral(["foo"], ["foo"]); +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); + +var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); + +var _templateObject = /*#__PURE__*/ (0, _taggedTemplateLiteral2.default)(["foo"]); tag(_templateObject); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-named/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-named/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-ordering/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-ordering/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-ordering/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-ordering/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/module-shadow/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/module-shadow/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/module-shadow/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/module-shadow/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/multi-load/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/multi-load/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/multi-load/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/multi-load/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/options.json index 4a31dd9de28f2..0f456743bc929 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/options.json +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/options.json @@ -1,4 +1,5 @@ { + "sourceType": "module", "plugins": [ "external-helpers", ["transform-modules-commonjs", { "loose": true }] diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/remap/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/remap/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/remap/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/remap/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-10/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-10/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-10/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-10/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-11/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-11/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-11/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-11/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-2/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-2/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-3/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-3/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-4/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-4/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-5/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-5/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-6/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-6/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-7/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-7/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-7/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-7/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-8/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-8/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-8/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-8/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-9/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-9/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-9/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default-9/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-destructured/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-destructured/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-destructured/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-destructured/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-2/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-2/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-3/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-3/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-4/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-4/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-5/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-5/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-6/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-6/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-7/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-7/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-7/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-7/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-8/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-8/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-8/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from-8/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-from/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-2/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-2/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-3/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-3/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-4/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-4/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-5/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-5/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/export-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/exports-variable/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/exports-variable/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/exports-variable/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/exports-variable/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/hoist-function-exports/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/hoist-function-exports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/hoist-function-exports/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/hoist-function-exports/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/illegal-export-esmodule-2/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/illegal-export-esmodule-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/illegal-export-esmodule-2/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/illegal-export-esmodule-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/illegal-export-esmodule/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/illegal-export-esmodule/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/illegal-export-esmodule/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/illegal-export-esmodule/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-default/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-default/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-default/input.mjs 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 f88741ee450f2..f3ae7f097128e 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,5 +1,9 @@ -var _taggedTemplateLiteral = require("@babel/runtime/helpers/taggedTemplateLiteral"); +"use strict"; -var _templateObject = /*#__PURE__*/ _taggedTemplateLiteral(["foo"], ["foo"]); +var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); + +var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral")); + +var _templateObject = /*#__PURE__*/ (0, _taggedTemplateLiteral2.default)(["foo"]); tag(_templateObject); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-named/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-named/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-ordering/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-ordering/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-ordering/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-ordering/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/module-shadow/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/module-shadow/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/module-shadow/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/module-shadow/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/multi-load/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/multi-load/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/multi-load/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/multi-load/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/options.json index e38115115dca1..47d0b962b92f3 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/options.json +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/options.json @@ -1,3 +1,4 @@ { + "sourceType": "module", "plugins": ["external-helpers", "transform-modules-commonjs"] } diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/remap/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/remap/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/remap/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/remap/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-default/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-default/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-named/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-named/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-namespace/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-namespace/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-namespace/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-namespace/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-namespace/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-namespace/output.js index e720a87205fbd..ef26faaebcf22 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-namespace/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/import-namespace/output.js @@ -1,7 +1,7 @@ "use strict"; function foo() { - const data = babelHelpers.interopRequireWildcard(require("foo")); + const data = babelHelpers.interopRequireDefault(require("foo")); foo = function () { return data; diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-all/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-all/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-all/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-all/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-default/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-default/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-named/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-named/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-namespace/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-namespace/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-namespace/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-namespace/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-namespace/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-namespace/output.js index 239f67e25a871..cb6dab1f41627 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-namespace/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/reexport-namespace/output.js @@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { exports.namespace = void 0; function namespace() { - const data = babelHelpers.interopRequireWildcard(require("foo")); + const data = babelHelpers.interopRequireDefault(require("foo")); namespace = function () { return data; diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/sideeffect/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/sideeffect/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/sideeffect/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-dep/sideeffect/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-default/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-default/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-named/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-named/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-namespace/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-namespace/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-namespace/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-namespace/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-namespace/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-namespace/output.js index d041921ee450e..ffdc4d8163469 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-namespace/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/import-namespace/output.js @@ -1,4 +1,4 @@ "use strict"; -var foo = babelHelpers.interopRequireWildcard(require("./foo")); +var foo = babelHelpers.interopRequireDefault(require("./foo")); console.log(foo); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-all/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-all/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-all/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-all/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-default/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-default/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-named/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-named/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-namespace/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-namespace/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-namespace/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-namespace/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-namespace/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-namespace/output.js index 6aad5e4726b74..82e3c24904e18 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-namespace/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/reexport-namespace/output.js @@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.namespace = void 0; -var namespace = babelHelpers.interopRequireWildcard(require("./foo")); +var namespace = babelHelpers.interopRequireDefault(require("./foo")); exports.namespace = namespace; diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/sideeffect/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/sideeffect/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/sideeffect/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-local/sideeffect/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-default/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-default/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-named/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-named/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-namespace/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-namespace/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-namespace/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-namespace/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-namespace/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-namespace/output.js index 703d0cdd86d90..848b8cb1d317c 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-namespace/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/import-namespace/output.js @@ -1,9 +1,9 @@ "use strict"; -var foo1 = babelHelpers.interopRequireWildcard(require("white")); +var foo1 = babelHelpers.interopRequireDefault(require("white")); function foo2() { - const data = babelHelpers.interopRequireWildcard(require("black")); + const data = babelHelpers.interopRequireDefault(require("black")); foo2 = function () { return data; diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-all/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-all/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-all/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-all/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-default/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-default/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-named/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-named/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-namespace/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-namespace/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-namespace/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-namespace/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-namespace/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-namespace/output.js index 7e52454406e74..999143700b192 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-namespace/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/reexport-namespace/output.js @@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.namespace2 = exports.namespace1 = void 0; -var namespace1 = babelHelpers.interopRequireWildcard(require("white")); +var namespace1 = babelHelpers.interopRequireDefault(require("white")); exports.namespace1 = namespace1; function namespace2() { - const data = babelHelpers.interopRequireWildcard(require("black")); + const data = babelHelpers.interopRequireDefault(require("black")); namespace2 = function () { return data; diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/sideeffect/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/sideeffect/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/sideeffect/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/lazy-whitelist/sideeffect/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/exec.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/exec.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/exec.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/exec.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/options.json new file mode 100644 index 0000000000000..fd06b45cf2e4e --- /dev/null +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters-star/options.json @@ -0,0 +1,5 @@ +{ + "plugins": [ + ["transform-modules-commonjs", { "mjsStrictNamespace": false }] + ] +} diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters/exec.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters/exec.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters/exec.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters/exec.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters/output.js index c545f5310d856..721f9af381e82 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/copy-getters-setters/output.js @@ -16,6 +16,6 @@ Object.defineProperty(exports, "baz", { } }); -var _moduleWithGetter = _interopRequireWildcard(require("./moduleWithGetter")); +var _moduleWithGetter = _interopRequireDefault(require("./moduleWithGetter")); -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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-const-throw/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-const-throw/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-const-throw/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-const-throw/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-const-throw/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-const-throw/output.js index 2433845dbdc23..7b05f0c824580 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-const-throw/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/import-const-throw/output.js @@ -2,12 +2,10 @@ var _foo = _interopRequireDefault(require("foo")); -var Bar = _interopRequireWildcard(require("bar")); +var Bar = _interopRequireDefault(require("bar")); var _baz = require("baz"); -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 _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } _foo.default = (42, function () { diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/local-exports-decl/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/local-exports-decl/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/local-exports-decl/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/local-exports-decl/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/module-exports/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/module-exports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/module-exports/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/module-exports/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/module-exports/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/module-exports/output.js index e1138b612d84b..3e9254c59bf29 100644 --- a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/module-exports/output.js +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/module-exports/output.js @@ -3,56 +3,56 @@ require("foo"); console.log(function () { - throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }()); console.log(function () { - throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }().prop); exports = function () { - throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }() + 1; exports = function () { - throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }() + 4; ({ exports } = ({}, function () { - throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }())); [exports] = ([], function () { - throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }()); exports = {}; (function () { - throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "exports" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); })().prop = ""; console.log(function () { - throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }()); console.log(function () { - throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }().exports); module = function () { - throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }() + 1; module = function () { - throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }() + 4; ({ module } = ({}, function () { - throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }())); [module] = ([], function () { - throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); }()); module = {}; (function () { - throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules."); + throw new Error("The CommonJS '" + "module" + "' variable is not available in ES6 modules." + "Consider setting setting sourceType:script or sourceType:unambiguous in your " + "Babel config for this file."); })().prop = ""; diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/input.mjs b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/input.mjs new file mode 100644 index 0000000000000..b85fcb659efb6 --- /dev/null +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/input.mjs @@ -0,0 +1,14 @@ +import aDefault from "one"; +import { aNamed } from "two"; +import { orig as anAliased } from "three"; +import * as aNamespace from "four"; + +console.log(aDefault); +console.log(aNamed); +console.log(anAliased); +console.log(aNamespace); + +console.log(aDefault()); +console.log(aNamed()); +console.log(anAliased()); +console.log(aNamespace()); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/options.json new file mode 100644 index 0000000000000..e38115115dca1 --- /dev/null +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["external-helpers", "transform-modules-commonjs"] +} diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/output.js new file mode 100644 index 0000000000000..c40ee11036e2b --- /dev/null +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/output.js @@ -0,0 +1,17 @@ +"use strict"; + +var _one = babelHelpers.interopRequireDefault(require("one")); + +var _two = require("two"); + +var _three = require("three"); + +var aNamespace = babelHelpers.interopRequireDefault(require("four")); +console.log(_one.default); +console.log(_two.aNamed); +console.log(_three.orig); +console.log(aNamespace); +console.log((0, _one.default)()); +console.log((0, _two.aNamed)()); +console.log((0, _three.orig)()); +console.log(aNamespace()); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/source-mappings.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/source-mappings.json new file mode 100644 index 0000000000000..c26d511a52a02 --- /dev/null +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/misc/reference-source-map/source-mappings.json @@ -0,0 +1,162 @@ +[ + { + "generated": { + "line": 10, + "column": 12 + }, + "original": { + "line": 6, + "column": 12 + } + }, + { + "generated": { + "line": 10, + "column": 23 + }, + "original": { + "line": 6, + "column": 12 + } + }, + { + "generated": { + "line": 11, + "column": 12 + }, + "original": { + "line": 7, + "column": 12 + } + }, + { + "generated": { + "line": 11, + "column": 22 + }, + "original": { + "line": 7, + "column": 12 + } + }, + { + "generated": { + "line": 12, + "column": 12 + }, + "original": { + "line": 8, + "column": 12 + } + }, + { + "generated": { + "line": 12, + "column": 22 + }, + "original": { + "line": 8, + "column": 12 + } + }, + { + "generated": { + "line": 13, + "column": 12 + }, + "original": { + "line": 9, + "column": 12 + } + }, + { + "generated": { + "line": 13, + "column": 21 + }, + "original": { + "line": 9, + "column": 12 + } + }, + { + "generated": { + "line": 14, + "column": 16 + }, + "original": { + "line": 11, + "column": 12 + } + }, + { + "generated": { + "line": 14, + "column": 27 + }, + "original": { + "line": 11, + "column": 12 + } + }, + { + "generated": { + "line": 15, + "column": 16 + }, + "original": { + "line": 12, + "column": 12 + } + }, + { + "generated": { + "line": 15, + "column": 26 + }, + "original": { + "line": 12, + "column": 12 + } + }, + { + "generated": { + "line": 16, + "column": 16 + }, + "original": { + "line": 13, + "column": 12 + } + }, + { + "generated": { + "line": 16, + "column": 26 + }, + "original": { + "line": 13, + "column": 12 + } + }, + { + "generated": { + "line": 17, + "column": 12 + }, + "original": { + "line": 14, + "column": 12 + } + }, + { + "generated": { + "line": 17, + "column": 21 + }, + "original": { + "line": 14, + "column": 12 + } + } +] diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/noInterop/export-from/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/noInterop/export-from/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/noInterop/export-from/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/noInterop/export-from/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/noInterop/import-default-only/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/noInterop/import-default-only/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/noInterop/import-default-only/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/noInterop/import-default-only/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/noInterop/import-wildcard/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/noInterop/import-wildcard/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/noInterop/import-wildcard/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/noInterop/import-wildcard/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/4462-T7565/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/4462-T7565/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/4462-T7565/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/4462-T7565/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7160/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7160/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7160/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7160/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7165/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7165/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7165/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7165/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7199/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7199/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7199/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7199/input.mjs 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 47c956825184e..563d49889bffa 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 @@ -4,9 +4,13 @@ var _foo = _interopRequireDefault(require("foo")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } -function _sliceIterator(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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } -function _slicedToArray(arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return _sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } } +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 _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } const _bar = bar, _bar2 = _slicedToArray(_bar, 1), diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7272/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7272/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7272/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/T7272/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-class/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-class/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-class/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-class/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-function/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-function/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-function/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-function/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-named-class/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-named-class/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-named-class/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-named-class/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-named-function/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-named-function/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-named-function/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility-named-function/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/es3-compatibility/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/lazy-7176/input.mjs b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/lazy-7176/input.mjs new file mode 100644 index 0000000000000..b6c0b8c947463 --- /dev/null +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/lazy-7176/input.mjs @@ -0,0 +1,5 @@ +import * as mod from "mod"; +import { named } from "mod"; + +named; +mod; diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/lazy-7176/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/lazy-7176/options.json new file mode 100644 index 0000000000000..4d4cb95420155 --- /dev/null +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/lazy-7176/options.json @@ -0,0 +1,6 @@ +{ + "plugins": [ + ["transform-modules-commonjs", {"lazy": true}], + "external-helpers" + ] +} diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/lazy-7176/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/lazy-7176/output.js new file mode 100644 index 0000000000000..7ed4c7dfaf61b --- /dev/null +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/regression/lazy-7176/output.js @@ -0,0 +1,14 @@ +"use strict"; + +function mod() { + const data = babelHelpers.interopRequireDefault(require("mod")); + + mod = function () { + return data; + }; + + return data; +} + +mod().named; +mod(); diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-1/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-1/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-1/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-1/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-2/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-2/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-3/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-3/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-all/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-all/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-all/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-all/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-array-default-params/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-array-default-params/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-array-default-params/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-array-default-params/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-array-rest/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-array-rest/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-array-rest/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-array-rest/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-array/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-array/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-array/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-array/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-deep/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-deep/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-deep/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-deep/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-default-params/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-default-params/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-default-params/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-default-params/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-rest/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-rest/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-rest/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-object-rest/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-object/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-object/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-object/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export-const-destructuring-object/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/export/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import-wildcard/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import-wildcard/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import-wildcard/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import-wildcard/input.mjs diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/input.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/input.js rename to packages/babel-plugin-transform-modules-commonjs/test/fixtures/strict/import/input.mjs 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 4b1163fa6190a..1654d4e359bd3 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,6 @@ "plugins": [ "external-helpers", "syntax-object-rest-spread", - ["transform-modules-commonjs", { "strict": true }] + ["transform-modules-commonjs", { "strict": true, "mjsStrictNamespace": false }] ] } diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/negative-suffix/input.mjs b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/negative-suffix/input.mjs new file mode 100644 index 0000000000000..4b99ecd9c235a --- /dev/null +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/negative-suffix/input.mjs @@ -0,0 +1,7 @@ +export let diffLevel = 0; + +export function diff() { + if (!--diffLevel) { + console.log("hey"); + } +} diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/negative-suffix/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/negative-suffix/output.js new file mode 100644 index 0000000000000..c881117d50d58 --- /dev/null +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/negative-suffix/output.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.diff = diff; +exports.diffLevel = void 0; +let diffLevel = 0; +exports.diffLevel = diffLevel; + +function diff() { + if (!(exports.diffLevel = diffLevel = diffLevel - 1)) { + console.log("hey"); + } +} diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/options.json b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/options.json new file mode 100644 index 0000000000000..ab27afaee30bf --- /dev/null +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["external-helpers", ["transform-modules-commonjs"]] +} diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/positive-suffix/input.mjs b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/positive-suffix/input.mjs new file mode 100644 index 0000000000000..a815395f6a897 --- /dev/null +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/positive-suffix/input.mjs @@ -0,0 +1,7 @@ +export let diffLevel = 0; + +export function diff() { + if (!++diffLevel) { + console.log("hey"); + } +} diff --git a/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/positive-suffix/output.js b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/positive-suffix/output.js new file mode 100644 index 0000000000000..6fd88b919dac4 --- /dev/null +++ b/packages/babel-plugin-transform-modules-commonjs/test/fixtures/update-expression/positive-suffix/output.js @@ -0,0 +1,15 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.diff = diff; +exports.diffLevel = void 0; +let diffLevel = 0; +exports.diffLevel = diffLevel; + +function diff() { + if (!(exports.diffLevel = diffLevel = diffLevel + 1)) { + console.log("hey"); + } +} diff --git a/packages/babel-plugin-transform-modules-systemjs/package.json b/packages/babel-plugin-transform-modules-systemjs/package.json index d9f40286edf8e..fd67ccc75bddb 100644 --- a/packages/babel-plugin-transform-modules-systemjs/package.json +++ b/packages/babel-plugin-transform-modules-systemjs/package.json @@ -1,22 +1,23 @@ { "name": "@babel/plugin-transform-modules-systemjs", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "This plugin transforms ES2015 modules to SystemJS", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-systemjs", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/helper-hoist-variables": "7.0.0-beta.39" + "@babel/helper-hoist-variables": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42" }, "keywords": [ "babel-plugin" ], "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39", - "@babel/plugin-syntax-dynamic-import": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42", + "@babel/plugin-syntax-dynamic-import": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-modules-systemjs/src/index.js b/packages/babel-plugin-transform-modules-systemjs/src/index.js index 73f62f5cad218..a323250359188 100644 --- a/packages/babel-plugin-transform-modules-systemjs/src/index.js +++ b/packages/babel-plugin-transform-modules-systemjs/src/index.js @@ -1,3 +1,4 @@ +import { declare } from "@babel/helper-plugin-utils"; import hoistVariables from "@babel/helper-hoist-variables"; import { template, types as t } from "@babel/core"; @@ -22,7 +23,9 @@ const buildExportAll = template(` const TYPE_IMPORT = "Import"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { systemGlobal = "System" } = options; const IGNORE_REASSIGNMENT_SYMBOL = Symbol(); @@ -407,4 +410,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/dynamic-import/dynamic-import/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/dynamic-import/dynamic-import/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/dynamic-import/dynamic-import/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/dynamic-import/dynamic-import/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/dynamic-import/dynamic-import/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/dynamic-import/dynamic-import/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/dynamic-import/dynamic-import/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/dynamic-import/dynamic-import/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-default-params/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array-rest/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-array/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-deep/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-default-params/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object-rest/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-const-destructuring-object/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-2/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-2/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-2/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-2/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-2/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-2/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-3/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-3/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-3/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-3/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-3/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-3/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-4/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-4/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-4/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-4/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-4/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-4/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-5/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-5/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-5/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-5/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-5/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-5/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-6/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-6/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-6/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-6/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-6/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-6/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-7/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-7/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-7/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-7/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-7/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-7/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-7/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-7/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-8/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-8/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-8/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-8/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-8/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-8/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-8/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-8/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-9/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-9/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-9/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-9/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-9/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-9/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-9/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default-9/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-default/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-2/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-2/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-2/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-2/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-2/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-2/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-3/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-3/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-3/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-3/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-3/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-3/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-4/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-4/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-4/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-4/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-4/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-4/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-5/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-5/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-5/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-5/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-5/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-5/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-6/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-6/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-6/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-6/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-6/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from-6/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-from/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-2/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-2/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-2/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-2/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-2/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-2/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-3/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-3/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-3/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-3/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-3/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-3/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-4/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-4/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-4/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-4/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-4/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-4/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-5/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-5/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-5/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-5/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-5/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-5/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-6/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-6/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-6/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-6/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-6/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-6/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-7/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-7/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-7/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-7/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-7/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-7/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-7/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named-7/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/export-named/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/exports-variable/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/exports-variable/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/exports-variable/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/exports-variable/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/exports-variable/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/exports-variable/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/exports-variable/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/exports-variable/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoist-function-exports/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoist-function-exports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoist-function-exports/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoist-function-exports/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoist-function-exports/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoist-function-exports/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoist-function-exports/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoist-function-exports/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoisting-bindings/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoisting-bindings/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoisting-bindings/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoisting-bindings/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoisting-bindings/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoisting-bindings/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoisting-bindings/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/hoisting-bindings/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-default/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-default/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-default/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-default/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-default/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-default/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-glob/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-glob/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-glob/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-glob/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-glob/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-glob/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-glob/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-glob/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-mixing/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-mixing/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-mixing/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-mixing/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-mixing/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-mixing/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-mixing/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-mixing/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-named/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-named/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-named/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-named/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-named/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-named/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-numbered/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-numbered/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-numbered/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-numbered/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-numbered/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-numbered/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-numbered/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports-numbered/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/imports/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/module-name/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/module-name/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/module-name/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/module-name/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/module-name/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/module-name/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/module-name/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/module-name/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/overview/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/overview/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/overview/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/overview/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/overview/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/overview/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/overview/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/overview/output.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/remap/input.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/remap/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/remap/input.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/remap/input.mjs diff --git a/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/remap/output.js b/packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/remap/output.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/remap/output.js rename to packages/babel-plugin-transform-modules-systemjs/test/fixtures/systemjs/remap/output.mjs diff --git a/packages/babel-plugin-transform-modules-umd/package.json b/packages/babel-plugin-transform-modules-umd/package.json index e458c8c0ac400..65e4c70b030f8 100644 --- a/packages/babel-plugin-transform-modules-umd/package.json +++ b/packages/babel-plugin-transform-modules-umd/package.json @@ -1,21 +1,22 @@ { "name": "@babel/plugin-transform-modules-umd", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "This plugin transforms ES2015 modules to UMD", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-umd", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/helper-module-transforms": "7.0.0-beta.39" + "@babel/helper-module-transforms": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42" }, "keywords": [ "babel-plugin" ], "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-modules-umd/src/index.js b/packages/babel-plugin-transform-modules-umd/src/index.js index 15b69ebd0655d..0e7979d9c8b44 100644 --- a/packages/babel-plugin-transform-modules-umd/src/index.js +++ b/packages/babel-plugin-transform-modules-umd/src/index.js @@ -1,3 +1,4 @@ +import { declare } from "@babel/helper-plugin-utils"; import { basename, extname } from "path"; import { isModule, @@ -30,7 +31,9 @@ const buildWrapper = template(` }) `); -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { globals, exactGlobals, @@ -225,4 +228,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-10/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-10/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-10/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-10/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-11/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-11/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-11/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-11/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-2/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-2/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-3/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-3/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-4/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-4/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-5/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-5/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-6/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-6/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-7/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-7/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-7/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-7/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-8/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-8/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-8/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-8/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-9/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-9/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-9/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default-9/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-2/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-2/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-3/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-3/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-4/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-4/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-5/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-5/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-6/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-6/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-from/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-2/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-2/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-3/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-3/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-4/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-4/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-5/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-5/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/export-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/exports-variable/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/exports-variable/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/exports-variable/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/exports-variable/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/get-module-name-option/options.json b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/get-module-name-option/options.json index fd01b12b80a53..b053905b03a9b 100644 --- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/get-module-name-option/options.json +++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/get-module-name-option/options.json @@ -1,4 +1,5 @@ { + "sourceType": "module", "moduleIds": true, "moduleId": "my custom module name", "plugins": [ diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/hoist-function-exports/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/hoist-function-exports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/hoist-function-exports/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/hoist-function-exports/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-default/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-default/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false-with-overrides/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false-with-overrides/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false-with-overrides/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false-with-overrides/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-false/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true-with-overrides/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true-with-overrides/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true-with-overrides/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true-with-overrides/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-exact-globals-true/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-glob/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-glob/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-glob/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-glob/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-mixing/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-mixing/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-mixing/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-mixing/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-named/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-named/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/imports/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-namespace/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-namespace/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-namespace/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-namespace/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-very-nested-namespace/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-very-nested-namespace/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-very-nested-namespace/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global-in-very-nested-namespace/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id-with-overridden-global/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id/options.json b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id/options.json index bf41ea5a3fbe5..895e18b863604 100644 --- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id/options.json +++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-id/options.json @@ -1,4 +1,5 @@ { + "sourceType": "module", "moduleId": "MyLib", "plugins": [ "external-helpers", diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name-with-overridden-global/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name-with-overridden-global/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name-with-overridden-global/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name-with-overridden-global/input.mjs 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 0bc010d814c4f..516c1e9a10c07 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 @@ -1,6 +1,6 @@ (function (global, factory) { if (typeof define === "function" && define.amd) { - define("loose/module-name-with-overridden-global/output", ["exports"], factory); + define("loose/module-name-with-overridden-global/input", ["exports"], factory); } else if (typeof exports !== "undefined") { factory(exports); } else { @@ -8,7 +8,7 @@ exports: {} }; factory(mod.exports); - global.looseModuleNameWithOverriddenGlobalOutput = mod.exports; + global.looseModuleNameWithOverriddenGlobalInput = mod.exports; } })(this, function (_exports) { "use strict"; diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name/options.json b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name/options.json index 050e3555fd00a..ab68188b076ce 100644 --- a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name/options.json +++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/module-name/options.json @@ -1,4 +1,5 @@ { + "sourceType": "module", "moduleIds": true, "plugins": [ "external-helpers", 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 31d43cd38b719..37b3679166223 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 @@ -1,6 +1,6 @@ (function (global, factory) { if (typeof define === "function" && define.amd) { - define("loose/module-name/output", [], factory); + define("loose/module-name/input", [], factory); } else if (typeof exports !== "undefined") { factory(); } else { @@ -8,7 +8,7 @@ exports: {} }; factory(); - global.looseModuleNameOutput = mod.exports; + global.looseModuleNameInput = mod.exports; } })(this, function () { "use strict"; diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/non-default-imports/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/non-default-imports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/non-default-imports/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/non-default-imports/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-export-name/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-export-name/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-export-name/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-export-name/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-import-name/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-import-name/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-import-name/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/override-import-name/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/overview/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/overview/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/overview/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/overview/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/remap/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/loose/remap/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/loose/remap/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/loose/remap/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/regression/4192/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/regression/4192/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/regression/4192/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/regression/4192/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-10/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-10/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-10/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-10/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-11/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-11/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-11/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-11/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-2/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-2/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-3/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-3/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-4/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-4/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-5/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-5/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-6/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-6/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-7/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-7/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-7/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-7/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-8/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-8/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-8/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-8/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-9/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-9/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-9/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default-9/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-2/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-2/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-3/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-3/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-4/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-4/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-5/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-5/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-6/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-6/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-6/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from-6/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-from/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-2/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-2/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-2/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-3/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-3/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-3/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-3/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-4/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-4/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-4/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-4/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-5/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-5/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-5/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named-5/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/export-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/exports-variable/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/exports-variable/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/exports-variable/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/exports-variable/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/get-module-name-option/options.json b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/get-module-name-option/options.json index 6d0cdb5a6f0cc..ef11b00e2ba23 100644 --- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/get-module-name-option/options.json +++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/get-module-name-option/options.json @@ -1,4 +1,5 @@ { + "sourceType": "module", "moduleIds": true, "moduleId": "my custom module name" } diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/hoist-function-exports/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/hoist-function-exports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/hoist-function-exports/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/hoist-function-exports/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-default/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-default/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-default/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false-with-overrides/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false-with-overrides/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false-with-overrides/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false-with-overrides/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-false/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true-with-overrides/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true-with-overrides/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true-with-overrides/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true-with-overrides/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-exact-globals-true/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-glob/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-glob/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-glob/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-glob/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-mixing/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-mixing/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-mixing/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-mixing/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-named/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-named/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-named/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports-named/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/imports/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-namespace/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-namespace/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-namespace/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-namespace/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-very-nested-namespace/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-very-nested-namespace/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-very-nested-namespace/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global-in-very-nested-namespace/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id-with-overridden-global/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id/options.json b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id/options.json index 921ceb966006f..48a14ad305b94 100644 --- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id/options.json +++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-id/options.json @@ -1,3 +1,4 @@ { + "sourceType": "module", "moduleId": "MyLib" } diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name-with-overridden-global/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name-with-overridden-global/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name-with-overridden-global/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name-with-overridden-global/input.mjs 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 f72bc963fe2aa..b17d582429ed7 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 @@ -1,6 +1,6 @@ (function (global, factory) { if (typeof define === "function" && define.amd) { - define("umd/module-name-with-overridden-global/output", ["exports"], factory); + define("umd/module-name-with-overridden-global/input", ["exports"], factory); } else if (typeof exports !== "undefined") { factory(exports); } else { @@ -8,7 +8,7 @@ exports: {} }; factory(mod.exports); - global.umdModuleNameWithOverriddenGlobalOutput = mod.exports; + global.umdModuleNameWithOverriddenGlobalInput = mod.exports; } })(this, function (_exports) { "use strict"; diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name/options.json b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name/options.json index be49a87d0b82f..5b0398abbe6f8 100644 --- a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name/options.json +++ b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/module-name/options.json @@ -1,3 +1,4 @@ { + "sourceType": "module", "moduleIds": true } 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 e18249884879b..3967f520001cb 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 @@ -1,6 +1,6 @@ (function (global, factory) { if (typeof define === "function" && define.amd) { - define("umd/module-name/output", [], factory); + define("umd/module-name/input", [], factory); } else if (typeof exports !== "undefined") { factory(); } else { @@ -8,7 +8,7 @@ exports: {} }; factory(); - global.umdModuleNameOutput = mod.exports; + global.umdModuleNameInput = mod.exports; } })(this, function () { "use strict"; diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/non-default-imports/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/non-default-imports/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/non-default-imports/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/non-default-imports/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-export-name/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-export-name/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-export-name/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-export-name/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-import-name/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-import-name/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-import-name/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/override-import-name/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/overview/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/overview/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/overview/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/overview/input.mjs diff --git a/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/remap/input.js b/packages/babel-plugin-transform-modules-umd/test/fixtures/umd/remap/input.mjs similarity index 100% rename from packages/babel-plugin-transform-modules-umd/test/fixtures/umd/remap/input.js rename to packages/babel-plugin-transform-modules-umd/test/fixtures/umd/remap/input.mjs diff --git a/packages/babel-plugin-transform-new-target/package.json b/packages/babel-plugin-transform-new-target/package.json index 5d239ae5db8c2..167dc0e8440ac 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Transforms new.target meta property", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-new-target", "license": "MIT", @@ -8,13 +8,16 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39", - "@babel/plugin-proposal-class-properties": "7.0.0-beta.39", - "@babel/plugin-transform-arrow-functions": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42", + "@babel/plugin-proposal-class-properties": "7.0.0-beta.42", + "@babel/plugin-transform-arrow-functions": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-new-target/src/index.js b/packages/babel-plugin-transform-new-target/src/index.js index 93825672f611e..162575ecf2274 100644 --- a/packages/babel-plugin-transform-new-target/src/index.js +++ b/packages/babel-plugin-transform-new-target/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { name: "transform-new-target", @@ -67,4 +70,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-object-assign/package.json b/packages/babel-plugin-transform-object-assign/package.json index 8e881de940b49..b6b48c9d8fca1 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,11 +9,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-object-assign/src/index.js b/packages/babel-plugin-transform-object-assign/src/index.js index 42df9df70a288..856405ce2f250 100644 --- a/packages/babel-plugin-transform-object-assign/src/index.js +++ b/packages/babel-plugin-transform-object-assign/src/index.js @@ -1,4 +1,8 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { visitor: { CallExpression: function(path, file) { @@ -8,4 +12,4 @@ export default function() { }, }, }; -} +}); 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 e5ece1e7846c5..f3eda35ba42fc 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-object-set-prototype-of-to-assign/src/index.js b/packages/babel-plugin-transform-object-set-prototype-of-to-assign/src/index.js index e1a9529c7ce3a..84f4399a978df 100644 --- a/packages/babel-plugin-transform-object-set-prototype-of-to-assign/src/index.js +++ b/packages/babel-plugin-transform-object-set-prototype-of-to-assign/src/index.js @@ -1,4 +1,8 @@ -export default function() { +import { declare } from "@babel/helper-plugin-utils"; + +export default declare(api => { + api.assertVersion(7); + return { visitor: { CallExpression(path, file) { @@ -8,4 +12,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-object-super/package.json b/packages/babel-plugin-transform-object-super/package.json index 2770b8cbac5dc..e5b704af8ef10 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile ES2015 object super to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-object-super", "license": "MIT", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-replace-supers": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/helper-replace-supers": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-object-super/src/index.js b/packages/babel-plugin-transform-object-super/src/index.js index e0c6c14cfa6e1..8ba3c588ec765 100644 --- a/packages/babel-plugin-transform-object-super/src/index.js +++ b/packages/babel-plugin-transform-object-super/src/index.js @@ -1,3 +1,4 @@ +import { declare } from "@babel/helper-plugin-utils"; import ReplaceSupers from "@babel/helper-replace-supers"; import { types as t } from "@babel/core"; @@ -14,7 +15,9 @@ function replacePropertySuper(path, node, scope, getObjectRef, file) { replaceSupers.replace(); } -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { ObjectExpression(path, state) { @@ -47,4 +50,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-parameters/package.json b/packages/babel-plugin-transform-parameters/package.json index eb3a6e26bcb44..d1cf013fee55b 100644 --- a/packages/babel-plugin-transform-parameters/package.json +++ b/packages/babel-plugin-transform-parameters/package.json @@ -1,22 +1,23 @@ { "name": "@babel/plugin-transform-parameters", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile ES2015 default and rest parameters to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-parameters", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/helper-call-delegate": "7.0.0-beta.39", - "@babel/helper-get-function-arity": "7.0.0-beta.39" + "@babel/helper-call-delegate": "7.0.0-beta.42", + "@babel/helper-get-function-arity": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42" }, "keywords": [ "babel-plugin" ], "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-parameters/src/index.js b/packages/babel-plugin-transform-parameters/src/index.js index 4f66e10ba49fe..733ff830834aa 100644 --- a/packages/babel-plugin-transform-parameters/src/index.js +++ b/packages/babel-plugin-transform-parameters/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import convertFunctionParams from "./params"; import convertFunctionRest from "./rest"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { loose } = options; return { visitor: { @@ -26,4 +29,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-parameters/test/fixtures/regression/4209/input.js b/packages/babel-plugin-transform-parameters/test/fixtures/regression/4209/input.mjs similarity index 100% rename from packages/babel-plugin-transform-parameters/test/fixtures/regression/4209/input.js rename to packages/babel-plugin-transform-parameters/test/fixtures/regression/4209/input.mjs diff --git a/packages/babel-plugin-transform-parameters/test/fixtures/regression/6057-expanded/input.js b/packages/babel-plugin-transform-parameters/test/fixtures/regression/6057-expanded/input.mjs similarity index 100% rename from packages/babel-plugin-transform-parameters/test/fixtures/regression/6057-expanded/input.js rename to packages/babel-plugin-transform-parameters/test/fixtures/regression/6057-expanded/input.mjs diff --git a/packages/babel-plugin-transform-parameters/test/fixtures/regression/6057-expanded/output.js b/packages/babel-plugin-transform-parameters/test/fixtures/regression/6057-expanded/output.js index c3554cc0ec248..e113eb30897c7 100644 --- a/packages/babel-plugin-transform-parameters/test/fixtures/regression/6057-expanded/output.js +++ b/packages/babel-plugin-transform-parameters/test/fixtures/regression/6057-expanded/output.js @@ -19,7 +19,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } diff --git a/packages/babel-plugin-transform-parameters/test/fixtures/use-loose-option/default-assignment-with-types/input.js b/packages/babel-plugin-transform-parameters/test/fixtures/use-loose-option/default-assignment-with-types/input.mjs similarity index 100% rename from packages/babel-plugin-transform-parameters/test/fixtures/use-loose-option/default-assignment-with-types/input.js rename to packages/babel-plugin-transform-parameters/test/fixtures/use-loose-option/default-assignment-with-types/input.mjs diff --git a/packages/babel-plugin-transform-parameters/test/fixtures/use-loose-option/default-assignment-with-types/output.js b/packages/babel-plugin-transform-parameters/test/fixtures/use-loose-option/default-assignment-with-types/output.mjs similarity index 100% rename from packages/babel-plugin-transform-parameters/test/fixtures/use-loose-option/default-assignment-with-types/output.js rename to packages/babel-plugin-transform-parameters/test/fixtures/use-loose-option/default-assignment-with-types/output.mjs diff --git a/packages/babel-plugin-transform-property-literals/package.json b/packages/babel-plugin-transform-property-literals/package.json index ad39e08b7ae72..f3d8103af6097 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-property-literals/src/index.js b/packages/babel-plugin-transform-property-literals/src/index.js index a8de9f34ca24f..812cf1a3b50d8 100644 --- a/packages/babel-plugin-transform-property-literals/src/index.js +++ b/packages/babel-plugin-transform-property-literals/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { ObjectProperty: { @@ -18,4 +21,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-property-mutators/package.json b/packages/babel-plugin-transform-property-mutators/package.json index cfcf819fa75bc..6017dbd3019e5 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-define-map": "7.0.0-beta.39" + "@babel/helper-define-map": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-property-mutators/src/index.js b/packages/babel-plugin-transform-property-mutators/src/index.js index d083dc5439158..6428f9a86227d 100644 --- a/packages/babel-plugin-transform-property-mutators/src/index.js +++ b/packages/babel-plugin-transform-property-mutators/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import * as defineMap from "@babel/helper-define-map"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { ObjectExpression(path, file) { @@ -38,4 +41,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-proto-to-assign/package.json b/packages/babel-plugin-transform-proto-to-assign/package.json index 031d2ad77554e..5cf2274ed9d6b 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,13 +9,13 @@ "babel-plugin" ], "dependencies": { - "lodash": "^4.2.0" + "@babel/helper-plugin-utils": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-proto-to-assign/src/index.js b/packages/babel-plugin-transform-proto-to-assign/src/index.js index 09ae0e71e211f..1a8fea57e5f2a 100644 --- a/packages/babel-plugin-transform-proto-to-assign/src/index.js +++ b/packages/babel-plugin-transform-proto-to-assign/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import pull from "lodash/pull"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + function isProtoKey(node) { return t.isLiteral(t.toComputedKey(node, node.key), { value: "__proto__" }); } @@ -76,4 +79,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-react-constant-elements/package.json b/packages/babel-plugin-transform-react-constant-elements/package.json index d2109b24864de..cf9c3a6fe0420 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,11 +8,15 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-annotate-as-pure": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } 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 29c8f7be94a26..70c6fb115be02 100644 --- a/packages/babel-plugin-transform-react-constant-elements/src/index.js +++ b/packages/babel-plugin-transform-react-constant-elements/src/index.js @@ -1,6 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; +import annotateAsPure from "@babel/helper-annotate-as-pure"; + +export default declare((api, options) => { + api.assertVersion(7); -export default function transformReactConstantElement(api, options) { const { allowMutablePropsOnTags } = options; if ( @@ -101,9 +105,13 @@ export default function transformReactConstantElement(api, options) { path.traverse(immutabilityVisitor, state); if (state.isImmutable) { - path.hoist(); + const hoisted = path.hoist(); + + if (hoisted) { + annotateAsPure(hoisted); + } } }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-2/input.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-2/input.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-2/input.mjs diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-2/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-2/output.mjs similarity index 71% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-2/output.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-2/output.mjs index 5f4d4762cf4fe..e44a4b518dc98 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-2/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-2/output.mjs @@ -1,10 +1,14 @@ -var _ref =
child
; +var _ref = +/*#__PURE__*/ +
child
; const AppItem = () => { return _ref; }; -var _ref2 =
+var _ref2 = +/*#__PURE__*/ +

Parent

; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-3/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-3/output.js index 5b5fdfbf7731d..602d3eb3b1842 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-3/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-3/output.js @@ -1,6 +1,10 @@ -var _ref2 =
child
; +var _ref2 = +/*#__PURE__*/ +
child
; -var _ref3 =

Parent

; +var _ref3 = +/*#__PURE__*/ +

Parent

; (function () { class App extends React.Component { @@ -13,7 +17,9 @@ var _ref3 =

Parent

; const AppItem = () => { return _ref2; }, - _ref =
+ _ref = + /*#__PURE__*/ +
{_ref3}
; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-4/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-4/output.js index 7088d18dca32f..21fa63efbd88f 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-4/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope-4/output.js @@ -1,13 +1,19 @@ -var _ref =
child
; +var _ref = +/*#__PURE__*/ +
child
; -var _ref3 =

Parent

; +var _ref3 = +/*#__PURE__*/ +

Parent

; (function () { const AppItem = () => { return _ref; }; - var _ref2 =
+ var _ref2 = + /*#__PURE__*/ +
{_ref3}
; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope/input.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope/input.mjs similarity index 100% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope/input.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope/input.mjs diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope/output.mjs similarity index 71% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope/output.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope/output.mjs index e7f8ea322a448..730a99a08cd84 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/append-to-end-when-declared-in-scope/output.mjs @@ -5,12 +5,16 @@ export default class App extends React.Component { } -var _ref2 =
child
; +var _ref2 = +/*#__PURE__*/ +
child
; const AppItem = () => { return _ref2; }, - _ref =
+ _ref = +/*#__PURE__*/ +

Parent

; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/async-function/input.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/async-function/input.mjs similarity index 100% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/async-function/input.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/async-function/input.mjs diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/async-function/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/async-function/output.mjs similarity index 100% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/async-function/output.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/async-function/output.mjs diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/children/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/children/output.js index 9f725b28e8081..b341d7309f569 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/children/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/children/output.js @@ -1,4 +1,6 @@ -var _ref = ; +var _ref = +/*#__PURE__*/ +; var Foo = React.createClass({ render: function () { diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/class-assign-unreferenced-param-deopt/input.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/class-assign-unreferenced-param-deopt/input.mjs similarity index 100% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/class-assign-unreferenced-param-deopt/input.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/class-assign-unreferenced-param-deopt/input.mjs diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/class-assign-unreferenced-param-deopt/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/class-assign-unreferenced-param-deopt/output.mjs similarity index 93% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/class-assign-unreferenced-param-deopt/output.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/class-assign-unreferenced-param-deopt/output.mjs index 9eaf6f3992d3d..12cdcd2c31128 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/class-assign-unreferenced-param-deopt/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/class-assign-unreferenced-param-deopt/output.mjs @@ -1,6 +1,8 @@ import React from 'react'; // Regression test for https://github.com/babel/babel/issues/5552 -var _ref =
; +var _ref = +/*#__PURE__*/ +
; class BugReport extends React.Component { constructor(...args) { diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/compound-assignment/input.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/compound-assignment/input.mjs similarity index 100% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/compound-assignment/input.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/compound-assignment/input.mjs diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/compound-assignment/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/compound-assignment/output.mjs similarity index 52% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/compound-assignment/output.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/compound-assignment/output.mjs index ed30e48545642..3f305943f7bbb 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/compound-assignment/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/compound-assignment/output.mjs @@ -1,9 +1,13 @@ import React from 'react'; import Loader from 'loader'; -var _ref = ; +var _ref = +/*#__PURE__*/ +; -var _ref2 = ; +var _ref2 = +/*#__PURE__*/ +; const errorComesHere = () => _ref, thisWorksFine = () => _ref2; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/constructor/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/constructor/output.js index e3e86ae68d6ee..ff7176d24ff8c 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/constructor/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/constructor/output.js @@ -1,6 +1,8 @@ var Foo = require("Foo"); -var _ref = ; +var _ref = +/*#__PURE__*/ +; function render() { return _ref; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deep-constant-violation/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deep-constant-violation/output.js index 325f0daf7c808..482d9ccbc4dcb 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deep-constant-violation/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/deep-constant-violation/output.js @@ -1,6 +1,10 @@ -var _ref = ; +var _ref = +/*#__PURE__*/ +; -var _ref2 = ; +var _ref2 = +/*#__PURE__*/ +; function render() { var children = _ref; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-class/input.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-class/input.mjs similarity index 100% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-class/input.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-class/input.mjs diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-class/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-class/output.mjs similarity index 61% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-class/output.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-class/output.mjs index 060811816d12a..3cab082e24b8b 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-class/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-class/output.mjs @@ -4,11 +4,15 @@ const Parent = ({}) => _ref; export default Parent; -var _ref2 =
+var _ref2 = +/*#__PURE__*/ +
ChildTextContent
; let Child = () => _ref2, - _ref =
+ _ref = +/*#__PURE__*/ +
; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-declaration/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-declaration/output.js index 878e19404bce1..a8a3c7e285998 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-declaration/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-declaration/output.js @@ -1,6 +1,8 @@ function render() { const bar = "bar", - _ref = , + _ref = + /*#__PURE__*/ + , renderFoo = () => _ref; return renderFoo(); @@ -10,7 +12,9 @@ function render() { const bar = "bar", renderFoo = () => _ref2, baz = "baz", - _ref2 = ; + _ref2 = + /*#__PURE__*/ + ; return renderFoo(); } diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-default-params-2/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-default-params-2/output.js index 86a47eb10a312..fccc84ff7b1de 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-default-params-2/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-default-params-2/output.js @@ -1,7 +1,9 @@ function render() { var title = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; - var _ref = ; + var _ref = + /*#__PURE__*/ + ; return () => _ref; } diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-default-params/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-default-params/output.js index 6780bc3d89305..93a36e512ca6a 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-default-params/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-default-params/output.js @@ -1,6 +1,8 @@ function render(Component) { var text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '', - _ref = ; + _ref = + /*#__PURE__*/ + ; return function () { return _ref; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-hoc/input.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-hoc/input.mjs similarity index 100% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-hoc/input.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-hoc/input.mjs diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-hoc/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-hoc/output.mjs similarity index 68% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-hoc/output.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-hoc/output.mjs index d1521a3baf4b0..105e9ef2a5804 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-hoc/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/dont-hoist-before-hoc/output.mjs @@ -6,7 +6,9 @@ const Parent = ({}) => _ref; export default Parent; -var _ref2 =
+var _ref2 = +/*#__PURE__*/ +
ChildTextContent
; @@ -14,6 +16,8 @@ let Child = () => _ref2; Child = HOC(Child); -var _ref =
+var _ref = +/*#__PURE__*/ +
; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/function-parameter/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/function-parameter/output.js index 0e737624dad5c..9aa0a32a48486 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/function-parameter/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/function-parameter/output.js @@ -1,5 +1,7 @@ function render(text) { - var _ref = {text}; + var _ref = + /*#__PURE__*/ + {text}; return function () { return _ref; @@ -9,7 +11,9 @@ function render(text) { var Foo2 = require("Foo"); function createComponent(text) { - var _ref2 = {text}; + var _ref2 = + /*#__PURE__*/ + {text}; return function render() { return _ref2; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/global-reference/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/global-reference/output.js index 2bfa9cf8e6766..0e89a63b8f0dc 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/global-reference/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/global-reference/output.js @@ -1,4 +1,6 @@ -var _ref =
; +var _ref = +/*#__PURE__*/ +
; var Foo = React.createClass({ render: function render() { diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/html-element/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/html-element/output.js index 7ec3220a51ab7..68181887a4823 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/html-element/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/html-element/output.js @@ -1,10 +1,14 @@ -var _ref = ; +var _ref = +/*#__PURE__*/ +; function render() { return _ref; } -var _ref2 =
; +var _ref2 = +/*#__PURE__*/ +
; function render() { return _ref2; 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 7ad3af57ed69f..3ae20e546c196 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 @@ -2,7 +2,9 @@ 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 }; } -var _ref = _jsx("foo", {}); +var _ref = +/*#__PURE__*/ +_jsx("foo", {}); function render() { return _ref; @@ -11,7 +13,9 @@ function render() { function render() { var text = getText(); - var _ref2 = _jsx("foo", {}, void 0, text); + var _ref2 = + /*#__PURE__*/ + _jsx("foo", {}, void 0, text); return function () { return _ref2; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/inner-declaration/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/inner-declaration/output.js index b0e2cde1adf93..0175f703f8a84 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/inner-declaration/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/inner-declaration/output.js @@ -1,7 +1,9 @@ function render() { var text = getText(); - var _ref = {text}; + var _ref = + /*#__PURE__*/ + {text}; return function () { return _ref; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/member-expression-constant/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/member-expression-constant/output.js index aa7a9994baeb4..ff03fb77d1b2f 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/member-expression-constant/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/member-expression-constant/output.js @@ -1,7 +1,9 @@ function render() { this.component = "div"; - var _ref = ; + var _ref = + /*#__PURE__*/ + ; return () => _ref; } diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/member-expression-this/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/member-expression-this/output.js index 9ce3a08e7437a..a22f490042c65 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/member-expression-this/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/member-expression-this/output.js @@ -1,10 +1,14 @@ -var _ref = Sub Component; +var _ref = +/*#__PURE__*/ +Sub Component; class Component extends React.Component { constructor(...args) { var _temp; - var _ref2 = ; + var _ref2 = + /*#__PURE__*/ + ; return _temp = super(...args), this.subComponent = () => _ref, this.render = () => _ref2, _temp; } diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/member-expression/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/member-expression/output.js index fe12eb988d5d4..1abfd5c341d19 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/member-expression/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/member-expression/output.js @@ -1,10 +1,14 @@ -var _ref = Sub Component; +var _ref = +/*#__PURE__*/ +Sub Component; const els = { subComponent: () => _ref }; -var _ref2 = ; +var _ref2 = +/*#__PURE__*/ +; class Component extends React.Component { constructor(...args) { diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/param-and-var/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/param-and-var/output.js index 599a2b9297686..0060b31496722 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/param-and-var/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/param-and-var/output.js @@ -1,6 +1,8 @@ function fn(Component, obj) { var data = obj.data, - _ref = ; + _ref = + /*#__PURE__*/ + ; return () => _ref; } diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-multi/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-multi/output.js index c039c14143f5d..8b89a78b032b6 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-multi/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-multi/output.js @@ -3,7 +3,9 @@ function render(_ref) { className = _ref.className, id = _ref.id; - var _ref2 = ; + var _ref2 = + /*#__PURE__*/ + ; return () => _ref2; } diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-rest/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-rest/output.js index a00f73f6f44f0..c457d24158227 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-rest/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure-rest/output.js @@ -4,7 +4,9 @@ function render(_ref) { id = _ref.id, props = babelHelpers.objectWithoutProperties(_ref, ["text", "className", "id"]); - var _ref2 = ; + var _ref2 = + /*#__PURE__*/ + ; // intentionally ignoring props return () => _ref2; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure/output.js index 272a607c98cc8..f890296a95d6c 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-destructure/output.js @@ -1,7 +1,9 @@ function render(_ref) { let text = _ref.text; - var _ref2 = ; + var _ref2 = + /*#__PURE__*/ + ; return () => _ref2; } diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-reference/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-reference/output.js index bec3e3499344c..00492afc72d99 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-reference/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/parameter-reference/output.js @@ -1,5 +1,7 @@ function render(text) { - var _ref =
{text}
; + var _ref = + /*#__PURE__*/ +
{text}
; return function () { return _ref; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-2/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-2/output.js index 71dfc286ceb05..0e6144849ed07 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-2/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-2/output.js @@ -1,5 +1,7 @@ function render(offset) { - var _ref =
; + var _ref = + /*#__PURE__*/ +
; return function () { return _ref; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-3/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-3/output.js index 79c8b1db99075..41fa9cc9d3893 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-3/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-3/output.js @@ -1,6 +1,8 @@ const OFFSET = 3; -var _ref =
; +var _ref = +/*#__PURE__*/ +
; var Foo = React.createClass({ render: function () { diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist-member/input.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist-member/input.mjs similarity index 100% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist-member/input.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist-member/input.mjs diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist-member/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist-member/output.js deleted file mode 100644 index 1452baefa3a7f..0000000000000 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist-member/output.js +++ /dev/null @@ -1,11 +0,0 @@ -import Intl from 'react-intl'; - -var _ref = ; - -var Foo = React.createClass({ - render: function () { - return _ref; - } -}); diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist-member/output.mjs b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist-member/output.mjs new file mode 100644 index 0000000000000..255829f6ab968 --- /dev/null +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist-member/output.mjs @@ -0,0 +1,13 @@ +import Intl from 'react-intl'; + +var _ref = +/*#__PURE__*/ +; + +var Foo = React.createClass({ + render: function () { + return _ref; + } +}); diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist/output.js index 9df27d0157b42..49e73a5663622 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression-whitelist/output.js @@ -1,4 +1,6 @@ -var _ref = ; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression/output.js index 957dc4a8a21b1..81c65bf5eddf2 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/pure-expression/output.js @@ -1,4 +1,6 @@ -var _ref =
; +var _ref = +/*#__PURE__*/ +
; var Foo = React.createClass({ render: function () { diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/reassignment/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/reassignment/output.js index 9eb9d792f1430..48b45690df719 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/reassignment/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/reassignment/output.js @@ -1,7 +1,9 @@ function render(text) { text += "yes"; - var _ref =
{text}
; + var _ref = + /*#__PURE__*/ +
{text}
; return function () { return _ref; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export-default/input.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export-default/input.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export-default/input.mjs diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export-default/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export-default/output.mjs similarity index 57% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export-default/output.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export-default/output.mjs index 0424a4d937b8d..285010c075513 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export-default/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export-default/output.mjs @@ -7,4 +7,6 @@ class A { export default class B {} -var _ref = React.createElement(B, null); +var _ref = +/*#__PURE__*/ +React.createElement(B, null); diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export/input.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export/input.mjs similarity index 100% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export/input.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export/input.mjs diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export/output.mjs similarity index 54% rename from packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export/output.js rename to packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export/output.mjs index b42d9d936602a..1192322d7be88 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/regression-node-type-export/output.mjs @@ -7,4 +7,6 @@ class A { export class B {} -var _ref = React.createElement(B, null); +var _ref = +/*#__PURE__*/ +React.createElement(B, null); diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/text-children/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/text-children/output.js index 43898f741313e..dc358b421fe22 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/text-children/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/text-children/output.js @@ -1,4 +1,6 @@ -var _ref =
+var _ref = +/*#__PURE__*/ +
Text
; diff --git a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/var/output.js b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/var/output.js index a0bf6d783bed0..0c7bcb7eb2aa2 100644 --- a/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/var/output.js +++ b/packages/babel-plugin-transform-react-constant-elements/test/fixtures/constant-elements/var/output.js @@ -1,6 +1,8 @@ function fn(Component) { var data = "prop", - _ref = ; + _ref = + /*#__PURE__*/ + ; return () => _ref; } diff --git a/packages/babel-plugin-transform-react-display-name/package.json b/packages/babel-plugin-transform-react-display-name/package.json index f75996ba7225d..ed05d9fa17b2b 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Add displayName to React.createClass calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-display-name", "license": "MIT", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-react-display-name/src/index.js b/packages/babel-plugin-transform-react-display-name/src/index.js index 85819e5d77ce8..e0d88d85699fa 100644 --- a/packages/babel-plugin-transform-react-display-name/src/index.js +++ b/packages/babel-plugin-transform-react-display-name/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import path from "path"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + function addDisplayName(id, call) { const props = call.arguments[0].properties; let safe = true; @@ -104,4 +107,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-react-inline-elements/package.json b/packages/babel-plugin-transform-react-inline-elements/package.json index 389655d4bd7b2..2b636285b00f8 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-builder-react-jsx": "7.0.0-beta.39" + "@babel/helper-builder-react-jsx": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-react-inline-elements/src/index.js b/packages/babel-plugin-transform-react-inline-elements/src/index.js index a2288ee9be901..a5c2ef3ff85fb 100644 --- a/packages/babel-plugin-transform-react-inline-elements/src/index.js +++ b/packages/babel-plugin-transform-react-inline-elements/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import helper from "@babel/helper-builder-react-jsx"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + function hasRefOrSpread(attrs) { for (let i = 0; i < attrs.length; i++) { const attr = attrs[i]; @@ -62,4 +65,4 @@ export default function() { }, }); return { visitor }; -} +}); diff --git a/packages/babel-plugin-transform-react-inline-elements/test/fixtures/inline-elements/lowercase-member-expression/input.js b/packages/babel-plugin-transform-react-inline-elements/test/fixtures/inline-elements/lowercase-member-expression/input.mjs similarity index 100% rename from packages/babel-plugin-transform-react-inline-elements/test/fixtures/inline-elements/lowercase-member-expression/input.js rename to packages/babel-plugin-transform-react-inline-elements/test/fixtures/inline-elements/lowercase-member-expression/input.mjs diff --git a/packages/babel-plugin-transform-react-inline-elements/test/fixtures/inline-elements/member-expression/input.js b/packages/babel-plugin-transform-react-inline-elements/test/fixtures/inline-elements/member-expression/input.mjs similarity index 100% rename from packages/babel-plugin-transform-react-inline-elements/test/fixtures/inline-elements/member-expression/input.js rename to packages/babel-plugin-transform-react-inline-elements/test/fixtures/inline-elements/member-expression/input.mjs diff --git a/packages/babel-plugin-transform-react-jsx-compat/package.json b/packages/babel-plugin-transform-react-jsx-compat/package.json index 07fdce24e5f78..14f8f87e938ad 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-builder-react-jsx": "7.0.0-beta.39" + "@babel/helper-builder-react-jsx": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-react-jsx-compat/src/index.js b/packages/babel-plugin-transform-react-jsx-compat/src/index.js index 85b93492082f6..844b255d4c7a9 100644 --- a/packages/babel-plugin-transform-react-jsx-compat/src/index.js +++ b/packages/babel-plugin-transform-react-jsx-compat/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import helper from "@babel/helper-builder-react-jsx"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { manipulateOptions(opts, parserOpts) { parserOpts.plugins.push("jsx"); @@ -27,4 +30,4 @@ export default function() { compat: true, }), }; -} +}); diff --git a/packages/babel-plugin-transform-react-jsx-self/package.json b/packages/babel-plugin-transform-react-jsx-self/package.json index 496340ea99b35..cc452efdc3dd2 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-jsx": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-jsx": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-react-jsx-self/src/index.js b/packages/babel-plugin-transform-react-jsx-self/src/index.js index 409c0049991f4..375f22325620d 100644 --- a/packages/babel-plugin-transform-react-jsx-self/src/index.js +++ b/packages/babel-plugin-transform-react-jsx-self/src/index.js @@ -11,11 +11,14 @@ * * */ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; const TRACE_ID = "__self"; -export default function() { +export default declare(api => { + api.assertVersion(7); + const visitor = { JSXOpeningElement({ node }) { const id = t.jsxIdentifier(TRACE_ID); @@ -28,4 +31,4 @@ export default function() { return { visitor, }; -} +}); diff --git a/packages/babel-plugin-transform-react-jsx-source/package.json b/packages/babel-plugin-transform-react-jsx-source/package.json index 5023f404ff748..2352ca9d058d6 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/plugin-syntax-jsx": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-jsx": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-react-jsx-source/src/index.js b/packages/babel-plugin-transform-react-jsx-source/src/index.js index 16e7b0bd39d55..71add8d1b52c1 100644 --- a/packages/babel-plugin-transform-react-jsx-source/src/index.js +++ b/packages/babel-plugin-transform-react-jsx-source/src/index.js @@ -12,12 +12,15 @@ * var __jsxFileName = 'this/file.js'; * */ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; const TRACE_ID = "__source"; const FILE_NAME_VAR = "_jsxFileName"; -export default function() { +export default declare(api => { + api.assertVersion(7); + function makeTrace(fileNameIdentifier, lineNumber) { const fileLineLiteral = lineNumber != null ? t.numericLiteral(lineNumber) : t.nullLiteral(); @@ -71,4 +74,4 @@ export default function() { return { visitor, }; -} +}); diff --git a/packages/babel-plugin-transform-react-jsx/package.json b/packages/babel-plugin-transform-react-jsx/package.json index ed3490af708b4..deecebf86da71 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Turn JSX into React function calls", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-react-jsx", "license": "MIT", @@ -9,14 +9,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-builder-react-jsx": "7.0.0-beta.39", - "@babel/plugin-syntax-jsx": "7.0.0-beta.39" + "@babel/helper-builder-react-jsx": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-jsx": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-react-jsx/src/index.js b/packages/babel-plugin-transform-react-jsx/src/index.js index d517a7a90b342..5ae4f11e71169 100644 --- a/packages/babel-plugin-transform-react-jsx/src/index.js +++ b/packages/babel-plugin-transform-react-jsx/src/index.js @@ -1,8 +1,11 @@ +import { declare } from "@babel/helper-plugin-utils"; import jsx from "@babel/plugin-syntax-jsx"; import helper from "@babel/helper-builder-react-jsx"; import { types as t } from "@babel/core"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const THROW_IF_NAMESPACE = options.throwIfNamespace === undefined ? true : !!options.throwIfNamespace; @@ -91,4 +94,4 @@ export default function(api, options) { inherits: jsx, visitor, }; -} +}); diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/react/display-name-export-default/input.js b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/display-name-export-default/input.mjs similarity index 100% rename from packages/babel-plugin-transform-react-jsx/test/fixtures/react/display-name-export-default/input.js rename to packages/babel-plugin-transform-react-jsx/test/fixtures/react/display-name-export-default/input.mjs diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/react/display-name-export-default/output.js b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/display-name-export-default/output.mjs similarity index 100% rename from packages/babel-plugin-transform-react-jsx/test/fixtures/react/display-name-export-default/output.js rename to packages/babel-plugin-transform-react-jsx/test/fixtures/react/display-name-export-default/output.mjs diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/react/optimisation.react.constant-elements/output.js b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/optimisation.react.constant-elements/output.js index dc5c056f68273..55beb4d7e3a60 100644 --- a/packages/babel-plugin-transform-react-jsx/test/fixtures/react/optimisation.react.constant-elements/output.js +++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/optimisation.react.constant-elements/output.js @@ -1,4 +1,6 @@ -var _ref =
+var _ref = +/*#__PURE__*/ +
diff --git a/packages/babel-plugin-transform-regenerator/package.json b/packages/babel-plugin-transform-regenerator/package.json index f11c7e02a9db6..084f181fea9f4 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -11,10 +11,10 @@ }, "license": "MIT", "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-regenerator/test/fixtures/regression/6733/input.js b/packages/babel-plugin-transform-regenerator/test/fixtures/regression/6733/input.mjs similarity index 100% rename from packages/babel-plugin-transform-regenerator/test/fixtures/regression/6733/input.js rename to packages/babel-plugin-transform-regenerator/test/fixtures/regression/6733/input.mjs diff --git a/packages/babel-plugin-transform-reserved-words/package.json b/packages/babel-plugin-transform-reserved-words/package.json index 824dcddcab678..5d0abe4193b41 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Ensure that no reserved words are used.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-reserved-words", "license": "MIT", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-reserved-words/src/index.js b/packages/babel-plugin-transform-reserved-words/src/index.js index b3d272e40d299..b691947ac6424 100644 --- a/packages/babel-plugin-transform-reserved-words/src/index.js +++ b/packages/babel-plugin-transform-reserved-words/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { "BindingIdentifier|ReferencedIdentifier"(path) { @@ -10,4 +13,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-runtime/package.json b/packages/babel-plugin-transform-runtime/package.json index bcec27c63d2f7..09279958db09b 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-module-imports": "7.0.0-beta.39" + "@babel/helper-module-imports": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-runtime/src/index.js b/packages/babel-plugin-transform-runtime/src/index.js index 8b1787c6d8202..dfb5d41306ccb 100644 --- a/packages/babel-plugin-transform-runtime/src/index.js +++ b/packages/babel-plugin-transform-runtime/src/index.js @@ -1,9 +1,12 @@ +import { declare } from "@babel/helper-plugin-utils"; import { addDefault, isModule } from "@babel/helper-module-imports"; import { types as t } from "@babel/core"; import definitions from "./definitions"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { helpers, moduleName = "@babel/runtime", @@ -212,6 +215,6 @@ export default function(api, options) { }, }, }; -} +}); export { definitions }; diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/custom-runtime/input.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/custom-runtime/input.mjs similarity index 100% rename from packages/babel-plugin-transform-runtime/test/fixtures/runtime/custom-runtime/input.js rename to packages/babel-plugin-transform-runtime/test/fixtures/runtime/custom-runtime/input.mjs diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/custom-runtime/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/custom-runtime/output.mjs similarity index 100% rename from packages/babel-plugin-transform-runtime/test/fixtures/runtime/custom-runtime/output.js rename to packages/babel-plugin-transform-runtime/test/fixtures/runtime/custom-runtime/output.mjs diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/input.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/input.mjs similarity index 100% rename from packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/input.js rename to packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/input.mjs diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/output.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/output.mjs similarity index 100% rename from packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/output.js rename to packages/babel-plugin-transform-runtime/test/fixtures/runtime/full/output.mjs diff --git a/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules/input.js b/packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules/input.mjs similarity index 100% rename from packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules/input.js rename to packages/babel-plugin-transform-runtime/test/fixtures/runtime/modules/input.mjs diff --git a/packages/babel-plugin-transform-shorthand-properties/package.json b/packages/babel-plugin-transform-shorthand-properties/package.json index a0ebe31b84672..ef5bfe9bd91f3 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile ES2015 shorthand properties to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-shorthand-properties", "license": "MIT", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-shorthand-properties/src/index.js b/packages/babel-plugin-transform-shorthand-properties/src/index.js index 09b138009c206..482607c370190 100644 --- a/packages/babel-plugin-transform-shorthand-properties/src/index.js +++ b/packages/babel-plugin-transform-shorthand-properties/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { ObjectMethod(path) { @@ -26,4 +29,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-spread/package.json b/packages/babel-plugin-transform-spread/package.json index f418c2bf8c368..9690a3515defc 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile ES2015 spread to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-spread", "license": "MIT", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-spread/src/index.js b/packages/babel-plugin-transform-spread/src/index.js index d9827ca8bd939..18f274474a789 100644 --- a/packages/babel-plugin-transform-spread/src/index.js +++ b/packages/babel-plugin-transform-spread/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); + const { loose } = options; function getSpreadLiteral(spread, scope) { @@ -156,4 +159,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-spread/test/fixtures/regression/6647/input.js b/packages/babel-plugin-transform-spread/test/fixtures/regression/6647/input.mjs similarity index 100% rename from packages/babel-plugin-transform-spread/test/fixtures/regression/6647/input.js rename to packages/babel-plugin-transform-spread/test/fixtures/regression/6647/input.mjs diff --git a/packages/babel-plugin-transform-sticky-regex/package.json b/packages/babel-plugin-transform-sticky-regex/package.json index d29e8bfd0dfa2..2ede48ba7c757 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -9,13 +9,14 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-regex": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/helper-regex": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-sticky-regex/src/index.js b/packages/babel-plugin-transform-sticky-regex/src/index.js index a6e7f0a48fa07..ee7a0aa5db5f1 100644 --- a/packages/babel-plugin-transform-sticky-regex/src/index.js +++ b/packages/babel-plugin-transform-sticky-regex/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import * as regex from "@babel/helper-regex"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { RegExpLiteral(path) { @@ -17,4 +20,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-strict-mode/package.json b/packages/babel-plugin-transform-strict-mode/package.json index d30781a798822..56f699fe7c4ac 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-strict-mode/src/index.js b/packages/babel-plugin-transform-strict-mode/src/index.js index 05c775af967da..4dd2823b12d12 100644 --- a/packages/babel-plugin-transform-strict-mode/src/index.js +++ b/packages/babel-plugin-transform-strict-mode/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { Program(path) { @@ -17,4 +20,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-template-literals/package.json b/packages/babel-plugin-transform-template-literals/package.json index 73f696c53558a..4a6eb8f2449f3 100644 --- a/packages/babel-plugin-transform-template-literals/package.json +++ b/packages/babel-plugin-transform-template-literals/package.json @@ -1,21 +1,22 @@ { "name": "@babel/plugin-transform-template-literals", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile ES2015 template literals to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-template-literals", "license": "MIT", "main": "lib/index.js", "dependencies": { - "@babel/helper-annotate-as-pure": "7.0.0-beta.39" + "@babel/helper-annotate-as-pure": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42" }, "keywords": [ "babel-plugin" ], "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-template-literals/src/index.js b/packages/babel-plugin-transform-template-literals/src/index.js index 6acc478537084..1ac0b165f9568 100644 --- a/packages/babel-plugin-transform-template-literals/src/index.js +++ b/packages/babel-plugin-transform-template-literals/src/index.js @@ -1,7 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import annotateAsPure from "@babel/helper-annotate-as-pure"; import { types as t } from "@babel/core"; -export default function(api, options) { +export default declare((api, options) => { + api.assertVersion(7); const { loose } = options; let helperName = "taggedTemplateLiteral"; @@ -54,6 +56,9 @@ export default function(api, options) { const strings = []; const raws = []; + // Flag variable to check if contents of strings and raw are equal + let isStringsRawEqual = true; + for (const elem of (quasi.quasis: Array)) { const { raw, cooked } = elem.value; const value = @@ -63,6 +68,11 @@ export default function(api, options) { strings.push(value); raws.push(t.stringLiteral(raw)); + + if (raw !== cooked) { + // false even if one of raw and cooked are not equal + isStringsRawEqual = false; + } } // Generate a unique name based on the string literals so we dedupe @@ -81,10 +91,15 @@ export default function(api, options) { this.templates.set(name, templateObject); const helperId = this.addHelper(helperName); - const init = t.callExpression(helperId, [ - t.arrayExpression(strings), - t.arrayExpression(raws), - ]); + const callExpressionInput = []; + callExpressionInput.push(t.arrayExpression(strings)); + + if (!isStringsRawEqual) { + callExpressionInput.push(t.arrayExpression(raws)); + } + + // only add raw arrayExpression if there is any difference between raws and strings + const init = t.callExpression(helperId, callExpressionInput); annotateAsPure(init); init._compact = true; programPath.scope.push({ @@ -142,4 +157,4 @@ export default function(api, options) { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-template-literals/test/fixtures/default/simple-tag/input.js b/packages/babel-plugin-transform-template-literals/test/fixtures/default/simple-tag/input.js new file mode 100644 index 0000000000000..5b13aa793aa6f --- /dev/null +++ b/packages/babel-plugin-transform-template-literals/test/fixtures/default/simple-tag/input.js @@ -0,0 +1,2 @@ +var foo = tag`wow`; +var bar = tag`first${1}second`; diff --git a/packages/babel-plugin-transform-template-literals/test/fixtures/default/simple-tag/output.js b/packages/babel-plugin-transform-template-literals/test/fixtures/default/simple-tag/output.js new file mode 100644 index 0000000000000..7b916abd6b10a --- /dev/null +++ b/packages/babel-plugin-transform-template-literals/test/fixtures/default/simple-tag/output.js @@ -0,0 +1,7 @@ +var _templateObject = /*#__PURE__*/ _taggedTemplateLiteral(["wow"]), + _templateObject2 = /*#__PURE__*/ _taggedTemplateLiteral(["first", "second"]); + +function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } + +var foo = tag(_templateObject); +var bar = tag(_templateObject2, 1); diff --git a/packages/babel-plugin-transform-template-literals/test/fixtures/default/tag/output.js b/packages/babel-plugin-transform-template-literals/test/fixtures/default/tag/output.js index 6a3d89a3c478d..b47badfa7fabc 100644 --- a/packages/babel-plugin-transform-template-literals/test/fixtures/default/tag/output.js +++ b/packages/babel-plugin-transform-template-literals/test/fixtures/default/tag/output.js @@ -2,7 +2,7 @@ var _templateObject = /*#__PURE__*/ _taggedTemplateLiteral(["wow\na", "b ", ""], _templateObject2 = /*#__PURE__*/ _taggedTemplateLiteral(["wow\nab", " ", ""], ["wow\\nab", " ", ""]), _templateObject3 = /*#__PURE__*/ _taggedTemplateLiteral(["wow\naB", " ", ""], ["wow\\naB", " ", ""]); -function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } +function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } var foo = bar(_templateObject, 42, _.foobar()); var bar = bar(_templateObject2, 42, _.foobar()); diff --git a/packages/babel-plugin-transform-template-literals/test/fixtures/default/template-revision/output.js b/packages/babel-plugin-transform-template-literals/test/fixtures/default/template-revision/output.js index c7f4371d6ed92..2f8b82de8f459 100644 --- a/packages/babel-plugin-transform-template-literals/test/fixtures/default/template-revision/output.js +++ b/packages/babel-plugin-transform-template-literals/test/fixtures/default/template-revision/output.js @@ -6,7 +6,7 @@ var _templateObject = /*#__PURE__*/ _taggedTemplateLiteral([void 0], ["\\unicode _templateObject6 = /*#__PURE__*/ _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\u000g", "right"]), _templateObject7 = /*#__PURE__*/ _taggedTemplateLiteral(["left", void 0, "right"], ["left", "\\u{-0}", "right"]); -function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } +function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } tag(_templateObject); tag(_templateObject2); diff --git a/packages/babel-plugin-transform-template-literals/test/fixtures/loose/tag/output.js b/packages/babel-plugin-transform-template-literals/test/fixtures/loose/tag/output.js index 09b108b3b191e..7e82908b36db8 100644 --- a/packages/babel-plugin-transform-template-literals/test/fixtures/loose/tag/output.js +++ b/packages/babel-plugin-transform-template-literals/test/fixtures/loose/tag/output.js @@ -2,7 +2,7 @@ var _templateObject = /*#__PURE__*/ _taggedTemplateLiteralLoose(["wow\na", "b ", _templateObject2 = /*#__PURE__*/ _taggedTemplateLiteralLoose(["wow\nab", " ", ""], ["wow\\nab", " ", ""]), _templateObject3 = /*#__PURE__*/ _taggedTemplateLiteralLoose(["wow\naB", " ", ""], ["wow\\naB", " ", ""]); -function _taggedTemplateLiteralLoose(strings, raw) { strings.raw = raw; return strings; } +function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; } var foo = bar(_templateObject, 42, _.foobar()); var bar = bar(_templateObject2, 42, _.foobar()); diff --git a/packages/babel-plugin-transform-template-literals/test/fixtures/loose/template-revision/output.js b/packages/babel-plugin-transform-template-literals/test/fixtures/loose/template-revision/output.js index 3077a8c82f1cc..9eee99e3065d3 100644 --- a/packages/babel-plugin-transform-template-literals/test/fixtures/loose/template-revision/output.js +++ b/packages/babel-plugin-transform-template-literals/test/fixtures/loose/template-revision/output.js @@ -6,7 +6,7 @@ var _templateObject = /*#__PURE__*/ _taggedTemplateLiteralLoose([void 0], ["\\un _templateObject6 = /*#__PURE__*/ _taggedTemplateLiteralLoose(["left", void 0, "right"], ["left", "\\u000g", "right"]), _templateObject7 = /*#__PURE__*/ _taggedTemplateLiteralLoose(["left", void 0, "right"], ["left", "\\u{-0}", "right"]); -function _taggedTemplateLiteralLoose(strings, raw) { strings.raw = raw; return strings; } +function _taggedTemplateLiteralLoose(strings, raw) { if (!raw) { raw = strings.slice(0); } strings.raw = raw; return strings; } tag(_templateObject); tag(_templateObject2); diff --git a/packages/babel-plugin-transform-typeof-symbol/package.json b/packages/babel-plugin-transform-typeof-symbol/package.json index 15de7d878685a..1de4d6d700b0d 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.0.0-beta.39", + "version": "7.0.0-beta.42", "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", @@ -8,11 +8,14 @@ "keywords": [ "babel-plugin" ], + "dependencies": { + "@babel/helper-plugin-utils": "7.0.0-beta.42" + }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-typeof-symbol/src/index.js b/packages/babel-plugin-transform-typeof-symbol/src/index.js index c32eba7c06bdb..70d1a65ca05d9 100644 --- a/packages/babel-plugin-transform-typeof-symbol/src/index.js +++ b/packages/babel-plugin-transform-typeof-symbol/src/index.js @@ -1,6 +1,9 @@ +import { declare } from "@babel/helper-plugin-utils"; import { types as t } from "@babel/core"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { Scope({ scope }) { @@ -47,7 +50,7 @@ export default function() { const call = t.callExpression(helper, [node.argument]); const arg = path.get("argument"); - if (arg.isIdentifier() && !path.scope.hasBinding(arg.node.name)) { + if (arg.isIdentifier() && !path.scope.hasBinding(arg.node.name, true)) { const unary = t.unaryExpression("typeof", t.cloneNode(node.argument)); path.replaceWith( t.conditionalExpression( @@ -62,4 +65,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/builtin-global/input.mjs b/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/builtin-global/input.mjs new file mode 100644 index 0000000000000..7cff6b432012e --- /dev/null +++ b/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/builtin-global/input.mjs @@ -0,0 +1 @@ +typeof Reflect === "object"; \ No newline at end of file diff --git a/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/builtin-global/options.json b/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/builtin-global/options.json new file mode 100644 index 0000000000000..5730916af9503 --- /dev/null +++ b/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/builtin-global/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["transform-typeof-symbol"] +} diff --git a/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/builtin-global/output.mjs b/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/builtin-global/output.mjs new file mode 100644 index 0000000000000..8b1124c31ba12 --- /dev/null +++ b/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/builtin-global/output.mjs @@ -0,0 +1,3 @@ +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { return typeof obj; }; } else { _typeof = function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +(typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object"; diff --git a/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/default-export/input.js b/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/default-export/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/default-export/input.js rename to packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/default-export/input.mjs diff --git a/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/default-export/output.js b/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/default-export/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/default-export/output.js rename to packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/default-export/output.mjs diff --git a/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/non-typeof/input.js b/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/non-typeof/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/non-typeof/input.js rename to packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/non-typeof/input.mjs diff --git a/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/non-typeof/output.js b/packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/non-typeof/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/non-typeof/output.js rename to packages/babel-plugin-transform-typeof-symbol/test/fixtures/symbols/non-typeof/output.mjs diff --git a/packages/babel-plugin-transform-typescript/README.md b/packages/babel-plugin-transform-typescript/README.md index fdff26cdec3d4..9286ac31e8524 100644 --- a/packages/babel-plugin-transform-typescript/README.md +++ b/packages/babel-plugin-transform-typescript/README.md @@ -4,8 +4,12 @@ Does not type-check its input. For that, you will need to install and set up TypeScript. -Does not support `namespace`s or `const enum`s because those require type information to transpile. -Also does not support `export =` and `import =`, because those cannot be transpiled to ES.next. +## Caveats + +* Does not support [`namespace`][namespace]s. **Workaround**: Move to using [file exports][fm], or migrate to using the `module { }` syntax instead. +* Does not support [`const enum`][const_enum]s because those require type information to compile. +**Workaround**: Remove the `const`, which makes it available at runtime. +* Does not support [`export =`][exin] and [`import =`][exin], because those cannot be compile to ES.next. **Workaround**: Convert to using `export default` and `export const`, and `import x, {y} from "z"`. ## Example @@ -52,3 +56,8 @@ require("@babel/core").transform("code", { plugins: ["@babel/plugin-transform-typescript"] }); ``` + +[const_enum]: https://www.typescriptlang.org/docs/handbook/enums.html#const-enums +[namespace]: https://www.typescriptlang.org/docs/handbook/namespaces.html +[exin]: https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require +[fm]: https://github.com/Microsoft/dtslint/blob/master/docs/no-single-declare-module.md diff --git a/packages/babel-plugin-transform-typescript/package.json b/packages/babel-plugin-transform-typescript/package.json index 9005c9e64c492..588f1b7a20977 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Transform TypeScript into ES.next", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript", "license": "MIT", @@ -10,13 +10,14 @@ "typescript" ], "dependencies": { - "@babel/plugin-syntax-typescript": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-typescript": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-typescript/src/index.js b/packages/babel-plugin-transform-typescript/src/index.js index efb7ae5e1370e..e93f7a5b0d374 100644 --- a/packages/babel-plugin-transform-typescript/src/index.js +++ b/packages/babel-plugin-transform-typescript/src/index.js @@ -1,3 +1,4 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxTypeScript from "@babel/plugin-syntax-typescript"; import { types as t } from "@babel/core"; @@ -19,7 +20,9 @@ interface State { programPath: any; } -export default function() { +export default declare(api => { + api.assertVersion(7); + return { inherits: syntaxTypeScript, visitor: { @@ -79,6 +82,10 @@ export default function() { if (path.node.declare) path.remove(); }, + VariableDeclarator({ node }) { + if (node.definite) node.definite = null; + }, + ClassMethod(path) { const { node } = path; @@ -154,7 +161,9 @@ export default function() { 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; }, @@ -270,4 +279,4 @@ export default function() { }); return !sourceFileHasJsx; } -} +}); diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/export-default-abstract/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/class/export-default-abstract/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/class/export-default-abstract/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/class/export-default-abstract/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/export-default-abstract/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/class/export-default-abstract/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/class/export-default-abstract/output.js rename to packages/babel-plugin-transform-typescript/test/fixtures/class/export-default-abstract/output.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/properties/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/class/properties/input.js index 36c4f340ca34e..ce12b25f6fd46 100644 --- a/packages/babel-plugin-transform-typescript/test/fixtures/class/properties/input.js +++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/properties/input.js @@ -1,4 +1,5 @@ class C { public a?: number; private b: number = 0; + readonly c!: number = 1; } diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/class/properties/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/class/properties/output.js index 14de70ecc590b..77e91a62b0671 100644 --- a/packages/babel-plugin-transform-typescript/test/fixtures/class/properties/output.js +++ b/packages/babel-plugin-transform-typescript/test/fixtures/class/properties/output.js @@ -1,3 +1,4 @@ class C { b = 0; + c = 1; } diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/declarations/erased/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/declarations/erased/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/declarations/erased/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/declarations/erased/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/declarations/erased/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/declarations/erased/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/declarations/erased/output.js rename to packages/babel-plugin-transform-typescript/test/fixtures/declarations/erased/output.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/boolean-value/actual.js b/packages/babel-plugin-transform-typescript/test/fixtures/enum/boolean-value/input.js similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/enum/boolean-value/actual.js rename to packages/babel-plugin-transform-typescript/test/fixtures/enum/boolean-value/input.js diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/boolean-value/expected.js b/packages/babel-plugin-transform-typescript/test/fixtures/enum/boolean-value/output.js similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/enum/boolean-value/expected.js rename to packages/babel-plugin-transform-typescript/test/fixtures/enum/boolean-value/output.js diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/export/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/enum/export/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/enum/export/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/enum/export/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/export/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/enum/export/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/enum/export/output.js rename to packages/babel-plugin-transform-typescript/test/fixtures/enum/export/output.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/inner-references/actual.js b/packages/babel-plugin-transform-typescript/test/fixtures/enum/inner-references/input.js similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/enum/inner-references/actual.js rename to packages/babel-plugin-transform-typescript/test/fixtures/enum/inner-references/input.js diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/inner-references/expected.js b/packages/babel-plugin-transform-typescript/test/fixtures/enum/inner-references/output.js similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/enum/inner-references/expected.js rename to packages/babel-plugin-transform-typescript/test/fixtures/enum/inner-references/output.js diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/actual.js b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/input.js similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/actual.js rename to packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/input.js diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/expected.js b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/output.js similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/expected.js rename to packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values-computed/output.js diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values/actual.js b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values/input.js similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values/actual.js rename to packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values/input.js diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values/expected.js b/packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values/output.js similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values/expected.js rename to packages/babel-plugin-transform-typescript/test/fixtures/enum/string-values/output.js diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/exports/export=/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/exports/export=/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/exports/export=/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/exports/export=/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-no-import-specifiers/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-no-import-specifiers/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-no-import-specifiers/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-no-import-specifiers/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-no-import-specifiers/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-no-import-specifiers/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-no-import-specifiers/output.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-no-import-specifiers/output.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no-2/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no-2/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no-2/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no-2/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no-2/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no-2/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no-2/output.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no-2/output.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no/output.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react-no/output.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react/output.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-react/output.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-typeof/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-typeof/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-typeof/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-typeof/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-typeof/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-typeof/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-typeof/output.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elide-typeof/output.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-locations/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-locations/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-locations/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-locations/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-locations/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-locations/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-locations/output.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-locations/output.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-qualifiedname/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-qualifiedname/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-qualifiedname/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-qualifiedname/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-qualifiedname/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-qualifiedname/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-qualifiedname/output.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-qualifiedname/output.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-rename/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-rename/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-rename/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-rename/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-rename/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-rename/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-rename/output.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elision-rename/output.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elision/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elision/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/elision/output.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/elision/output.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/elision/output.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/imports/import=/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/imports/import=/input.mjs similarity index 100% rename from packages/babel-plugin-transform-typescript/test/fixtures/imports/import=/input.js rename to packages/babel-plugin-transform-typescript/test/fixtures/imports/import=/input.mjs diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/variable-declaration/exclamation/input.js b/packages/babel-plugin-transform-typescript/test/fixtures/variable-declaration/exclamation/input.js new file mode 100644 index 0000000000000..f27135a2b9f0d --- /dev/null +++ b/packages/babel-plugin-transform-typescript/test/fixtures/variable-declaration/exclamation/input.js @@ -0,0 +1 @@ +let x!: number; diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/variable-declaration/exclamation/output.js b/packages/babel-plugin-transform-typescript/test/fixtures/variable-declaration/exclamation/output.js new file mode 100644 index 0000000000000..2756c24c45775 --- /dev/null +++ b/packages/babel-plugin-transform-typescript/test/fixtures/variable-declaration/exclamation/output.js @@ -0,0 +1 @@ +let x; diff --git a/packages/babel-plugin-transform-unicode-regex/package.json b/packages/babel-plugin-transform-unicode-regex/package.json index 8da305da548ec..bcf4a778d3a8f 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Compile ES2015 Unicode regex to ES5", "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-unicode-regex", "license": "MIT", @@ -9,14 +9,15 @@ "babel-plugin" ], "dependencies": { - "@babel/helper-regex": "7.0.0-beta.39", + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/helper-regex": "7.0.0-beta.42", "regexpu-core": "^4.1.3" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-plugin-transform-unicode-regex/src/index.js b/packages/babel-plugin-transform-unicode-regex/src/index.js index 22360409196a4..6b0e434ddad98 100644 --- a/packages/babel-plugin-transform-unicode-regex/src/index.js +++ b/packages/babel-plugin-transform-unicode-regex/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import rewritePattern from "regexpu-core"; import * as regex from "@babel/helper-regex"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { visitor: { RegExpLiteral({ node }) { @@ -11,4 +14,4 @@ export default function() { }, }, }; -} +}); diff --git a/packages/babel-polyfill/package.json b/packages/babel-polyfill/package.json index 7f4bedf59aa0a..41cc1857b57f4 100644 --- a/packages/babel-polyfill/package.json +++ b/packages/babel-polyfill/package.json @@ -1,6 +1,6 @@ { "name": "@babel/polyfill", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "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 2a7e403aace48..edab002d04091 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Standalone build of babel-prest-env for use in non-Node.js environments.", "main": "babel-preset-env.js", "files": [ @@ -9,10 +9,9 @@ "src" ], "devDependencies": { - "@babel/plugin-transform-new-target": "7.0.0-beta.39", - "@babel/preset-env": "7.0.0-beta.39", - "@babel/standalone": "7.0.0-beta.39", - "mock-require": "^2.0.2" + "@babel/plugin-transform-new-target": "7.0.0-beta.42", + "@babel/preset-env": "7.0.0-beta.42", + "@babel/standalone": "7.0.0-beta.42" }, "keywords": [ "babel", 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 c61a67a93a515..0e7c3ca5aeef5 100644 --- a/packages/babel-preset-env-standalone/test/babel-preset-env.js +++ b/packages/babel-preset-env-standalone/test/babel-preset-env.js @@ -1,57 +1,66 @@ const assert = require("assert"); -const mock = require("mock-require"); -const Babel = require("@babel/standalone/babel"); -mock("Babel", Babel); -require("../babel-preset-env"); -describe("babel-preset-env-standalone", () => { - it("works w/o targets", () => { - const output = Babel.transform("const a = 1;", { - presets: ["env"], - }).code; - assert.equal(output, "var a = 1;"); - }); +(process.env.TEST_TYPE === "cov" ? describe.skip : describe)( + "babel-preset-env-standalone", + () => { + const Babel = require("@babel/standalone/babel"); + jest.mock("Babel", () => require("@babel/standalone/babel"), { + virtual: true, + }); + require("../babel-preset-env"); - it("doesn't transpile `const` with chrome 60", () => { - const output = Babel.transform("const a = 1;", { - presets: [ - [ - "env", - { - targets: { - chrome: 60, + it("works w/o targets", () => { + const output = Babel.transform("const a = 1;", { + sourceType: "script", + presets: ["env"], + }).code; + assert.equal(output, "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; - assert.equal(output, "const a = 1;"); - }); + }).code; + assert.equal(output, "const a = 1;"); + }); - it("transpiles `const` with chrome 60 and preset-es2015", () => { - const output = Babel.transform("const a = 1;", { - presets: [ - [ - "env", - { - targets: { - chrome: 60, + it("transpiles `const` with chrome 60 and preset-es2015", () => { + const output = Babel.transform("const a = 1;", { + sourceType: "script", + presets: [ + [ + "env", + { + targets: { + chrome: 60, + }, }, - }, + ], + "es2015", ], - "es2015", - ], - }).code; - assert.equal(output, "var a = 1;"); - }); + }).code; + assert.equal(output, "var a = 1;"); + }); - it("uses transform-new-targets plugin", () => { - const output = Babel.transform("function Foo() {new.target}", { - presets: ["env"], - }).code; - assert.equal( - output, - "function Foo() {\n this instanceof Foo ? this.constructor : void 0;\n}", - ); - }); -}); + it("uses transform-new-targets plugin", () => { + const output = Babel.transform("function Foo() {new.target}", { + sourceType: "script", + presets: ["env"], + }).code; + assert.equal( + output, + "function Foo() {\n this instanceof Foo ? this.constructor : void 0;\n}", + ); + }); + }, +); diff --git a/packages/babel-preset-env/README.md b/packages/babel-preset-env/README.md index 1e968236c8959..3bb7ec1991352 100644 --- a/packages/babel-preset-env/README.md +++ b/packages/babel-preset-env/README.md @@ -405,13 +405,14 @@ Toggles whether or not [browserslist config sources](https://github.com/ai/brows `boolean`, defaults to `false` -Toggles enabling support for builtin/feature proposals that have shipped in browsers. If your target environments have native support for a feature proposal, its matching parser syntax plugin is enabled instead of performing any transform. Note that this _does not_ enable the same transformations as [`@babel/preset-stage3`](https://babeljs.io/docs/plugins/preset-stage-3/), since proposals can continue to change before landing in browsers. +Toggles enabling support for builtin/feature proposals that have shipped in browsers. If your target environments have native support for a feature proposal, its matching parser syntax plugin is enabled instead of performing any transform. Note that this _does not_ enable the same transformations as [`@babel/preset-stage-3`](https://babeljs.io/docs/plugins/preset-stage-3/), since proposals can continue to change before landing in browsers. The following are currently supported: **Builtins** - [Promise.prototype.finally](https://github.com/tc39/proposal-promise-finally) +- [Symbol.asyncIterator](https://github.com/tc39/proposal-async-iteration) **Features** diff --git a/packages/babel-preset-env/data/built-in-modules.json b/packages/babel-preset-env/data/built-in-modules.json index 9cab30106fc57..c2d05dbd7135a 100644 --- a/packages/babel-preset-env/data/built-in-modules.json +++ b/packages/babel-preset-env/data/built-in-modules.json @@ -1,6 +1,7 @@ { "es6.module": { "edge": "16", + "firefox": "60", "chrome": "61", "safari": "10.1", "ios_saf": "10.3" diff --git a/packages/babel-preset-env/data/built-ins.json b/packages/babel-preset-env/data/built-ins.json index 96b619f845ffd..2ba4db1f14269 100644 --- a/packages/babel-preset-env/data/built-ins.json +++ b/packages/babel-preset-env/data/built-ins.json @@ -1149,6 +1149,12 @@ "es7.promise.finally": { "chrome": "63", "firefox": "58", + "safari": "11.1", + "opera": "50" + }, + "es7.symbol.async-iterator": { + "chrome": "63", + "firefox": "57", "safari": "tp", "opera": "50" } diff --git a/packages/babel-preset-env/data/plugins.json b/packages/babel-preset-env/data/plugins.json index 99ed3351eeef2..fccca0e457e72 100644 --- a/packages/babel-preset-env/data/plugins.json +++ b/packages/babel-preset-env/data/plugins.json @@ -220,7 +220,7 @@ }, "transform-dotall-regex": { "chrome": "62", - "safari": "tp", + "safari": "11.1", "opera": "49" }, "proposal-async-generator-functions": { @@ -232,17 +232,20 @@ "proposal-object-rest-spread": { "chrome": "60", "firefox": "55", - "safari": "tp", + "safari": "11.1", "node": "8.3", - "opera": "47" + "opera": "47", + "electron": "2" }, "proposal-optional-catch-binding": { + "chrome": "66", "firefox": "58", - "safari": "tp" + "safari": "11.1", + "opera": "53" }, "proposal-unicode-property-regex": { "chrome": "64", - "safari": "tp", + "safari": "11.1", "opera": "51" } } diff --git a/packages/babel-preset-env/data/shipped-proposals.js b/packages/babel-preset-env/data/shipped-proposals.js index 09f7e5071a927..d63e07f3cfc0a 100644 --- a/packages/babel-preset-env/data/shipped-proposals.js +++ b/packages/babel-preset-env/data/shipped-proposals.js @@ -2,7 +2,8 @@ // shipped by browsers, and are enabled by the `shippedProposals` option. const builtIns = { - "es7.promise.finally": "Promise.prototype.finally" + "es7.promise.finally": "Promise.prototype.finally", + "es7.symbol.async-iterator": "Asynchronous Iterators", }; const features = { diff --git a/packages/babel-preset-env/package.json b/packages/babel-preset-env/package.json index e9438cad0a7a7..3fbd92b801e6c 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "A Babel preset for each environment.", "author": "Henry Zhu ", "homepage": "https://babeljs.io/", @@ -11,53 +11,55 @@ "build-data": "node ./scripts/build-data.js; node ./scripts/build-modules-support.js" }, "dependencies": { - "@babel/plugin-proposal-async-generator-functions": "7.0.0-beta.39", - "@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.39", - "@babel/plugin-proposal-optional-catch-binding": "7.0.0-beta.39", - "@babel/plugin-proposal-unicode-property-regex": "7.0.0-beta.39", - "@babel/plugin-syntax-async-generators": "7.0.0-beta.39", - "@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.39", - "@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.39", - "@babel/plugin-transform-arrow-functions": "7.0.0-beta.39", - "@babel/plugin-transform-async-to-generator": "7.0.0-beta.39", - "@babel/plugin-transform-block-scoped-functions": "7.0.0-beta.39", - "@babel/plugin-transform-block-scoping": "7.0.0-beta.39", - "@babel/plugin-transform-classes": "7.0.0-beta.39", - "@babel/plugin-transform-computed-properties": "7.0.0-beta.39", - "@babel/plugin-transform-destructuring": "7.0.0-beta.39", - "@babel/plugin-transform-dotall-regex": "7.0.0-beta.39", - "@babel/plugin-transform-duplicate-keys": "7.0.0-beta.39", - "@babel/plugin-transform-exponentiation-operator": "7.0.0-beta.39", - "@babel/plugin-transform-for-of": "7.0.0-beta.39", - "@babel/plugin-transform-function-name": "7.0.0-beta.39", - "@babel/plugin-transform-literals": "7.0.0-beta.39", - "@babel/plugin-transform-modules-amd": "7.0.0-beta.39", - "@babel/plugin-transform-modules-commonjs": "7.0.0-beta.39", - "@babel/plugin-transform-modules-systemjs": "7.0.0-beta.39", - "@babel/plugin-transform-modules-umd": "7.0.0-beta.39", - "@babel/plugin-transform-new-target": "7.0.0-beta.39", - "@babel/plugin-transform-object-super": "7.0.0-beta.39", - "@babel/plugin-transform-parameters": "7.0.0-beta.39", - "@babel/plugin-transform-regenerator": "7.0.0-beta.39", - "@babel/plugin-transform-shorthand-properties": "7.0.0-beta.39", - "@babel/plugin-transform-spread": "7.0.0-beta.39", - "@babel/plugin-transform-sticky-regex": "7.0.0-beta.39", - "@babel/plugin-transform-template-literals": "7.0.0-beta.39", - "@babel/plugin-transform-typeof-symbol": "7.0.0-beta.39", - "@babel/plugin-transform-unicode-regex": "7.0.0-beta.39", - "browserslist": "^2.4.0", + "@babel/helper-module-imports": "7.0.0-beta.42", + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-proposal-async-generator-functions": "7.0.0-beta.42", + "@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.42", + "@babel/plugin-proposal-optional-catch-binding": "7.0.0-beta.42", + "@babel/plugin-proposal-unicode-property-regex": "7.0.0-beta.42", + "@babel/plugin-syntax-async-generators": "7.0.0-beta.42", + "@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.42", + "@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.42", + "@babel/plugin-transform-arrow-functions": "7.0.0-beta.42", + "@babel/plugin-transform-async-to-generator": "7.0.0-beta.42", + "@babel/plugin-transform-block-scoped-functions": "7.0.0-beta.42", + "@babel/plugin-transform-block-scoping": "7.0.0-beta.42", + "@babel/plugin-transform-classes": "7.0.0-beta.42", + "@babel/plugin-transform-computed-properties": "7.0.0-beta.42", + "@babel/plugin-transform-destructuring": "7.0.0-beta.42", + "@babel/plugin-transform-dotall-regex": "7.0.0-beta.42", + "@babel/plugin-transform-duplicate-keys": "7.0.0-beta.42", + "@babel/plugin-transform-exponentiation-operator": "7.0.0-beta.42", + "@babel/plugin-transform-for-of": "7.0.0-beta.42", + "@babel/plugin-transform-function-name": "7.0.0-beta.42", + "@babel/plugin-transform-literals": "7.0.0-beta.42", + "@babel/plugin-transform-modules-amd": "7.0.0-beta.42", + "@babel/plugin-transform-modules-commonjs": "7.0.0-beta.42", + "@babel/plugin-transform-modules-systemjs": "7.0.0-beta.42", + "@babel/plugin-transform-modules-umd": "7.0.0-beta.42", + "@babel/plugin-transform-new-target": "7.0.0-beta.42", + "@babel/plugin-transform-object-super": "7.0.0-beta.42", + "@babel/plugin-transform-parameters": "7.0.0-beta.42", + "@babel/plugin-transform-regenerator": "7.0.0-beta.42", + "@babel/plugin-transform-shorthand-properties": "7.0.0-beta.42", + "@babel/plugin-transform-spread": "7.0.0-beta.42", + "@babel/plugin-transform-sticky-regex": "7.0.0-beta.42", + "@babel/plugin-transform-template-literals": "7.0.0-beta.42", + "@babel/plugin-transform-typeof-symbol": "7.0.0-beta.42", + "@babel/plugin-transform-unicode-regex": "7.0.0-beta.42", + "browserslist": "^3.0.0", "invariant": "^2.2.2", "semver": "^5.3.0" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/cli": "7.0.0-beta.39", - "@babel/core": "7.0.0-beta.39", - "@babel/helper-fixtures": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39", - "compat-table": "kangax/compat-table#3e30cd67a5d3d853caf8424d00ca66d100674d4f", + "@babel/cli": "7.0.0-beta.42", + "@babel/core": "7.0.0-beta.42", + "@babel/helper-fixtures": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42", + "compat-table": "kangax/compat-table#7c202e2da648fbd9d223d48d1680ec8f15147044", "electron-to-chromium": "^1.3.27", "request": "^2.83.0" } diff --git a/packages/babel-preset-env/scripts/build-modules-support.js b/packages/babel-preset-env/scripts/build-modules-support.js index 55cf110165015..edbdd85b8b836 100644 --- a/packages/babel-preset-env/scripts/build-modules-support.js +++ b/packages/babel-preset-env/scripts/build-modules-support.js @@ -8,12 +8,16 @@ const request = require("request"); // * https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type const lastKnown = { chrome: 61, - firefox: 59, safari: 10.1, ios_saf: 10.3, edge: 16, }; +const acceptedWithCaveats = { + safari: true, + ios_saf: true, +}; + function input() { return new Promise(function(resolve, reject) { request( @@ -38,12 +42,15 @@ function input() { const browserVersions = stats[browser]; const allowedVersions = Object.keys(browserVersions) .filter(value => { - return browserVersions[value] === "y"; + return acceptedWithCaveats[browser] + ? browserVersions[value][0] === "a" + : browserVersions[value] === "y"; }) .sort((a, b) => a - b); if (allowedVersions[0] !== undefined) { - allowedBrowsers[browser] = allowedVersions[0]; + // Handle cases where caniuse specifies version as: "11.0-11.2" + allowedBrowsers[browser] = allowedVersions[0].split("-")[0]; } } }); diff --git a/packages/babel-preset-env/src/built-in-definitions.js b/packages/babel-preset-env/src/built-in-definitions.js index f4bf559ab3033..7153a5ccdc10f 100644 --- a/packages/babel-preset-env/src/built-in-definitions.js +++ b/packages/babel-preset-env/src/built-in-definitions.js @@ -15,8 +15,8 @@ export const definitions = { Set: "es6.set", WeakMap: "es6.weak-map", WeakSet: "es6.weak-set", - Promise: "es6.promise", - Symbol: "es6.symbol", + Promise: ["es6.object.to-string", "es6.promise"], + Symbol: ["es6.symbol", "es7.symbol.async-iterator"], }, instanceMethods: { @@ -109,11 +109,18 @@ export const definitions = { isInteger: "es6.number.is-integer", isSafeInteger: "es6.number.is-safe-integer", isNaN: "es6.number.is-nan", + parseFloat: "es6.number.parse-float", + parseInt: "es6.number.parse-int", EPSILON: "es6.number.epsilon", MIN_SAFE_INTEGER: "es6.number.min-safe-integer", MAX_SAFE_INTEGER: "es6.number.max-safe-integer", }, + Promise: { + all: ["es6.string.iterator", "web.dom.iterable"], + race: ["es6.string.iterator", "web.dom.iterable"], + }, + Reflect: { apply: "es6.reflect.apply", construct: "es6.reflect.construct", diff --git a/packages/babel-preset-env/src/index.js b/packages/babel-preset-env/src/index.js index ae6c4825f1745..99464814af643 100644 --- a/packages/babel-preset-env/src/index.js +++ b/packages/babel-preset-env/src/index.js @@ -25,7 +25,8 @@ import { semverify, isUnreleasedVersion, } from "./utils"; -import type { Plugin, Targets } from "./types"; +import type { Targets } from "./types"; +import { declare } from "@babel/helper-plugin-utils"; const getPlugin = (pluginName: string) => { const plugin = availablePlugins[pluginName]; @@ -152,10 +153,9 @@ const filterItems = ( return result; }; -export default function buildPreset( - api: Object, - opts: Object = {}, -): { plugins: Array } { +export default declare((api, opts) => { + api.assertVersion(7); + const { configPath, debug, @@ -288,4 +288,4 @@ Using polyfills with \`${useBuiltIns}\` option:`, return { plugins, }; -} +}); diff --git a/packages/babel-preset-env/src/normalize-options.js b/packages/babel-preset-env/src/normalize-options.js index 9c0b2ed139625..bbcdbd19f732d 100644 --- a/packages/babel-preset-env/src/normalize-options.js +++ b/packages/babel-preset-env/src/normalize-options.js @@ -169,7 +169,7 @@ export default function normalizeOptions(opts: Options) { false, ), spec: validateBoolOption("loose", opts.spec, false), - targets: opts.targets, + targets: Object.assign({}, opts.targets), useBuiltIns: validateUseBuiltInsOption(opts.useBuiltIns), }; } diff --git a/packages/babel-preset-env/src/use-built-ins-entry-plugin.js b/packages/babel-preset-env/src/use-built-ins-entry-plugin.js index 0c6620fc053f6..bb2680969c71a 100644 --- a/packages/babel-preset-env/src/use-built-ins-entry-plugin.js +++ b/packages/babel-preset-env/src/use-built-ins-entry-plugin.js @@ -1,11 +1,6 @@ // @flow import { logEntryPolyfills } from "./debug"; -import { - createImport, - isPolyfillSource, - isRequire, - type RequireType, -} from "./utils"; +import { createImport, isPolyfillSource, isRequire } from "./utils"; type Plugin = { visitor: Object, @@ -15,21 +10,22 @@ type Plugin = { }; export default function({ types: t }: { types: Object }): Plugin { - function createImports( - polyfills: Array, - requireType: RequireType, + function replaceWithPolyfillImports( + path: Object, + polyfills: Array | Set, regenerator: boolean, - ): Array { - const items = Array.isArray(polyfills) ? new Set(polyfills) : polyfills; - const imports = []; + ): void { + if (regenerator) { + createImport(path, "regenerator-runtime"); + } - items.forEach(p => imports.push(createImport(t, p, requireType))); + const items = Array.isArray(polyfills) ? new Set(polyfills) : polyfills; - if (regenerator) { - imports.push(createImport(t, "regenerator-runtime", requireType)); + for (const p of Array.from(items).reverse()) { + createImport(path, p); } - return imports; + path.remove(); } const isPolyfillImport = { @@ -39,20 +35,21 @@ export default function({ types: t }: { types: Object }): Plugin { isPolyfillSource(path.node.source.value) ) { this.importPolyfillIncluded = true; - path.replaceWithMultiple( - createImports(state.opts.polyfills, "import", state.opts.regenerator), + + replaceWithPolyfillImports( + path, + state.opts.polyfills, + state.opts.regenerator, ); } }, Program(path, state) { path.get("body").forEach(bodyPath => { if (isRequire(t, bodyPath)) { - bodyPath.replaceWithMultiple( - createImports( - state.opts.polyfills, - "require", - state.opts.regenerator, - ), + replaceWithPolyfillImports( + bodyPath, + state.opts.polyfills, + state.opts.regenerator, ); } }); diff --git a/packages/babel-preset-env/src/use-built-ins-plugin.js b/packages/babel-preset-env/src/use-built-ins-plugin.js index 25ebd661a8922..6fcfe2dbf64a5 100644 --- a/packages/babel-preset-env/src/use-built-ins-plugin.js +++ b/packages/babel-preset-env/src/use-built-ins-plugin.js @@ -42,8 +42,7 @@ export default function({ types: t }: { types: Object }): Plugin { ): void { if (builtIn && !builtIns.has(builtIn)) { builtIns.add(builtIn); - const programPath = path.find(path => path.isProgram()); - programPath.unshiftContainer("body", createImport(t, builtIn)); + createImport(path, builtIn); } } diff --git a/packages/babel-preset-env/src/utils.js b/packages/babel-preset-env/src/utils.js index 714ce2d56f9fc..7f08ad109c4af 100644 --- a/packages/babel-preset-env/src/utils.js +++ b/packages/babel-preset-env/src/utils.js @@ -1,6 +1,6 @@ // @flow - 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"; @@ -88,15 +88,6 @@ export const filterStageFromList = (list: any, stageList: any) => { export const isPolyfillSource = (source: string): boolean => source === "@babel/polyfill" || source === "core-js"; -export const isRequire = (t: Object, path: Object): boolean => - t.isExpressionStatement(path.node) && - t.isCallExpression(path.node.expression) && - t.isIdentifier(path.node.expression.callee) && - path.node.expression.callee.name === "require" && - path.node.expression.arguments.length === 1 && - t.isStringLiteral(path.node.expression.arguments[0]) && - isPolyfillSource(path.node.expression.arguments[0].value); - const modulePathMap = { "regenerator-runtime": "regenerator-runtime/runtime", }; @@ -104,22 +95,14 @@ const modulePathMap = { export const getModulePath = (mod: string) => modulePathMap[mod] || `core-js/modules/${mod}`; -export type RequireType = "require" | "import"; - -export const createImport = ( - t: Object, - polyfill: string, - requireType?: RequireType = "import", -): Object => { - const modulePath = getModulePath(polyfill); +export const createImport = (path: Object, mod: string) => + addSideEffect(path, getModulePath(mod)); - if (requireType === "import") { - const declar = t.importDeclaration([], t.stringLiteral(modulePath)); - declar._blockHoist = 3; - return declar; - } - - return t.expressionStatement( - t.callExpression(t.identifier("require"), [t.stringLiteral(modulePath)]), - ); -}; +export const isRequire = (t: Object, path: Object): boolean => + t.isExpressionStatement(path.node) && + t.isCallExpression(path.node.expression) && + t.isIdentifier(path.node.expression.callee) && + path.node.expression.callee.name === "require" && + path.node.expression.arguments.length === 1 && + t.isStringLiteral(path.node.expression.arguments[0]) && + isPolyfillSource(path.node.expression.arguments[0].value); diff --git a/packages/babel-preset-env/test/debug-fixtures.js b/packages/babel-preset-env/test/debug-fixtures.js index 288407f8b3467..4b4fcb256978e 100644 --- a/packages/babel-preset-env/test/debug-fixtures.js +++ b/packages/babel-preset-env/test/debug-fixtures.js @@ -76,6 +76,16 @@ const buildTest = opts => { }; 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); diff --git a/packages/babel-preset-env/test/debug-fixtures/android/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/android/stdout.txt index 00a05762c351d..7d2e24133dea8 100644 --- a/packages/babel-preset-env/test/debug-fixtures/android/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/android/stdout.txt @@ -133,4 +133,4 @@ Using polyfills with `entry` option: web.timers { "android":"4" } web.immediate { "android":"4" } web.dom.iterable { "android":"4" } -src/in.js -> lib/in.js \ No newline at end of file +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-preset-env/test/debug-fixtures/builtins-no-import/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/builtins-no-import/stdout.txt index 7f1e819d315f3..d3c444f086407 100644 --- a/packages/babel-preset-env/test/debug-fixtures/builtins-no-import/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/builtins-no-import/stdout.txt @@ -18,4 +18,4 @@ Using plugins: Using polyfills with `entry` option: [src/in.js] `import '@babel/polyfill'` was not found. -src/in.js -> lib/in.js \ No newline at end of file +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-preset-env/test/debug-fixtures/builtins-uglify/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/builtins-uglify/stdout.txt index 5fee15ef63383..78d1d4feea006 100644 --- a/packages/babel-preset-env/test/debug-fixtures/builtins-uglify/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/builtins-uglify/stdout.txt @@ -44,4 +44,4 @@ Using polyfills with `entry` option: web.timers { "chrome":"55" } web.immediate { "chrome":"55" } web.dom.iterable { "chrome":"55" } -src/in.js -> lib/in.js \ No newline at end of file +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-preset-env/test/debug-fixtures/builtins/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/builtins/stdout.txt index cefe457b70f6e..5dc6d89ae660e 100644 --- a/packages/babel-preset-env/test/debug-fixtures/builtins/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/builtins/stdout.txt @@ -135,4 +135,4 @@ 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" } -src/in.js -> lib/in.js \ No newline at end of file +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-preset-env/test/debug-fixtures/electron/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/electron/stdout.txt index 27f90400617c2..d670e5d54fde7 100644 --- a/packages/babel-preset-env/test/debug-fixtures/electron/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/electron/stdout.txt @@ -92,4 +92,4 @@ Using polyfills with `entry` option: web.timers { "electron":"0.36" } web.immediate { "electron":"0.36" } web.dom.iterable { "electron":"0.36" } -src/in.js -> lib/in.js \ No newline at end of file +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-preset-env/test/debug-fixtures/force-all-transforms/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/force-all-transforms/stdout.txt index a6ca17fbd939f..9ca9e9357d8f6 100644 --- a/packages/babel-preset-env/test/debug-fixtures/force-all-transforms/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/force-all-transforms/stdout.txt @@ -41,4 +41,4 @@ Using polyfills with `entry` option: web.timers { "chrome":"55" } web.immediate { "chrome":"55" } web.dom.iterable { "chrome":"55" } -src/in.js -> lib/in.js \ No newline at end of file +🎉 Successfully compiled 1 file with Babel. 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 6fb8c6144d347..7e9e7ff3e2cd5 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 @@ -23,4 +23,4 @@ Using plugins: transform-dotall-regex { "firefox":"52", "node":"7.4" } Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set. -src/in.js -> lib/in.js \ No newline at end of file +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-preset-env/test/debug-fixtures/shippedProposals-chrome60/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/shippedProposals-chrome60/stdout.txt index 9e2f76c707439..c6f1945e61893 100644 --- a/packages/babel-preset-env/test/debug-fixtures/shippedProposals-chrome60/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/shippedProposals-chrome60/stdout.txt @@ -19,7 +19,8 @@ Using polyfills with `entry` option: [src/in.js] Replaced `@babel/polyfill` with the following polyfills: es6.array.sort { "chrome":"60" } es7.promise.finally { "chrome":"60" } + es7.symbol.async-iterator { "chrome":"60" } web.timers { "chrome":"60" } web.immediate { "chrome":"60" } web.dom.iterable { "chrome":"60" } -src/in.js -> lib/in.js \ No newline at end of file +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-preset-env/test/debug-fixtures/shippedProposals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/shippedProposals/stdout.txt index 150d19dd1441a..a3932e2a7ebf9 100644 --- a/packages/babel-preset-env/test/debug-fixtures/shippedProposals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/shippedProposals/stdout.txt @@ -150,7 +150,8 @@ Using polyfills with `entry` option: es7.string.pad-start {} es7.string.pad-end {} es7.promise.finally {} + es7.symbol.async-iterator {} web.timers {} web.immediate {} web.dom.iterable {} -src/in.js -> lib/in.js \ No newline at end of file +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-preset-env/test/debug-fixtures/specific-targets/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/specific-targets/stdout.txt index 29a17fe714ca3..0e69225c32814 100644 --- a/packages/babel-preset-env/test/debug-fixtures/specific-targets/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/specific-targets/stdout.txt @@ -139,4 +139,4 @@ 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" } -src/in.js -> lib/in.js \ No newline at end of file +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-none/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-none/stdout.txt index 1d80cac70ef6b..830016841e853 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-none/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-none/stdout.txt @@ -36,7 +36,6 @@ Using plugins: Using polyfills with `usage` option: [src/in.js] Based on your code and targets, none were added. -src/in.js -> lib/in.js [src/in2.js] Based on your code and targets, none were added. -src/in2.js -> lib/in2.js \ No newline at end of file +🎉 Successfully compiled 2 files with Babel. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage-with-import/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage-with-import/stdout.txt index 63f953cc27e96..5b4637b417147 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage-with-import/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage-with-import/stdout.txt @@ -13,4 +13,4 @@ Using plugins: Using polyfills with `usage` option: [src/in.js] Based on your code and targets, none were added. -src/in.js -> lib/in.js \ No newline at end of file +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-preset-env/test/debug-fixtures/usage/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/usage/stdout.txt index 4ce33e8da2795..805fec388400b 100644 --- a/packages/babel-preset-env/test/debug-fixtures/usage/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/usage/stdout.txt @@ -38,9 +38,8 @@ Using polyfills with `usage` option: [src/in.js] Added following polyfills: es6.promise { "ie":"11" } es6.map { "firefox":"50", "ie":"11" } -src/in.js -> lib/in.js [src/in2.js] Added following polyfills: regenerator-runtime { "chrome":"52", "firefox":"50", "ie":"11" } web.dom.iterable { "chrome":"52", "firefox":"50", "ie":"11" } -src/in2.js -> lib/in2.js \ No newline at end of file +🎉 Successfully compiled 2 files with Babel. diff --git a/packages/babel-preset-env/test/debug-fixtures/versions-decimals/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/versions-decimals/stdout.txt index 81048c38d3dba..810d24c691a60 100644 --- a/packages/babel-preset-env/test/debug-fixtures/versions-decimals/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/versions-decimals/stdout.txt @@ -161,4 +161,4 @@ 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" } -src/in.js -> lib/in.js \ No newline at end of file +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-preset-env/test/debug-fixtures/versions-strings/stdout.txt b/packages/babel-preset-env/test/debug-fixtures/versions-strings/stdout.txt index 053aba06c23c1..6985edeaa5ad3 100644 --- a/packages/babel-preset-env/test/debug-fixtures/versions-strings/stdout.txt +++ b/packages/babel-preset-env/test/debug-fixtures/versions-strings/stdout.txt @@ -135,4 +135,4 @@ 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" } -src/in.js -> lib/in.js \ No newline at end of file +🎉 Successfully compiled 1 file with Babel. diff --git a/packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator-in/input.js b/packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator-in/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator-in/input.js rename to packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator-in/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator-in/output.js b/packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator-in/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator-in/output.js rename to packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator-in/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator/input.js b/packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator/input.js rename to packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator/output.js b/packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator/output.js rename to packages/babel-preset-env/test/fixtures/dom-iterable/symbol-iterator/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/dom-iterable/yield-non-star/input.js b/packages/babel-preset-env/test/fixtures/dom-iterable/yield-non-star/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/dom-iterable/yield-non-star/input.js rename to packages/babel-preset-env/test/fixtures/dom-iterable/yield-non-star/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/dom-iterable/yield-non-star/output.js b/packages/babel-preset-env/test/fixtures/dom-iterable/yield-non-star/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/dom-iterable/yield-non-star/output.js rename to packages/babel-preset-env/test/fixtures/dom-iterable/yield-non-star/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/dom-iterable/yield-star/input.js b/packages/babel-preset-env/test/fixtures/dom-iterable/yield-star/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/dom-iterable/yield-star/input.js rename to packages/babel-preset-env/test/fixtures/dom-iterable/yield-star/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/dom-iterable/yield-star/output.js b/packages/babel-preset-env/test/fixtures/dom-iterable/yield-star/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/dom-iterable/yield-star/output.js rename to packages/babel-preset-env/test/fixtures/dom-iterable/yield-star/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/plugin-options/filters-duplicates/input.js b/packages/babel-preset-env/test/fixtures/plugin-options/filters-duplicates/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugin-options/filters-duplicates/input.js rename to packages/babel-preset-env/test/fixtures/plugin-options/filters-duplicates/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/plugin-options/filters-duplicates/output.js b/packages/babel-preset-env/test/fixtures/plugin-options/filters-duplicates/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugin-options/filters-duplicates/output.js rename to packages/babel-preset-env/test/fixtures/plugin-options/filters-duplicates/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/plugin-options/regenerator-false/input.js b/packages/babel-preset-env/test/fixtures/plugin-options/regenerator-false/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugin-options/regenerator-false/input.js rename to packages/babel-preset-env/test/fixtures/plugin-options/regenerator-false/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/plugin-options/regenerator-true/input.js b/packages/babel-preset-env/test/fixtures/plugin-options/regenerator-true/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugin-options/regenerator-true/input.js rename to packages/babel-preset-env/test/fixtures/plugin-options/regenerator-true/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/plugin-options/regenerator-true/output.js b/packages/babel-preset-env/test/fixtures/plugin-options/regenerator-true/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/plugin-options/regenerator-true/output.js rename to packages/babel-preset-env/test/fixtures/plugin-options/regenerator-true/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/exec.js b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/exec.js new file mode 100644 index 0000000000000..928ee1da87b77 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/exec.js @@ -0,0 +1,6 @@ +class MyDate extends Date { + constructor(time) { + super(time); + } +} +let myDate = new MyDate(); diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/input.mjs b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/input.mjs new file mode 100644 index 0000000000000..928ee1da87b77 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/input.mjs @@ -0,0 +1,6 @@ +class MyDate extends Date { + constructor(time) { + super(time); + } +} +let myDate = new MyDate(); diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/options.json b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/options.json new file mode 100644 index 0000000000000..5506781ec8a96 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/options.json @@ -0,0 +1,4 @@ +{ + "plugins": [], + "presets": ["../../../../lib"] +} \ No newline at end of file diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/output.js b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/output.js new file mode 100644 index 0000000000000..0e08c36ad7920 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/issue-7527/output.js @@ -0,0 +1,35 @@ +"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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function _gPO(o) { _gPO = Object.getPrototypeOf || function _gPO(o) { return o.__proto__; }; return _gPO(o); } + +function _sPO(o, p) { _sPO = Object.setPrototypeOf || function _sPO(o, p) { o.__proto__ = p; return o; }; return _sPO(o, p); } + +function _construct(Parent, args, Class) { _construct = (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) === "object" && Reflect.construct || function _construct(Parent, args, Class) { var Constructor, a = [null]; a.push.apply(a, args); Constructor = Parent.bind.apply(Parent, a); return _sPO(new Constructor(), Class.prototype); }; return _construct(Parent, args, Class); } + +function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() {} Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _sPO(Wrapper, _sPO(function Super() { return _construct(Class, arguments, _gPO(this).constructor); }, Class)); }; return _wrapNativeSuper(Class); } + +var MyDate = +/*#__PURE__*/ +function (_Date) { + _inherits(MyDate, _Date); + + function MyDate(time) { + _classCallCheck(this, MyDate); + + return _possibleConstructorReturn(this, (MyDate.__proto__ || Object.getPrototypeOf(MyDate)).call(this, time)); + } + + return MyDate; +}(_wrapNativeSuper(Date)); + +var myDate = new MyDate(); diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-false/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-false/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-false/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-false/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-false/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-false/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-false/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-false/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-class-methods/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-class-methods/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-class-methods/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-class-methods/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-class-methods/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-class-methods/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-class-methods/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-class-methods/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-instance-methods/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-instance-methods/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-instance-methods/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-instance-methods/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-instance-methods/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-instance-methods/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-instance-methods/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-evaluated-instance-methods/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods-native-support/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods-native-support/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods-native-support/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods-native-support/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods-native-support/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods-native-support/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods-native-support/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods-native-support/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-instance-methods/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-native-support/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-native-support/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-native-support/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-native-support/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-native-support/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-native-support/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-native-support/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used-native-support/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/builtins-used/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-with/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-with/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-with/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-with/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-with/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-with/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-with/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-with/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-without/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-without/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-without/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-without/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-without/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-without/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-without/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/for-of-destructure-without/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/no-builtins-used/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/no-builtins-used/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/no-builtins-used/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/no-builtins-used/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/no-builtins-used/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/no-builtins-used/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/no-builtins-used/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/no-builtins-used/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/number-ie11/input.mjs b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/number-ie11/input.mjs new file mode 100644 index 0000000000000..f71c85f35e63c --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/number-ie11/input.mjs @@ -0,0 +1,2 @@ +Number.parseFloat("3.14"); +Number.parseInt("10"); diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/number-ie11/options.json b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/number-ie11/options.json new file mode 100644 index 0000000000000..a7327659bd855 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/number-ie11/options.json @@ -0,0 +1,14 @@ +{ + "presets": [ + [ + "../../../../lib", + { + "targets": { + "ie": "11" + }, + "useBuiltIns": "usage", + "modules": false + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/number-ie11/output.mjs b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/number-ie11/output.mjs new file mode 100644 index 0000000000000..315a46476ddf8 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/number-ie11/output.mjs @@ -0,0 +1,4 @@ +import "core-js/modules/es6.number.parse-int"; +import "core-js/modules/es6.number.parse-float"; +Number.parseFloat("3.14"); +Number.parseInt("10"); diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-all/input.mjs b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-all/input.mjs new file mode 100644 index 0000000000000..0fef928e163de --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-all/input.mjs @@ -0,0 +1,4 @@ +var p = Promise.resolve(0); +Promise.all([p]).then(outcome => { + alert("OK"); +}); diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-all/options.json b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-all/options.json new file mode 100644 index 0000000000000..eeb3ed89dd1fd --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-all/options.json @@ -0,0 +1,14 @@ +{ + "presets": [ + [ + "../../../../lib", + { + "targets": { + "browsers": ["ie > 10"] + }, + "useBuiltIns": "usage", + "modules": false + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-all/output.mjs b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-all/output.mjs new file mode 100644 index 0000000000000..3c6e6de8aacb6 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-all/output.mjs @@ -0,0 +1,6 @@ +import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es6.promise"; +var p = Promise.resolve(0); +Promise.all([p]).then(function (outcome) { + alert("OK"); +}); diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-race/input.mjs b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-race/input.mjs new file mode 100644 index 0000000000000..334252838bc0a --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-race/input.mjs @@ -0,0 +1,4 @@ +var p = Promise.resolve(0); +Promise.race([p]).then(outcome => { + alert("OK"); +}); diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-race/options.json b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-race/options.json new file mode 100644 index 0000000000000..eeb3ed89dd1fd --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-race/options.json @@ -0,0 +1,14 @@ +{ + "presets": [ + [ + "../../../../lib", + { + "targets": { + "browsers": ["ie > 10"] + }, + "useBuiltIns": "usage", + "modules": false + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-race/output.mjs b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-race/output.mjs new file mode 100644 index 0000000000000..42d9a206b3192 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/promise-race/output.mjs @@ -0,0 +1,6 @@ +import "core-js/modules/web.dom.iterable"; +import "core-js/modules/es6.promise"; +var p = Promise.resolve(0); +Promise.race([p]).then(function (outcome) { + alert("OK"); +}); diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async-native-support/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async-native-support/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async-native-support/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async-native-support/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async-native-support/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async-native-support/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async-native-support/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async-native-support/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-async/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator-native-support/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator-native-support/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator-native-support/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator-native-support/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator-native-support/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator-native-support/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator-native-support/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator-native-support/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/regenerator-used-generator/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/remove-babel-polyfill-import/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/remove-babel-polyfill-import/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/remove-babel-polyfill-import/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/remove-babel-polyfill-import/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/source-type-script/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/source-type-script/input.js new file mode 100644 index 0000000000000..39f9e5858b8c0 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/source-type-script/input.js @@ -0,0 +1,8 @@ +require("foo"); + +const x = new Promise(resolve => { + const p = []; + + if (p.includes("a")) { + } +}); diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/source-type-script/options.json b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/source-type-script/options.json new file mode 100644 index 0000000000000..a92e3abd7a6c8 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/source-type-script/options.json @@ -0,0 +1,12 @@ +{ + "presets": [ + ["../../../../lib", { + "modules": false, + "targets": { + "node": "4.0.0" + }, + "useBuiltIns": "usage", + "shippedProposals": true + }] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/source-type-script/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/source-type-script/output.js new file mode 100644 index 0000000000000..d98c7e41c6af5 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/source-type-script/output.js @@ -0,0 +1,11 @@ +require("core-js/modules/es7.array.includes"); + +require("core-js/modules/es6.promise"); + +require("foo"); + +var x = new Promise(function (resolve) { + var p = []; + + if (p.includes("a")) {} +}); diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/test-modules-tranform/input.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/test-modules-transform/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/test-modules-tranform/input.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/test-modules-transform/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/test-modules-tranform/options.json b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/test-modules-transform/options.json similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/test-modules-tranform/options.json rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/test-modules-transform/options.json diff --git a/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/test-modules-tranform/output.js b/packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/test-modules-transform/output.js similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/test-modules-tranform/output.js rename to packages/babel-preset-env/test/fixtures/preset-options-add-used-built-ins/test-modules-transform/output.js diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-config-ignore-with-false/input.js b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-config-ignore-with-false/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/browserslist-config-ignore-with-false/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/browserslist-config-ignore-with-false/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-config-ignore-with-false/output.js b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-config-ignore-with-false/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/browserslist-config-ignore-with-false/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/browserslist-config-ignore-with-false/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-config/input.js b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-config/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/browserslist-config/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/browserslist-config/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-config/options.json b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-config/options.json index f048ce5e36d88..1545c51ee962c 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-config/options.json +++ b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-config/options.json @@ -1,7 +1,7 @@ { "presets": [ ["../../../../lib", { - "configPath": "../fixtures/preset-options/browserslist-config", + "configPath": "packages/babel-preset-env/test/fixtures/preset-options/browserslist-config", "modules": false }] ] diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-config/output.js b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-config/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/browserslist-config/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/browserslist-config/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-package-ignore-with-array/input.js b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-package-ignore-with-array/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/browserslist-package-ignore-with-array/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/browserslist-package-ignore-with-array/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-package-ignore-with-array/output.js b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-package-ignore-with-array/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/browserslist-package-ignore-with-array/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/browserslist-package-ignore-with-array/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-package/input.js b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-package/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/browserslist-package/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/browserslist-package/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-package/options.json b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-package/options.json index 04183bdbd1b58..c10fd049d797a 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-package/options.json +++ b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-package/options.json @@ -1,7 +1,7 @@ { "presets": [ ["../../../../lib", { - "configPath": "../fixtures/preset-options/browserslist-package", + "configPath": "packages/babel-preset-env/test/fixtures/preset-options/browserslist-package", "targets": { "chrome": 55 }, diff --git a/packages/babel-preset-env/test/fixtures/preset-options/browserslist-package/output.js b/packages/babel-preset-env/test/fixtures/preset-options/browserslist-package/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/browserslist-package/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/browserslist-package/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/core-js/input.js b/packages/babel-preset-env/test/fixtures/preset-options/core-js/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/core-js/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/core-js/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/core-js/output.js b/packages/babel-preset-env/test/fixtures/preset-options/core-js/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/core-js/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/core-js/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/electron/input.js b/packages/babel-preset-env/test/fixtures/preset-options/electron/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/electron/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/electron/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/electron/output.js b/packages/babel-preset-env/test/fixtures/preset-options/electron/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/electron/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/electron/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/empty-options/input.js b/packages/babel-preset-env/test/fixtures/preset-options/empty-options/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/empty-options/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/empty-options/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/empty-options/output.js b/packages/babel-preset-env/test/fixtures/preset-options/empty-options/output.js index 2c64b68bbb728..b298c5e19dd96 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/empty-options/output.js +++ b/packages/babel-preset-env/test/fixtures/preset-options/empty-options/output.js @@ -1 +1,3 @@ +"use strict"; + var a = "1"; diff --git a/packages/babel-preset-env/test/fixtures/preset-options/exclude-built-ins/input.js b/packages/babel-preset-env/test/fixtures/preset-options/exclude-built-ins/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/exclude-built-ins/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/exclude-built-ins/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/exclude-include/input.js b/packages/babel-preset-env/test/fixtures/preset-options/exclude-include/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/exclude-include/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/exclude-include/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/exclude-include/output.js b/packages/babel-preset-env/test/fixtures/preset-options/exclude-include/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/exclude-include/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/exclude-include/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/exclude-regenerator/input.js b/packages/babel-preset-env/test/fixtures/preset-options/exclude-regenerator/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/exclude-regenerator/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/exclude-regenerator/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/exclude-regenerator/output.js b/packages/babel-preset-env/test/fixtures/preset-options/exclude-regenerator/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/exclude-regenerator/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/exclude-regenerator/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/exclude/input.js b/packages/babel-preset-env/test/fixtures/preset-options/exclude/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/exclude/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/exclude/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/exclude/output.js b/packages/babel-preset-env/test/fixtures/preset-options/exclude/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/exclude/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/exclude/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/force-all-transforms/input.js b/packages/babel-preset-env/test/fixtures/preset-options/force-all-transforms/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/force-all-transforms/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/force-all-transforms/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/force-all-transforms/output.js b/packages/babel-preset-env/test/fixtures/preset-options/force-all-transforms/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/force-all-transforms/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/force-all-transforms/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/ie-11-built-ins/input.js b/packages/babel-preset-env/test/fixtures/preset-options/ie-11-built-ins/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/ie-11-built-ins/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/ie-11-built-ins/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/ie-11-built-ins/output.js b/packages/babel-preset-env/test/fixtures/preset-options/ie-11-built-ins/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/ie-11-built-ins/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/ie-11-built-ins/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/include-built-ins/input.js b/packages/babel-preset-env/test/fixtures/preset-options/include-built-ins/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/include-built-ins/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/include-built-ins/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/include-built-ins/output.js b/packages/babel-preset-env/test/fixtures/preset-options/include-built-ins/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/include-built-ins/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/include-built-ins/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/include/input.js b/packages/babel-preset-env/test/fixtures/preset-options/include/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/include/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/include/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/include/output.js b/packages/babel-preset-env/test/fixtures/preset-options/include/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/include/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/include/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/ios-10/input.js b/packages/babel-preset-env/test/fixtures/preset-options/ios-10/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/ios-10/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/ios-10/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/ios-10/output.js b/packages/babel-preset-env/test/fixtures/preset-options/ios-10/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/ios-10/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/ios-10/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/ios-6/input.js b/packages/babel-preset-env/test/fixtures/preset-options/ios-6/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/ios-6/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/ios-6/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/loose-typeof-symbol/input.js b/packages/babel-preset-env/test/fixtures/preset-options/loose-typeof-symbol/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/loose-typeof-symbol/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/loose-typeof-symbol/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/loose-typeof-symbol/output.js b/packages/babel-preset-env/test/fixtures/preset-options/loose-typeof-symbol/output.js index 6d69e92eaa36c..565dccdd11658 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/loose-typeof-symbol/output.js +++ b/packages/babel-preset-env/test/fixtures/preset-options/loose-typeof-symbol/output.js @@ -1 +1,3 @@ +"use strict"; + typeof Symbol(); diff --git a/packages/babel-preset-env/test/fixtures/preset-options/loose-with-typeof-symbol-includes/input.js b/packages/babel-preset-env/test/fixtures/preset-options/loose-with-typeof-symbol-includes/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/loose-with-typeof-symbol-includes/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/loose-with-typeof-symbol-includes/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/loose-with-typeof-symbol-includes/output.js b/packages/babel-preset-env/test/fixtures/preset-options/loose-with-typeof-symbol-includes/output.js index 35d292f43c1c5..47a605e274102 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/loose-with-typeof-symbol-includes/output.js +++ b/packages/babel-preset-env/test/fixtures/preset-options/loose-with-typeof-symbol-includes/output.js @@ -1,3 +1,5 @@ +"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); } _typeof(Symbol()); diff --git a/packages/babel-preset-env/test/fixtures/preset-options/modules-amd-loose/input.js b/packages/babel-preset-env/test/fixtures/preset-options/modules-amd-loose/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/modules-amd-loose/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/modules-amd-loose/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/modules-cjs/input.js b/packages/babel-preset-env/test/fixtures/preset-options/modules-cjs/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/modules-cjs/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/modules-cjs/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/modules-commonjs/input.js b/packages/babel-preset-env/test/fixtures/preset-options/modules-commonjs/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/modules-commonjs/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/modules-commonjs/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/modules-false/input.js b/packages/babel-preset-env/test/fixtures/preset-options/modules-false/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/modules-false/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/modules-false/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/modules-false/output.js b/packages/babel-preset-env/test/fixtures/preset-options/modules-false/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/modules-false/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/modules-false/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/modules-systemjs/input.js b/packages/babel-preset-env/test/fixtures/preset-options/modules-systemjs/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/modules-systemjs/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/modules-systemjs/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/modules-systemjs/output.js b/packages/babel-preset-env/test/fixtures/preset-options/modules-systemjs/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/modules-systemjs/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/modules-systemjs/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/modules-umd/input.js b/packages/babel-preset-env/test/fixtures/preset-options/modules-umd/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/modules-umd/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/modules-umd/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/no-options/input.js b/packages/babel-preset-env/test/fixtures/preset-options/no-options/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/no-options/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/no-options/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/no-options/output.js b/packages/babel-preset-env/test/fixtures/preset-options/no-options/output.js index 2c64b68bbb728..b298c5e19dd96 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/no-options/output.js +++ b/packages/babel-preset-env/test/fixtures/preset-options/no-options/output.js @@ -1 +1,3 @@ +"use strict"; + var a = "1"; diff --git a/packages/babel-preset-env/test/fixtures/preset-options/no-transform/input.js b/packages/babel-preset-env/test/fixtures/preset-options/no-transform/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/no-transform/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/no-transform/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/no-transform/output.js b/packages/babel-preset-env/test/fixtures/preset-options/no-transform/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/no-transform/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/no-transform/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals-use-builtins-entry/output.js b/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals-use-builtins-entry/output.js index af88590c74302..0c600cdd7be2d 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals-use-builtins-entry/output.js +++ b/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals-use-builtins-entry/output.js @@ -1,3 +1,9 @@ +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? 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; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, 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; } + +function _objectWithoutProperties(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]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + function _awaitAsyncGenerator(value) { return new _AwaitValue(value); } function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; } @@ -14,8 +20,6 @@ _AsyncGenerator.prototype.return = function (arg) { return this._invoke("return" function _AwaitValue(value) { this.wrapped = value; } -function _objectWithoutProperties(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]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } - var _x$y$a$b = { x: 1, y: 2, @@ -26,7 +30,7 @@ var _x$y$a$b = { y = _x$y$a$b.y, z = _objectWithoutProperties(_x$y$a$b, ["x", "y"]); -var n = Object.assign({ +var n = _objectSpread({ x: x, y: y }, z); diff --git a/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals-use-builtins-usage/options.json b/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals-use-builtins-usage/options.json index d1b9e87480134..c67678705d2a5 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals-use-builtins-usage/options.json +++ b/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals-use-builtins-usage/options.json @@ -1,4 +1,5 @@ { + "sourceType": "module", "presets": [ ["../../../../lib", { "shippedProposals": true, diff --git a/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals-use-builtins-usage/output.js b/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals-use-builtins-usage/output.js index 8ad03ca549e26..3f72aaa90249f 100644 --- a/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals-use-builtins-usage/output.js +++ b/packages/babel-preset-env/test/fixtures/preset-options/shippedProposals-use-builtins-usage/output.js @@ -1,14 +1,24 @@ "use strict"; +require("core-js/modules/es6.array.for-each"); + +require("core-js/modules/es6.array.filter"); + +require("core-js/modules/es6.array.index-of"); + require("regenerator-runtime/runtime"); +require("core-js/modules/es7.symbol.async-iterator"); + require("core-js/modules/es6.symbol"); require("core-js/modules/es6.promise"); -require("core-js/modules/es6.array.index-of"); +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? 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; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, 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; } -require("core-js/modules/es6.object.assign"); +function _objectWithoutProperties(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]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _awaitAsyncGenerator(value) { return new _AwaitValue(value); } @@ -26,8 +36,6 @@ _AsyncGenerator.prototype.return = function (arg) { return this._invoke("return" function _AwaitValue(value) { this.wrapped = value; } -function _objectWithoutProperties(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]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } - var _x$y$a$b = { x: 1, y: 2, @@ -38,7 +46,7 @@ var _x$y$a$b = { y = _x$y$a$b.y, z = _objectWithoutProperties(_x$y$a$b, ["x", "y"]); -var n = Object.assign({ +var n = _objectSpread({ x: x, y: y }, z); 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 4088c6e0c315b..0c600cdd7be2d 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,3 +1,9 @@ +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? 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; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, 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; } + +function _objectWithoutProperties(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]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } + function _awaitAsyncGenerator(value) { return new _AwaitValue(value); } function _wrapAsyncGenerator(fn) { return function () { return new _AsyncGenerator(fn.apply(this, arguments)); }; } @@ -14,10 +20,6 @@ _AsyncGenerator.prototype.return = function (arg) { return this._invoke("return" function _AwaitValue(value) { this.wrapped = value; } -function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } - -function _objectWithoutProperties(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]; } if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } - var _x$y$a$b = { x: 1, y: 2, @@ -28,7 +30,7 @@ var _x$y$a$b = { y = _x$y$a$b.y, z = _objectWithoutProperties(_x$y$a$b, ["x", "y"]); -var n = _extends({ +var n = _objectSpread({ x: x, y: y }, z); diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-all/input.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-all/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-all/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-all/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-all/output.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-all/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-all/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-all/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-48/input.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-48/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-48/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-48/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-48/output.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-48/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-48/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-48/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-49/input.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-49/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-49/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-49/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-49/output.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-49/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-49/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chrome-49/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chromeandroid/input.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chromeandroid/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chromeandroid/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chromeandroid/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chromeandroid/output.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chromeandroid/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chromeandroid/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-chromeandroid/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/input.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/output.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-ie-9/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-import/input.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-import/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-import/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-import/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-import/output.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-import/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-import/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-import/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node-web/input.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node-web/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node-web/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node-web/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node-web/output.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node-web/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node-web/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node-web/output.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node/input.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node/input.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node/input.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node/input.mjs diff --git a/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node/output.js b/packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node/output.mjs similarity index 100% rename from packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node/output.js rename to packages/babel-preset-env/test/fixtures/preset-options/use-builtins-node/output.mjs diff --git a/packages/babel-preset-env/test/targets-parser.spec.js b/packages/babel-preset-env/test/targets-parser.spec.js index d1144ea9936cf..ae000a2b6e2e3 100644 --- a/packages/babel-preset-env/test/targets-parser.spec.js +++ b/packages/babel-preset-env/test/targets-parser.spec.js @@ -1,5 +1,5 @@ import assert from "assert"; -import getTargets from "../src/targets-parser"; +import getTargets from "../lib/targets-parser"; describe("getTargets", () => { it("parses", () => { @@ -87,6 +87,7 @@ describe("getTargets", () => { { chrome: "61.0.0", safari: "10.1.0", + firefox: "60.0.0", ios: "10.3.0", edge: "16.0.0", }, @@ -102,6 +103,7 @@ describe("getTargets", () => { { chrome: "61.0.0", safari: "10.1.0", + firefox: "60.0.0", ios: "10.3.0", edge: "16.0.0", }, @@ -117,6 +119,7 @@ describe("getTargets", () => { { chrome: "61.0.0", safari: "10.1.0", + firefox: "60.0.0", ios: "10.3.0", ie: "11.0.0", edge: "16.0.0", @@ -137,6 +140,7 @@ describe("getTargets", () => { ios: "10.3.0", ie: "11.0.0", edge: "16.0.0", + firefox: "60.0.0", }, ); }); diff --git a/packages/babel-preset-es2015/package.json b/packages/babel-preset-es2015/package.json index 297c3abdc664a..c03f75e38b876 100644 --- a/packages/babel-preset-es2015/package.json +++ b/packages/babel-preset-es2015/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-es2015", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Babel preset for all es2015 plugins.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -8,37 +8,38 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-es2015", "main": "lib/index.js", "dependencies": { - "@babel/plugin-transform-arrow-functions": "7.0.0-beta.39", - "@babel/plugin-transform-block-scoped-functions": "7.0.0-beta.39", - "@babel/plugin-transform-block-scoping": "7.0.0-beta.39", - "@babel/plugin-transform-classes": "7.0.0-beta.39", - "@babel/plugin-transform-computed-properties": "7.0.0-beta.39", - "@babel/plugin-transform-destructuring": "7.0.0-beta.39", - "@babel/plugin-transform-duplicate-keys": "7.0.0-beta.39", - "@babel/plugin-transform-for-of": "7.0.0-beta.39", - "@babel/plugin-transform-function-name": "7.0.0-beta.39", - "@babel/plugin-transform-instanceof": "7.0.0-beta.39", - "@babel/plugin-transform-literals": "7.0.0-beta.39", - "@babel/plugin-transform-modules-amd": "7.0.0-beta.39", - "@babel/plugin-transform-modules-commonjs": "7.0.0-beta.39", - "@babel/plugin-transform-modules-systemjs": "7.0.0-beta.39", - "@babel/plugin-transform-modules-umd": "7.0.0-beta.39", - "@babel/plugin-transform-object-super": "7.0.0-beta.39", - "@babel/plugin-transform-parameters": "7.0.0-beta.39", - "@babel/plugin-transform-regenerator": "7.0.0-beta.39", - "@babel/plugin-transform-shorthand-properties": "7.0.0-beta.39", - "@babel/plugin-transform-spread": "7.0.0-beta.39", - "@babel/plugin-transform-sticky-regex": "7.0.0-beta.39", - "@babel/plugin-transform-template-literals": "7.0.0-beta.39", - "@babel/plugin-transform-typeof-symbol": "7.0.0-beta.39", - "@babel/plugin-transform-unicode-regex": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-transform-arrow-functions": "7.0.0-beta.42", + "@babel/plugin-transform-block-scoped-functions": "7.0.0-beta.42", + "@babel/plugin-transform-block-scoping": "7.0.0-beta.42", + "@babel/plugin-transform-classes": "7.0.0-beta.42", + "@babel/plugin-transform-computed-properties": "7.0.0-beta.42", + "@babel/plugin-transform-destructuring": "7.0.0-beta.42", + "@babel/plugin-transform-duplicate-keys": "7.0.0-beta.42", + "@babel/plugin-transform-for-of": "7.0.0-beta.42", + "@babel/plugin-transform-function-name": "7.0.0-beta.42", + "@babel/plugin-transform-instanceof": "7.0.0-beta.42", + "@babel/plugin-transform-literals": "7.0.0-beta.42", + "@babel/plugin-transform-modules-amd": "7.0.0-beta.42", + "@babel/plugin-transform-modules-commonjs": "7.0.0-beta.42", + "@babel/plugin-transform-modules-systemjs": "7.0.0-beta.42", + "@babel/plugin-transform-modules-umd": "7.0.0-beta.42", + "@babel/plugin-transform-object-super": "7.0.0-beta.42", + "@babel/plugin-transform-parameters": "7.0.0-beta.42", + "@babel/plugin-transform-regenerator": "7.0.0-beta.42", + "@babel/plugin-transform-shorthand-properties": "7.0.0-beta.42", + "@babel/plugin-transform-spread": "7.0.0-beta.42", + "@babel/plugin-transform-sticky-regex": "7.0.0-beta.42", + "@babel/plugin-transform-template-literals": "7.0.0-beta.42", + "@babel/plugin-transform-typeof-symbol": "7.0.0-beta.42", + "@babel/plugin-transform-unicode-regex": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39", - "@babel/helper-transform-fixture-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42", + "@babel/helper-transform-fixture-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-preset-es2015/src/index.js b/packages/babel-preset-es2015/src/index.js index a80bf685eed9c..8fcedf63c3126 100644 --- a/packages/babel-preset-es2015/src/index.js +++ b/packages/babel-preset-es2015/src/index.js @@ -1,3 +1,4 @@ +import { declare } from "@babel/helper-plugin-utils"; import transformES2015TemplateLiterals from "@babel/plugin-transform-template-literals"; import transformES2015Literals from "@babel/plugin-transform-literals"; import transformES2015FunctionName from "@babel/plugin-transform-function-name"; @@ -23,7 +24,9 @@ import transformES2015ModulesUMD from "@babel/plugin-transform-modules-umd"; import transformES2015Instanceof from "@babel/plugin-transform-instanceof"; import transformRegenerator from "@babel/plugin-transform-regenerator"; -export default function(api, opts = {}) { +export default declare((api, opts) => { + api.assertVersion(7); + const moduleTypes = ["commonjs", "cjs", "amd", "umd", "systemjs"]; let loose = false; let modules = "commonjs"; @@ -82,4 +85,4 @@ export default function(api, opts = {}) { [transformRegenerator, { async: false, asyncGenerators: false }], ].filter(Boolean), // filter out falsy values }; -} +}); diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/empty-options/input.js b/packages/babel-preset-es2015/test/fixtures/preset-options/empty-options/input.mjs similarity index 100% rename from packages/babel-preset-es2015/test/fixtures/preset-options/empty-options/input.js rename to packages/babel-preset-es2015/test/fixtures/preset-options/empty-options/input.mjs diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/loose-false/input.js b/packages/babel-preset-es2015/test/fixtures/preset-options/loose-false/input.mjs similarity index 100% rename from packages/babel-preset-es2015/test/fixtures/preset-options/loose-false/input.js rename to packages/babel-preset-es2015/test/fixtures/preset-options/loose-false/input.mjs diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/loose/input.js b/packages/babel-preset-es2015/test/fixtures/preset-options/loose/input.mjs similarity index 100% rename from packages/babel-preset-es2015/test/fixtures/preset-options/loose/input.js rename to packages/babel-preset-es2015/test/fixtures/preset-options/loose/input.mjs diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/modules-amd-loose/input.js b/packages/babel-preset-es2015/test/fixtures/preset-options/modules-amd-loose/input.mjs similarity index 100% rename from packages/babel-preset-es2015/test/fixtures/preset-options/modules-amd-loose/input.js rename to packages/babel-preset-es2015/test/fixtures/preset-options/modules-amd-loose/input.mjs diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/modules-cjs/input.js b/packages/babel-preset-es2015/test/fixtures/preset-options/modules-cjs/input.mjs similarity index 100% rename from packages/babel-preset-es2015/test/fixtures/preset-options/modules-cjs/input.js rename to packages/babel-preset-es2015/test/fixtures/preset-options/modules-cjs/input.mjs diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/modules-commonjs/input.js b/packages/babel-preset-es2015/test/fixtures/preset-options/modules-commonjs/input.mjs similarity index 100% rename from packages/babel-preset-es2015/test/fixtures/preset-options/modules-commonjs/input.js rename to packages/babel-preset-es2015/test/fixtures/preset-options/modules-commonjs/input.mjs diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/modules-false/input.js b/packages/babel-preset-es2015/test/fixtures/preset-options/modules-false/input.mjs similarity index 100% rename from packages/babel-preset-es2015/test/fixtures/preset-options/modules-false/input.js rename to packages/babel-preset-es2015/test/fixtures/preset-options/modules-false/input.mjs diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/modules-false/output.js b/packages/babel-preset-es2015/test/fixtures/preset-options/modules-false/output.mjs similarity index 100% rename from packages/babel-preset-es2015/test/fixtures/preset-options/modules-false/output.js rename to packages/babel-preset-es2015/test/fixtures/preset-options/modules-false/output.mjs diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/modules-systemjs/input.js b/packages/babel-preset-es2015/test/fixtures/preset-options/modules-systemjs/input.mjs similarity index 100% rename from packages/babel-preset-es2015/test/fixtures/preset-options/modules-systemjs/input.js rename to packages/babel-preset-es2015/test/fixtures/preset-options/modules-systemjs/input.mjs diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/modules-systemjs/output.js b/packages/babel-preset-es2015/test/fixtures/preset-options/modules-systemjs/output.mjs similarity index 100% rename from packages/babel-preset-es2015/test/fixtures/preset-options/modules-systemjs/output.js rename to packages/babel-preset-es2015/test/fixtures/preset-options/modules-systemjs/output.mjs diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/modules-umd/input.js b/packages/babel-preset-es2015/test/fixtures/preset-options/modules-umd/input.mjs similarity index 100% rename from packages/babel-preset-es2015/test/fixtures/preset-options/modules-umd/input.js rename to packages/babel-preset-es2015/test/fixtures/preset-options/modules-umd/input.mjs diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/no-options/input.js b/packages/babel-preset-es2015/test/fixtures/preset-options/no-options/input.mjs similarity index 100% rename from packages/babel-preset-es2015/test/fixtures/preset-options/no-options/input.js rename to packages/babel-preset-es2015/test/fixtures/preset-options/no-options/input.mjs diff --git a/packages/babel-preset-es2015/test/fixtures/preset-options/string-preset/input.js b/packages/babel-preset-es2015/test/fixtures/preset-options/string-preset/input.mjs similarity index 100% rename from packages/babel-preset-es2015/test/fixtures/preset-options/string-preset/input.js rename to packages/babel-preset-es2015/test/fixtures/preset-options/string-preset/input.mjs diff --git a/packages/babel-preset-es2015/test/index.js b/packages/babel-preset-es2015/test/index.js index d09abe717fc4e..10239190a43e6 100644 --- a/packages/babel-preset-es2015/test/index.js +++ b/packages/babel-preset-es2015/test/index.js @@ -1,18 +1,19 @@ +import * as babel from "@babel/core"; import es2015 from "../lib"; import { expect } from "chai"; describe("es2015 preset", function() { - it("doesn't throw with no options passed", function() { + it("does throw clear error when no options passed for Babel 6", () => { expect(function() { - es2015(null); - }).not.to.throw(); + es2015({ version: "6.5.0" }); + }).to.throw(Error, /Requires Babel "\^7.0.0-0"/); }); describe("options", function() { describe("loose", function() { it("throws on non-boolean value", function() { expect(function() { - es2015(null, { loose: 1 }); + babel.transform("", { presets: [[es2015, { loose: 1 }]] }); }).to.throw(/must be a boolean/); }); }); @@ -20,7 +21,7 @@ describe("es2015 preset", function() { describe("spec", function() { it("throws on non-boolean value", function() { expect(function() { - es2015(null, { spec: 1 }); + babel.transform("", { presets: [[es2015, { spec: 1 }]] }); }).to.throw(/must be a boolean/); }); }); @@ -28,31 +29,31 @@ describe("es2015 preset", function() { describe("modules", function() { it("doesn't throw when passing one false", function() { expect(function() { - es2015(null, { modules: false }); + babel.transform("", { presets: [[es2015, { modules: false }]] }); }).not.to.throw(); }); it("doesn't throw when passing one of: 'commonjs', 'amd', 'umd', 'systemjs", function() { expect(function() { - es2015(null, { modules: "commonjs" }); + babel.transform("", { presets: [[es2015, { modules: "commonjs" }]] }); }).not.to.throw(); expect(function() { - es2015(null, { modules: "amd" }); + babel.transform("", { presets: [[es2015, { modules: "amd" }]] }); }).not.to.throw(); expect(function() { - es2015(null, { modules: "umd" }); + babel.transform("", { presets: [[es2015, { modules: "umd" }]] }); }).not.to.throw(); expect(function() { - es2015(null, { modules: "systemjs" }); + babel.transform("", { presets: [[es2015, { modules: "systemjs" }]] }); }).not.to.throw(); }); it("throws when passing neither false nor one of: 'commonjs', 'amd', 'umd', 'systemjs'", function() { expect(function() { - es2015(null, { modules: 1 }); + babel.transform("", { presets: [[es2015, { modules: 1 }]] }); }).to.throw(); }); }); diff --git a/packages/babel-preset-es2016/package.json b/packages/babel-preset-es2016/package.json index 4c31765f437ab..beb99f74ab13a 100644 --- a/packages/babel-preset-es2016/package.json +++ b/packages/babel-preset-es2016/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-es2016", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Babel preset for all es2016 plugins.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -8,12 +8,13 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-es2016", "main": "lib/index.js", "dependencies": { - "@babel/plugin-transform-exponentiation-operator": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-transform-exponentiation-operator": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-preset-es2016/src/index.js b/packages/babel-preset-es2016/src/index.js index c246cc3692712..c7dd4b7466534 100644 --- a/packages/babel-preset-es2016/src/index.js +++ b/packages/babel-preset-es2016/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import transformExponentiationOperator from "@babel/plugin-transform-exponentiation-operator"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { plugins: [transformExponentiationOperator], }; -} +}); diff --git a/packages/babel-preset-es2017/package.json b/packages/babel-preset-es2017/package.json index 0f77c5a5a8899..a6279d8c7f155 100644 --- a/packages/babel-preset-es2017/package.json +++ b/packages/babel-preset-es2017/package.json @@ -1,6 +1,6 @@ { "name": "@babel/preset-es2017", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Babel preset for all es2017 plugins.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -8,12 +8,13 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-es2017", "main": "lib/index.js", "dependencies": { - "@babel/plugin-transform-async-to-generator": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-transform-async-to-generator": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-preset-es2017/src/index.js b/packages/babel-preset-es2017/src/index.js index 1acaae9254fc3..ac07e6afc366d 100644 --- a/packages/babel-preset-es2017/src/index.js +++ b/packages/babel-preset-es2017/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import transformAsyncToGenerator from "@babel/plugin-transform-async-to-generator"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { plugins: [transformAsyncToGenerator], }; -} +}); diff --git a/packages/babel-preset-flow/package.json b/packages/babel-preset-flow/package.json index 4f60a6e4d43fb..4d6561d973d2d 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-beta.39", + "version": "7.0.0-beta.42", "description": "Babel preset for all Flow plugins.", "author": "James Kyle ", "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-flow", @@ -13,13 +13,14 @@ "types" ], "dependencies": { - "@babel/plugin-transform-flow-strip-types": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-transform-flow-strip-types": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-preset-flow/src/index.js b/packages/babel-preset-flow/src/index.js index 844f46a817e99..7dc163bdbfd96 100644 --- a/packages/babel-preset-flow/src/index.js +++ b/packages/babel-preset-flow/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import transformFlowStripTypes from "@babel/plugin-transform-flow-strip-types"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { plugins: [transformFlowStripTypes], }; -} +}); diff --git a/packages/babel-preset-react/package.json b/packages/babel-preset-react/package.json index 0b053476216a2..649cbc8f85bfa 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-beta.39", + "version": "7.0.0-beta.42", "description": "Babel preset for all React plugins.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -8,18 +8,19 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-react", "main": "lib/index.js", "dependencies": { - "@babel/plugin-syntax-jsx": "7.0.0-beta.39", - "@babel/plugin-transform-react-display-name": "7.0.0-beta.39", - "@babel/plugin-transform-react-jsx": "7.0.0-beta.39", - "@babel/plugin-transform-react-jsx-self": "7.0.0-beta.39", - "@babel/plugin-transform-react-jsx-source": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-syntax-jsx": "7.0.0-beta.42", + "@babel/plugin-transform-react-display-name": "7.0.0-beta.42", + "@babel/plugin-transform-react-jsx": "7.0.0-beta.42", + "@babel/plugin-transform-react-jsx-self": "7.0.0-beta.42", + "@babel/plugin-transform-react-jsx-source": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helper-plugin-test-runner": "7.0.0-beta.39", - "@babel/helper-transform-fixture-test-runner": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helper-plugin-test-runner": "7.0.0-beta.42", + "@babel/helper-transform-fixture-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-preset-react/src/index.js b/packages/babel-preset-react/src/index.js index 2891f52ce4103..d13753fdc533e 100644 --- a/packages/babel-preset-react/src/index.js +++ b/packages/babel-preset-react/src/index.js @@ -1,10 +1,13 @@ +import { declare } from "@babel/helper-plugin-utils"; import transformReactJSX from "@babel/plugin-transform-react-jsx"; import transformSyntaxJSX from "@babel/plugin-syntax-jsx"; import transformReactDisplayName from "@babel/plugin-transform-react-display-name"; import transformReactJSXSource from "@babel/plugin-transform-react-jsx-source"; import transformReactJSXSelf from "@babel/plugin-transform-react-jsx-self"; -export default function(api, opts = {}) { +export default declare((api, opts) => { + api.assertVersion(7); + const pragma = opts.pragma || "React.createElement"; const pragmaFrag = opts.pragmaFrag || "React.Fragment"; const throwIfNamespace = @@ -31,4 +34,4 @@ export default function(api, opts = {}) { development && transformReactJSXSelf, ].filter(Boolean), }; -} +}); diff --git a/packages/babel-preset-react/test/index.js b/packages/babel-preset-react/test/index.js index 92a7d30391eb8..4d7a12e26cafd 100644 --- a/packages/babel-preset-react/test/index.js +++ b/packages/babel-preset-react/test/index.js @@ -2,9 +2,9 @@ import react from "../lib"; import { expect } from "chai"; describe("react preset", () => { - it("doesn't throw with no options passed", () => { + it("does throw clear error when no options passed for Babel 6", () => { expect(() => { - react(null); - }).not.to.throw(); + react({ version: "6.5.0" }); + }).to.throw(Error, /Requires Babel "\^7.0.0-0"/); }); }); diff --git a/packages/babel-preset-stage-0/package.json b/packages/babel-preset-stage-0/package.json index 33167b7b4c353..98570a2e95822 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-beta.39", + "version": "7.0.0-beta.42", "description": "Babel preset for stage 0 plugins", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -8,13 +8,15 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-stage-0", "main": "lib/index.js", "dependencies": { - "@babel/plugin-proposal-function-bind": "7.0.0-beta.39", - "@babel/preset-stage-1": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-proposal-function-bind": "7.0.0-beta.42", + "@babel/plugin-proposal-logical-assignment-operators": "7.0.0-beta.42", + "@babel/preset-stage-1": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-preset-stage-0/src/index.js b/packages/babel-preset-stage-0/src/index.js index 2d97b1f23b069..7eadd4cf25dd9 100644 --- a/packages/babel-preset-stage-0/src/index.js +++ b/packages/babel-preset-stage-0/src/index.js @@ -1,8 +1,12 @@ +import { declare } from "@babel/helper-plugin-utils"; import presetStage1 from "@babel/preset-stage-1"; import transformFunctionBind from "@babel/plugin-proposal-function-bind"; +import transformLogicalAssignmentOperators from "@babel/plugin-proposal-logical-assignment-operators"; + +export default declare((api, opts) => { + api.assertVersion(7); -export default function(context, opts = {}) { let loose = false; let useBuiltIns = false; @@ -22,6 +26,6 @@ export default function(context, opts = {}) { return { presets: [[presetStage1, { loose, useBuiltIns }]], - plugins: [transformFunctionBind], + plugins: [transformFunctionBind, transformLogicalAssignmentOperators], }; -} +}); diff --git a/packages/babel-preset-stage-1/package.json b/packages/babel-preset-stage-1/package.json index 184cbc9b5b220..14f788fb3353e 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-beta.39", + "version": "7.0.0-beta.42", "description": "Babel preset for stage 1 plugins", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -8,18 +8,19 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-stage-1", "main": "lib/index.js", "dependencies": { - "@babel/plugin-proposal-decorators": "7.0.0-beta.39", - "@babel/plugin-proposal-do-expressions": "7.0.0-beta.39", - "@babel/plugin-proposal-export-default-from": "7.0.0-beta.39", - "@babel/plugin-proposal-nullish-coalescing-operator": "7.0.0-beta.39", - "@babel/plugin-proposal-optional-chaining": "7.0.0-beta.39", - "@babel/plugin-proposal-pipeline-operator": "7.0.0-beta.39", - "@babel/preset-stage-2": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-proposal-decorators": "7.0.0-beta.42", + "@babel/plugin-proposal-do-expressions": "7.0.0-beta.42", + "@babel/plugin-proposal-export-default-from": "7.0.0-beta.42", + "@babel/plugin-proposal-nullish-coalescing-operator": "7.0.0-beta.42", + "@babel/plugin-proposal-optional-chaining": "7.0.0-beta.42", + "@babel/plugin-proposal-pipeline-operator": "7.0.0-beta.42", + "@babel/preset-stage-2": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-preset-stage-1/src/index.js b/packages/babel-preset-stage-1/src/index.js index 4658ccd94f15f..104f468aff161 100644 --- a/packages/babel-preset-stage-1/src/index.js +++ b/packages/babel-preset-stage-1/src/index.js @@ -1,3 +1,4 @@ +import { declare } from "@babel/helper-plugin-utils"; import presetStage2 from "@babel/preset-stage-2"; import transformDecorators from "@babel/plugin-proposal-decorators"; @@ -7,7 +8,9 @@ import transformPipelineOperator from "@babel/plugin-proposal-pipeline-operator" import transformNullishCoalescingOperator from "@babel/plugin-proposal-nullish-coalescing-operator"; import transformDoExpressions from "@babel/plugin-proposal-do-expressions"; -export default function(context, opts = {}) { +export default declare((api, opts) => { + api.assertVersion(7); + let loose = false; let useBuiltIns = false; @@ -36,4 +39,4 @@ export default function(context, opts = {}) { transformDoExpressions, ], }; -} +}); diff --git a/packages/babel-preset-stage-2/package.json b/packages/babel-preset-stage-2/package.json index 15856cd1bec07..998f000f255e0 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-beta.39", + "version": "7.0.0-beta.42", "description": "Babel preset for stage 2 plugins", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -8,16 +8,17 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-stage-2", "main": "lib/index.js", "dependencies": { - "@babel/plugin-proposal-export-namespace-from": "7.0.0-beta.39", - "@babel/plugin-proposal-function-sent": "7.0.0-beta.39", - "@babel/plugin-proposal-numeric-separator": "7.0.0-beta.39", - "@babel/plugin-proposal-throw-expressions": "7.0.0-beta.39", - "@babel/preset-stage-3": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-proposal-export-namespace-from": "7.0.0-beta.42", + "@babel/plugin-proposal-function-sent": "7.0.0-beta.42", + "@babel/plugin-proposal-numeric-separator": "7.0.0-beta.42", + "@babel/plugin-proposal-throw-expressions": "7.0.0-beta.42", + "@babel/preset-stage-3": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-preset-stage-2/src/index.js b/packages/babel-preset-stage-2/src/index.js index 556023e04f377..22c1fd81bd0c5 100644 --- a/packages/babel-preset-stage-2/src/index.js +++ b/packages/babel-preset-stage-2/src/index.js @@ -1,3 +1,4 @@ +import { declare } from "@babel/helper-plugin-utils"; import presetStage3 from "@babel/preset-stage-3"; import transformFunctionSent from "@babel/plugin-proposal-function-sent"; @@ -5,7 +6,9 @@ import transformExportNamespaceFrom from "@babel/plugin-proposal-export-namespac import transformNumericSeparator from "@babel/plugin-proposal-numeric-separator"; import transformThrowExpressions from "@babel/plugin-proposal-throw-expressions"; -export default function(context, opts = {}) { +export default declare((api, opts) => { + api.assertVersion(7); + let loose = false; let useBuiltIns = false; @@ -32,4 +35,4 @@ export default function(context, opts = {}) { transformThrowExpressions, ], }; -} +}); diff --git a/packages/babel-preset-stage-3/package.json b/packages/babel-preset-stage-3/package.json index c06ce2d0f0c2f..bf7dd40312b37 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-beta.39", + "version": "7.0.0-beta.42", "description": "Babel preset for stage 3 plugins", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -8,18 +8,19 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-stage-3", "main": "lib/index.js", "dependencies": { - "@babel/plugin-proposal-async-generator-functions": "7.0.0-beta.39", - "@babel/plugin-proposal-class-properties": "7.0.0-beta.39", - "@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.39", - "@babel/plugin-proposal-optional-catch-binding": "7.0.0-beta.39", - "@babel/plugin-proposal-unicode-property-regex": "7.0.0-beta.39", - "@babel/plugin-syntax-dynamic-import": "7.0.0-beta.39", - "@babel/plugin-syntax-import-meta": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-proposal-async-generator-functions": "7.0.0-beta.42", + "@babel/plugin-proposal-class-properties": "7.0.0-beta.42", + "@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.42", + "@babel/plugin-proposal-optional-catch-binding": "7.0.0-beta.42", + "@babel/plugin-proposal-unicode-property-regex": "7.0.0-beta.42", + "@babel/plugin-syntax-dynamic-import": "7.0.0-beta.42", + "@babel/plugin-syntax-import-meta": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-preset-stage-3/src/index.js b/packages/babel-preset-stage-3/src/index.js index afe2ff4e3c50b..6bec72fb8d73e 100644 --- a/packages/babel-preset-stage-3/src/index.js +++ b/packages/babel-preset-stage-3/src/index.js @@ -1,3 +1,4 @@ +import { declare } from "@babel/helper-plugin-utils"; import syntaxDynamicImport from "@babel/plugin-syntax-dynamic-import"; import syntaxImportMeta from "@babel/plugin-syntax-import-meta"; import transformAsyncGeneratorFunctions from "@babel/plugin-proposal-async-generator-functions"; @@ -6,7 +7,9 @@ import transformObjectRestSpread from "@babel/plugin-proposal-object-rest-spread import transformOptionalCatchBinding from "@babel/plugin-proposal-optional-catch-binding"; import transformUnicodePropertyRegex from "@babel/plugin-proposal-unicode-property-regex"; -export default function(context, opts = {}) { +export default declare((api, opts) => { + api.assertVersion(7); + let loose = false; let useBuiltIns = false; @@ -35,4 +38,4 @@ export default function(context, opts = {}) { transformUnicodePropertyRegex, ], }; -} +}); diff --git a/packages/babel-preset-typescript/package.json b/packages/babel-preset-typescript/package.json index 8dda11b98c3e1..67cb1b6d5fede 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.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Babel preset for TypeScript.", "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-typescript", "license": "MIT", @@ -10,12 +10,13 @@ "typescript" ], "dependencies": { - "@babel/plugin-transform-typescript": "7.0.0-beta.39" + "@babel/helper-plugin-utils": "7.0.0-beta.42", + "@babel/plugin-transform-typescript": "7.0.0-beta.42" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" } } diff --git a/packages/babel-preset-typescript/src/index.js b/packages/babel-preset-typescript/src/index.js index 9348fa06227f3..0d5f60c0e418a 100644 --- a/packages/babel-preset-typescript/src/index.js +++ b/packages/babel-preset-typescript/src/index.js @@ -1,7 +1,10 @@ +import { declare } from "@babel/helper-plugin-utils"; import transformTypeScript from "@babel/plugin-transform-typescript"; -export default function() { +export default declare(api => { + api.assertVersion(7); + return { plugins: [transformTypeScript], }; -} +}); diff --git a/packages/babel-register/package.json b/packages/babel-register/package.json index f8960eb54d7d7..527bf6ebed132 100644 --- a/packages/babel-register/package.json +++ b/packages/babel-register/package.json @@ -1,6 +1,6 @@ { "name": "@babel/register", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "babel require hook", "license": "MIT", "repository": "https://github.com/babel/babel/tree/master/packages/babel-register", @@ -19,10 +19,10 @@ "source-map-support": "^0.4.2" }, "peerDependencies": { - "@babel/core": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", + "@babel/core": "7.0.0-beta.42", "default-require-extensions": "^2.0.0" } } diff --git a/packages/babel-register/src/node.js b/packages/babel-register/src/node.js index a20514f2a1f10..9dbdf5d659868 100644 --- a/packages/babel-register/src/node.js +++ b/packages/babel-register/src/node.js @@ -9,7 +9,7 @@ import fs from "fs"; import path from "path"; const maps = {}; -const transformOpts = {}; +let transformOpts = {}; let piratesRevert = null; function installSourceMapSupport() { @@ -113,18 +113,24 @@ export default function register(opts?: Object = {}) { delete opts.extensions; delete opts.cache; - Object.assign(transformOpts, opts); + transformOpts = Object.assign({}, opts); - if (!transformOpts.ignore && !transformOpts.only) { + let { cwd = "." } = transformOpts; + + // Ensure that the working directory is resolved up front so that + // things don't break if it changes later. + cwd = transformOpts.cwd = path.resolve(cwd); + + if (transformOpts.ignore === undefined && transformOpts.only === undefined) { transformOpts.only = [ // Only compile things inside the current working directory. - new RegExp("^" + escapeRegExp(process.cwd()), "i"), + new RegExp("^" + escapeRegExp(cwd), "i"), ]; transformOpts.ignore = [ // Ignore any node_modules inside the current working directory. new RegExp( "^" + - escapeRegExp(process.cwd()) + + escapeRegExp(cwd) + "(?:" + path.sep + ".*)?" + diff --git a/packages/babel-register/test/__data__/.babelrc b/packages/babel-register/test/__data__/.babelrc new file mode 100644 index 0000000000000..b3eb3ec8efed6 --- /dev/null +++ b/packages/babel-register/test/__data__/.babelrc @@ -0,0 +1,5 @@ +{ + "plugins": [ + "@babel/transform-modules-commonjs" + ] +} \ No newline at end of file diff --git a/packages/babel-register/test/__data__/gen_error.js b/packages/babel-register/test/__data__/gen_error.js deleted file mode 100644 index 4a0676556e1d8..0000000000000 --- a/packages/babel-register/test/__data__/gen_error.js +++ /dev/null @@ -1,4 +0,0 @@ -/* eslint-disable */ -module.exports = () => { 'use strict'; let error; try { const impossible_result = ''.toFixed(); } catch (e) { error = e; } return error.stack.toString().replace('\n', ''); } - - diff --git a/packages/babel-register/test/cache.js b/packages/babel-register/test/cache.js index 6c150758b998a..c9704cbdd3ab9 100644 --- a/packages/babel-register/test/cache.js +++ b/packages/babel-register/test/cache.js @@ -1,4 +1,3 @@ -import { expect } from "chai"; import fs from "fs"; import path from "path"; @@ -35,7 +34,7 @@ describe("@babel/register - caching", () => { beforeEach(() => { // Since lib/cache is a singleton we need to fully reload it - delete require.cache[require.resolve("../lib/cache")]; + jest.resetModules(); const cache = require("../lib/cache"); load = cache.load; @@ -44,22 +43,20 @@ describe("@babel/register - caching", () => { }); afterEach(cleanCache); - after(resetCache); + afterAll(resetCache); it("should load and get cached data", () => { writeCache({ foo: "bar" }); load(); - expect(get()).to.be.an("object"); - expect(get()).to.deep.equal({ foo: "bar" }); + expect(get()).toEqual({ foo: "bar" }); }); it("should load and get an object with no cached data", () => { load(); - expect(get()).to.be.an("object"); - expect(get()).to.deep.equal({}); + expect(get()).toEqual({}); }); it("should load and get an object with invalid cached data", () => { @@ -67,15 +64,14 @@ describe("@babel/register - caching", () => { load(); - expect(get()).to.be.an("object"); - expect(get()).to.deep.equal({}); + expect(get()).toEqual({}); }); it("should create the cache on save", () => { save(); - expect(fs.existsSync(testCacheFilename)).to.be.true; - expect(get()).to.deep.equal({}); + expect(fs.existsSync(testCacheFilename)).toBe(true); + expect(get()).toEqual({}); }); }); }); diff --git a/packages/babel-register/test/index.js b/packages/babel-register/test/index.js index a41f299e193f1..67eef99204881 100644 --- a/packages/babel-register/test/index.js +++ b/packages/babel-register/test/index.js @@ -1,32 +1,46 @@ -import sourceMapSupport from "source-map-support"; -import chai from "chai"; +import fs from "fs"; + +let currentHook; +let currentOptions; +let sourceMapSupport = false; + +const registerFile = require.resolve("../lib/node"); +const testFile = require.resolve("./__data__/es2015"); +const testFileContent = fs.readFileSync(testFile); + +jest.mock("pirates", () => { + return { + addHook(hook, opts) { + currentHook = hook; + currentOptions = opts; + + return () => { + currentHook = null; + currentOptions = null; + }; + }, + }; +}); + +jest.mock("source-map-support", () => { + return { + install() { + sourceMapSupport = true; + }, + }; +}); -const DATA_ES2015 = require.resolve("./__data__/es2015"); -const GEN_ERROR = require.resolve("./__data__/gen_error"); +const defaultOptions = { + exts: [".js", ".jsx", ".es6", ".es", ".mjs"], + ignoreNodeModules: false, +}; describe("@babel/register", function() { let babelRegister; - let oldCompiler; - - function setupRegister(config = {}) { - babelRegister = require("../lib/node"); - babelRegister.default( - Object.assign( - { - plugins: [ - { - visitor: { - ImportDeclaration(path) { - path.remove(); - }, - }, - }, - ], - babelrc: false, - }, - config, - ), - ); + + function setupRegister(config = { babelrc: false }) { + babelRegister = require(registerFile); + babelRegister.default(config); } function revertRegister() { @@ -36,71 +50,79 @@ describe("@babel/register", function() { } } - before(() => { - const js = require("default-require-extensions/js"); - oldCompiler = require.extensions[".js"]; - require.extensions[".js"] = js; - sourceMapSupport.install({ - emptyCacheBetweenOperations: true, - }); + afterEach(() => { + revertRegister(); + currentHook = null; + currentOptions = null; + sourceMapSupport = false; + jest.resetModules(); }); - after(() => { - require.extensions[".js"] = oldCompiler; - }); + test("registers hook correctly", () => { + setupRegister(); - afterEach(() => { - revertRegister(); - delete require.cache[DATA_ES2015]; - delete require.cache[GEN_ERROR]; + expect(typeof currentHook).toBe("function"); + expect(currentOptions).toEqual(defaultOptions); }); - it("registers correctly", () => { + test("unregisters hook correctly", () => { setupRegister(); + revertRegister(); - chai.expect(require(DATA_ES2015)).to.be.ok; + expect(currentHook).toBeNull(); + expect(currentOptions).toBeNull(); }); - it("reverts correctly", () => { + test("installs source map support by default", () => { setupRegister(); - chai.expect(require(DATA_ES2015)).to.be.ok; - delete require.cache[DATA_ES2015]; + currentHook("const a = 1;", testFile); - revertRegister(); + expect(sourceMapSupport).toBe(true); + }); + + test("installs source map support when requested", () => { + setupRegister({ + babelrc: false, + sourceMaps: true, + }); - chai - .expect(() => { - require(DATA_ES2015); - }) - .to.throw(SyntaxError); + currentHook("const a = 1;", testFile); + + expect(sourceMapSupport).toBe(true); }); - it("does not install source map support if asked not to", () => { + test("does not install source map support if asked not to", () => { setupRegister({ + babelrc: false, sourceMaps: false, }); - let gen_error; - chai.expect((gen_error = require(GEN_ERROR))).to.be.ok; - chai.expect(gen_error()).to.match(/gen_error\.js:8:34/); + currentHook("const a = 1;", testFile); + + expect(sourceMapSupport).toBe(false); }); - it("installs source map support by default", () => { - setupRegister(); + test("hook transpiles with config", () => { + setupRegister({ + babelrc: false, + sourceMaps: false, + plugins: ["@babel/transform-modules-commonjs"], + }); - let gen_error; - chai.expect((gen_error = require(GEN_ERROR))).to.be.ok; - chai.expect(gen_error()).to.match(/gen_error\.js:2:86/); + const result = currentHook(testFileContent, testFile); + + expect(result).toBe('"use strict";\n\nrequire("assert");'); }); - it("installs source map support when requested", () => { + test("hook transpiles with babelrc", () => { setupRegister({ - sourceMaps: "both", + babelrc: true, + sourceMaps: false, }); - let gen_error; - chai.expect((gen_error = require(GEN_ERROR))).to.be.ok; - chai.expect(gen_error()).to.match(/gen_error\.js:2:86/); + const result = currentHook(testFileContent, testFile); + + expect(result).toBe('"use strict";\n\nrequire("assert");'); }); }); diff --git a/packages/babel-runtime/helpers/builtin/es6/iterableToArray.js b/packages/babel-runtime/helpers/builtin/es6/iterableToArray.js new file mode 100644 index 0000000000000..671e400d91668 --- /dev/null +++ b/packages/babel-runtime/helpers/builtin/es6/iterableToArray.js @@ -0,0 +1,3 @@ +export default function _iterableToArray(iter) { + if (Symbol.iterator in 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/helpers/builtin/es6/toArray.js b/packages/babel-runtime/helpers/builtin/es6/toArray.js index 5443502a98695..5acb22b388ad5 100644 --- a/packages/babel-runtime/helpers/builtin/es6/toArray.js +++ b/packages/babel-runtime/helpers/builtin/es6/toArray.js @@ -1,3 +1,6 @@ +import arrayWithHoles from "./arrayWithHoles"; +import iterableToArray from "./iterableToArray"; +import nonIterableRest from "./nonIterableRest"; export default function _toArray(arr) { - return Array.isArray(arr) ? arr : Array.from(arr); + return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest(); } \ No newline at end of file diff --git a/packages/babel-runtime/helpers/builtin/iterableToArray.js b/packages/babel-runtime/helpers/builtin/iterableToArray.js new file mode 100644 index 0000000000000..e917e57937bff --- /dev/null +++ b/packages/babel-runtime/helpers/builtin/iterableToArray.js @@ -0,0 +1,5 @@ +function _iterableToArray(iter) { + if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); +} + +module.exports = _iterableToArray; \ No newline at end of file diff --git a/packages/babel-runtime/helpers/builtin/toArray.js b/packages/babel-runtime/helpers/builtin/toArray.js index 97107ebfeb313..c28fd9e46ef93 100644 --- a/packages/babel-runtime/helpers/builtin/toArray.js +++ b/packages/babel-runtime/helpers/builtin/toArray.js @@ -1,5 +1,11 @@ +var arrayWithHoles = require("./arrayWithHoles"); + +var iterableToArray = require("./iterableToArray"); + +var nonIterableRest = require("./nonIterableRest"); + function _toArray(arr) { - return Array.isArray(arr) ? arr : Array.from(arr); + return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest(); } module.exports = _toArray; \ No newline at end of file diff --git a/packages/babel-runtime/helpers/es6/iterableToArray.js b/packages/babel-runtime/helpers/es6/iterableToArray.js new file mode 100644 index 0000000000000..9f20ecdbd9560 --- /dev/null +++ b/packages/babel-runtime/helpers/es6/iterableToArray.js @@ -0,0 +1,5 @@ +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/helpers/es6/toArray.js b/packages/babel-runtime/helpers/es6/toArray.js index e14a0feb30d9b..5acb22b388ad5 100644 --- a/packages/babel-runtime/helpers/es6/toArray.js +++ b/packages/babel-runtime/helpers/es6/toArray.js @@ -1,4 +1,6 @@ -import _Array$from from "../../core-js/array/from"; +import arrayWithHoles from "./arrayWithHoles"; +import iterableToArray from "./iterableToArray"; +import nonIterableRest from "./nonIterableRest"; export default function _toArray(arr) { - return Array.isArray(arr) ? arr : _Array$from(arr); + return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest(); } \ No newline at end of file diff --git a/packages/babel-runtime/helpers/iterableToArray.js b/packages/babel-runtime/helpers/iterableToArray.js new file mode 100644 index 0000000000000..c7834a312257a --- /dev/null +++ b/packages/babel-runtime/helpers/iterableToArray.js @@ -0,0 +1,9 @@ +var _Array$from = require("../core-js/array/from"); + +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); +} + +module.exports = _iterableToArray; \ No newline at end of file diff --git a/packages/babel-runtime/helpers/toArray.js b/packages/babel-runtime/helpers/toArray.js index 6709feb464ed3..c28fd9e46ef93 100644 --- a/packages/babel-runtime/helpers/toArray.js +++ b/packages/babel-runtime/helpers/toArray.js @@ -1,7 +1,11 @@ -var _Array$from = require("../core-js/array/from"); +var arrayWithHoles = require("./arrayWithHoles"); + +var iterableToArray = require("./iterableToArray"); + +var nonIterableRest = require("./nonIterableRest"); function _toArray(arr) { - return Array.isArray(arr) ? arr : _Array$from(arr); + return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest(); } module.exports = _toArray; \ No newline at end of file diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index ea2170b825eb3..97a081a2f9d23 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -1,6 +1,6 @@ { "name": "@babel/runtime", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "babel selfContained runtime", "license": "MIT", "repository": "https://github.com/babel/babel/tree/master/packages/babel-runtime", @@ -10,10 +10,10 @@ "regenerator-runtime": "^0.11.1" }, "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/helpers": "7.0.0-beta.39", - "@babel/plugin-transform-runtime": "7.0.0-beta.39", - "@babel/preset-env": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/helpers": "7.0.0-beta.42", + "@babel/plugin-transform-runtime": "7.0.0-beta.42", + "@babel/preset-env": "7.0.0-beta.42", + "@babel/types": "7.0.0-beta.42" } } diff --git a/packages/babel-standalone/README.md b/packages/babel-standalone/README.md index 3b00488a411fa..16a6851e6dd84 100644 --- a/packages/babel-standalone/README.md +++ b/packages/babel-standalone/README.md @@ -19,7 +19,6 @@ Installation There are several ways to get a copy of @babel/standalone. Pick whichever one you like: - Use it via UNPKG: https://unpkg.com/@babel/standalone/babel.min.js. This is a simple way to embed it on a webpage without having to do any other setup. -- Install via Bower: `bower install @babel/standalone` - Install via NPM: `npm install --save @babel/standalone` - Manually grab `babel.js` and/or `babel.min.js` from the [GitHub releases page](https://github.com/Daniel15/babel-standalone/releases). Every release includes these files. - Install it via Git: You can use the repo at https://github.com/Daniel15/babel-standalone-bower to pull a prebuilt version from Git. Note that this is generally only advised for systems that *must* pull artifacts from Git, such as Bower. diff --git a/packages/babel-standalone/package.json b/packages/babel-standalone/package.json index 39d22f96f5292..315e4162e239d 100644 --- a/packages/babel-standalone/package.json +++ b/packages/babel-standalone/package.json @@ -1,6 +1,6 @@ { "name": "@babel/standalone", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Standalone build of Babel for use in non-Node.js environments.", "main": "babel.js", "files": [ @@ -9,92 +9,92 @@ "src" ], "devDependencies": { - "@babel/core": "7.0.0-beta.39", - "@babel/plugin-external-helpers": "7.0.0-beta.39", - "@babel/plugin-proposal-async-generator-functions": "7.0.0-beta.39", - "@babel/plugin-proposal-class-properties": "7.0.0-beta.39", - "@babel/plugin-proposal-decorators": "7.0.0-beta.39", - "@babel/plugin-proposal-do-expressions": "7.0.0-beta.39", - "@babel/plugin-proposal-export-default-from": "7.0.0-beta.39", - "@babel/plugin-proposal-export-namespace-from": "7.0.0-beta.39", - "@babel/plugin-proposal-function-bind": "7.0.0-beta.39", - "@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.39", - "@babel/plugin-proposal-optional-catch-binding": "7.0.0-beta.39", - "@babel/plugin-proposal-pipeline-operator": "7.0.0-beta.39", - "@babel/plugin-proposal-unicode-property-regex": "7.0.0-beta.39", - "@babel/plugin-syntax-async-generators": "7.0.0-beta.39", - "@babel/plugin-syntax-class-properties": "7.0.0-beta.39", - "@babel/plugin-syntax-decorators": "7.0.0-beta.39", - "@babel/plugin-syntax-do-expressions": "7.0.0-beta.39", - "@babel/plugin-syntax-dynamic-import": "7.0.0-beta.39", - "@babel/plugin-syntax-export-default-from": "7.0.0-beta.39", - "@babel/plugin-syntax-export-namespace-from": "7.0.0-beta.39", - "@babel/plugin-syntax-flow": "7.0.0-beta.39", - "@babel/plugin-syntax-function-bind": "7.0.0-beta.39", - "@babel/plugin-syntax-function-sent": "7.0.0-beta.39", - "@babel/plugin-syntax-import-meta": "7.0.0-beta.39", - "@babel/plugin-syntax-jsx": "7.0.0-beta.39", - "@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.39", - "@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.39", - "@babel/plugin-syntax-pipeline-operator": "7.0.0-beta.39", - "@babel/plugin-syntax-typescript": "7.0.0-beta.39", - "@babel/plugin-transform-arrow-functions": "7.0.0-beta.39", - "@babel/plugin-transform-async-to-generator": "7.0.0-beta.39", - "@babel/plugin-transform-block-scoped-functions": "7.0.0-beta.39", - "@babel/plugin-transform-block-scoping": "7.0.0-beta.39", - "@babel/plugin-transform-classes": "7.0.0-beta.39", - "@babel/plugin-transform-computed-properties": "7.0.0-beta.39", - "@babel/plugin-transform-destructuring": "7.0.0-beta.39", - "@babel/plugin-transform-dotall-regex": "7.0.0-beta.39", - "@babel/plugin-transform-duplicate-keys": "7.0.0-beta.39", - "@babel/plugin-transform-exponentiation-operator": "7.0.0-beta.39", - "@babel/plugin-transform-flow-comments": "7.0.0-beta.39", - "@babel/plugin-transform-flow-strip-types": "7.0.0-beta.39", - "@babel/plugin-transform-for-of": "7.0.0-beta.39", - "@babel/plugin-transform-function-name": "7.0.0-beta.39", - "@babel/plugin-transform-instanceof": "7.0.0-beta.39", - "@babel/plugin-transform-jscript": "7.0.0-beta.39", - "@babel/plugin-transform-literals": "7.0.0-beta.39", - "@babel/plugin-transform-member-expression-literals": "7.0.0-beta.39", - "@babel/plugin-transform-modules-amd": "7.0.0-beta.39", - "@babel/plugin-transform-modules-commonjs": "7.0.0-beta.39", - "@babel/plugin-transform-modules-systemjs": "7.0.0-beta.39", - "@babel/plugin-transform-modules-umd": "7.0.0-beta.39", - "@babel/plugin-transform-new-target": "7.0.0-beta.39", - "@babel/plugin-transform-object-assign": "7.0.0-beta.39", - "@babel/plugin-transform-object-set-prototype-of-to-assign": "7.0.0-beta.39", - "@babel/plugin-transform-object-super": "7.0.0-beta.39", - "@babel/plugin-transform-parameters": "7.0.0-beta.39", - "@babel/plugin-transform-property-literals": "7.0.0-beta.39", - "@babel/plugin-transform-property-mutators": "7.0.0-beta.39", - "@babel/plugin-transform-proto-to-assign": "7.0.0-beta.39", - "@babel/plugin-transform-react-constant-elements": "7.0.0-beta.39", - "@babel/plugin-transform-react-display-name": "7.0.0-beta.39", - "@babel/plugin-transform-react-inline-elements": "7.0.0-beta.39", - "@babel/plugin-transform-react-jsx": "7.0.0-beta.39", - "@babel/plugin-transform-react-jsx-compat": "7.0.0-beta.39", - "@babel/plugin-transform-react-jsx-self": "7.0.0-beta.39", - "@babel/plugin-transform-react-jsx-source": "7.0.0-beta.39", - "@babel/plugin-transform-regenerator": "7.0.0-beta.39", - "@babel/plugin-transform-runtime": "7.0.0-beta.39", - "@babel/plugin-transform-shorthand-properties": "7.0.0-beta.39", - "@babel/plugin-transform-spread": "7.0.0-beta.39", - "@babel/plugin-transform-sticky-regex": "7.0.0-beta.39", - "@babel/plugin-transform-strict-mode": "7.0.0-beta.39", - "@babel/plugin-transform-template-literals": "7.0.0-beta.39", - "@babel/plugin-transform-typeof-symbol": "7.0.0-beta.39", - "@babel/plugin-transform-typescript": "7.0.0-beta.39", - "@babel/plugin-transform-unicode-regex": "7.0.0-beta.39", - "@babel/preset-es2015": "7.0.0-beta.39", - "@babel/preset-es2016": "7.0.0-beta.39", - "@babel/preset-es2017": "7.0.0-beta.39", - "@babel/preset-flow": "7.0.0-beta.39", - "@babel/preset-react": "7.0.0-beta.39", - "@babel/preset-stage-0": "7.0.0-beta.39", - "@babel/preset-stage-1": "7.0.0-beta.39", - "@babel/preset-stage-2": "7.0.0-beta.39", - "@babel/preset-stage-3": "7.0.0-beta.39", - "@babel/preset-typescript": "7.0.0-beta.39" + "@babel/core": "7.0.0-beta.42", + "@babel/plugin-external-helpers": "7.0.0-beta.42", + "@babel/plugin-proposal-async-generator-functions": "7.0.0-beta.42", + "@babel/plugin-proposal-class-properties": "7.0.0-beta.42", + "@babel/plugin-proposal-decorators": "7.0.0-beta.42", + "@babel/plugin-proposal-do-expressions": "7.0.0-beta.42", + "@babel/plugin-proposal-export-default-from": "7.0.0-beta.42", + "@babel/plugin-proposal-export-namespace-from": "7.0.0-beta.42", + "@babel/plugin-proposal-function-bind": "7.0.0-beta.42", + "@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.42", + "@babel/plugin-proposal-optional-catch-binding": "7.0.0-beta.42", + "@babel/plugin-proposal-pipeline-operator": "7.0.0-beta.42", + "@babel/plugin-proposal-unicode-property-regex": "7.0.0-beta.42", + "@babel/plugin-syntax-async-generators": "7.0.0-beta.42", + "@babel/plugin-syntax-class-properties": "7.0.0-beta.42", + "@babel/plugin-syntax-decorators": "7.0.0-beta.42", + "@babel/plugin-syntax-do-expressions": "7.0.0-beta.42", + "@babel/plugin-syntax-dynamic-import": "7.0.0-beta.42", + "@babel/plugin-syntax-export-default-from": "7.0.0-beta.42", + "@babel/plugin-syntax-export-namespace-from": "7.0.0-beta.42", + "@babel/plugin-syntax-flow": "7.0.0-beta.42", + "@babel/plugin-syntax-function-bind": "7.0.0-beta.42", + "@babel/plugin-syntax-function-sent": "7.0.0-beta.42", + "@babel/plugin-syntax-import-meta": "7.0.0-beta.42", + "@babel/plugin-syntax-jsx": "7.0.0-beta.42", + "@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.42", + "@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.42", + "@babel/plugin-syntax-pipeline-operator": "7.0.0-beta.42", + "@babel/plugin-syntax-typescript": "7.0.0-beta.42", + "@babel/plugin-transform-arrow-functions": "7.0.0-beta.42", + "@babel/plugin-transform-async-to-generator": "7.0.0-beta.42", + "@babel/plugin-transform-block-scoped-functions": "7.0.0-beta.42", + "@babel/plugin-transform-block-scoping": "7.0.0-beta.42", + "@babel/plugin-transform-classes": "7.0.0-beta.42", + "@babel/plugin-transform-computed-properties": "7.0.0-beta.42", + "@babel/plugin-transform-destructuring": "7.0.0-beta.42", + "@babel/plugin-transform-dotall-regex": "7.0.0-beta.42", + "@babel/plugin-transform-duplicate-keys": "7.0.0-beta.42", + "@babel/plugin-transform-exponentiation-operator": "7.0.0-beta.42", + "@babel/plugin-transform-flow-comments": "7.0.0-beta.42", + "@babel/plugin-transform-flow-strip-types": "7.0.0-beta.42", + "@babel/plugin-transform-for-of": "7.0.0-beta.42", + "@babel/plugin-transform-function-name": "7.0.0-beta.42", + "@babel/plugin-transform-instanceof": "7.0.0-beta.42", + "@babel/plugin-transform-jscript": "7.0.0-beta.42", + "@babel/plugin-transform-literals": "7.0.0-beta.42", + "@babel/plugin-transform-member-expression-literals": "7.0.0-beta.42", + "@babel/plugin-transform-modules-amd": "7.0.0-beta.42", + "@babel/plugin-transform-modules-commonjs": "7.0.0-beta.42", + "@babel/plugin-transform-modules-systemjs": "7.0.0-beta.42", + "@babel/plugin-transform-modules-umd": "7.0.0-beta.42", + "@babel/plugin-transform-new-target": "7.0.0-beta.42", + "@babel/plugin-transform-object-assign": "7.0.0-beta.42", + "@babel/plugin-transform-object-set-prototype-of-to-assign": "7.0.0-beta.42", + "@babel/plugin-transform-object-super": "7.0.0-beta.42", + "@babel/plugin-transform-parameters": "7.0.0-beta.42", + "@babel/plugin-transform-property-literals": "7.0.0-beta.42", + "@babel/plugin-transform-property-mutators": "7.0.0-beta.42", + "@babel/plugin-transform-proto-to-assign": "7.0.0-beta.42", + "@babel/plugin-transform-react-constant-elements": "7.0.0-beta.42", + "@babel/plugin-transform-react-display-name": "7.0.0-beta.42", + "@babel/plugin-transform-react-inline-elements": "7.0.0-beta.42", + "@babel/plugin-transform-react-jsx": "7.0.0-beta.42", + "@babel/plugin-transform-react-jsx-compat": "7.0.0-beta.42", + "@babel/plugin-transform-react-jsx-self": "7.0.0-beta.42", + "@babel/plugin-transform-react-jsx-source": "7.0.0-beta.42", + "@babel/plugin-transform-regenerator": "7.0.0-beta.42", + "@babel/plugin-transform-runtime": "7.0.0-beta.42", + "@babel/plugin-transform-shorthand-properties": "7.0.0-beta.42", + "@babel/plugin-transform-spread": "7.0.0-beta.42", + "@babel/plugin-transform-sticky-regex": "7.0.0-beta.42", + "@babel/plugin-transform-strict-mode": "7.0.0-beta.42", + "@babel/plugin-transform-template-literals": "7.0.0-beta.42", + "@babel/plugin-transform-typeof-symbol": "7.0.0-beta.42", + "@babel/plugin-transform-typescript": "7.0.0-beta.42", + "@babel/plugin-transform-unicode-regex": "7.0.0-beta.42", + "@babel/preset-es2015": "7.0.0-beta.42", + "@babel/preset-es2016": "7.0.0-beta.42", + "@babel/preset-es2017": "7.0.0-beta.42", + "@babel/preset-flow": "7.0.0-beta.42", + "@babel/preset-react": "7.0.0-beta.42", + "@babel/preset-stage-0": "7.0.0-beta.42", + "@babel/preset-stage-1": "7.0.0-beta.42", + "@babel/preset-stage-2": "7.0.0-beta.42", + "@babel/preset-stage-3": "7.0.0-beta.42", + "@babel/preset-typescript": "7.0.0-beta.42" }, "keywords": [ "babel", diff --git a/packages/babel-standalone/test/babel.js b/packages/babel-standalone/test/babel.js index 388adb7f0aef7..c9fad9860612a 100644 --- a/packages/babel-standalone/test/babel.js +++ b/packages/babel-standalone/test/babel.js @@ -1,151 +1,158 @@ const assert = require("assert"); -const Babel = require("../babel"); // Basic smoke tests for @babel/standalone -describe("@babel/standalone", () => { - it("handles the es2015-no-commonjs preset", () => { - const output = Babel.transform('const getMessage = () => "Hello World"', { - presets: ["es2015-no-commonjs"], - }).code; - assert.equal( - output, - "var getMessage = function getMessage() {\n" + - ' return "Hello World";\n' + - "};", - ); - }); - it("handles the es2015-loose preset", () => { - const output = Babel.transform("class A {}", { - presets: ["es2015-loose"], - }).code; - assert.equal(output, "var A = function A() {};"); - }); - it("handles the typescript preset", () => { - const output = Babel.transform("var a: string;", { - presets: ["typescript"], - }).code; - assert.equal(output, "var a;"); - }); - it("handles the flow preset", () => { - const output = Babel.transform("var a: string;", { - presets: ["flow"], - }).code; - assert.equal(output, "var a;"); - }); - it("can translate simple ast", () => { - const ast = { - type: "Program", - start: 0, - end: 2, - directives: [], - body: [ - { - type: "ExpressionStatement", - start: 0, - end: 1, - expression: { - type: "NumericLiteral", +(process.env.TEST_TYPE === "cov" ? describe.skip : describe)( + "@babel/standalone", + () => { + const Babel = require("../babel"); + + it("handles the es2015-no-commonjs preset", () => { + const output = Babel.transform('const getMessage = () => "Hello World"', { + presets: ["es2015-no-commonjs"], + }).code; + assert.equal( + output, + "var getMessage = function getMessage() {\n" + + ' return "Hello World";\n' + + "};", + ); + }); + it("handles the es2015-loose preset", () => { + const output = Babel.transform("class A {}", { + sourceType: "script", + presets: ["es2015-loose"], + }).code; + assert.equal(output, "var A = function A() {};"); + }); + it("handles the typescript preset", () => { + const output = Babel.transform("var a: string;", { + presets: ["typescript"], + }).code; + assert.equal(output, "var a;"); + }); + it("handles the flow preset", () => { + const output = Babel.transform("var a: string;", { + presets: ["flow"], + }).code; + assert.equal(output, "var a;"); + }); + it("can translate simple ast", () => { + const ast = { + type: "Program", + start: 0, + end: 2, + directives: [], + body: [ + { + type: "ExpressionStatement", start: 0, - end: 2, - value: 42, - raw: "42", + end: 1, + expression: { + type: "NumericLiteral", + start: 0, + end: 2, + value: 42, + raw: "42", + }, }, - }, - ], - sourceType: "module", - }; - const output = Babel.transformFromAst(ast, "42", { presets: ["es2015"] }) - .code; - assert.equal(output, "42;"); - }); + ], + sourceType: "script", + }; + const output = Babel.transformFromAst(ast, "42", { presets: ["es2015"] }) + .code; + assert.equal(output, "42;"); + }); - it("handles the react preset", () => { - const output = Babel.transform( - "const someDiv =
{getMessage()}
", - { - presets: ["react"], - }, - ).code; - assert.equal( - output, - 'const someDiv = React.createElement("div", null, getMessage());', - ); - }); + it("handles the react preset", () => { + const output = Babel.transform( + "const someDiv =
{getMessage()}
", + { + presets: ["react"], + }, + ).code; + assert.equal( + output, + 'const someDiv = React.createElement("div", null, getMessage());', + ); + }); - it("handles presets with options", () => { - const output = Babel.transform("export let x", { - presets: [["es2015", { modules: false }]], - }).code; - assert.equal(output, "export var x;"); - }); + it("handles presets with options", () => { + const output = Babel.transform("export let x", { + presets: [["es2015", { modules: false }]], + }).code; + assert.equal(output, "export var x;"); + }); - it("handles specifying a plugin by name", () => { - const output = Babel.transform('const getMessage = () => "Hello World"', { - plugins: ["transform-arrow-functions"], - }).code; - // Transforms arrow syntax but NOT "const". - assert.equal( - output, - "const getMessage = function () {\n" + ' return "Hello World";\n' + "};", - ); - }); + it("handles specifying a plugin by name", () => { + const output = Babel.transform('const getMessage = () => "Hello World"', { + plugins: ["transform-arrow-functions"], + }).code; + // Transforms arrow syntax but NOT "const". + assert.equal( + output, + "const getMessage = function () {\n" + + ' return "Hello World";\n' + + "};", + ); + }); - it("handles plugins with options", () => { - const output = Babel.transform("`${x}`", { - plugins: [["transform-template-literals", { loose: true }]], - }).code; - assert.equal(output, '"" + x;'); - }); + it("handles plugins with options", () => { + const output = Babel.transform("`${x}`", { + plugins: [["transform-template-literals", { loose: true }]], + }).code; + assert.equal(output, '"" + x;'); + }); - it("throws on invalid preset name", () => { - assert.throws( - () => Babel.transform("var foo", { presets: ["lolfail"] }), - /Invalid preset specified in Babel options: "lolfail"/, - ); - }); + it("throws on invalid preset name", () => { + assert.throws( + () => Babel.transform("var foo", { presets: ["lolfail"] }), + /Invalid preset specified in Babel options: "lolfail"/, + ); + }); - it("throws on invalid plugin name", () => { - assert.throws( - () => Babel.transform("var foo", { plugins: ["lolfail"] }), - /Invalid plugin specified in Babel options: "lolfail"/, - ); - }); + it("throws on invalid plugin name", () => { + assert.throws( + () => Babel.transform("var foo", { plugins: ["lolfail"] }), + /Invalid plugin specified in Babel options: "lolfail"/, + ); + }); - describe("custom plugins and presets", () => { - const lolizer = () => ({ - visitor: { - Identifier(path) { - path.node.name = "LOL"; + describe("custom plugins and presets", () => { + const lolizer = () => ({ + visitor: { + Identifier(path) { + path.node.name = "LOL"; + }, }, - }, - }); + }); - it("allows custom plugins to be registered", () => { - Babel.registerPlugin("lolizer", lolizer); - const output = Babel.transform( - "function helloWorld() { alert(hello); }", - { plugins: ["lolizer"] }, - ); - assert.equal( - output.code, - `function LOL() { + it("allows custom plugins to be registered", () => { + Babel.registerPlugin("lolizer", lolizer); + const output = Babel.transform( + "function helloWorld() { alert(hello); }", + { plugins: ["lolizer"] }, + ); + assert.equal( + output.code, + `function LOL() { LOL(LOL); }`, - ); - }); + ); + }); - it("allows custom presets to be registered", () => { - Babel.registerPreset("lulz", { plugins: [lolizer] }); - const output = Babel.transform( - "function helloWorld() { alert(hello); }", - { presets: ["lulz"] }, - ); - assert.equal( - output.code, - `function LOL() { + it("allows custom presets to be registered", () => { + Babel.registerPreset("lulz", { plugins: [lolizer] }); + const output = Babel.transform( + "function helloWorld() { alert(hello); }", + { presets: ["lulz"] }, + ); + assert.equal( + output.code, + `function LOL() { LOL(LOL); }`, - ); + ); + }); }); - }); -}); + }, +); diff --git a/packages/babel-template/package.json b/packages/babel-template/package.json index 8b54813de023c..a33197b417430 100644 --- a/packages/babel-template/package.json +++ b/packages/babel-template/package.json @@ -1,6 +1,6 @@ { "name": "@babel/template", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "Generate an AST from a string template.", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -8,9 +8,9 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-template", "main": "lib/index.js", "dependencies": { - "@babel/code-frame": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39", - "babylon": "7.0.0-beta.39", + "@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" } } diff --git a/packages/babel-template/src/formatters.js b/packages/babel-template/src/formatters.js index e665e343be661..4feb1d5484e41 100644 --- a/packages/babel-template/src/formatters.js +++ b/packages/babel-template/src/formatters.js @@ -12,7 +12,7 @@ function makeStatementFormatter( return { // We need to prepend a ";" to force statement parsing so that // ExpressionStatement strings won't be parsed as directives. - // Alonside that, we also prepend a comment so that when a syntax error + // Alongside that, we also prepend a comment so that when a syntax error // is encountered, the user will be less likely to get confused about // where the random semicolon came from. code: str => `/* @babel/template */;\n${str}`, @@ -54,16 +54,17 @@ export const statement: Formatter = makeStatementFormatter( export const expression: Formatter = { code: str => `(\n${str}\n)`, - validate: (ast: BabelNodeFile) => { - const { program } = ast; + validate: ({ program }) => { if (program.body.length > 1) { throw new Error("Found multiple statements but wanted one"); } + // $FlowFixMe const expression = program.body[0].expression; if (expression.start === 0) { throw new Error("Parse result included parens."); } }, + // $FlowFixMe unwrap: ast => ast.program.body[0].expression, }; diff --git a/packages/babel-traverse/package.json b/packages/babel-traverse/package.json index 4837c1f4fad42..57db996193137 100644 --- a/packages/babel-traverse/package.json +++ b/packages/babel-traverse/package.json @@ -1,6 +1,6 @@ { "name": "@babel/traverse", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "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/", @@ -8,17 +8,18 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-traverse", "main": "lib/index.js", "dependencies": { - "@babel/code-frame": "7.0.0-beta.39", - "@babel/generator": "7.0.0-beta.39", - "@babel/helper-function-name": "7.0.0-beta.39", - "@babel/types": "7.0.0-beta.39", - "babylon": "7.0.0-beta.39", - "debug": "^3.0.1", + "@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" }, "devDependencies": { - "@babel/helper-plugin-test-runner": "7.0.0-beta.39" + "@babel/helper-plugin-test-runner": "7.0.0-beta.42" } } diff --git a/packages/babel-traverse/src/path/lib/hoister.js b/packages/babel-traverse/src/path/lib/hoister.js index 0f6fa039596c4..edd27385105d1 100644 --- a/packages/babel-traverse/src/path/lib/hoister.js +++ b/packages/babel-traverse/src/path/lib/hoister.js @@ -206,10 +206,11 @@ export default class PathHoister { // generate declaration and insert it to our point let uid = attachTo.scope.generateUidIdentifier("ref"); + const declarator = t.variableDeclarator(uid, this.path.node); const insertFn = this.attachAfter ? "insertAfter" : "insertBefore"; - attachTo[insertFn]([ + const [attached] = attachTo[insertFn]([ attachTo.isVariableDeclarator() ? declarator : t.variableDeclaration("var", [declarator]), @@ -223,5 +224,9 @@ export default class PathHoister { } this.path.replaceWith(t.cloneNode(uid)); + + return attachTo.isVariableDeclarator() + ? attached.get("init") + : attached.get("declarations.0.init"); } } diff --git a/packages/babel-traverse/src/scope/index.js b/packages/babel-traverse/src/scope/index.js index 8af703fdc09a3..a2055dd05ac90 100644 --- a/packages/babel-traverse/src/scope/index.js +++ b/packages/babel-traverse/src/scope/index.js @@ -210,7 +210,7 @@ export default class Scope { * Generate a unique identifier and add it to the current scope. */ - generateDeclaredUidIdentifier(name: string = "temp") { + generateDeclaredUidIdentifier(name?: string) { const id = this.generateUidIdentifier(name); this.push({ id }); return t.cloneNode(id); @@ -220,7 +220,7 @@ export default class Scope { * Generate a unique identifier. */ - generateUidIdentifier(name: string = "temp") { + generateUidIdentifier(name?: string) { return t.identifier(this.generateUid(name)); } @@ -401,7 +401,7 @@ export default class Scope { console.log(sep); } - toArray(node: Object, i?: number) { + toArray(node: Object, i?: number | boolean) { const file = this.hub.file; if (t.isIdentifier(node)) { @@ -431,14 +431,20 @@ export default class Scope { ); } - let helperName = "toArray"; + let helperName; const args = [node]; if (i === true) { + // Used in array-spread to create an array. helperName = "toConsumableArray"; } else if (i) { args.push(t.numericLiteral(i)); + + // Used in array-rest to create an array from a subset of an iterable. helperName = "slicedToArray"; // TODO if (this.hub.file.isLoose("es6.forOf")) helperName += "-loose"; + } else { + // Used in array-rest to create an array + helperName = "toArray"; } return t.callExpression(file.addHelper(helperName), args); } diff --git a/packages/babel-traverse/src/scope/lib/renamer.js b/packages/babel-traverse/src/scope/lib/renamer.js index c18c20b1a12e8..05b9e807f4c56 100644 --- a/packages/babel-traverse/src/scope/lib/renamer.js +++ b/packages/babel-traverse/src/scope/lib/renamer.js @@ -1,4 +1,5 @@ import Binding from "../binding"; +import splitExportDeclaration from "@babel/helper-split-export-declaration"; import * as t from "@babel/types"; const renameVisitor = { @@ -40,48 +41,20 @@ export default class Renamer { binding: Binding; maybeConvertFromExportDeclaration(parentDeclar) { - const exportDeclar = - parentDeclar.parentPath.isExportDeclaration() && parentDeclar.parentPath; - if (!exportDeclar) return; + const maybeExportDeclar = parentDeclar.parentPath; - // build specifiers that point back to this export declaration - const isDefault = exportDeclar.isExportDefaultDeclaration(); + if (!maybeExportDeclar.isExportDeclaration()) { + return; + } if ( - isDefault && - (parentDeclar.isFunctionDeclaration() || - parentDeclar.isClassDeclaration()) && - !parentDeclar.node.id + maybeExportDeclar.isExportDefaultDeclaration() && + !maybeExportDeclar.get("declaration").node.id ) { - // Ensure that default class and function exports have a name so they have a identifier to - // reference from the export specifier list. - parentDeclar.node.id = parentDeclar.scope.generateUidIdentifier( - "default", - ); - } - - const bindingIdentifiers = parentDeclar.getOuterBindingIdentifiers(); - const specifiers = []; - - for (const name in bindingIdentifiers) { - const localName = name === this.oldName ? this.newName : name; - const exportedName = isDefault ? "default" : name; - specifiers.push( - t.exportSpecifier(t.identifier(localName), t.identifier(exportedName)), - ); + return; } - if (specifiers.length) { - const aliasDeclar = t.exportNamedDeclaration(null, specifiers); - - // hoist to the top if it's a function - if (parentDeclar.isFunctionDeclaration()) { - aliasDeclar._blockHoist = 3; - } - - exportDeclar.insertAfter(aliasDeclar); - exportDeclar.replaceWith(parentDeclar.node); - } + splitExportDeclaration(maybeExportDeclar); } maybeConvertFromClassFunctionDeclaration(path) { @@ -129,7 +102,10 @@ export default class Renamer { const { scope, path } = binding; const parentDeclar = path.find( - path => path.isDeclaration() || path.isFunctionExpression(), + path => + path.isDeclaration() || + path.isFunctionExpression() || + path.isClassExpression(), ); if (parentDeclar) { this.maybeConvertFromExportDeclaration(parentDeclar); diff --git a/packages/babel-traverse/test/replacement.js b/packages/babel-traverse/test/replacement.js index 853f90f11715d..cbd40feb997b6 100644 --- a/packages/babel-traverse/test/replacement.js +++ b/packages/babel-traverse/test/replacement.js @@ -2,7 +2,6 @@ import traverse from "../lib"; import assert from "assert"; import { parse } from "babylon"; import * as t from "@babel/types"; -import { expect } from "chai"; describe("path/replacement", function() { describe("replaceWith", function() { @@ -37,7 +36,7 @@ describe("path/replacement", function() { path.replaceWith(t.identifier("a")); }, }); - }).to.throw( + }).toThrow( /You can only replace a Program root node with another Program node/, ); }); @@ -54,7 +53,7 @@ describe("path/replacement", function() { ]); }, }); - }).to.throw( + }).toThrow( /Don't use `path\.replaceWith\(\)` with an array of nodes, use `path\.replaceWithMultiple\(\)`/, ); }); @@ -69,7 +68,7 @@ describe("path/replacement", function() { path.replaceWith("17 + 23"); }, }); - }).to.throw( + }).toThrow( /Don't use `path\.replaceWith\(\)` with a source string, use `path\.replaceWithSourceString\(\)`/, ); }); @@ -83,7 +82,7 @@ describe("path/replacement", function() { path.replaceWith(t.identifier("p")); }, }); - }).to.throw(/You can't replace this node, we've already removed it/); + }).toThrow(/You can't replace this node, we've already removed it/); }); it("throws error when passed a falsy value", function() { @@ -94,7 +93,7 @@ describe("path/replacement", function() { path.replaceWith(); }, }); - }).to.throw( + }).toThrow( /You passed `path\.replaceWith\(\)` a falsy node, use `path\.remove\(\)` instead/, ); }); diff --git a/packages/babel-types/README.md b/packages/babel-types/README.md index b465146f791c3..a48301c15cc30 100644 --- a/packages/babel-types/README.md +++ b/packages/babel-types/README.md @@ -359,6 +359,7 @@ Aliases: `Property` - `computed`: `boolean` (default: `false`) - `abstract`: `boolean` (default: `null`) - `accessibility`: `"public" | "private" | "protected"` (default: `null`) + - `definite`: `boolean` (default: `null`) - `optional`: `boolean` (default: `null`) - `readonly`: `boolean` (default: `null`) - `static`: `boolean` (default: `null`) @@ -1498,7 +1499,7 @@ Aliases: `UserWhitespacable`, `Property`, `ObjectMember` ### objectTypeAnnotation ```javascript -t.objectTypeAnnotation(properties, indexers, callProperties) +t.objectTypeAnnotation(properties, indexers, callProperties, exact) ``` See also `t.isObjectTypeAnnotation(node, opts)` and `t.assertObjectTypeAnnotation(node, opts)`. @@ -1508,7 +1509,7 @@ Aliases: `Flow`, `FlowType` - `properties`: `Array` (required) - `indexers`: `Array` (default: `null`) - `callProperties`: `Array` (default: `null`) - - `exact`: `boolean` (default: `null`) + - `exact`: `boolean` (default: `false`) --- @@ -1875,6 +1876,22 @@ Aliases: `TSTypeElement` --- +### tSConditionalType +```javascript +t.tsConditionalType(checkType, extendsType, trueType, falseType) +``` + +See also `t.isTSConditionalType(node, opts)` and `t.assertTSConditionalType(node, opts)`. + +Aliases: `TSType` + + - `checkType`: `TSType` (required) + - `extendsType`: `TSType` (required) + - `trueType`: `TSType` (required) + - `falseType`: `TSType` (required) + +--- + ### tSConstructSignatureDeclaration ```javascript t.tsConstructSignatureDeclaration(typeParameters, parameters, typeAnnotation) @@ -2074,6 +2091,19 @@ Aliases: `TSType` --- +### tSInferType +```javascript +t.tsInferType(typeParameter) +``` + +See also `t.isTSInferType(node, opts)` and `t.assertTSInferType(node, opts)`. + +Aliases: `TSType` + + - `typeParameter`: `TSType` (required) + +--- + ### tSInterfaceBody ```javascript t.tsInterfaceBody(body) @@ -2822,6 +2852,7 @@ See also `t.isVariableDeclarator(node, opts)` and `t.assertVariableDeclarator(no - `id`: `LVal` (required) - `init`: `Expression` (default: `null`) + - `definite`: `boolean` (default: `null`) --- diff --git a/packages/babel-types/package.json b/packages/babel-types/package.json index 50ee1a5e4205f..89e1f2a35b355 100644 --- a/packages/babel-types/package.json +++ b/packages/babel-types/package.json @@ -1,6 +1,6 @@ { "name": "@babel/types", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "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.0.0-beta.39", - "babylon": "7.0.0-beta.39" + "@babel/generator": "7.0.0-beta.42", + "babylon": "7.0.0-beta.42" } } diff --git a/packages/babel-types/src/asserts/generated/index.js b/packages/babel-types/src/asserts/generated/index.js index 093d1e7701b05..efae53080e0ec 100644 --- a/packages/babel-types/src/asserts/generated/index.js +++ b/packages/babel-types/src/asserts/generated/index.js @@ -801,6 +801,15 @@ export function assertTSIntersectionType( ): void { assert("TSIntersectionType", node, opts); } +export function assertTSConditionalType( + node: Object, + opts?: Object = {}, +): void { + assert("TSConditionalType", node, opts); +} +export function assertTSInferType(node: Object, opts?: Object = {}): void { + assert("TSInferType", node, opts); +} export function assertTSParenthesizedType( 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 ee003c27e8120..1ec3b17766826 100644 --- a/packages/babel-types/src/builders/generated/index.js +++ b/packages/babel-types/src/builders/generated/index.js @@ -774,6 +774,16 @@ export function TSIntersectionType(...args: Array): Object { } export { TSIntersectionType as tsIntersectionType }; export { TSIntersectionType as tSIntersectionType }; +export function TSConditionalType(...args: Array): Object { + return builder("TSConditionalType", ...args); +} +export { TSConditionalType as tsConditionalType }; +export { TSConditionalType as tSConditionalType }; +export function TSInferType(...args: Array): Object { + return builder("TSInferType", ...args); +} +export { TSInferType as tsInferType }; +export { TSInferType as tSInferType }; export function TSParenthesizedType(...args: Array): Object { return builder("TSParenthesizedType", ...args); } diff --git a/packages/babel-types/src/definitions/core.js b/packages/babel-types/src/definitions/core.js index 6845a78a3f7a7..0bd5c2ae33dd1 100644 --- a/packages/babel-types/src/definitions/core.js +++ b/packages/babel-types/src/definitions/core.js @@ -836,6 +836,10 @@ defineType("VariableDeclarator", { id: { validate: assertNodeType("LVal"), }, + definite: { + optional: true, + validate: assertValueType("boolean"), + }, init: { optional: true, validate: assertNodeType("Expression"), diff --git a/packages/babel-types/src/definitions/experimental.js b/packages/babel-types/src/definitions/experimental.js index d10d2c47c0fc5..c9d7b1a301b24 100644 --- a/packages/babel-types/src/definitions/experimental.js +++ b/packages/babel-types/src/definitions/experimental.js @@ -36,6 +36,10 @@ defineType("ClassProperty", { validate: assertNodeType("Expression"), optional: true, }, + definite: { + validate: assertValueType("boolean"), + optional: true, + }, typeAnnotation: { validate: assertNodeType("TypeAnnotation", "TSTypeAnnotation", "Noop"), optional: true, diff --git a/packages/babel-types/src/definitions/flow.js b/packages/babel-types/src/definitions/flow.js index 709d179db72ec..cbd75c77758d0 100644 --- a/packages/babel-types/src/definitions/flow.js +++ b/packages/babel-types/src/definitions/flow.js @@ -252,13 +252,17 @@ defineType("NumberTypeAnnotation", { defineType("ObjectTypeAnnotation", { visitor: ["properties", "indexers", "callProperties"], aliases: ["Flow", "FlowType"], + builder: ["properties", "indexers", "callProperties", "exact"], fields: { properties: validate( arrayOfType(["ObjectTypeProperty", "ObjectTypeSpreadProperty"]), ), indexers: validateOptional(arrayOfType("ObjectTypeIndexer")), callProperties: validateOptional(arrayOfType("ObjectTypeCallProperty")), - exact: validate(assertValueType("boolean")), + exact: { + validate: assertValueType("boolean"), + default: false, + }, }, }); diff --git a/packages/babel-types/src/definitions/typescript.js b/packages/babel-types/src/definitions/typescript.js index 8f4ff25bdafdf..3aaba9ec6b072 100644 --- a/packages/babel-types/src/definitions/typescript.js +++ b/packages/babel-types/src/definitions/typescript.js @@ -223,6 +223,25 @@ const unionOrIntersection = { defineType("TSUnionType", unionOrIntersection); defineType("TSIntersectionType", unionOrIntersection); +defineType("TSConditionalType", { + aliases: ["TSType"], + visitor: ["checkType", "extendsType", "trueType", "falseType"], + fields: { + checkType: validateType("TSType"), + extendsType: validateType("TSType"), + trueType: validateType("TSType"), + falseType: validateType("TSType"), + }, +}); + +defineType("TSInferType", { + aliases: ["TSType"], + visitor: ["typeParameter"], + fields: { + typeParameter: validateType("TSType"), + }, +}); + defineType("TSParenthesizedType", { aliases: ["TSType"], visitor: ["typeAnnotation"], diff --git a/packages/babel-types/src/definitions/utils.js b/packages/babel-types/src/definitions/utils.js index 4fc52eef84c9c..45cf72b297fa4 100644 --- a/packages/babel-types/src/definitions/utils.js +++ b/packages/babel-types/src/definitions/utils.js @@ -21,10 +21,10 @@ function getType(val) { } // TODO: Import and use Node instead of any -opaque type Validator = (any, string, any) => void; +type Validator = (any, string, any) => void; type FieldOptions = { - default?: boolean, + default?: any, optional?: boolean, validate?: Validator, }; diff --git a/packages/babel-types/src/retrievers/getBindingIdentifiers.js b/packages/babel-types/src/retrievers/getBindingIdentifiers.js index d55a6c83262b3..bd289a8168177 100644 --- a/packages/babel-types/src/retrievers/getBindingIdentifiers.js +++ b/packages/babel-types/src/retrievers/getBindingIdentifiers.js @@ -94,6 +94,9 @@ getBindingIdentifiers.keys = { FunctionDeclaration: ["id", "params"], FunctionExpression: ["id", "params"], + ArrowFunctionExpression: ["params"], + ObjectMethod: ["params"], + ClassMethod: ["params"], ForInStatement: ["left"], ForOfStatement: ["left"], diff --git a/packages/babel-types/src/validators/generated/index.js b/packages/babel-types/src/validators/generated/index.js index 4a2215a50b117..874d8f65086eb 100644 --- a/packages/babel-types/src/validators/generated/index.js +++ b/packages/babel-types/src/validators/generated/index.js @@ -608,6 +608,12 @@ export function isTSUnionType(node: Object, opts?: Object): boolean { export function isTSIntersectionType(node: Object, opts?: Object): boolean { return is("TSIntersectionType", node, opts); } +export function isTSConditionalType(node: Object, opts?: Object): boolean { + return is("TSConditionalType", node, opts); +} +export function isTSInferType(node: Object, opts?: Object): boolean { + return is("TSInferType", node, opts); +} export function isTSParenthesizedType(node: Object, opts?: Object): boolean { return is("TSParenthesizedType", node, opts); } diff --git a/packages/babel-types/test/cloning.js b/packages/babel-types/test/cloning.js index 298f64fc84290..f86b7faa564bd 100644 --- a/packages/babel-types/test/cloning.js +++ b/packages/babel-types/test/cloning.js @@ -2,7 +2,7 @@ import * as t from "../lib"; import assert from "assert"; import { parse } from "babylon"; -suite("cloneNode", function() { +describe("cloneNode", function() { it("should handle undefined", function() { const node = undefined; const cloned = t.cloneNode(node); diff --git a/packages/babel-types/test/converters.js b/packages/babel-types/test/converters.js index 29836b704a3f8..e0e46d90263d9 100644 --- a/packages/babel-types/test/converters.js +++ b/packages/babel-types/test/converters.js @@ -1,5 +1,4 @@ import * as t from "../lib"; -import { assert } from "chai"; import { parse } from "babylon"; import generate from "@babel/generator"; @@ -14,49 +13,45 @@ function generateCode(node) { describe("converters", function() { it("toIdentifier", function() { - assert.equal(t.toIdentifier("swag-lord"), "swagLord"); + expect(t.toIdentifier("swag-lord")).toBe("swagLord"); }); describe("valueToNode", function() { it("number", function() { - assert.deepEqual(t.valueToNode(Math.PI), t.numericLiteral(Math.PI)); - assert.deepEqual(t.valueToNode(-Infinity), t.numericLiteral(-Infinity)); - assert.deepEqual(t.valueToNode(NaN), t.numericLiteral(NaN)); + expect(t.valueToNode(Math.PI)).toEqual(t.numericLiteral(Math.PI)); + expect(t.valueToNode(-Infinity)).toEqual(t.numericLiteral(-Infinity)); + expect(t.valueToNode(NaN)).toEqual(t.numericLiteral(NaN)); }); it("string", function() { - assert.deepEqual( - t.valueToNode('This is a "string"'), + expect(t.valueToNode('This is a "string"')).toEqual( t.stringLiteral('This is a "string"'), ); }); it("boolean", function() { - assert.deepEqual(t.valueToNode(true), t.booleanLiteral(true)); - assert.deepEqual(t.valueToNode(false), t.booleanLiteral(false)); + expect(t.valueToNode(true)).toEqual(t.booleanLiteral(true)); + expect(t.valueToNode(false)).toEqual(t.booleanLiteral(false)); }); it("null", function() { - assert.deepEqual(t.valueToNode(null), t.nullLiteral()); + expect(t.valueToNode(null)).toEqual(t.nullLiteral()); }); it("undefined", function() { - assert.deepEqual(t.valueToNode(undefined), t.identifier("undefined")); + expect(t.valueToNode(undefined)).toEqual(t.identifier("undefined")); }); it("RegExp", function() { - assert.deepEqual( - t.valueToNode(/abc.+/gm), - t.regExpLiteral("abc.+", "gm"), - ); + expect(t.valueToNode(/abc.+/gm)).toEqual(t.regExpLiteral("abc.+", "gm")); }); it("array", function() { - assert.deepEqual( - t.valueToNode([1, "a"]), + expect(t.valueToNode([1, "a"])).toEqual( t.arrayExpression([t.numericLiteral(1), t.stringLiteral("a")]), ); }); it("object", function() { - assert.deepEqual( + expect( t.valueToNode({ a: 1, "b c": 2, }), + ).toEqual( t.objectExpression([ t.objectProperty(t.identifier("a"), t.numericLiteral(1)), t.objectProperty(t.stringLiteral("b c"), t.numericLiteral(2)), @@ -64,12 +59,12 @@ describe("converters", function() { ); }); it("throws if cannot convert", function() { - assert.throws(function() { + expect(function() { t.valueToNode(Object); - }); - assert.throws(function() { + }).toThrow(); + expect(function() { t.valueToNode(Symbol()); - }); + }).toThrow(); }); }); describe("toKeyAlias", function() { @@ -78,24 +73,22 @@ describe("converters", function() { t.toKeyAlias.uid = 0; }); it("doesn't change string literals", function() { - assert.equal( + expect( t.toKeyAlias(t.objectProperty(t.stringLiteral("a"), t.nullLiteral())), - '"a"', - ); + ).toBe('"a"'); }); it("wraps around at Number.MAX_SAFE_INTEGER", function() { - assert.equal( + expect( t.toKeyAlias( t.objectMethod("method", t.identifier("a"), [], t.blockStatement([])), ), - "0", - ); + ).toBe("0"); }); }); describe("toStatement", function() { it("noop on statements", function() { const node = t.emptyStatement(); - assert.equal(t.toStatement(node), node); + expect(t.toStatement(node)).toEqual(node); t.assertEmptyStatement(node); }); it("mutate class expression to declaration", function() { @@ -110,10 +103,10 @@ describe("converters", function() { }); it("fail if class expression has no id", function() { const node = t.classExpression(null, null, t.classBody([]), []); - assert.throws(function() { + expect(function() { t.toStatement(node); - }); - assert.strictEqual(t.toStatement(node, /* ignore = */ true), false); + }).toThrow(Error); + expect(t.toStatement(node, /* ignore = */ true)).toBe(false); t.assertClassExpression(node); }); it("mutate function expression to declaration", function() { @@ -127,10 +120,10 @@ describe("converters", function() { }); it("fail if function expression has no id", function() { const node = t.functionExpression(null, [], t.blockStatement([])); - assert.throws(function() { + expect(function() { t.toStatement(node); - }); - assert.strictEqual(t.toStatement(node, /* ignore = */ true), false); + }).toThrow(Error); + expect(t.toStatement(node, /* ignore = */ true)).toBe(false); t.assertFunctionExpression(node); }); it("assignment expression", function() { @@ -144,17 +137,17 @@ describe("converters", function() { }); it("fail if cannot convert node type", function() { const node = t.yieldExpression(t.identifier("foo")); - assert.throws(function() { + expect(function() { t.toStatement(node); - }); - assert.strictEqual(t.toStatement(node, /* ignore = */ true), false); + }).toThrow(Error); + expect(t.toStatement(node, /* ignore = */ true)).toBe(false); t.assertYieldExpression(node); }); }); describe("toExpression", function() { it("noop on expressions", function() { const node = t.identifier("a"); - assert.equal(t.toExpression(node), node); + expect(t.toExpression(node)).toEqual(node); t.assertIdentifier(node); }); it("mutate class declaration to expression", function() { @@ -200,14 +193,14 @@ describe("converters", function() { const inner = t.yieldExpression(t.identifier("foo")); const node = t.expressionStatement(inner); t.assertYieldExpression(t.toExpression(node)); - assert.equal(t.toExpression(node), inner); + expect(t.toExpression(node)).toEqual(inner); t.assertExpressionStatement(node); }); it("fail if cannot convert node type", function() { const node = t.program([]); - assert.throws(function() { + expect(function() { t.toExpression(node); - }); + }).toThrow(Error); t.assertProgram(node); }); }); @@ -224,95 +217,94 @@ describe("converters", function() { const node = t.identifier("a"); const sequence = t.toSequenceExpression([undefinedNode, node], scope); t.assertSequenceExpression(sequence); - assert.equal(sequence.expressions[0], undefinedNode); - assert.equal(sequence.expressions[1], node); + expect(sequence.expressions[0]).toBe(undefinedNode); + expect(sequence.expressions[1]).toBe(node); t.assertIdentifier(node); }); it("avoids sequence for single node", function() { const node = t.identifier("a"); let sequence = t.toSequenceExpression([node], scope); - assert.equal(sequence, node); + expect(sequence).toBe(node); const block = t.blockStatement([t.expressionStatement(node)]); sequence = t.toSequenceExpression([block], scope); - assert.equal(sequence, node); + expect(sequence).toBe(node); }); it("gathers expression", function() { const node = t.identifier("a"); const sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.equal(sequence.expressions[1], node); + expect(sequence.expressions[1]).toBe(node); }); it("gathers expression statement", function() { const node = t.expressionStatement(t.identifier("a")); const sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.equal(sequence.expressions[1], node.expression); + expect(sequence.expressions[1]).toBe(node.expression); }); it("gathers var declarations", function() { const node = parseCode("var a, b = 1;"); const sequence = t.toSequenceExpression([undefinedNode, node], scope); t.assertIdentifier(scope[0].id, { name: "a" }); t.assertIdentifier(scope[1].id, { name: "b" }); - assert.equal(generateCode(sequence.expressions[1]), "b = 1"); - assert.equal(generateCode(sequence.expressions[2]), "undefined"); + expect(generateCode(sequence.expressions[1])).toBe("b = 1"); + expect(generateCode(sequence.expressions[2])).toBe("undefined"); }); it("skips undefined if expression after var declaration", function() { const node = parseCode("{ var a, b = 1; true }"); const sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.equal(generateCode(sequence.expressions[1]), "b = 1, true"); + expect(generateCode(sequence.expressions[1])).toBe("b = 1, true"); }); it("bails on let and const declarations", function() { let node = parseCode("let a, b = 1;"); let sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.isUndefined(sequence); + expect(sequence).toBeUndefined(); node = parseCode("const b = 1;"); sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.isUndefined(sequence); + expect(sequence).toBeUndefined(); }); it("gathers if statements", function() { let node = parseCode("if (true) { true }"); let sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.equal( - generateCode(sequence.expressions[1]), + expect(generateCode(sequence.expressions[1])).toBe( "true ? true : undefined", ); node = parseCode("if (true) { true } else { b }"); sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.equal(generateCode(sequence.expressions[1]), "true ? true : b"); + expect(generateCode(sequence.expressions[1])).toBe("true ? true : b"); }); it("bails in if statements if recurse bails", function() { let node = parseCode("if (true) { return }"); let sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.isUndefined(sequence); + expect(sequence).toBeUndefined(); node = parseCode("if (true) { true } else { return }"); sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.isUndefined(sequence); + expect(sequence).toBeUndefined(); }); it("gathers block statements", function() { let node = parseCode("{ a }"); let sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.equal(generateCode(sequence.expressions[1]), "a"); + expect(generateCode(sequence.expressions[1])).toBe("a"); node = parseCode("{ a; b; }"); sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.equal(generateCode(sequence.expressions[1]), "a, b"); + expect(generateCode(sequence.expressions[1])).toBe("a, b"); }); it("bails in block statements if recurse bails", function() { const node = parseCode("{ return }"); const sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.isUndefined(sequence); + expect(sequence).toBeUndefined(); }); it("gathers empty statements", function() { const node = parseCode(";"); const sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.equal(generateCode(sequence.expressions[1]), "undefined"); + expect(generateCode(sequence.expressions[1])).toBe("undefined"); }); it("skips empty statement if expression afterwards", function() { const node = parseCode("{ ; true }"); const sequence = t.toSequenceExpression([undefinedNode, node], scope); - assert.equal(generateCode(sequence.expressions[1]), "true"); + expect(generateCode(sequence.expressions[1])).toBe("true"); }); }); }); diff --git a/packages/babel-types/test/validators.js b/packages/babel-types/test/validators.js index f3466fa3c7422..fd323ebe14e81 100644 --- a/packages/babel-types/test/validators.js +++ b/packages/babel-types/test/validators.js @@ -1,84 +1,83 @@ import * as t from "../lib"; -import assert from "assert"; import { parse } from "babylon"; -suite("validators", function() { - suite("isNodesEquivalent", function() { +describe("validators", function() { + describe("isNodesEquivalent", function() { it("should handle simple cases", function() { const mem = t.memberExpression(t.identifier("a"), t.identifier("b")); - assert(t.isNodesEquivalent(mem, mem) === true); + expect(t.isNodesEquivalent(mem, mem)).toBe(true); const mem2 = t.memberExpression(t.identifier("a"), t.identifier("c")); - assert(t.isNodesEquivalent(mem, mem2) === false); + expect(t.isNodesEquivalent(mem, mem2)).toBe(false); }); it("should handle full programs", function() { - assert(t.isNodesEquivalent(parse("1 + 1"), parse("1+1")) === true); - assert(t.isNodesEquivalent(parse("1 + 1"), parse("1+2")) === false); + expect(t.isNodesEquivalent(parse("1 + 1"), parse("1+1"))).toBe(true); + expect(t.isNodesEquivalent(parse("1 + 1"), parse("1+2"))).toBe(false); }); it("should handle complex programs", function() { const program = "'use strict'; function lol() { wow();return 1; }"; - assert(t.isNodesEquivalent(parse(program), parse(program)) === true); + expect(t.isNodesEquivalent(parse(program), parse(program))).toBe(true); const program2 = "'use strict'; function lol() { wow();return -1; }"; - assert(t.isNodesEquivalent(parse(program), parse(program2)) === false); + expect(t.isNodesEquivalent(parse(program), parse(program2))).toBe(false); }); it("rejects 'await' as an identifier", function() { - assert(t.isValidIdentifier("await") === false); + expect(t.isValidIdentifier("await")).toBe(false); }); }); - suite("isCompatTag", function() { + describe("isCompatTag", function() { it("should handle lowercase tag names", function() { - assert(t.react.isCompatTag("div")); - assert(t.react.isCompatTag("a")); // one letter - assert(t.react.isCompatTag("h3")); // letters and numbers + expect(t.react.isCompatTag("div")).toBe(true); + expect(t.react.isCompatTag("a")).toBe(true); // one letter + expect(t.react.isCompatTag("h3")).toBe(true); // letters and numbers }); it("should handle custom element tag names", function() { - assert(t.react.isCompatTag("plastic-button")); // ascii letters - assert(t.react.isCompatTag("math-α")); // non-latin chars - assert(t.react.isCompatTag("img-viewer2")); // numbers - assert(t.react.isCompatTag("emotion-😍")); // emoji + expect(t.react.isCompatTag("plastic-button")).toBe(true); // ascii letters + expect(t.react.isCompatTag("math-α")).toBe(true); // non-latin chars + expect(t.react.isCompatTag("img-viewer2")).toBe(true); // numbers + expect(t.react.isCompatTag("emotion-😍")).toBe(true); // emoji }); it("accepts trailing dash '-' in custom element tag names", function() { - assert(t.react.isCompatTag("div-")); - assert(t.react.isCompatTag("a-")); - assert(t.react.isCompatTag("h3-")); + expect(t.react.isCompatTag("div-")).toBe(true); + expect(t.react.isCompatTag("a-")).toBe(true); + expect(t.react.isCompatTag("h3-")).toBe(true); }); it("rejects empty or null tag names", function() { - assert(t.react.isCompatTag(null) === false); - assert(t.react.isCompatTag() === false); - assert(t.react.isCompatTag(undefined) === false); - assert(t.react.isCompatTag("") === false); + expect(t.react.isCompatTag(null)).toBe(false); + expect(t.react.isCompatTag()).toBe(false); + expect(t.react.isCompatTag(undefined)).toBe(false); + expect(t.react.isCompatTag("")).toBe(false); }); it("rejects tag names starting with an uppercase letter", function() { - assert(t.react.isCompatTag("Div") === false); - assert(t.react.isCompatTag("A") === false); - assert(t.react.isCompatTag("H3") === false); + expect(t.react.isCompatTag("Div")).toBe(false); + expect(t.react.isCompatTag("A")).toBe(false); + expect(t.react.isCompatTag("H3")).toBe(false); }); it("rejects all uppercase tag names", function() { - assert(t.react.isCompatTag("DIV") === false); - assert(t.react.isCompatTag("A") === false); - assert(t.react.isCompatTag("H3") === false); + expect(t.react.isCompatTag("DIV")).toBe(false); + expect(t.react.isCompatTag("A")).toBe(false); + expect(t.react.isCompatTag("H3")).toBe(false); }); it("rejects leading dash '-'", function() { - assert(t.react.isCompatTag("-div") === false); - assert(t.react.isCompatTag("-a") === false); - assert(t.react.isCompatTag("-h3") === false); + expect(t.react.isCompatTag("-div")).toBe(false); + expect(t.react.isCompatTag("-a")).toBe(false); + expect(t.react.isCompatTag("-h3")).toBe(false); }); }); - suite("patterns", function() { + describe("patterns", function() { it("allows nested pattern structures", function() { const pattern = t.objectPattern([ t.objectProperty( @@ -93,7 +92,7 @@ suite("validators", function() { ), ]); - assert(t.isNodesEquivalent(pattern, pattern) === true); + expect(t.isNodesEquivalent(pattern, pattern)).toBe(true); }); }); }); diff --git a/packages/babylon/README.md b/packages/babylon/README.md index 8f75fe8c0f7e3..c1762058bea1b 100644 --- a/packages/babylon/README.md +++ b/packages/babylon/README.md @@ -66,9 +66,7 @@ It is based on [ESTree spec][] with the following deviations: - [Program][] and [BlockStatement][] contain additional `directives` field with [Directive][] and [DirectiveLiteral][] - [ClassMethod][], [ObjectProperty][], and [ObjectMethod][] value property's properties in [FunctionExpression][] is coerced/brought into the main method node. -AST for JSX code is based on [Facebook JSX AST][] with the addition of one node type: - -- `JSXText` +AST for JSX code is based on [Facebook JSX AST][]. [Babel AST format]: https://github.com/babel/babylon/blob/master/ast/spec.md [ESTree spec]: https://github.com/estree/estree diff --git a/packages/babylon/package.json b/packages/babylon/package.json index c3ba740eddd58..da8fec58a63f4 100644 --- a/packages/babylon/package.json +++ b/packages/babylon/package.json @@ -1,6 +1,6 @@ { "name": "babylon", - "version": "7.0.0-beta.39", + "version": "7.0.0-beta.42", "description": "A JavaScript parser", "author": "Sebastian McKenzie ", "homepage": "https://babeljs.io/", @@ -23,8 +23,8 @@ "node": ">=4.2.0" }, "devDependencies": { - "@babel/helper-fixtures": "7.0.0-beta.39", - "charcodes": "0.0.10", + "@babel/helper-fixtures": "7.0.0-beta.42", + "charcodes": "0.1.0", "unicode-10.0.0": "^0.7.4" }, "bin": { diff --git a/packages/babylon/src/index.js b/packages/babylon/src/index.js index 7071a312b3e3e..a90f0af0f67ae 100755 --- a/packages/babylon/src/index.js +++ b/packages/babylon/src/index.js @@ -22,11 +22,12 @@ export function parse(input: string, options?: Options): File { options = Object.assign({}, options); try { options.sourceType = "module"; - const ast = getParser(options, input).parse(); + 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 (!hasModuleSyntax(ast)) ast.program.sourceType = "script"; + if (!parser.sawUnambiguousESM) ast.program.sourceType = "script"; return ast; } catch (moduleError) { try { @@ -111,16 +112,3 @@ function getParserClass( } return cls; } - -function hasModuleSyntax(ast) { - return ast.program.body.some( - child => - (child.type === "ImportDeclaration" && - (!child.importKind || child.importKind === "value")) || - (child.type === "ExportNamedDeclaration" && - (!child.exportKind || child.exportKind === "value")) || - (child.type === "ExportAllDeclaration" && - (!child.exportKind || child.exportKind === "value")) || - child.type === "ExportDefaultDeclaration", - ); -} diff --git a/packages/babylon/src/parser/base.js b/packages/babylon/src/parser/base.js index 972d60c800796..6e7ab90d65776 100644 --- a/packages/babylon/src/parser/base.js +++ b/packages/babylon/src/parser/base.js @@ -11,6 +11,7 @@ export default class BaseParser { inModule: boolean; plugins: { [key: string]: boolean }; filename: ?string; + sawUnambiguousESM: boolean = false; // Initialized by Tokenizer state: State; diff --git a/packages/babylon/src/parser/expression.js b/packages/babylon/src/parser/expression.js index 84727492d2c20..b390d56e94c26 100644 --- a/packages/babylon/src/parser/expression.js +++ b/packages/babylon/src/parser/expression.js @@ -427,7 +427,10 @@ export default class ExpressionParser extends LValParser { startLoc: Position, noCalls?: ?boolean, ): N.Expression { - const state = { stop: false }; + const state = { + optionalChainMember: false, + stop: false, + }; do { base = this.parseSubscript(base, startPos, startLoc, noCalls, state); } while (!state.stop); @@ -440,7 +443,7 @@ export default class ExpressionParser extends LValParser { startPos: number, startLoc: Position, noCalls: ?boolean, - state: { stop: boolean, optionalChainMember?: boolean }, + state: N.ParseSubscriptState, ): N.Expression { if (!noCalls && this.eat(tt.doubleColon)) { const node = this.startNodeAt(startPos, startLoc); @@ -555,14 +558,13 @@ export default class ExpressionParser extends LValParser { const node = this.startNodeAt(startPos, startLoc); node.tag = base; node.quasi = this.parseTemplate(true); - if (!state.optionalChainMember) { - return this.finishNode(node, "TaggedTemplateExpression"); - } else { + if (state.optionalChainMember) { this.raise( startPos, "Tagged Template Literals are not allowed in optionalChain", ); } + return this.finishNode(node, "TaggedTemplateExpression"); } else { state.stop = true; return base; @@ -571,6 +573,7 @@ export default class ExpressionParser extends LValParser { atPossibleAsync(base: N.Expression): boolean { return ( + !this.state.containsEsc && this.state.potentialArrowAt === base.start && base.type === "Identifier" && base.name === "async" && @@ -738,6 +741,7 @@ export default class ExpressionParser extends LValParser { case tt.name: { node = this.startNode(); const allowAwait = this.state.value === "await" && this.state.inAsync; + const containsEsc = this.state.containsEsc; const allowYield = this.shouldAllowYieldIdentifier(); const id = this.parseIdentifier(allowAwait || allowYield); @@ -746,6 +750,7 @@ export default class ExpressionParser extends LValParser { return this.parseAwait(node); } } else if ( + !containsEsc && id.name === "async" && this.match(tt._function) && !this.canInsertSemicolon() @@ -914,9 +919,11 @@ export default class ExpressionParser extends LValParser { } } + const containsEsc = this.state.containsEsc; + node.property = this.parseIdentifier(true); - if (node.property.name !== propertyName) { + if (node.property.name !== propertyName || containsEsc) { this.raise( node.property.start, `The only valid meta property for ${meta.name} is ${ @@ -948,8 +955,11 @@ export default class ExpressionParser extends LValParser { 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"); } @@ -1302,6 +1312,8 @@ export default class ExpressionParser extends LValParser { isGenerator = this.eat(tt.star); } + const containsEsc = this.state.containsEsc; + if (!isPattern && this.isContextual("async")) { if (isGenerator) this.unexpected(); @@ -1336,6 +1348,7 @@ export default class ExpressionParser extends LValParser { isAsync, isPattern, refShorthandDefaultPos, + containsEsc, ); this.checkPropClash(prop, propHash); @@ -1381,17 +1394,24 @@ export default class ExpressionParser extends LValParser { } // get methods aren't allowed to have any parameters - // set methods must have exactly 1 parameter - checkGetterSetterParamCount(method: N.ObjectMethod | N.ClassMethod): void { + // set methods must have exactly 1 parameter which is not a rest parameter + checkGetterSetterParams(method: N.ObjectMethod | N.ClassMethod): void { const paramCount = method.kind === "get" ? 0 : 1; + const start = method.start; if (method.params.length !== paramCount) { - const start = method.start; if (method.kind === "get") { - this.raise(start, "getter should have no params"); + this.raise(start, "getter must not have any formal parameters"); } else { - this.raise(start, "setter should have exactly one param"); + this.raise(start, "setter must have exactly one formal parameter"); } } + + if (method.kind === "set" && method.params[0].type === "RestElement") { + this.raise( + start, + "setter function argument must not be a rest parameter", + ); + } } parseObjectMethod( @@ -1399,6 +1419,7 @@ export default class ExpressionParser extends LValParser { isGenerator: boolean, isAsync: boolean, isPattern: boolean, + containsEsc: boolean, ): ?N.ObjectMethod { if (isAsync || isGenerator || this.match(tt.parenL)) { if (isPattern) this.unexpected(); @@ -1413,7 +1434,7 @@ export default class ExpressionParser extends LValParser { ); } - if (this.isGetterOrSetterMethod(prop, isPattern)) { + if (!containsEsc && this.isGetterOrSetterMethod(prop, isPattern)) { if (isGenerator || isAsync) this.unexpected(); prop.kind = prop.key.name; this.parsePropertyName(prop); @@ -1424,7 +1445,7 @@ export default class ExpressionParser extends LValParser { /* isConstructor */ false, "ObjectMethod", ); - this.checkGetterSetterParamCount(prop); + this.checkGetterSetterParams(prop); return prop; } } @@ -1481,9 +1502,16 @@ export default class ExpressionParser extends LValParser { isAsync: boolean, isPattern: boolean, refShorthandDefaultPos: ?Pos, + containsEsc: boolean, ): void { const node = - this.parseObjectMethod(prop, isGenerator, isAsync, isPattern) || + this.parseObjectMethod( + prop, + isGenerator, + isAsync, + isPattern, + containsEsc, + ) || this.parseObjectProperty( prop, startPos, @@ -1676,9 +1704,7 @@ export default class ExpressionParser extends LValParser { const oldStrict = this.state.strict; if (isStrict) this.state.strict = isStrict; - if (node.id) { - this.checkReservedWord(node.id, node.start, true, true); - } + if (checkLVal) { const nameHash: any = Object.create(null); if (node.id) { diff --git a/packages/babylon/src/parser/location.js b/packages/babylon/src/parser/location.js index f3b0fb656d077..79db584a49958 100644 --- a/packages/babylon/src/parser/location.js +++ b/packages/babylon/src/parser/location.js @@ -13,7 +13,13 @@ export default class LocationParser extends CommentsParser { raise( pos: number, message: string, - missingPluginNames?: Array, + { + missingPluginNames, + code, + }: { + missingPluginNames?: Array, + code?: string, + } = {}, ): empty { const loc = getLineInfo(this.input, pos); message += ` (${loc.line}:${loc.column})`; @@ -26,6 +32,9 @@ export default class LocationParser extends CommentsParser { if (missingPluginNames) { err.missingPlugin = missingPluginNames; } + if (code !== undefined) { + err.code = code; + } throw err; } } diff --git a/packages/babylon/src/parser/statement.js b/packages/babylon/src/parser/statement.js index 1d443f06f7ee9..f86f7af9b9ea8 100644 --- a/packages/babylon/src/parser/statement.js +++ b/packages/babylon/src/parser/statement.js @@ -146,8 +146,25 @@ export default class StatementParser extends ExpressionParser { let result; if (starttype == tt._import) { result = this.parseImport(node); + + if ( + result.type === "ImportDeclaration" && + (!result.importKind || result.importKind === "value") + ) { + this.sawUnambiguousESM = true; + } } else { result = this.parseExport(node); + + if ( + (result.type === "ExportNamedDeclaration" && + (!result.exportKind || result.exportKind === "value")) || + (result.type === "ExportAllDeclaration" && + (!result.exportKind || result.exportKind === "value")) || + result.type === "ExportDefaultDeclaration" + ) { + this.sawUnambiguousESM = true; + } } this.assertModuleNodeAllowed(node); @@ -155,7 +172,7 @@ export default class StatementParser extends ExpressionParser { return result; } case tt.name: - if (this.state.value === "async") { + if (this.isContextual("async")) { // peek ahead and see if next token is a function const state = this.state.clone(); this.next(); @@ -192,6 +209,9 @@ export default class StatementParser extends ExpressionParser { this.raise( node.start, `'import' and 'export' may appear only with 'sourceType: "module"'`, + { + code: "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED", + }, ); } } @@ -364,8 +384,19 @@ export default class StatementParser extends ExpressionParser { this.finishNode(init, "VariableDeclaration"); if (this.match(tt._in) || this.isContextual("of")) { - if (init.declarations.length === 1 && !init.declarations[0].init) { - return this.parseForIn(node, init, forAwait); + if (init.declarations.length === 1) { + const declaration = init.declarations[0]; + const isForInInitializer = + varKind === tt._var && + declaration.init && + declaration.id.type != "ObjectPattern" && + declaration.id.type != "ArrayPattern" && + !this.isContextual("of"); + if (this.state.strict && isForInInitializer) { + this.raise(this.state.start, "for-in initializer in strict mode"); + } else if (isForInInitializer || !declaration.init) { + return this.parseForIn(node, init, forAwait); + } } } if (forAwait) { @@ -956,8 +987,11 @@ export default class StatementParser extends ExpressionParser { state: { hadConstructor: boolean }, ): void { let isStatic = false; + const containsEsc = this.state.containsEsc; + if (this.match(tt.name) && this.state.value === "static") { const key = this.parseIdentifier(true); // eats 'static' + if (this.isClassMethod()) { const method: N.ClassMethod = (member: any); @@ -983,7 +1017,10 @@ export default class StatementParser extends ExpressionParser { prop.static = false; classBody.body.push(this.parseClassProperty(prop)); return; + } else if (containsEsc) { + throw this.unexpected(); } + // otherwise something static isStatic = true; } @@ -1147,7 +1184,7 @@ export default class StatementParser extends ExpressionParser { ); } - this.checkGetterSetterParamCount(publicMethod); + this.checkGetterSetterParams(publicMethod); } else if (this.isLineTerminator()) { // an uninitialized class property (due to ASI, since we don't otherwise recognize the next token) if (isPrivate) { @@ -1488,7 +1525,10 @@ export default class StatementParser extends ExpressionParser { node.declaration.type === "FunctionDeclaration" || node.declaration.type === "ClassDeclaration" ) { - this.checkDuplicateExports(node, node.declaration.id.name); + const id = node.declaration.id; + if (!id) throw new Error("Assertion failure"); + + this.checkDuplicateExports(node, id.name); } else if (node.declaration.type === "VariableDeclaration") { for (const declaration of node.declaration.declarations) { this.checkDeclaration(declaration.id); diff --git a/packages/babylon/src/parser/util.js b/packages/babylon/src/parser/util.js index c89e40bd8f811..7871141ca7a03 100644 --- a/packages/babylon/src/parser/util.js +++ b/packages/babylon/src/parser/util.js @@ -46,7 +46,11 @@ export default class UtilParser extends Tokenizer { // Tests whether parsed token is a contextual keyword. isContextual(name: string): boolean { - return this.match(tt.name) && this.state.value === name; + return ( + this.match(tt.name) && + this.state.value === name && + !this.state.containsEsc + ); } isLookaheadContextual(name: string): boolean { @@ -57,7 +61,7 @@ export default class UtilParser extends Tokenizer { // Consumes contextual keyword if possible. eatContextual(name: string): boolean { - return this.state.value === name && this.eat(tt.name); + return this.isContextual(name) && this.eat(tt.name); } // Asserts that following token is given contextual keyword. @@ -120,7 +124,7 @@ export default class UtilParser extends Tokenizer { throw this.raise( pos != null ? pos : this.state.start, `This experimental syntax requires enabling the parser plugin: '${name}'`, - [name], + { missingPluginNames: [name] }, ); } @@ -134,7 +138,7 @@ export default class UtilParser extends Tokenizer { `This experimental syntax requires enabling one of the following parser plugin(s): '${names.join( ", ", )}'`, - names, + { missingPluginNames: names }, ); } } diff --git a/packages/babylon/src/plugins/estree.js b/packages/babylon/src/plugins/estree.js index 81ed5a2010b04..3da593f7d9f36 100644 --- a/packages/babylon/src/plugins/estree.js +++ b/packages/babylon/src/plugins/estree.js @@ -82,17 +82,24 @@ export default (superClass: Class): Class => } } - checkGetterSetterParamCount(prop: N.ObjectMethod | N.ClassMethod): void { + checkGetterSetterParams(method: N.ObjectMethod | N.ClassMethod): void { + const prop = ((method: any): N.EstreeProperty | N.EstreeMethodDefinition); const paramCount = prop.kind === "get" ? 0 : 1; - // $FlowFixMe (prop.value present for ObjectMethod, but for ClassMethod should use prop.params?) + const start = prop.start; if (prop.value.params.length !== paramCount) { - const start = prop.start; if (prop.kind === "get") { - this.raise(start, "getter should have no params"); + this.raise(start, "getter must not have any formal parameters"); } else { - this.raise(start, "setter should have exactly one param"); + this.raise(start, "setter must have exactly one formal parameter"); } } + + if (prop.kind === "set" && prop.value.params[0].type === "RestElement") { + this.raise( + start, + "setter function argument must not be a rest parameter", + ); + } } checkLVal( @@ -281,12 +288,14 @@ export default (superClass: Class): Class => isGenerator: boolean, isAsync: boolean, isPattern: boolean, + containsEsc: boolean, ): ?N.ObjectMethod { const node: N.EstreeProperty = (super.parseObjectMethod( prop, isGenerator, isAsync, isPattern, + containsEsc, ): any); if (node) { diff --git a/packages/babylon/src/plugins/flow.js b/packages/babylon/src/plugins/flow.js index b5c904ef19d29..c94cc8ba443da 100644 --- a/packages/babylon/src/plugins/flow.js +++ b/packages/babylon/src/plugins/flow.js @@ -763,7 +763,7 @@ export default (superClass: Class): Class => this.startNodeAt(node.start, node.loc.start), ); if (kind === "get" || kind === "set") { - this.flowCheckGetterSetterParamCount(node); + this.flowCheckGetterSetterParams(node); } } else { if (kind !== "init") this.unexpected(); @@ -783,20 +783,29 @@ export default (superClass: Class): Class => } } - // This is similar to checkGetterSetterParamCount, but as + // This is similar to checkGetterSetterParams, but as // babylon uses non estree properties we cannot reuse it here - flowCheckGetterSetterParamCount( + flowCheckGetterSetterParams( property: N.FlowObjectTypeProperty | N.FlowObjectTypeSpreadProperty, ): void { const paramCount = property.kind === "get" ? 0 : 1; - if (property.value.params.length !== paramCount) { - const start = property.start; + const start = property.start; + const length = + property.value.params.length + (property.value.rest ? 1 : 0); + if (length !== paramCount) { if (property.kind === "get") { - this.raise(start, "getter should have no params"); + this.raise(start, "getter must not have any formal parameters"); } else { - this.raise(start, "setter should have exactly one param"); + this.raise(start, "setter must have exactly one formal parameter"); } } + + if (property.kind === "set" && property.value.rest) { + this.raise( + start, + "setter function argument must not be a rest parameter", + ); + } } flowObjectTypeSemicolon(): void { @@ -1632,7 +1641,7 @@ export default (superClass: Class): Class => return this.finishOp(tt.relational, 1); } else if (isIteratorStart(code, next)) { this.state.isIterator = true; - return super.readWord(code); + return super.readWord(); } else { return super.readToken(code); } @@ -1828,6 +1837,7 @@ export default (superClass: Class): Class => isAsync: boolean, isPattern: boolean, refShorthandDefaultPos: ?Pos, + containsEsc: boolean, ): void { if ((prop: $FlowFixMe).variance) { this.unexpected((prop: $FlowFixMe).variance.start); @@ -1850,6 +1860,7 @@ export default (superClass: Class): Class => isAsync, isPattern, refShorthandDefaultPos, + containsEsc, ); // add typeParameters if we found them diff --git a/packages/babylon/src/plugins/typescript.js b/packages/babylon/src/plugins/typescript.js index 693edfe59f2a4..58074479e04ee 100644 --- a/packages/babylon/src/plugins/typescript.js +++ b/packages/babylon/src/plugins/typescript.js @@ -617,11 +617,22 @@ export default (superClass: Class): Class => return this.finishNode(node, "TSTypeOperator"); } + tsParseInferType(): N.TsInferType { + const node = this.startNode(); + this.expectContextual("infer"); + const typeParameter = this.startNode(); + typeParameter.name = this.parseIdentifierName(typeParameter.start); + node.typeParameter = this.finishNode(typeParameter, "TypeParameter"); + return this.finishNode(node, "TSInferType"); + } + tsParseTypeOperatorOrHigher(): N.TsType { const operator = ["keyof", "unique"].find(kw => this.isContextual(kw)); return operator ? this.tsParseTypeOperator(operator) - : this.tsParseArrayTypeOrHigher(); + : this.isContextual("infer") + ? this.tsParseInferType() + : this.tsParseArrayTypeOrHigher(); } tsParseUnionOrIntersectionType( @@ -774,6 +785,21 @@ export default (superClass: Class): Class => tsParseType(): N.TsType { // Need to set `state.inType` so that we don't parse JSX in a type context. assert(this.state.inType); + const type = this.tsParseNonConditionalType(); + if (this.hasPrecedingLineBreak() || !this.eat(tt._extends)) { + return type; + } + const node: N.TsConditionalType = this.startNodeAtNode(type); + node.checkType = type; + node.extendsType = this.tsParseNonConditionalType(); + this.expect(tt.question); + node.trueType = this.tsParseType(); + this.expect(tt.colon); + node.falseType = this.tsParseType(); + return this.finishNode(node, "TSConditionalType"); + } + + tsParseNonConditionalType(): N.TsType { if (this.tsIsStartOfFunctionType()) { return this.tsParseFunctionOrConstructorType("TSFunctionType"); } @@ -860,7 +886,7 @@ export default (superClass: Class): Class => } } - tsEatThenParseType(token: TokenType): N.TsType | undefined { + tsEatThenParseType(token: TokenType): N.TsType | typeof undefined { return !this.match(token) ? undefined : this.tsNextThenParseType(); } @@ -1300,7 +1326,7 @@ export default (superClass: Class): Class => startPos: number, startLoc: Position, noCalls: ?boolean, - state: { stop: boolean }, + state: N.ParseSubscriptState, ): N.Expression { if (!this.hasPrecedingLineBreak() && this.eat(tt.bang)) { const nonNullExpression: N.TsNonNullExpression = this.startNodeAt( @@ -1665,6 +1691,10 @@ export default (superClass: Class): Class => } parseClassProperty(node: N.ClassProperty): N.ClassProperty { + if (!node.optional && this.eat(tt.bang)) { + node.definite = true; + } + const type = this.tsTryParseTypeAnnotation(); if (type) node.typeAnnotation = type; return super.parseClassProperty(node); @@ -1726,6 +1756,10 @@ export default (superClass: Class): Class => // `let x: number;` parseVarHead(decl: N.VariableDeclarator): void { super.parseVarHead(decl); + if (decl.id.type === "Identifier" && this.eat(tt.bang)) { + decl.definite = true; + } + const type = this.tsTryParseTypeAnnotation(); if (type) { decl.id.typeAnnotation = type; @@ -1954,7 +1988,9 @@ export default (superClass: Class): Class => } isClassProperty(): boolean { - return this.match(tt.colon) || super.isClassProperty(); + return ( + this.match(tt.bang) || this.match(tt.colon) || super.isClassProperty() + ); } parseMaybeDefault(...args): N.Pattern { diff --git a/packages/babylon/src/tokenizer/index.js b/packages/babylon/src/tokenizer/index.js index 3fce132907710..48c1efc25df26 100644 --- a/packages/babylon/src/tokenizer/index.js +++ b/packages/babylon/src/tokenizer/index.js @@ -464,9 +464,17 @@ export default class Tokenizer extends LocationParser { const next = this.input.charCodeAt(this.state.pos + 1); if (next === code) { + const assign = + this.input.charCodeAt(this.state.pos + 2) === charCodes.equalsTo; + if (assign) { + // $FlowFixMe + this.expectPlugin("logicalAssignment"); + } this.finishOp( - code === charCodes.verticalBar ? tt.logicalOR : tt.logicalAND, - 2, + assign + ? tt.assign + : code === charCodes.verticalBar ? tt.logicalOR : tt.logicalAND, + assign ? 3 : 2, ); return; } @@ -1273,7 +1281,7 @@ export default class Tokenizer extends LocationParser { return word + this.input.slice(chunkStart, this.state.pos); } - isIterator(word): boolean { + isIterator(word: string): boolean { return word === "@@iterator" || word === "@@asyncIterator"; } diff --git a/packages/babylon/src/tokenizer/state.js b/packages/babylon/src/tokenizer/state.js index eab456ad6cc20..026386e21fb78 100644 --- a/packages/babylon/src/tokenizer/state.js +++ b/packages/babylon/src/tokenizer/state.js @@ -22,7 +22,7 @@ export default class State { this.noArrowParamsConversionAt = []; // eslint-disable-next-line max-len - this.inMethod = this.inFunction = this.inParameters = this.maybeInArrowParameters = this.inGenerator = this.inAsync = this.inPropertyName = this.inType = this.inClassProperty = this.noAnonFunctionType = false; + this.inMethod = this.inFunction = this.inParameters = this.maybeInArrowParameters = this.inGenerator = this.inAsync = this.inPropertyName = this.inType = this.inClassProperty = this.noAnonFunctionType = this.hasFlowComment = this.isIterator = false; this.classLevel = 0; @@ -102,6 +102,8 @@ export default class State { noAnonFunctionType: boolean; inPropertyName: boolean; inClassProperty: boolean; + hasFlowComment: boolean; + isIterator: boolean; // Check whether we are in a (nested) class or not. classLevel: number; diff --git a/packages/babylon/src/types.js b/packages/babylon/src/types.js index 201c4f35c7187..41d457d7f137e 100644 --- a/packages/babylon/src/types.js +++ b/packages/babylon/src/types.js @@ -326,6 +326,9 @@ export type VariableDeclarator = NodeBase & { type: "VariableDeclarator", id: Pattern, init: ?Expression, + + // TypeScript only: + definite?: true, }; // Misc @@ -696,6 +699,7 @@ export type ClassProperty = ClassMemberBase & { // TypeScript only: (TODO: Not in spec) readonly?: true, + definite?: true, }; export type ClassPrivateProperty = NodeBase & { @@ -937,6 +941,18 @@ export type EstreeProperty = NodeBase & { variance?: ?FlowVariance, }; +export type EstreeMethodDefinition = NodeBase & { + type: "MethodDefinition", + static: boolean, + key: Expression, + computed: boolean, + value: Expression, + decorators: $ReadOnlyArray, + kind?: "get" | "set" | "method", + + variance?: ?FlowVariance, +}; + // === === === === // TypeScript // === === === === @@ -1064,6 +1080,8 @@ export type TsType = | TsArrayType | TsTupleType | TsUnionOrIntersectionType + | TsConditionalType + | TsInferType | TsParenthesizedType | TsTypeOperator | TsIndexedAccessType @@ -1154,6 +1172,19 @@ export type TsIntersectionType = TsUnionOrIntersectionTypeBase & { type: "TSIntersectionType", }; +export type TsConditionalType = TsTypeBase & { + type: "TSConditionalType", + checkType: TsType, + extendsType: TsType, + trueType: TsType, + falseType: TsType, +}; + +export type TsInferType = TsTypeBase & { + type: "TSInferType", + typeParameter: TypeParameter, +}; + export type TsParenthesizedType = TsTypeBase & { type: "TSParenthesizedType", typeAnnotation: TsType, @@ -1298,3 +1329,12 @@ export type TsNonNullExpression = NodeBase & { type: "TSNonNullExpression", expression: Expression, }; + +// ================ +// Other +// ================ + +export type ParseSubscriptState = { + optionalChainMember: boolean, + stop: boolean, +}; diff --git a/packages/babylon/test/fixtures/core/sourcetype-unambiguous/import-meta/input.js b/packages/babylon/test/fixtures/core/sourcetype-unambiguous/import-meta/input.js new file mode 100644 index 0000000000000..e7313a090ffe5 --- /dev/null +++ b/packages/babylon/test/fixtures/core/sourcetype-unambiguous/import-meta/input.js @@ -0,0 +1 @@ +console.log(import.meta); diff --git a/packages/babylon/test/fixtures/core/sourcetype-unambiguous/import-meta/options.json b/packages/babylon/test/fixtures/core/sourcetype-unambiguous/import-meta/options.json new file mode 100644 index 0000000000000..6fdc0a23b66ec --- /dev/null +++ b/packages/babylon/test/fixtures/core/sourcetype-unambiguous/import-meta/options.json @@ -0,0 +1,4 @@ +{ + "sourceType": "unambiguous", + "plugins": ["importMeta"] +} diff --git a/packages/babylon/test/fixtures/core/sourcetype-unambiguous/import-meta/output.json b/packages/babylon/test/fixtures/core/sourcetype-unambiguous/import-meta/output.json new file mode 100644 index 0000000000000..1fe4795f6400c --- /dev/null +++ b/packages/babylon/test/fixtures/core/sourcetype-unambiguous/import-meta/output.json @@ -0,0 +1,165 @@ +{ + "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", + "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": "MemberExpression", + "start": 0, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 11 + } + }, + "object": { + "type": "Identifier", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "console" + }, + "name": "console" + }, + "property": { + "type": "Identifier", + "start": 8, + "end": 11, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 11 + }, + "identifierName": "log" + }, + "name": "log" + }, + "computed": false + }, + "arguments": [ + { + "type": "MetaProperty", + "start": 12, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "meta": { + "type": "Identifier", + "start": 12, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 18 + }, + "identifierName": "import" + }, + "name": "import" + }, + "property": { + "type": "Identifier", + "start": 19, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + }, + "identifierName": "meta" + }, + "name": "meta" + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/es2015/class-methods/getter-signature/options.json b/packages/babylon/test/fixtures/es2015/class-methods/getter-signature/options.json index 9699409e829a5..e096100dcfd64 100644 --- a/packages/babylon/test/fixtures/es2015/class-methods/getter-signature/options.json +++ b/packages/babylon/test/fixtures/es2015/class-methods/getter-signature/options.json @@ -1,3 +1,3 @@ { - "throws": "getter should have no params (2:2)" + "throws": "getter must not have any formal parameters (2:2)" } \ No newline at end of file diff --git a/packages/babylon/test/fixtures/es2015/for-in/bare-initializer/input.js b/packages/babylon/test/fixtures/es2015/for-in/bare-initializer/input.js new file mode 100644 index 0000000000000..094f22863b559 --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/bare-initializer/input.js @@ -0,0 +1,2 @@ +var a; +for (a = 0 in {}); diff --git a/packages/babylon/test/fixtures/es2015/for-in/bare-initializer/output.json b/packages/babylon/test/fixtures/es2015/for-in/bare-initializer/output.json new file mode 100644 index 0000000000000..b205c87f55d43 --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/bare-initializer/output.json @@ -0,0 +1,183 @@ +{ + "type": "File", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 25, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 18 + } + }, + "sourceType": "script", + "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/babylon/test/fixtures/es2015/for-in/const-initializer/input.js b/packages/babylon/test/fixtures/es2015/for-in/const-initializer/input.js new file mode 100644 index 0000000000000..aa7bc09da8a2e --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/const-initializer/input.js @@ -0,0 +1 @@ +for (const a = 0 in {}); \ No newline at end of file diff --git a/packages/babylon/test/fixtures/es2015/for-in/const-initializer/options.json b/packages/babylon/test/fixtures/es2015/for-in/const-initializer/options.json new file mode 100644 index 0000000000000..a7c6e79257b97 --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/const-initializer/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected \";\" (1:17)" +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/es2015/for-in/let-initializer/input.js b/packages/babylon/test/fixtures/es2015/for-in/let-initializer/input.js new file mode 100644 index 0000000000000..037f0d340379b --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/let-initializer/input.js @@ -0,0 +1 @@ +for (let a = 0 in {}); \ No newline at end of file diff --git a/packages/babylon/test/fixtures/es2015/for-in/let-initializer/options.json b/packages/babylon/test/fixtures/es2015/for-in/let-initializer/options.json new file mode 100644 index 0000000000000..bc625e0d0c48c --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/let-initializer/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected \";\" (1:15)" +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/es2015/for-in/nonstrict-initializer/input.js b/packages/babylon/test/fixtures/es2015/for-in/nonstrict-initializer/input.js new file mode 100644 index 0000000000000..c2b56cda957ff --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/nonstrict-initializer/input.js @@ -0,0 +1,6 @@ + var effects = 0; + var iterations = 0; + var stored; + for (var a = (++effects, -1) in stored = a, {a: 0, b: 1, c: 2}) { + ++iterations; + } diff --git a/packages/babylon/test/fixtures/es2015/for-in/nonstrict-initializer/output.json b/packages/babylon/test/fixtures/es2015/for-in/nonstrict-initializer/output.json new file mode 100644 index 0000000000000..4e0e704c3706e --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/nonstrict-initializer/output.json @@ -0,0 +1,707 @@ +{ + "type": "File", + "start": 0, + "end": 144, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 144, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "sourceType": "script", + "body": [ + { + "type": "VariableDeclaration", + "start": 2, + "end": 18, + "loc": { + "start": { + "line": 1, + "column": 2 + }, + "end": { + "line": 1, + "column": 18 + } + }, + "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": "effects" + }, + "name": "effects" + }, + "init": { + "type": "NumericLiteral", + "start": 16, + "end": 17, + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 17 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "start": 21, + "end": 40, + "loc": { + "start": { + "line": 2, + "column": 2 + }, + "end": { + "line": 2, + "column": 21 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 25, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "id": { + "type": "Identifier", + "start": 25, + "end": 35, + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 16 + }, + "identifierName": "iterations" + }, + "name": "iterations" + }, + "init": { + "type": "NumericLiteral", + "start": 38, + "end": 39, + "loc": { + "start": { + "line": 2, + "column": 19 + }, + "end": { + "line": 2, + "column": 20 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + } + ], + "kind": "var" + }, + { + "type": "VariableDeclaration", + "start": 43, + "end": 54, + "loc": { + "start": { + "line": 3, + "column": 2 + }, + "end": { + "line": 3, + "column": 13 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 47, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 12 + } + }, + "id": { + "type": "Identifier", + "start": 47, + "end": 53, + "loc": { + "start": { + "line": 3, + "column": 6 + }, + "end": { + "line": 3, + "column": 12 + }, + "identifierName": "stored" + }, + "name": "stored" + }, + "init": null + } + ], + "kind": "var" + }, + { + "type": "ForInStatement", + "start": 57, + "end": 144, + "loc": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "left": { + "type": "VariableDeclaration", + "start": 62, + "end": 85, + "loc": { + "start": { + "line": 4, + "column": 7 + }, + "end": { + "line": 4, + "column": 30 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 66, + "end": 85, + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 30 + } + }, + "id": { + "type": "Identifier", + "start": 66, + "end": 67, + "loc": { + "start": { + "line": 4, + "column": 11 + }, + "end": { + "line": 4, + "column": 12 + }, + "identifierName": "a" + }, + "name": "a" + }, + "init": { + "type": "SequenceExpression", + "start": 71, + "end": 84, + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "expressions": [ + { + "type": "UpdateExpression", + "start": 71, + "end": 80, + "loc": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 25 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 73, + "end": 80, + "loc": { + "start": { + "line": 4, + "column": 18 + }, + "end": { + "line": 4, + "column": 25 + }, + "identifierName": "effects" + }, + "name": "effects" + }, + "extra": { + "parenthesizedArgument": false + } + }, + { + "type": "UnaryExpression", + "start": 82, + "end": 84, + "loc": { + "start": { + "line": 4, + "column": 27 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "operator": "-", + "prefix": true, + "argument": { + "type": "NumericLiteral", + "start": 83, + "end": 84, + "loc": { + "start": { + "line": 4, + "column": 28 + }, + "end": { + "line": 4, + "column": 29 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + }, + "extra": { + "parenthesizedArgument": false + } + } + ], + "extra": { + "parenthesized": true, + "parenStart": 70 + } + } + } + ], + "kind": "var" + }, + "right": { + "type": "SequenceExpression", + "start": 89, + "end": 119, + "loc": { + "start": { + "line": 4, + "column": 34 + }, + "end": { + "line": 4, + "column": 64 + } + }, + "expressions": [ + { + "type": "AssignmentExpression", + "start": 89, + "end": 99, + "loc": { + "start": { + "line": 4, + "column": 34 + }, + "end": { + "line": 4, + "column": 44 + } + }, + "operator": "=", + "left": { + "type": "Identifier", + "start": 89, + "end": 95, + "loc": { + "start": { + "line": 4, + "column": 34 + }, + "end": { + "line": 4, + "column": 40 + }, + "identifierName": "stored" + }, + "name": "stored" + }, + "right": { + "type": "Identifier", + "start": 98, + "end": 99, + "loc": { + "start": { + "line": 4, + "column": 43 + }, + "end": { + "line": 4, + "column": 44 + }, + "identifierName": "a" + }, + "name": "a" + } + }, + { + "type": "ObjectExpression", + "start": 101, + "end": 119, + "loc": { + "start": { + "line": 4, + "column": 46 + }, + "end": { + "line": 4, + "column": 64 + } + }, + "properties": [ + { + "type": "ObjectProperty", + "start": 102, + "end": 106, + "loc": { + "start": { + "line": 4, + "column": 47 + }, + "end": { + "line": 4, + "column": 51 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 102, + "end": 103, + "loc": { + "start": { + "line": 4, + "column": 47 + }, + "end": { + "line": 4, + "column": 48 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 105, + "end": 106, + "loc": { + "start": { + "line": 4, + "column": 50 + }, + "end": { + "line": 4, + "column": 51 + } + }, + "extra": { + "rawValue": 0, + "raw": "0" + }, + "value": 0 + } + }, + { + "type": "ObjectProperty", + "start": 108, + "end": 112, + "loc": { + "start": { + "line": 4, + "column": 53 + }, + "end": { + "line": 4, + "column": 57 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 108, + "end": 109, + "loc": { + "start": { + "line": 4, + "column": 53 + }, + "end": { + "line": 4, + "column": 54 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 111, + "end": 112, + "loc": { + "start": { + "line": 4, + "column": 56 + }, + "end": { + "line": 4, + "column": 57 + } + }, + "extra": { + "rawValue": 1, + "raw": "1" + }, + "value": 1 + } + }, + { + "type": "ObjectProperty", + "start": 114, + "end": 118, + "loc": { + "start": { + "line": 4, + "column": 59 + }, + "end": { + "line": 4, + "column": 63 + } + }, + "method": false, + "key": { + "type": "Identifier", + "start": 114, + "end": 115, + "loc": { + "start": { + "line": 4, + "column": 59 + }, + "end": { + "line": 4, + "column": 60 + }, + "identifierName": "c" + }, + "name": "c" + }, + "computed": false, + "shorthand": false, + "value": { + "type": "NumericLiteral", + "start": 117, + "end": 118, + "loc": { + "start": { + "line": 4, + "column": 62 + }, + "end": { + "line": 4, + "column": 63 + } + }, + "extra": { + "rawValue": 2, + "raw": "2" + }, + "value": 2 + } + } + ] + } + ] + }, + "body": { + "type": "BlockStatement", + "start": 121, + "end": 144, + "loc": { + "start": { + "line": 4, + "column": 66 + }, + "end": { + "line": 6, + "column": 3 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 127, + "end": 140, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 17 + } + }, + "expression": { + "type": "UpdateExpression", + "start": 127, + "end": 139, + "loc": { + "start": { + "line": 5, + "column": 4 + }, + "end": { + "line": 5, + "column": 16 + } + }, + "operator": "++", + "prefix": true, + "argument": { + "type": "Identifier", + "start": 129, + "end": 139, + "loc": { + "start": { + "line": 5, + "column": 6 + }, + "end": { + "line": 5, + "column": 16 + }, + "identifierName": "iterations" + }, + "name": "iterations" + }, + "extra": { + "parenthesizedArgument": false + } + } + } + ], + "directives": [] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/es2015/for-in/strict-initializer/input.js b/packages/babylon/test/fixtures/es2015/for-in/strict-initializer/input.js new file mode 100644 index 0000000000000..c1ecfdf85c803 --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/strict-initializer/input.js @@ -0,0 +1,2 @@ +'use strict'; +for (var a = 0 in {}); \ No newline at end of file diff --git a/packages/babylon/test/fixtures/es2015/for-in/strict-initializer/options.json b/packages/babylon/test/fixtures/es2015/for-in/strict-initializer/options.json new file mode 100644 index 0000000000000..983e17a01e63f --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/strict-initializer/options.json @@ -0,0 +1,3 @@ +{ + "throws": "for-in initializer in strict mode (2:15)" +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/input.js b/packages/babylon/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/input.js new file mode 100644 index 0000000000000..54b71b26a4223 --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/input.js @@ -0,0 +1 @@ +for (var [a] = 0 in {}); \ No newline at end of file diff --git a/packages/babylon/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/options.json b/packages/babylon/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/options.json new file mode 100644 index 0000000000000..a7c6e79257b97 --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected \";\" (1:17)" +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/input.js b/packages/babylon/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/input.js new file mode 100644 index 0000000000000..f0708b2348324 --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/input.js @@ -0,0 +1 @@ +for (var {a} = 0 in {}); \ No newline at end of file diff --git a/packages/babylon/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/options.json b/packages/babylon/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/options.json new file mode 100644 index 0000000000000..a7c6e79257b97 --- /dev/null +++ b/packages/babylon/test/fixtures/es2015/for-in/var-objectbindingpattern-initializer/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected \";\" (1:17)" +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/es2015/uncategorised/347/options.json b/packages/babylon/test/fixtures/es2015/uncategorised/347/options.json index 739bda889b8ab..9a137564eed4e 100644 --- a/packages/babylon/test/fixtures/es2015/uncategorised/347/options.json +++ b/packages/babylon/test/fixtures/es2015/uncategorised/347/options.json @@ -1,3 +1,3 @@ { - "throws": "setter should have exactly one param (1:10)" + "throws": "setter must have exactly one formal parameter (1:10)" } diff --git a/packages/babylon/test/fixtures/esprima/rest-parameter/invalid-setter-rest/options.json b/packages/babylon/test/fixtures/esprima/rest-parameter/invalid-setter-rest/options.json new file mode 100644 index 0000000000000..c397e398c82b9 --- /dev/null +++ b/packages/babylon/test/fixtures/esprima/rest-parameter/invalid-setter-rest/options.json @@ -0,0 +1,3 @@ +{ + "throws": "setter function argument must not be a rest parameter (1:6)" + } diff --git a/packages/babylon/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json b/packages/babylon/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json deleted file mode 100644 index 8d4bed2eb18c4..0000000000000 --- a/packages/babylon/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json +++ /dev/null @@ -1,188 +0,0 @@ -{ - "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", - "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/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals-no-plugin/input.js b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals-no-plugin/input.js new file mode 100644 index 0000000000000..740f1fa9268a3 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals-no-plugin/input.js @@ -0,0 +1,2 @@ +a &&= b; +obj.a &&= b; diff --git a/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals-no-plugin/options.json b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals-no-plugin/options.json new file mode 100644 index 0000000000000..5b674fdee42e7 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals-no-plugin/options.json @@ -0,0 +1,4 @@ +{ + "plugins": [], + "throws": "This experimental syntax requires enabling the parser plugin: 'logicalAssignment' (1:2)" +} diff --git a/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals/input.js b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals/input.js new file mode 100644 index 0000000000000..740f1fa9268a3 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals/input.js @@ -0,0 +1,2 @@ +a &&= b; +obj.a &&= b; diff --git a/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals/options.json b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals/options.json new file mode 100644 index 0000000000000..5041dbb19f815 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["logicalAssignment"] +} diff --git a/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals/output.json b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals/output.json new file mode 100644 index 0000000000000..a8cf00f410427 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/and-and-equals/output.json @@ -0,0 +1,197 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "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": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "b" + }, + "name": "b" + } + } + }, + { + "type": "ExpressionStatement", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 9, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "operator": "&&=", + "left": { + "type": "MemberExpression", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "object": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "obj" + }, + "name": "obj" + }, + "property": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "b" + }, + "name": "b" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet-no-plugin/input.js b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet-no-plugin/input.js new file mode 100644 index 0000000000000..53c87792bb2fc --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet-no-plugin/input.js @@ -0,0 +1 @@ +a ||= b; diff --git a/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet-no-plugin/options.json b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet-no-plugin/options.json new file mode 100644 index 0000000000000..5b674fdee42e7 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet-no-plugin/options.json @@ -0,0 +1,4 @@ +{ + "plugins": [], + "throws": "This experimental syntax requires enabling the parser plugin: 'logicalAssignment' (1:2)" +} diff --git a/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet/input.js b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet/input.js new file mode 100644 index 0000000000000..cb4961f49b9e6 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet/input.js @@ -0,0 +1,2 @@ +a ||= b; +obj.a ||= b; diff --git a/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet/options.json b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet/options.json new file mode 100644 index 0000000000000..5041dbb19f815 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet/options.json @@ -0,0 +1,3 @@ +{ + "plugins": ["logicalAssignment"] +} diff --git a/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet/output.json b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet/output.json new file mode 100644 index 0000000000000..857dd9538eb58 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/logical-assignment-operator/mallet/output.json @@ -0,0 +1,197 @@ +{ + "type": "File", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 21, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ExpressionStatement", + "start": 0, + "end": 8, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 8 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 0, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 7 + } + }, + "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": "Identifier", + "start": 6, + "end": 7, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 7 + }, + "identifierName": "b" + }, + "name": "b" + } + } + }, + { + "type": "ExpressionStatement", + "start": 9, + "end": 21, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 12 + } + }, + "expression": { + "type": "AssignmentExpression", + "start": 9, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 11 + } + }, + "operator": "||=", + "left": { + "type": "MemberExpression", + "start": 9, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 5 + } + }, + "object": { + "type": "Identifier", + "start": 9, + "end": 12, + "loc": { + "start": { + "line": 2, + "column": 0 + }, + "end": { + "line": 2, + "column": 3 + }, + "identifierName": "obj" + }, + "name": "obj" + }, + "property": { + "type": "Identifier", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 2, + "column": 5 + }, + "identifierName": "a" + }, + "name": "a" + }, + "computed": false + }, + "right": { + "type": "Identifier", + "start": 19, + "end": 20, + "loc": { + "start": { + "line": 2, + "column": 10 + }, + "end": { + "line": 2, + "column": 11 + }, + "identifierName": "b" + }, + "name": "b" + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/experimental/optional-chaining/optional-super-property-class/input.js b/packages/babylon/test/fixtures/experimental/optional-chaining/optional-super-property-class/input.js new file mode 100644 index 0000000000000..7af8cadabc117 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/optional-chaining/optional-super-property-class/input.js @@ -0,0 +1,5 @@ +class A{ + b(){ + return super?.b; + } +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/experimental/optional-chaining/optional-super-property-class/options.json b/packages/babylon/test/fixtures/experimental/optional-chaining/optional-super-property-class/options.json new file mode 100644 index 0000000000000..0bbb2f11bae6e --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/optional-chaining/optional-super-property-class/options.json @@ -0,0 +1,4 @@ +{ + "plugins":["optionalChaining"], + "throws": "Unexpected token (3:20)" +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/experimental/optional-chaining/optional-super-property/input.js b/packages/babylon/test/fixtures/experimental/optional-chaining/optional-super-property/input.js new file mode 100644 index 0000000000000..dafc54712f081 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/optional-chaining/optional-super-property/input.js @@ -0,0 +1,5 @@ +const a = { + b(){ + return super?.c; + } +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/experimental/optional-chaining/optional-super-property/options.json b/packages/babylon/test/fixtures/experimental/optional-chaining/optional-super-property/options.json new file mode 100644 index 0000000000000..0bbb2f11bae6e --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/optional-chaining/optional-super-property/options.json @@ -0,0 +1,4 @@ +{ + "plugins":["optionalChaining"], + "throws": "Unexpected token (3:20)" +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/experimental/optional-chaining/super-method-class/input.js b/packages/babylon/test/fixtures/experimental/optional-chaining/super-method-class/input.js new file mode 100644 index 0000000000000..31dcb716ca789 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/optional-chaining/super-method-class/input.js @@ -0,0 +1,5 @@ +class A{ + constructor(){ + super()?.b; + } +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/experimental/optional-chaining/super-method-class/options.json b/packages/babylon/test/fixtures/experimental/optional-chaining/super-method-class/options.json new file mode 100644 index 0000000000000..1655838858132 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/optional-chaining/super-method-class/options.json @@ -0,0 +1,3 @@ +{ + "plugins":["optionalChaining"] +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/experimental/optional-chaining/super-method-class/output.json b/packages/babylon/test/fixtures/experimental/optional-chaining/super-method-class/output.json new file mode 100644 index 0000000000000..b6c5a510c4ad2 --- /dev/null +++ b/packages/babylon/test/fixtures/experimental/optional-chaining/super-method-class/output.json @@ -0,0 +1,221 @@ +{ + "type": "File", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 55, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "sourceType": "script", + "body": [ + { + "type": "ClassDeclaration", + "start": 0, + "end": 55, + "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": 55, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 5, + "column": 1 + } + }, + "body": [ + { + "type": "ClassMethod", + "start": 13, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 4 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 13, + "end": 24, + "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": [], + "body": { + "type": "BlockStatement", + "start": 26, + "end": 53, + "loc": { + "start": { + "line": 2, + "column": 17 + }, + "end": { + "line": 4, + "column": 5 + } + }, + "body": [ + { + "type": "ExpressionStatement", + "start": 36, + "end": 47, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 19 + } + }, + "expression": { + "type": "OptionalMemberExpression", + "start": 36, + "end": 46, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 18 + } + }, + "object": { + "type": "CallExpression", + "start": 36, + "end": 43, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 15 + } + }, + "callee": { + "type": "Super", + "start": 36, + "end": 41, + "loc": { + "start": { + "line": 3, + "column": 8 + }, + "end": { + "line": 3, + "column": 13 + } + } + }, + "arguments": [] + }, + "property": { + "type": "Identifier", + "start": 45, + "end": 46, + "loc": { + "start": { + "line": 3, + "column": 17 + }, + "end": { + "line": 3, + "column": 18 + }, + "identifierName": "b" + }, + "name": "b" + }, + "computed": false, + "optional": true + } + } + ], + "directives": [] + } + } + ] + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/flow/object-types/invalid-getter-param-count-rest/input.js b/packages/babylon/test/fixtures/flow/object-types/invalid-getter-param-count-rest/input.js new file mode 100644 index 0000000000000..a93bcb11c209c --- /dev/null +++ b/packages/babylon/test/fixtures/flow/object-types/invalid-getter-param-count-rest/input.js @@ -0,0 +1,3 @@ +type B = { + get a(...foo): number; +} diff --git a/packages/babylon/test/fixtures/flow/object-types/invalid-getter-param-count-rest/options.json b/packages/babylon/test/fixtures/flow/object-types/invalid-getter-param-count-rest/options.json new file mode 100644 index 0000000000000..65bc24a66fcdb --- /dev/null +++ b/packages/babylon/test/fixtures/flow/object-types/invalid-getter-param-count-rest/options.json @@ -0,0 +1,3 @@ +{ + "throws": "getter must not have any formal parameters (2:2)" +} diff --git a/packages/babylon/test/fixtures/flow/object-types/invalid-getter-param-count/options.json b/packages/babylon/test/fixtures/flow/object-types/invalid-getter-param-count/options.json index 8694117aee685..65bc24a66fcdb 100644 --- a/packages/babylon/test/fixtures/flow/object-types/invalid-getter-param-count/options.json +++ b/packages/babylon/test/fixtures/flow/object-types/invalid-getter-param-count/options.json @@ -1,3 +1,3 @@ { - "throws": "getter should have no params (2:2)" + "throws": "getter must not have any formal parameters (2:2)" } diff --git a/packages/babylon/test/fixtures/flow/object-types/invalid-setter-param-count/options.json b/packages/babylon/test/fixtures/flow/object-types/invalid-setter-param-count/options.json index 8ea95ab8887d0..6a15677822025 100644 --- a/packages/babylon/test/fixtures/flow/object-types/invalid-setter-param-count/options.json +++ b/packages/babylon/test/fixtures/flow/object-types/invalid-setter-param-count/options.json @@ -1,3 +1,3 @@ { - "throws": "setter should have exactly one param (2:2)" + "throws": "setter must have exactly one formal parameter (2:2)" } diff --git a/packages/babylon/test/fixtures/flow/object-types/invalid-setter-param-type/input.js b/packages/babylon/test/fixtures/flow/object-types/invalid-setter-param-type/input.js new file mode 100644 index 0000000000000..169d54941f64e --- /dev/null +++ b/packages/babylon/test/fixtures/flow/object-types/invalid-setter-param-type/input.js @@ -0,0 +1,3 @@ +type B = { + set a(...w): void; +} diff --git a/packages/babylon/test/fixtures/flow/object-types/invalid-setter-param-type/options.json b/packages/babylon/test/fixtures/flow/object-types/invalid-setter-param-type/options.json new file mode 100644 index 0000000000000..15ce6a4c5a51f --- /dev/null +++ b/packages/babylon/test/fixtures/flow/object-types/invalid-setter-param-type/options.json @@ -0,0 +1,3 @@ +{ + "throws": "setter function argument must not be a rest parameter (2:2)" +} diff --git a/packages/babylon/test/fixtures/typescript/class/properties/input.js b/packages/babylon/test/fixtures/typescript/class/properties/input.js index 8c0ad68965879..51413533ae042 100644 --- a/packages/babylon/test/fixtures/typescript/class/properties/input.js +++ b/packages/babylon/test/fixtures/typescript/class/properties/input.js @@ -3,4 +3,6 @@ class C { x?; x: number; x: number = 1; + x!; + x!: number; } diff --git a/packages/babylon/test/fixtures/typescript/class/properties/output.json b/packages/babylon/test/fixtures/typescript/class/properties/output.json index edbf544f70e6c..90e0d7df2267b 100644 --- a/packages/babylon/test/fixtures/typescript/class/properties/output.json +++ b/packages/babylon/test/fixtures/typescript/class/properties/output.json @@ -1,28 +1,28 @@ { "type": "File", "start": 0, - "end": 60, + "end": 84, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 6, + "line": 8, "column": 1 } }, "program": { "type": "Program", "start": 0, - "end": 60, + "end": 84, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 6, + "line": 8, "column": 1 } }, @@ -31,14 +31,14 @@ { "type": "ClassDeclaration", "start": 0, - "end": 60, + "end": 84, "loc": { "start": { "line": 1, "column": 0 }, "end": { - "line": 6, + "line": 8, "column": 1 } }, @@ -63,14 +63,14 @@ "body": { "type": "ClassBody", "start": 8, - "end": 60, + "end": 84, "loc": { "start": { "line": 1, "column": 8 }, "end": { - "line": 6, + "line": 8, "column": 1 } }, @@ -294,6 +294,108 @@ }, "value": 1 } + }, + { + "type": "ClassProperty", + "start": 63, + "end": 66, + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 7 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 63, + "end": 64, + "loc": { + "start": { + "line": 6, + "column": 4 + }, + "end": { + "line": 6, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "computed": false, + "definite": true, + "value": null + }, + { + "type": "ClassProperty", + "start": 71, + "end": 82, + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 15 + } + }, + "static": false, + "key": { + "type": "Identifier", + "start": 71, + "end": 72, + "loc": { + "start": { + "line": 7, + "column": 4 + }, + "end": { + "line": 7, + "column": 5 + }, + "identifierName": "x" + }, + "name": "x" + }, + "computed": false, + "definite": true, + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 73, + "end": 81, + "loc": { + "start": { + "line": 7, + "column": 6 + }, + "end": { + "line": 7, + "column": 14 + } + }, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start": 75, + "end": 81, + "loc": { + "start": { + "line": 7, + "column": 8 + }, + "end": { + "line": 7, + "column": 14 + } + } + } + }, + "value": null } ] } diff --git a/packages/babylon/test/fixtures/typescript/class/property-optional-definite-assignment-not-allowed/input.js b/packages/babylon/test/fixtures/typescript/class/property-optional-definite-assignment-not-allowed/input.js new file mode 100644 index 0000000000000..f649b70d9ca1d --- /dev/null +++ b/packages/babylon/test/fixtures/typescript/class/property-optional-definite-assignment-not-allowed/input.js @@ -0,0 +1,3 @@ +class C { + x?!: number; +} diff --git a/packages/babylon/test/fixtures/typescript/class/property-optional-definite-assignment-not-allowed/options.json b/packages/babylon/test/fixtures/typescript/class/property-optional-definite-assignment-not-allowed/options.json new file mode 100644 index 0000000000000..626e94c744f1e --- /dev/null +++ b/packages/babylon/test/fixtures/typescript/class/property-optional-definite-assignment-not-allowed/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Unexpected token, expected \";\" (2:4)" +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/typescript/types/conditional-infer/input.js b/packages/babylon/test/fixtures/typescript/types/conditional-infer/input.js new file mode 100644 index 0000000000000..fc9bc48546e6a --- /dev/null +++ b/packages/babylon/test/fixtures/typescript/types/conditional-infer/input.js @@ -0,0 +1 @@ +type Element = T extends (infer U)[] ? U : T; diff --git a/packages/babylon/test/fixtures/typescript/types/conditional-infer/output.json b/packages/babylon/test/fixtures/typescript/types/conditional-infer/output.json new file mode 100644 index 0000000000000..dd94232cb832f --- /dev/null +++ b/packages/babylon/test/fixtures/typescript/types/conditional-infer/output.json @@ -0,0 +1,271 @@ +{ + "type": "File", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "sourceType": "module", + "body": [ + { + "type": "TSTypeAliasDeclaration", + "start": 0, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "id": { + "type": "Identifier", + "start": 5, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 12 + }, + "identifierName": "Element" + }, + "name": "Element" + }, + "typeParameters": { + "type": "TSTypeParameterDeclaration", + "start": 12, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 12 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "params": [ + { + "type": "TSTypeParameter", + "start": 13, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "name": "T" + } + ] + }, + "typeAnnotation": { + "type": "TSConditionalType", + "start": 18, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "checkType": { + "type": "TSTypeReference", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "typeName": { + "type": "Identifier", + "start": 18, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 18 + }, + "end": { + "line": 1, + "column": 19 + }, + "identifierName": "T" + }, + "name": "T" + } + }, + "extendsType": { + "type": "TSArrayType", + "start": 28, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "elementType": { + "type": "TSParenthesizedType", + "start": 28, + "end": 37, + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 37 + } + }, + "typeAnnotation": { + "type": "TSInferType", + "start": 29, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "typeParameter": { + "type": "TypeParameter", + "start": 35, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 35 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "name": "U" + } + } + } + }, + "trueType": { + "type": "TSTypeReference", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + } + }, + "typeName": { + "type": "Identifier", + "start": 42, + "end": 43, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 43 + }, + "identifierName": "U" + }, + "name": "U" + } + }, + "falseType": { + "type": "TSTypeReference", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "typeName": { + "type": "Identifier", + "start": 46, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 46 + }, + "end": { + "line": 1, + "column": 47 + }, + "identifierName": "T" + }, + "name": "T" + } + } + } + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/typescript/types/conditional/input.js b/packages/babylon/test/fixtures/typescript/types/conditional/input.js new file mode 100644 index 0000000000000..c776486898189 --- /dev/null +++ b/packages/babylon/test/fixtures/typescript/types/conditional/input.js @@ -0,0 +1 @@ +let x: number extends string ? boolean : null; diff --git a/packages/babylon/test/fixtures/typescript/types/conditional/output.json b/packages/babylon/test/fixtures/typescript/types/conditional/output.json new file mode 100644 index 0000000000000..d9e73ef0a3649 --- /dev/null +++ b/packages/babylon/test/fixtures/typescript/types/conditional/output.json @@ -0,0 +1,175 @@ +{ + "type": "File", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "sourceType": "module", + "body": [ + { + "type": "VariableDeclaration", + "start": 0, + "end": 46, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 46 + } + }, + "declarations": [ + { + "type": "VariableDeclarator", + "start": 4, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "id": { + "type": "Identifier", + "start": 4, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 4 + }, + "end": { + "line": 1, + "column": 45 + }, + "identifierName": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 5, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "typeAnnotation": { + "type": "TSConditionalType", + "start": 7, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 45 + } + }, + "checkType": { + "type": "TSNumberKeyword", + "start": 7, + "end": 13, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 13 + } + } + }, + "extendsType": { + "type": "TSStringKeyword", + "start": 22, + "end": 28, + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 28 + } + } + }, + "trueType": { + "type": "TSBooleanKeyword", + "start": 31, + "end": 38, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 38 + } + } + }, + "falseType": { + "type": "TSNullKeyword", + "start": 41, + "end": 45, + "loc": { + "start": { + "line": 1, + "column": 41 + }, + "end": { + "line": 1, + "column": 45 + } + } + } + } + } + }, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/input.js b/packages/babylon/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/input.js new file mode 100644 index 0000000000000..e91abc1a9d92d --- /dev/null +++ b/packages/babylon/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/input.js @@ -0,0 +1 @@ +let {}! = {}; \ No newline at end of file diff --git a/packages/babylon/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/options.json b/packages/babylon/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/options.json new file mode 100644 index 0000000000000..8cb567ee77881 --- /dev/null +++ b/packages/babylon/test/fixtures/typescript/variable-declarator/definite-assignment-not-allowed/options.json @@ -0,0 +1,3 @@ +{ + "throws": "Complex binding patterns require an initialization value (1:6)" +} \ No newline at end of file diff --git a/packages/babylon/test/fixtures/typescript/variable-declarator/definite-assignment/input.js b/packages/babylon/test/fixtures/typescript/variable-declarator/definite-assignment/input.js new file mode 100644 index 0000000000000..f27135a2b9f0d --- /dev/null +++ b/packages/babylon/test/fixtures/typescript/variable-declarator/definite-assignment/input.js @@ -0,0 +1 @@ +let x!: number; diff --git a/packages/babylon/test/fixtures/typescript/variable-declarator/definite-assignment/output.json b/packages/babylon/test/fixtures/typescript/variable-declarator/definite-assignment/output.json new file mode 100644 index 0000000000000..d47c7ce44ba1e --- /dev/null +++ b/packages/babylon/test/fixtures/typescript/variable-declarator/definite-assignment/output.json @@ -0,0 +1,116 @@ +{ + "type": "File", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "program": { + "type": "Program", + "start": 0, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "sourceType": "module", + "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": "x" + }, + "name": "x", + "typeAnnotation": { + "type": "TSTypeAnnotation", + "start": 6, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 14 + } + }, + "typeAnnotation": { + "type": "TSNumberKeyword", + "start": 8, + "end": 14, + "loc": { + "start": { + "line": 1, + "column": 8 + }, + "end": { + "line": 1, + "column": 14 + } + } + } + } + }, + "definite": true, + "init": null + } + ], + "kind": "let" + } + ], + "directives": [] + } +} \ No newline at end of file diff --git a/scripts/_get-test-directories.sh b/scripts/_get-test-directories.sh deleted file mode 100755 index be33ede24e83c..0000000000000 --- a/scripts/_get-test-directories.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -set -e - -TEST_DIRS="" - -sources=("codemods" "packages") - -for source in "${sources[@]}"; do - for f in $source/*; do - if [ -n "$TEST_ONLY" ] && [[ `basename $f` != *"$TEST_ONLY"* ]]; then - continue - fi - # Exclude babel-standalone from coverage runs - if [ "$TEST_TYPE" = "cov" ] && [[ `basename $f` = 'babel-standalone' || `basename $f` = 'babel-preset-env-standalone' ]]; then - continue - fi - - if [ -d "$f/test" ]; then - TEST_DIRS="$f/test $TEST_DIRS" - fi - done -done - -echo $TEST_DIRS diff --git a/scripts/eslint_rules/no-deprecated-clone.js b/scripts/eslint_rules/no-deprecated-clone.js new file mode 100644 index 0000000000000..323e5ed2255c6 --- /dev/null +++ b/scripts/eslint_rules/no-deprecated-clone.js @@ -0,0 +1,265 @@ +// @flow + +"use strict"; + +function getVariableDefinition(name /*: string */, scope /*: 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)); +} + +/*:: +type ReferenceOriginImport = { kind: "import", source: string, name: string }; +type ReferenceOriginParam = { + kind: "export param", + exportName: string, + index: number, +}; + +type ReferenceOrigin = + | ReferenceOriginImport + | ReferenceOriginParam + | { kind: "import *", source: string } + | { + kind: "property", + base: ReferenceOriginImport | ReferenceOriginParam, + path: 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 /*: Node */, + scope /*: 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") { + const parent = defNode.parent; + let exportName /*: string */; + if (parent.type === "ExportDefaultDeclaration") { + exportName = "default"; + } else if (parent.type === "ExportNamedDeclaration") { + exportName = defNode.id.name; + } else 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" + ) { + exportName = "module.exports"; + } else { + return null; + } + return patternToProperty(definition.name, { + kind: "export param", + exportName, + index: definition.index, + }); + } + } + + if (node.type === "MemberExpression" && !node.computed) { + const origin = getReferenceOrigin(node.object, scope); + return origin && addProperty(origin, node.property.name); + } + + return null; +} + +function patternToProperty( + id /*: Node */, + base /*: ReferenceOrigin */ +) /*: ?ReferenceOrigin */ { + 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 /*: ReferenceOrigin */, + name /*: string */ +) /* ReferenceOrigin */ { + 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, + }; + } + return { + kind: "property", + base: origin, + path: name, + }; +} + +// if "node" is c of { a: { b: c } }, the result is ["a","b"] +function getPatternPath(node /*: Node */) /*: ?string[] */ { + 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; +} + +function reportError(context /*: Context */, node /*: Node */) { + const isMemberExpression = node.type === "MemberExpression"; + const id = isMemberExpression ? node.property : node; + context.report({ + node: id, + message: `t.${id.name}() is deprecated. Use t.cloneNode() instead.`, + fix(fixer) { + if (isMemberExpression) { + return fixer.replaceText(id, "cloneNode"); + } + }, + }); +} + +module.exports = { + meta: { + schema: [], + fixable: "code", + }, + create(context /*: Context */) { + return { + CallExpression(node /*: Node */) { + const origin = getReferenceOrigin(node.callee, context.getScope()); + + if (!origin) return; + + if ( + origin.kind === "import" && + (origin.name === "clone" || origin.name === "cloneDeep") && + origin.source === "@babel/types" + ) { + // imported from @babel/types + return reportError(context, node.callee); + } + + 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 reportError(context, node.callee); + } + + if ( + origin.kind === "property" && + (origin.path === "types.clone" || + origin.path === "types.cloneDeep") && + origin.base.kind === "export param" && + (origin.base.exportName === "default" || + origin.base.exportName === "module.exports") && + origin.base.index === 0 + ) { + // export default function ({ types: t }) {} + // module.exports = function ({ types: t }) {} + return reportError(context, node.callee); + } + }, + }; + }, +}; + +/*:: // ESLint types + +type Node = { type: string, [string]: any }; + +type Definition = { + type: "ImportedBinding", + name: Node, + node: Node, + parent: Node, +}; + +type Variable = { + defs: Definition[], +}; + +type Scope = { + set: Map, + upper: ?Scope, +}; + +type Context = { + report(options: { + node: Node, + message: string, + fix?: (fixer: Fixer) => ?Fixer, + }): void, + + getScope(): Scope, +}; + +type Fixer = { + replaceText(node: Node, replacement: string): Fixer, +}; +*/ diff --git a/scripts/gulp-tasks.js b/scripts/gulp-tasks.js index 47ca24303397f..972474f433645 100644 --- a/scripts/gulp-tasks.js +++ b/scripts/gulp-tasks.js @@ -131,10 +131,12 @@ function registerStandalonePackageTask( plugins, }), gulp.dest(standalonePath), - uglify(), + ].concat( + // Minification is super slow, so we skip it in CI. + process.env.CI ? [] : uglify(), rename({ extname: ".min.js" }), - gulp.dest(standalonePath), - ], + gulp.dest(standalonePath) + ), cb ); }); diff --git a/scripts/test-cov.sh b/scripts/test-cov.sh index 50f9f4f022c62..6914ef3fb0f96 100755 --- a/scripts/test-cov.sh +++ b/scripts/test-cov.sh @@ -1,6 +1,10 @@ #!/bin/bash set -e -testDirs=`TEST_TYPE=cov scripts/_get-test-directories.sh` -node_modules/.bin/nyc node_modules/mocha/bin/_mocha --opts test/mocha.opts $testDirs -node_modules/.bin/nyc report --reporter=json +jestArgs="--coverage" + +if [ -n "$CI" ]; then + jestArgs="${jestArgs} --maxWorkers=4 --ci" +fi + +node_modules/.bin/jest $jestArgs diff --git a/scripts/test.sh b/scripts/test.sh index 017e24c57227a..c5cb866956b77 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -1,14 +1,26 @@ #!/bin/bash set -e -if [ -z "$TEST_GREP" ]; then - TEST_GREP="" -fi - node="node" +jestArgs=() if [ "$TEST_DEBUG" ]; then - node="node --inspect --debug-brk" + node="node --inspect-brk" + jestArgs+=("--runInBand") +fi + +if [ -n "$CI" ]; then + jestArgs+=("--maxWorkers=4") + jestArgs+=("--ci") +fi + +if [ -n "$TEST_GREP" ]; then + jestArgs+=("-t") + jestArgs+=("$TEST_GREP") +fi + +if [ -n "$TEST_ONLY" ]; then + jestArgs+=("packages/.*$TEST_ONLY.*/test") fi -$node node_modules/mocha/bin/_mocha `scripts/_get-test-directories.sh` --opts test/mocha.opts --grep "$TEST_GREP" +$node node_modules/.bin/jest "${jestArgs[@]}" diff --git a/scripts/tests/test262/run_babylon_test262.js b/scripts/tests/test262/run_babylon_test262.js index 45f88d5916f78..9f4bd96bd634c 100644 --- a/scripts/tests/test262/run_babylon_test262.js +++ b/scripts/tests/test262/run_babylon_test262.js @@ -4,7 +4,7 @@ const path = require("path"); const chalk = require("chalk"); const utils = require("./run_babylon_test262_utils"); -const testDir = path.join(__dirname, "../../../build/test262/test"); +const testDir = path.join(__dirname, "../../../build/test262"); const whitelistFile = path.join(__dirname, "test262_whitelist.txt"); const plugins = ["asyncGenerators", "objectRestSpread", "optionalCatchBinding"]; const shouldUpdate = process.argv.indexOf("--update-whitelist") > -1; diff --git a/scripts/tests/test262/run_babylon_test262_utils.js b/scripts/tests/test262/run_babylon_test262_utils.js index 3b30125312747..2b7bbe35b1dcf 100644 --- a/scripts/tests/test262/run_babylon_test262_utils.js +++ b/scripts/tests/test262/run_babylon_test262_utils.js @@ -1,8 +1,8 @@ "use strict"; const fs = require("graceful-fs"); -const path = require("path"); -const promisify = require("util.promisify"); +const promisify = require("util").promisify; +const TestStream = require("test262-stream"); const pfs = { readFile: promisify(fs.readFile), writeFile: promisify(fs.writeFile), @@ -12,115 +12,35 @@ const pfs = { const parse = require("../../../packages/babylon").parse; -const modulePattern = /^\s*-\s*module\s*$|^\s*flags\s*:.*\bmodule\b/m; -const noStrictPattern = /^\s*-\s*noStrict\s*$|^\s*flags\s*:.*\bnoStrict\b/m; -const onlyStrictPattern = /^\s*-\s*onlyStrict\s*$|^\s*flags\s*:.*\bonlyStrict\b/m; -const rawPattern = /^\s*-\s*raw\s*$|^\s*flags\s*:.*\braw\b/m; -const testNamePattern = /^(?!.*_FIXTURE).*\.[jJ][sS]$/; - -function flatten(array) { - const flattened = []; - array.forEach(function(element) { - if (Array.isArray(element)) { - flattened.push.apply(flattened, element); - } else { - flattened.push(element); - } - }); - return flattened; -} - -function hasEarlyError(src) { - return !!( - src.match(/^\s*negative:\s*$/m) && src.match(/^\s+phase:\s*early\s*$/m) - ); -} - -function readDirDeep(dirName) { - return pfs.readdir(dirName).then(function(contents) { - return Promise.all( - contents.map(function(name) { - return findTests(path.join(dirName, name)); - }) - ).then(flatten); +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); + + tests.push({ + contents: test.contents, + fileName, + id: `${fileName}(${test.scenario})`, + sourceType: test.attrs.flags.module ? "module" : "script", + expectedError: + !!test.attrs.negative && + (test.attrs.negative.phase === "parse" || + test.attrs.negative.phase === "early"), + }); }); -} -function findTests(name) { - return pfs.stat(name).then(function(stat) { - if (stat.isDirectory()) { - return readDirDeep(name); - } - - return name; + return new Promise((resolve, reject) => { + stream.on("end", () => resolve(tests)); + stream.on("error", reject); }); -} - -function readTest(fileName, testDir) { - if (!testNamePattern.test(fileName)) { - return Promise.resolve([]); - } - - return pfs.readFile(fileName, "utf-8").then(function(contents) { - return makeScenarios(path.relative(testDir, fileName), contents); - }); -} - -function makeScenarios(fileName, testContent) { - const scenarios = []; - const base = { - fileName: fileName, - isModule: modulePattern.test(testContent), - expectedError: hasEarlyError(testContent), - }; - const isNoStrict = noStrictPattern.test(testContent); - const isOnlyStrict = onlyStrictPattern.test(testContent); - const isRaw = rawPattern.test(testContent); - - if (!isOnlyStrict) { - scenarios.push( - Object.assign( - { - id: fileName + "(default)", - content: testContent, - }, - base - ) - ); - } - - if (!isNoStrict && !isRaw) { - scenarios.push( - Object.assign( - { - id: fileName + "(strict mode)", - content: "'use strict';\n" + testContent, - }, - base - ) - ); - } - - return scenarios; -} - -exports.getTests = function(testDir) { - return findTests(testDir) - .then(function(testPaths) { - return Promise.all( - testPaths.map(function(path) { - return readTest(path, testDir); - }) - ); - }) - .then(flatten); }; exports.runTest = function(test, plugins) { - const sourceType = test.isModule ? "module" : "script"; - try { - parse(test.content, { sourceType: sourceType, plugins: plugins }); + parse(test.contents, { sourceType: test.sourceType, plugins: plugins }); test.actualError = false; } catch (err) { test.actualError = true; diff --git a/scripts/tests/test262/test262_whitelist.txt b/scripts/tests/test262/test262_whitelist.txt index 2f6696503cc40..e10be4e105c9c 100644 --- a/scripts/tests/test262/test262_whitelist.txt +++ b/scripts/tests/test262/test262_whitelist.txt @@ -1,1319 +1,297 @@ -# This file lists tests that are known to produce incorrect results when parsed -# with Babylon: -# -# - Tests that are expected to parse successfully but for which Babylon reports -# a syntax error -# - Tests that contain invalid syntax but for which Babylon reports no syntax -# error -# -# Entries should be removed incrementally as Babylon is improved. - -annexB/language/statements/for-in/bare-initializer.js(default) -annexB/language/statements/for-in/bare-initializer.js(strict mode) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/export/escaped-as-export-specifier.js(default) -language/export/escaped-as-export-specifier.js(strict mode) -language/export/escaped-from.js(default) -language/export/escaped-from.js(strict mode) -language/expressions/assignment/dstr-array-rest-before-elision.js(default) -language/expressions/assignment/dstr-array-rest-before-elision.js(strict mode) -language/expressions/assignment/dstr-array-rest-elision-invalid.js(default) -language/expressions/assignment/dstr-array-rest-elision-invalid.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/async-arrow-function/early-errors-arrow-formals-body-duplicate.js(default) -language/expressions/async-arrow-function/early-errors-arrow-formals-body-duplicate.js(strict mode) -language/expressions/async-arrow-function/escaped-async.js(default) -language/expressions/async-arrow-function/escaped-async.js(strict mode) -language/expressions/async-function/early-errors-expression-formals-body-duplicate.js(default) -language/expressions/async-function/early-errors-expression-formals-body-duplicate.js(strict mode) -language/expressions/async-function/escaped-async.js(default) -language/expressions/async-function/escaped-async.js(strict mode) -language/expressions/async-function/named-dflt-params-duplicates.js(default) -language/expressions/async-function/nameless-dflt-params-duplicates.js(default) -language/expressions/function/dflt-params-duplicates.js(default) -language/expressions/generators/dflt-params-duplicates.js(default) -language/expressions/new.target/escaped-target.js(default) -language/expressions/new.target/escaped-target.js(strict mode) -language/expressions/object/method-definition/async-meth-escaped-async.js(default) -language/expressions/object/method-definition/async-meth-escaped-async.js(strict mode) -language/expressions/object/method-definition/early-errors-object-method-async-lineterminator.js(default) -language/expressions/object/method-definition/early-errors-object-method-async-lineterminator.js(strict mode) -language/expressions/object/method-definition/early-errors-object-method-await-in-formals-default.js(default) -language/expressions/object/method-definition/early-errors-object-method-await-in-formals-default.js(strict mode) -language/expressions/object/method-definition/early-errors-object-method-await-in-formals.js(default) -language/expressions/object/method-definition/early-errors-object-method-await-in-formals.js(strict mode) -language/expressions/object/method-definition/early-errors-object-method-duplicate-parameters.js(default) -language/expressions/object/method-definition/escaped-get.js(default) -language/expressions/object/method-definition/escaped-get.js(strict mode) -language/expressions/object/method-definition/escaped-set.js(default) -language/expressions/object/method-definition/escaped-set.js(strict mode) -language/expressions/object/method-definition/gen-meth-dflt-params-duplicates.js(default) -language/expressions/object/method-definition/generator-param-redecl-const.js(default) -language/expressions/object/method-definition/generator-param-redecl-const.js(strict mode) -language/expressions/object/method-definition/generator-param-redecl-let.js(default) -language/expressions/object/method-definition/generator-param-redecl-let.js(strict mode) -language/expressions/object/method-definition/meth-dflt-params-duplicates.js(default) -language/expressions/object/method-definition/name-param-redecl.js(default) -language/expressions/object/method-definition/name-param-redecl.js(strict mode) -language/expressions/template-literal/invalid-legacy-octal-escape-sequence.js(default) -language/expressions/template-literal/invalid-legacy-octal-escape-sequence.js(strict mode) -language/expressions/yield/in-iteration-stmt.js(default) -language/expressions/yield/in-iteration-stmt.js(strict mode) -language/expressions/yield/star-in-iteration-stmt.js(default) -language/expressions/yield/star-in-iteration-stmt.js(strict mode) -language/global-code/new.target-arrow.js(default) -language/global-code/new.target-arrow.js(strict mode) -language/import/dup-bound-names.js(default) -language/import/dup-bound-names.js(strict mode) -language/import/escaped-as-import-specifier.js(default) -language/import/escaped-as-import-specifier.js(strict mode) -language/import/escaped-as-namespace-import.js(default) -language/import/escaped-as-namespace-import.js(strict mode) -language/import/escaped-from.js(default) -language/import/escaped-from.js(strict mode) -language/literals/regexp/early-err-dup-flag.js(default) -language/literals/regexp/early-err-dup-flag.js(strict mode) -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/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-quantifiable-assertion.js(default) -language/literals/regexp/u-invalid-quantifiable-assertion.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/string/legacy-non-octal-escape-sequence-strict.js(strict mode) -language/module-code/early-export-global.js(default) -language/module-code/early-export-global.js(strict mode) -language/module-code/early-export-unresolvable.js(default) -language/module-code/early-export-unresolvable.js(strict mode) -language/module-code/early-lex-and-var.js(default) -language/module-code/early-lex-and-var.js(strict mode) -language/module-code/instn-resolve-empty-export.js(default) -language/module-code/instn-resolve-empty-export.js(strict mode) -language/module-code/instn-resolve-empty-import.js(default) -language/module-code/instn-resolve-empty-import.js(strict mode) -language/module-code/instn-resolve-err-reference.js(default) -language/module-code/instn-resolve-err-reference.js(strict mode) -language/module-code/instn-resolve-err-syntax.js(default) -language/module-code/instn-resolve-err-syntax.js(strict mode) -language/module-code/instn-resolve-order-depth.js(default) -language/module-code/instn-resolve-order-depth.js(strict mode) -language/module-code/instn-resolve-order-src.js(default) -language/module-code/instn-resolve-order-src.js(strict mode) -language/module-code/parse-err-hoist-lex-fun.js(default) -language/module-code/parse-err-hoist-lex-fun.js(strict mode) -language/module-code/parse-err-hoist-lex-gen.js(default) -language/module-code/parse-err-hoist-lex-gen.js(strict mode) -language/statements/async-function/dflt-params-duplicates.js(default) -language/statements/async-function/early-errors-declaration-await-in-formals-default.js(default) -language/statements/async-function/early-errors-declaration-await-in-formals-default.js(strict mode) -language/statements/async-function/early-errors-declaration-await-in-formals.js(default) -language/statements/async-function/early-errors-declaration-await-in-formals.js(strict mode) -language/statements/async-function/early-errors-declaration-formals-body-duplicate.js(default) -language/statements/async-function/early-errors-declaration-formals-body-duplicate.js(strict mode) -language/statements/async-function/escaped-async.js(default) -language/statements/async-function/escaped-async.js(strict mode) -language/statements/class/async-meth-escaped-async.js(default) -language/statements/class/async-meth-escaped-async.js(strict mode) -language/statements/class/definition/early-errors-class-method-await-in-formals-default.js(default) -language/statements/class/definition/early-errors-class-method-await-in-formals-default.js(strict mode) -language/statements/class/definition/early-errors-class-method-await-in-formals.js(default) -language/statements/class/definition/early-errors-class-method-await-in-formals.js(strict mode) -language/statements/class/strict-mode/with.js(default) -language/statements/class/syntax/early-errors/class-body-has-direct-super-missing-class-heritage.js(default) -language/statements/class/syntax/early-errors/class-body-has-direct-super-missing-class-heritage.js(strict mode) -language/statements/class/syntax/early-errors/class-definition-evaluation-block-duplicate-binding.js(default) -language/statements/class/syntax/early-errors/class-definition-evaluation-block-duplicate-binding.js(strict mode) -language/statements/class/syntax/early-errors/class-definition-evaluation-scriptbody-duplicate-binding.js(default) -language/statements/class/syntax/early-errors/class-definition-evaluation-scriptbody-duplicate-binding.js(strict mode) -language/statements/class/syntax/escaped-static.js(default) -language/statements/class/syntax/escaped-static.js(strict mode) -language/statements/const/redeclaration-error-from-within-strict-mode-function-const.js(default) -language/statements/do-while/decl-async-fun.js(default) -language/statements/do-while/decl-async-fun.js(strict mode) -language/statements/do-while/labelled-fn-stmt.js(default) -language/statements/for/decl-async-fun.js(default) -language/statements/for/decl-async-fun.js(strict mode) -language/statements/for/head-let-bound-names-in-stmt.js(default) -language/statements/for/head-let-bound-names-in-stmt.js(strict mode) -language/statements/for/labelled-fn-stmt-expr.js(default) -language/statements/for/labelled-fn-stmt-let.js(default) -language/statements/for/labelled-fn-stmt-var.js(default) -language/statements/for-in/decl-async-fun.js(default) -language/statements/for-in/decl-async-fun.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-in/head-const-bound-names-dup.js(default) -language/statements/for-in/head-const-bound-names-dup.js(strict mode) -language/statements/for-in/head-const-bound-names-in-stmt.js(default) -language/statements/for-in/head-const-bound-names-in-stmt.js(strict mode) -language/statements/for-in/head-let-bound-names-dup.js(default) -language/statements/for-in/head-let-bound-names-dup.js(strict mode) -language/statements/for-in/head-let-bound-names-in-stmt.js(default) -language/statements/for-in/head-let-bound-names-in-stmt.js(strict mode) -language/statements/for-in/labelled-fn-stmt-const.js(default) -language/statements/for-in/labelled-fn-stmt-let.js(default) -language/statements/for-in/labelled-fn-stmt-lhs.js(default) -language/statements/for-in/labelled-fn-stmt-var.js(default) -language/statements/for-of/decl-async-fun.js(default) -language/statements/for-of/decl-async-fun.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) -language/statements/for-of/escaped-of.js(default) -language/statements/for-of/escaped-of.js(strict mode) -language/statements/for-of/head-const-bound-names-dup.js(default) -language/statements/for-of/head-const-bound-names-dup.js(strict mode) -language/statements/for-of/head-const-bound-names-in-stmt.js(default) -language/statements/for-of/head-const-bound-names-in-stmt.js(strict mode) -language/statements/for-of/head-decl-no-expr.js(default) -language/statements/for-of/head-decl-no-expr.js(strict mode) -language/statements/for-of/head-expr-no-expr.js(default) -language/statements/for-of/head-expr-no-expr.js(strict mode) -language/statements/for-of/head-let-bound-names-dup.js(default) -language/statements/for-of/head-let-bound-names-dup.js(strict mode) -language/statements/for-of/head-let-bound-names-in-stmt.js(default) -language/statements/for-of/head-let-bound-names-in-stmt.js(strict mode) -language/statements/for-of/head-var-no-expr.js(default) -language/statements/for-of/head-var-no-expr.js(strict mode) -language/statements/for-of/labelled-fn-stmt-const.js(default) -language/statements/for-of/labelled-fn-stmt-let.js(default) -language/statements/for-of/labelled-fn-stmt-lhs.js(default) -language/statements/for-of/labelled-fn-stmt-var.js(default) -language/statements/function/dflt-params-duplicates.js(default) -language/statements/generators/dflt-params-duplicates.js(default) -language/statements/if/if-async-fun-else-async-fun.js(default) -language/statements/if/if-async-fun-else-async-fun.js(strict mode) -language/statements/if/if-async-fun-else-stmt.js(default) -language/statements/if/if-async-fun-else-stmt.js(strict mode) -language/statements/if/if-async-fun-no-else.js(default) -language/statements/if/if-async-fun-no-else.js(strict mode) -language/statements/if/if-stmt-else-async-fun.js(default) -language/statements/if/if-stmt-else-async-fun.js(strict mode) -language/statements/if/labelled-fn-stmt-first.js(default) -language/statements/if/labelled-fn-stmt-lone.js(default) -language/statements/if/labelled-fn-stmt-second.js(default) -language/statements/let/redeclaration-error-from-within-strict-mode-function.js(default) -language/statements/let/syntax/attempt-to-redeclare-let-binding-with-function-declaration.js(default) -language/statements/let/syntax/attempt-to-redeclare-let-binding-with-function-declaration.js(strict mode) -language/statements/let/syntax/attempt-to-redeclare-let-binding-with-var.js(default) -language/statements/let/syntax/attempt-to-redeclare-let-binding-with-var.js(strict mode) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/statements/try/early-catch-lex.js(default) -language/statements/try/early-catch-lex.js(strict mode) -language/statements/try/early-catch-var.js(default) -language/statements/try/early-catch-var.js(strict mode) -language/statements/while/decl-async-fun.js(default) -language/statements/while/decl-async-fun.js(strict mode) -language/statements/while/labelled-fn-stmt.js(default) -language/statements/with/decl-async-fun.js(default) -language/statements/with/labelled-fn-stmt.js(default) -language/white-space/mongolian-vowel-separator.js(default) -language/white-space/mongolian-vowel-separator.js(strict mode) -annexB/language/function-code/if-decl-else-decl-a-func-block-scoping.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-existing-block-fn-no-init.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-existing-block-fn-update.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-existing-fn-no-init.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-existing-fn-update.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-existing-var-no-init.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-existing-var-update.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-init.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-no-skip-try.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-skip-dft-param.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-block.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for-in.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for-of.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-switch.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-try.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-skip-param.js(default) -annexB/language/function-code/if-decl-else-decl-a-func-update.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-block-scoping.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-existing-block-fn-no-init.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-existing-block-fn-update.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-existing-fn-no-init.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-existing-fn-update.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-existing-var-no-init.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-existing-var-update.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-init.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-no-skip-try.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-skip-dft-param.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-block.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-for-in.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-for-of.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-for.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-switch.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-try.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-skip-param.js(default) -annexB/language/function-code/if-decl-else-decl-b-func-update.js(default) -annexB/language/function-code/if-decl-else-stmt-func-block-scoping.js(default) -annexB/language/function-code/if-decl-else-stmt-func-existing-block-fn-no-init.js(default) -annexB/language/function-code/if-decl-else-stmt-func-existing-block-fn-update.js(default) -annexB/language/function-code/if-decl-else-stmt-func-existing-fn-no-init.js(default) -annexB/language/function-code/if-decl-else-stmt-func-existing-fn-update.js(default) -annexB/language/function-code/if-decl-else-stmt-func-existing-var-no-init.js(default) -annexB/language/function-code/if-decl-else-stmt-func-existing-var-update.js(default) -annexB/language/function-code/if-decl-else-stmt-func-init.js(default) -annexB/language/function-code/if-decl-else-stmt-func-no-skip-try.js(default) -annexB/language/function-code/if-decl-else-stmt-func-skip-dft-param.js(default) -annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-block.js(default) -annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-for-in.js(default) -annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-for-of.js(default) -annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-for.js(default) -annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-switch.js(default) -annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-try.js(default) -annexB/language/function-code/if-decl-else-stmt-func-skip-early-err.js(default) -annexB/language/function-code/if-decl-else-stmt-func-skip-param.js(default) -annexB/language/function-code/if-decl-else-stmt-func-update.js(default) -annexB/language/function-code/if-decl-no-else-func-block-scoping.js(default) -annexB/language/function-code/if-decl-no-else-func-existing-block-fn-no-init.js(default) -annexB/language/function-code/if-decl-no-else-func-existing-block-fn-update.js(default) -annexB/language/function-code/if-decl-no-else-func-existing-fn-no-init.js(default) -annexB/language/function-code/if-decl-no-else-func-existing-fn-update.js(default) -annexB/language/function-code/if-decl-no-else-func-existing-var-no-init.js(default) -annexB/language/function-code/if-decl-no-else-func-existing-var-update.js(default) -annexB/language/function-code/if-decl-no-else-func-init.js(default) -annexB/language/function-code/if-decl-no-else-func-no-skip-try.js(default) -annexB/language/function-code/if-decl-no-else-func-skip-dft-param.js(default) -annexB/language/function-code/if-decl-no-else-func-skip-early-err-block.js(default) -annexB/language/function-code/if-decl-no-else-func-skip-early-err-for-in.js(default) -annexB/language/function-code/if-decl-no-else-func-skip-early-err-for-of.js(default) -annexB/language/function-code/if-decl-no-else-func-skip-early-err-for.js(default) -annexB/language/function-code/if-decl-no-else-func-skip-early-err-switch.js(default) -annexB/language/function-code/if-decl-no-else-func-skip-early-err-try.js(default) -annexB/language/function-code/if-decl-no-else-func-skip-early-err.js(default) -annexB/language/function-code/if-decl-no-else-func-skip-param.js(default) -annexB/language/function-code/if-decl-no-else-func-update.js(default) -annexB/language/function-code/if-stmt-else-decl-func-block-scoping.js(default) -annexB/language/function-code/if-stmt-else-decl-func-existing-block-fn-no-init.js(default) -annexB/language/function-code/if-stmt-else-decl-func-existing-block-fn-update.js(default) -annexB/language/function-code/if-stmt-else-decl-func-existing-fn-no-init.js(default) -annexB/language/function-code/if-stmt-else-decl-func-existing-fn-update.js(default) -annexB/language/function-code/if-stmt-else-decl-func-existing-var-no-init.js(default) -annexB/language/function-code/if-stmt-else-decl-func-existing-var-update.js(default) -annexB/language/function-code/if-stmt-else-decl-func-init.js(default) -annexB/language/function-code/if-stmt-else-decl-func-no-skip-try.js(default) -annexB/language/function-code/if-stmt-else-decl-func-skip-dft-param.js(default) -annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-block.js(default) -annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-for-in.js(default) -annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-for-of.js(default) -annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-for.js(default) -annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-switch.js(default) -annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-try.js(default) -annexB/language/function-code/if-stmt-else-decl-func-skip-early-err.js(default) -annexB/language/function-code/if-stmt-else-decl-func-skip-param.js(default) -annexB/language/function-code/if-stmt-else-decl-func-update.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-block-scoping.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-existing-block-fn-no-init.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-existing-block-fn-update.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-existing-fn-no-init.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-existing-fn-update.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-existing-var-no-init.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-existing-var-update.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-init.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-no-skip-try.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-block.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for-in.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for-of.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-switch.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-try.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err.js(default) -annexB/language/global-code/if-decl-else-decl-a-global-update.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-block-scoping.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-existing-block-fn-no-init.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-existing-block-fn-update.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-existing-fn-no-init.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-existing-fn-update.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-existing-var-no-init.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-existing-var-update.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-init.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-no-skip-try.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-block.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for-in.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for-of.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-switch.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-try.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err.js(default) -annexB/language/global-code/if-decl-else-decl-b-global-update.js(default) -annexB/language/global-code/if-decl-else-stmt-global-block-scoping.js(default) -annexB/language/global-code/if-decl-else-stmt-global-existing-block-fn-no-init.js(default) -annexB/language/global-code/if-decl-else-stmt-global-existing-block-fn-update.js(default) -annexB/language/global-code/if-decl-else-stmt-global-existing-fn-no-init.js(default) -annexB/language/global-code/if-decl-else-stmt-global-existing-fn-update.js(default) -annexB/language/global-code/if-decl-else-stmt-global-existing-var-no-init.js(default) -annexB/language/global-code/if-decl-else-stmt-global-existing-var-update.js(default) -annexB/language/global-code/if-decl-else-stmt-global-init.js(default) -annexB/language/global-code/if-decl-else-stmt-global-no-skip-try.js(default) -annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-block.js(default) -annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for-in.js(default) -annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for-of.js(default) -annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for.js(default) -annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-switch.js(default) -annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-try.js(default) -annexB/language/global-code/if-decl-else-stmt-global-skip-early-err.js(default) -annexB/language/global-code/if-decl-else-stmt-global-update.js(default) -annexB/language/global-code/if-decl-no-else-global-block-scoping.js(default) -annexB/language/global-code/if-decl-no-else-global-existing-block-fn-no-init.js(default) -annexB/language/global-code/if-decl-no-else-global-existing-block-fn-update.js(default) -annexB/language/global-code/if-decl-no-else-global-existing-fn-no-init.js(default) -annexB/language/global-code/if-decl-no-else-global-existing-fn-update.js(default) -annexB/language/global-code/if-decl-no-else-global-existing-var-no-init.js(default) -annexB/language/global-code/if-decl-no-else-global-existing-var-update.js(default) -annexB/language/global-code/if-decl-no-else-global-init.js(default) -annexB/language/global-code/if-decl-no-else-global-no-skip-try.js(default) -annexB/language/global-code/if-decl-no-else-global-skip-early-err-block.js(default) -annexB/language/global-code/if-decl-no-else-global-skip-early-err-for-in.js(default) -annexB/language/global-code/if-decl-no-else-global-skip-early-err-for-of.js(default) -annexB/language/global-code/if-decl-no-else-global-skip-early-err-for.js(default) -annexB/language/global-code/if-decl-no-else-global-skip-early-err-switch.js(default) -annexB/language/global-code/if-decl-no-else-global-skip-early-err-try.js(default) -annexB/language/global-code/if-decl-no-else-global-skip-early-err.js(default) -annexB/language/global-code/if-decl-no-else-global-update.js(default) -annexB/language/global-code/if-stmt-else-decl-global-block-scoping.js(default) -annexB/language/global-code/if-stmt-else-decl-global-existing-block-fn-no-init.js(default) -annexB/language/global-code/if-stmt-else-decl-global-existing-block-fn-update.js(default) -annexB/language/global-code/if-stmt-else-decl-global-existing-fn-no-init.js(default) -annexB/language/global-code/if-stmt-else-decl-global-existing-fn-update.js(default) -annexB/language/global-code/if-stmt-else-decl-global-existing-var-no-init.js(default) -annexB/language/global-code/if-stmt-else-decl-global-existing-var-update.js(default) -annexB/language/global-code/if-stmt-else-decl-global-init.js(default) -annexB/language/global-code/if-stmt-else-decl-global-no-skip-try.js(default) -annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-block.js(default) -annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for-in.js(default) -annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for-of.js(default) -annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for.js(default) -annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-switch.js(default) -annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-try.js(default) -annexB/language/global-code/if-stmt-else-decl-global-skip-early-err.js(default) -annexB/language/global-code/if-stmt-else-decl-global-update.js(default) -annexB/language/statements/for-in/nonstrict-initializer.js(default) -built-ins/Function/prototype/toString/intrinsics.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-obj-id-identifier-yield-ident-valid.js(default) - -language/expressions/object/let-non-strict-access.js(default) -language/expressions/object/let-non-strict-syntax.js(default) -language/expressions/object/yield-non-strict-access.js(default) -language/expressions/object/yield-non-strict-syntax.js(default) -language/statements/for/head-lhs-let.js(default) -language/statements/for/let-block-with-newline.js(default) -language/statements/for/let-identifier-with-newline.js(default) -language/statements/for-await-of/let-block-with-newline.js(default) -language/statements/for-await-of/let-identifier-with-newline.js(default) -language/statements/for-in/head-lhs-let.js(default) -language/statements/for-in/head-var-bound-names-let.js(default) -language/statements/for-in/let-block-with-newline.js(default) -language/statements/for-in/let-identifier-with-newline.js(default) -language/statements/for-of/dstr-obj-id-identifier-yield-ident-valid.js(default) -language/statements/for-of/head-var-bound-names-let.js(default) -language/statements/for-of/let-block-with-newline.js(default) -language/statements/for-of/let-identifier-with-newline.js(default) -language/statements/if/let-block-with-newline.js(default) -language/statements/if/let-identifier-with-newline.js(default) -language/statements/labeled/let-block-with-newline.js(default) -language/statements/labeled/value-yield-non-strict.js(default) -language/statements/while/let-block-with-newline.js(default) -language/statements/while/let-identifier-with-newline.js(default) -language/statements/with/let-block-with-newline.js(default) -language/statements/with/let-identifier-with-newline.js(default) - -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/expressions/async-generator/dflt-params-duplicates.js(default) -language/expressions/async-generator/early-errors-expression-await-as-function-binding-identifier.js(default) -language/expressions/async-generator/early-errors-expression-await-as-function-binding-identifier.js(strict mode) -language/expressions/async-generator/early-errors-expression-formals-body-duplicate-const.js(default) -language/expressions/async-generator/early-errors-expression-formals-body-duplicate-const.js(strict mode) -language/expressions/async-generator/early-errors-expression-formals-body-duplicate-let.js(default) -language/expressions/async-generator/early-errors-expression-formals-body-duplicate-let.js(strict mode) -language/expressions/async-generator/early-errors-expression-formals-contains-await.js(default) -language/expressions/async-generator/early-errors-expression-formals-contains-await.js(strict mode) -language/expressions/async-generator/escaped-async.js(default) -language/expressions/async-generator/escaped-async.js(strict mode) -language/expressions/async-generator/named-dflt-params-duplicates.js(default) -language/expressions/object/method-definition/async-gen-meth-dflt-params-duplicates.js(default) -language/expressions/object/method-definition/async-gen-meth-escaped-async.js(default) -language/expressions/object/method-definition/async-gen-meth-escaped-async.js(strict mode) -language/expressions/object/method-definition/async-meth-dflt-params-duplicates.js(default) -language/statements/async-generator/dflt-params-duplicates.js(default) -language/statements/async-generator/escaped-async.js(default) -language/statements/async-generator/escaped-async.js(strict mode) -language/statements/class/async-gen-meth-escaped-async.js(default) -language/statements/class/async-gen-meth-escaped-async.js(strict mode) -language/statements/do-while/decl-async-gen.js(default) -language/statements/do-while/decl-async-gen.js(strict mode) -language/statements/for/decl-async-gen.js(default) -language/statements/for/decl-async-gen.js(strict mode) -language/statements/for-await-of/escaped-of.js(default) -language/statements/for-await-of/escaped-of.js(strict mode) -language/statements/for-in/decl-async-gen.js(default) -language/statements/for-in/decl-async-gen.js(strict mode) -language/statements/for-of/decl-async-gen.js(default) -language/statements/for-of/decl-async-gen.js(strict mode) -language/statements/if/if-async-gen-else-async-gen.js(default) -language/statements/if/if-async-gen-else-async-gen.js(strict mode) -language/statements/if/if-async-gen-else-stmt.js(default) -language/statements/if/if-async-gen-else-stmt.js(strict mode) -language/statements/if/if-async-gen-no-else.js(default) -language/statements/if/if-async-gen-no-else.js(strict mode) -language/statements/if/if-stmt-else-async-gen.js(default) -language/statements/if/if-stmt-else-async-gen.js(strict mode) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-const-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-let-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js(default) -language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) -language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) -language/statements/while/decl-async-gen.js(default) -language/statements/while/decl-async-gen.js(strict mode) -language/statements/with/decl-async-gen.js(default) - -language/expressions/class/fields-after-same-line-gen-computed-names.js(default) -language/expressions/class/fields-after-same-line-gen-computed-names.js(strict mode) -language/expressions/class/fields-after-same-line-gen-computed-symbol-names.js(default) -language/expressions/class/fields-after-same-line-gen-computed-symbol-names.js(strict mode) -language/expressions/class/fields-after-same-line-gen-literal-names.js(default) -language/expressions/class/fields-after-same-line-gen-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-gen-static-computed-names.js(default) -language/expressions/class/fields-after-same-line-gen-static-computed-names.js(strict mode) -language/expressions/class/fields-after-same-line-gen-static-computed-symbol-names.js(default) -language/expressions/class/fields-after-same-line-gen-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-after-same-line-gen-static-literal-names.js(default) -language/expressions/class/fields-after-same-line-gen-static-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-gen-string-literal-names.js(default) -language/expressions/class/fields-after-same-line-gen-string-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-method-computed-names.js(default) -language/expressions/class/fields-after-same-line-method-computed-names.js(strict mode) -language/expressions/class/fields-after-same-line-method-computed-symbol-names.js(default) -language/expressions/class/fields-after-same-line-method-computed-symbol-names.js(strict mode) -language/expressions/class/fields-after-same-line-method-literal-names.js(default) -language/expressions/class/fields-after-same-line-method-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-method-static-computed-names.js(default) -language/expressions/class/fields-after-same-line-method-static-computed-names.js(strict mode) -language/expressions/class/fields-after-same-line-method-static-computed-symbol-names.js(default) -language/expressions/class/fields-after-same-line-method-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-after-same-line-method-static-literal-names.js(default) -language/expressions/class/fields-after-same-line-method-static-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-method-string-literal-names.js(default) -language/expressions/class/fields-after-same-line-method-string-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js(default) -language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js(default) -language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js(default) -language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-gen-static-computed-names.js(default) -language/expressions/class/fields-after-same-line-static-async-gen-static-computed-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js(default) -language/expressions/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-gen-static-literal-names.js(default) -language/expressions/class/fields-after-same-line-static-async-gen-static-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js(default) -language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-method-computed-names.js(default) -language/expressions/class/fields-after-same-line-static-async-method-computed-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js(default) -language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-method-literal-names.js(default) -language/expressions/class/fields-after-same-line-static-async-method-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-method-static-computed-names.js(default) -language/expressions/class/fields-after-same-line-static-async-method-static-computed-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js(default) -language/expressions/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-method-static-literal-names.js(default) -language/expressions/class/fields-after-same-line-static-async-method-static-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js(default) -language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-gen-computed-names.js(default) -language/expressions/class/fields-after-same-line-static-gen-computed-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-gen-computed-symbol-names.js(default) -language/expressions/class/fields-after-same-line-static-gen-computed-symbol-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-gen-literal-names.js(default) -language/expressions/class/fields-after-same-line-static-gen-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-gen-static-computed-names.js(default) -language/expressions/class/fields-after-same-line-static-gen-static-computed-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-gen-static-computed-symbol-names.js(default) -language/expressions/class/fields-after-same-line-static-gen-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-gen-static-literal-names.js(default) -language/expressions/class/fields-after-same-line-static-gen-static-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-gen-string-literal-names.js(default) -language/expressions/class/fields-after-same-line-static-gen-string-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-method-computed-names.js(default) -language/expressions/class/fields-after-same-line-static-method-computed-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-method-computed-symbol-names.js(default) -language/expressions/class/fields-after-same-line-static-method-computed-symbol-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-method-literal-names.js(default) -language/expressions/class/fields-after-same-line-static-method-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-method-static-computed-names.js(default) -language/expressions/class/fields-after-same-line-static-method-static-computed-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-method-static-computed-symbol-names.js(default) -language/expressions/class/fields-after-same-line-static-method-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-method-static-literal-names.js(default) -language/expressions/class/fields-after-same-line-static-method-static-literal-names.js(strict mode) -language/expressions/class/fields-after-same-line-static-method-string-literal-names.js(default) -language/expressions/class/fields-after-same-line-static-method-string-literal-names.js(strict mode) -language/expressions/class/fields-multiple-definitions-computed-names.js(default) -language/expressions/class/fields-multiple-definitions-computed-names.js(strict mode) -language/expressions/class/fields-multiple-definitions-computed-symbol-names.js(default) -language/expressions/class/fields-multiple-definitions-computed-symbol-names.js(strict mode) -language/expressions/class/fields-multiple-definitions-literal-names.js(default) -language/expressions/class/fields-multiple-definitions-literal-names.js(strict mode) -language/expressions/class/fields-multiple-definitions-static-computed-names.js(default) -language/expressions/class/fields-multiple-definitions-static-computed-names.js(strict mode) -language/expressions/class/fields-multiple-definitions-static-computed-symbol-names.js(default) -language/expressions/class/fields-multiple-definitions-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-multiple-definitions-static-literal-names.js(default) -language/expressions/class/fields-multiple-definitions-static-literal-names.js(strict mode) -language/expressions/class/fields-multiple-definitions-string-literal-names.js(default) -language/expressions/class/fields-multiple-definitions-string-literal-names.js(strict mode) -language/expressions/class/fields-multiple-stacked-definitions-computed-names.js(default) -language/expressions/class/fields-multiple-stacked-definitions-computed-names.js(strict mode) -language/expressions/class/fields-multiple-stacked-definitions-computed-symbol-names.js(default) -language/expressions/class/fields-multiple-stacked-definitions-computed-symbol-names.js(strict mode) -language/expressions/class/fields-multiple-stacked-definitions-literal-names.js(default) -language/expressions/class/fields-multiple-stacked-definitions-literal-names.js(strict mode) -language/expressions/class/fields-multiple-stacked-definitions-static-computed-names.js(default) -language/expressions/class/fields-multiple-stacked-definitions-static-computed-names.js(strict mode) -language/expressions/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js(default) -language/expressions/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-multiple-stacked-definitions-static-literal-names.js(default) -language/expressions/class/fields-multiple-stacked-definitions-static-literal-names.js(strict mode) -language/expressions/class/fields-multiple-stacked-definitions-string-literal-names.js(default) -language/expressions/class/fields-multiple-stacked-definitions-string-literal-names.js(strict mode) -language/expressions/class/fields-new-no-sc-line-method-computed-names.js(default) -language/expressions/class/fields-new-no-sc-line-method-computed-names.js(strict mode) -language/expressions/class/fields-new-no-sc-line-method-computed-symbol-names.js(default) -language/expressions/class/fields-new-no-sc-line-method-computed-symbol-names.js(strict mode) -language/expressions/class/fields-new-no-sc-line-method-literal-names.js(default) -language/expressions/class/fields-new-no-sc-line-method-literal-names.js(strict mode) -language/expressions/class/fields-new-no-sc-line-method-static-computed-names.js(default) -language/expressions/class/fields-new-no-sc-line-method-static-computed-names.js(strict mode) -language/expressions/class/fields-new-no-sc-line-method-static-computed-symbol-names.js(default) -language/expressions/class/fields-new-no-sc-line-method-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-new-no-sc-line-method-static-literal-names.js(default) -language/expressions/class/fields-new-no-sc-line-method-static-literal-names.js(strict mode) -language/expressions/class/fields-new-no-sc-line-method-string-literal-names.js(default) -language/expressions/class/fields-new-no-sc-line-method-string-literal-names.js(strict mode) -language/expressions/class/fields-new-sc-line-gen-computed-names.js(default) -language/expressions/class/fields-new-sc-line-gen-computed-names.js(strict mode) -language/expressions/class/fields-new-sc-line-gen-computed-symbol-names.js(default) -language/expressions/class/fields-new-sc-line-gen-computed-symbol-names.js(strict mode) -language/expressions/class/fields-new-sc-line-gen-literal-names.js(default) -language/expressions/class/fields-new-sc-line-gen-literal-names.js(strict mode) -language/expressions/class/fields-new-sc-line-gen-static-computed-names.js(default) -language/expressions/class/fields-new-sc-line-gen-static-computed-names.js(strict mode) -language/expressions/class/fields-new-sc-line-gen-static-computed-symbol-names.js(default) -language/expressions/class/fields-new-sc-line-gen-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-new-sc-line-gen-static-literal-names.js(default) -language/expressions/class/fields-new-sc-line-gen-static-literal-names.js(strict mode) -language/expressions/class/fields-new-sc-line-gen-string-literal-names.js(default) -language/expressions/class/fields-new-sc-line-gen-string-literal-names.js(strict mode) -language/expressions/class/fields-new-sc-line-method-computed-names.js(default) -language/expressions/class/fields-new-sc-line-method-computed-names.js(strict mode) -language/expressions/class/fields-new-sc-line-method-computed-symbol-names.js(default) -language/expressions/class/fields-new-sc-line-method-computed-symbol-names.js(strict mode) -language/expressions/class/fields-new-sc-line-method-literal-names.js(default) -language/expressions/class/fields-new-sc-line-method-literal-names.js(strict mode) -language/expressions/class/fields-new-sc-line-method-static-computed-names.js(default) -language/expressions/class/fields-new-sc-line-method-static-computed-names.js(strict mode) -language/expressions/class/fields-new-sc-line-method-static-computed-symbol-names.js(default) -language/expressions/class/fields-new-sc-line-method-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-new-sc-line-method-static-literal-names.js(default) -language/expressions/class/fields-new-sc-line-method-static-literal-names.js(strict mode) -language/expressions/class/fields-new-sc-line-method-string-literal-names.js(default) -language/expressions/class/fields-new-sc-line-method-string-literal-names.js(strict mode) -language/expressions/class/fields-regular-definitions-computed-names.js(default) -language/expressions/class/fields-regular-definitions-computed-names.js(strict mode) -language/expressions/class/fields-regular-definitions-computed-symbol-names.js(default) -language/expressions/class/fields-regular-definitions-computed-symbol-names.js(strict mode) -language/expressions/class/fields-regular-definitions-literal-names.js(default) -language/expressions/class/fields-regular-definitions-literal-names.js(strict mode) -language/expressions/class/fields-regular-definitions-static-computed-names.js(default) -language/expressions/class/fields-regular-definitions-static-computed-names.js(strict mode) -language/expressions/class/fields-regular-definitions-static-computed-symbol-names.js(default) -language/expressions/class/fields-regular-definitions-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-regular-definitions-static-literal-names.js(default) -language/expressions/class/fields-regular-definitions-static-literal-names.js(strict mode) -language/expressions/class/fields-regular-definitions-string-literal-names.js(default) -language/expressions/class/fields-regular-definitions-string-literal-names.js(strict mode) -language/expressions/class/fields-same-line-async-gen-computed-names.js(default) -language/expressions/class/fields-same-line-async-gen-computed-names.js(strict mode) -language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js(default) -language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js(strict mode) -language/expressions/class/fields-same-line-async-gen-literal-names.js(default) -language/expressions/class/fields-same-line-async-gen-literal-names.js(strict mode) -language/expressions/class/fields-same-line-async-gen-static-computed-names.js(default) -language/expressions/class/fields-same-line-async-gen-static-computed-names.js(strict mode) -language/expressions/class/fields-same-line-async-gen-static-computed-symbol-names.js(default) -language/expressions/class/fields-same-line-async-gen-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-same-line-async-gen-static-literal-names.js(default) -language/expressions/class/fields-same-line-async-gen-static-literal-names.js(strict mode) -language/expressions/class/fields-same-line-async-gen-string-literal-names.js(default) -language/expressions/class/fields-same-line-async-gen-string-literal-names.js(strict mode) -language/expressions/class/fields-same-line-async-method-computed-names.js(default) -language/expressions/class/fields-same-line-async-method-computed-names.js(strict mode) -language/expressions/class/fields-same-line-async-method-computed-symbol-names.js(default) -language/expressions/class/fields-same-line-async-method-computed-symbol-names.js(strict mode) -language/expressions/class/fields-same-line-async-method-literal-names.js(default) -language/expressions/class/fields-same-line-async-method-literal-names.js(strict mode) -language/expressions/class/fields-same-line-async-method-static-computed-names.js(default) -language/expressions/class/fields-same-line-async-method-static-computed-names.js(strict mode) -language/expressions/class/fields-same-line-async-method-static-computed-symbol-names.js(default) -language/expressions/class/fields-same-line-async-method-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-same-line-async-method-static-literal-names.js(default) -language/expressions/class/fields-same-line-async-method-static-literal-names.js(strict mode) -language/expressions/class/fields-same-line-async-method-string-literal-names.js(default) -language/expressions/class/fields-same-line-async-method-string-literal-names.js(strict mode) -language/expressions/class/fields-same-line-gen-computed-names.js(default) -language/expressions/class/fields-same-line-gen-computed-names.js(strict mode) -language/expressions/class/fields-same-line-gen-computed-symbol-names.js(default) -language/expressions/class/fields-same-line-gen-computed-symbol-names.js(strict mode) -language/expressions/class/fields-same-line-gen-literal-names.js(default) -language/expressions/class/fields-same-line-gen-literal-names.js(strict mode) -language/expressions/class/fields-same-line-gen-static-computed-names.js(default) -language/expressions/class/fields-same-line-gen-static-computed-names.js(strict mode) -language/expressions/class/fields-same-line-gen-static-computed-symbol-names.js(default) -language/expressions/class/fields-same-line-gen-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-same-line-gen-static-literal-names.js(default) -language/expressions/class/fields-same-line-gen-static-literal-names.js(strict mode) -language/expressions/class/fields-same-line-gen-string-literal-names.js(default) -language/expressions/class/fields-same-line-gen-string-literal-names.js(strict mode) -language/expressions/class/fields-same-line-method-computed-names.js(default) -language/expressions/class/fields-same-line-method-computed-names.js(strict mode) -language/expressions/class/fields-same-line-method-computed-symbol-names.js(default) -language/expressions/class/fields-same-line-method-computed-symbol-names.js(strict mode) -language/expressions/class/fields-same-line-method-literal-names.js(default) -language/expressions/class/fields-same-line-method-literal-names.js(strict mode) -language/expressions/class/fields-same-line-method-static-computed-names.js(default) -language/expressions/class/fields-same-line-method-static-computed-names.js(strict mode) -language/expressions/class/fields-same-line-method-static-computed-symbol-names.js(default) -language/expressions/class/fields-same-line-method-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-same-line-method-static-literal-names.js(default) -language/expressions/class/fields-same-line-method-static-literal-names.js(strict mode) -language/expressions/class/fields-same-line-method-string-literal-names.js(default) -language/expressions/class/fields-same-line-method-string-literal-names.js(strict mode) -language/expressions/class/fields-wrapped-in-sc-computed-names.js(default) -language/expressions/class/fields-wrapped-in-sc-computed-names.js(strict mode) -language/expressions/class/fields-wrapped-in-sc-computed-symbol-names.js(default) -language/expressions/class/fields-wrapped-in-sc-computed-symbol-names.js(strict mode) -language/expressions/class/fields-wrapped-in-sc-literal-names.js(default) -language/expressions/class/fields-wrapped-in-sc-literal-names.js(strict mode) -language/expressions/class/fields-wrapped-in-sc-static-computed-names.js(default) -language/expressions/class/fields-wrapped-in-sc-static-computed-names.js(strict mode) -language/expressions/class/fields-wrapped-in-sc-static-computed-symbol-names.js(default) -language/expressions/class/fields-wrapped-in-sc-static-computed-symbol-names.js(strict mode) -language/expressions/class/fields-wrapped-in-sc-static-literal-names.js(default) -language/expressions/class/fields-wrapped-in-sc-static-literal-names.js(strict mode) -language/expressions/class/fields-wrapped-in-sc-string-literal-names.js(default) -language/expressions/class/fields-wrapped-in-sc-string-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-gen-computed-names.js(default) -language/statements/class/fields-after-same-line-gen-computed-names.js(strict mode) -language/statements/class/fields-after-same-line-gen-computed-symbol-names.js(default) -language/statements/class/fields-after-same-line-gen-computed-symbol-names.js(strict mode) -language/statements/class/fields-after-same-line-gen-literal-names.js(default) -language/statements/class/fields-after-same-line-gen-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-gen-static-computed-names.js(default) -language/statements/class/fields-after-same-line-gen-static-computed-names.js(strict mode) -language/statements/class/fields-after-same-line-gen-static-computed-symbol-names.js(default) -language/statements/class/fields-after-same-line-gen-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-after-same-line-gen-static-literal-names.js(default) -language/statements/class/fields-after-same-line-gen-static-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-gen-string-literal-names.js(default) -language/statements/class/fields-after-same-line-gen-string-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-method-computed-names.js(default) -language/statements/class/fields-after-same-line-method-computed-names.js(strict mode) -language/statements/class/fields-after-same-line-method-computed-symbol-names.js(default) -language/statements/class/fields-after-same-line-method-computed-symbol-names.js(strict mode) -language/statements/class/fields-after-same-line-method-literal-names.js(default) -language/statements/class/fields-after-same-line-method-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-method-static-computed-names.js(default) -language/statements/class/fields-after-same-line-method-static-computed-names.js(strict mode) -language/statements/class/fields-after-same-line-method-static-computed-symbol-names.js(default) -language/statements/class/fields-after-same-line-method-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-after-same-line-method-static-literal-names.js(default) -language/statements/class/fields-after-same-line-method-static-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-method-string-literal-names.js(default) -language/statements/class/fields-after-same-line-method-string-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-gen-computed-names.js(default) -language/statements/class/fields-after-same-line-static-async-gen-computed-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js(default) -language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-gen-literal-names.js(default) -language/statements/class/fields-after-same-line-static-async-gen-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-gen-static-computed-names.js(default) -language/statements/class/fields-after-same-line-static-async-gen-static-computed-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js(default) -language/statements/class/fields-after-same-line-static-async-gen-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-gen-static-literal-names.js(default) -language/statements/class/fields-after-same-line-static-async-gen-static-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js(default) -language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-method-computed-names.js(default) -language/statements/class/fields-after-same-line-static-async-method-computed-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js(default) -language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-method-literal-names.js(default) -language/statements/class/fields-after-same-line-static-async-method-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-method-static-computed-names.js(default) -language/statements/class/fields-after-same-line-static-async-method-static-computed-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js(default) -language/statements/class/fields-after-same-line-static-async-method-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-method-static-literal-names.js(default) -language/statements/class/fields-after-same-line-static-async-method-static-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js(default) -language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-static-gen-computed-names.js(default) -language/statements/class/fields-after-same-line-static-gen-computed-names.js(strict mode) -language/statements/class/fields-after-same-line-static-gen-computed-symbol-names.js(default) -language/statements/class/fields-after-same-line-static-gen-computed-symbol-names.js(strict mode) -language/statements/class/fields-after-same-line-static-gen-literal-names.js(default) -language/statements/class/fields-after-same-line-static-gen-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-static-gen-static-computed-names.js(default) -language/statements/class/fields-after-same-line-static-gen-static-computed-names.js(strict mode) -language/statements/class/fields-after-same-line-static-gen-static-computed-symbol-names.js(default) -language/statements/class/fields-after-same-line-static-gen-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-after-same-line-static-gen-static-literal-names.js(default) -language/statements/class/fields-after-same-line-static-gen-static-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-static-gen-string-literal-names.js(default) -language/statements/class/fields-after-same-line-static-gen-string-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-static-method-computed-names.js(default) -language/statements/class/fields-after-same-line-static-method-computed-names.js(strict mode) -language/statements/class/fields-after-same-line-static-method-computed-symbol-names.js(default) -language/statements/class/fields-after-same-line-static-method-computed-symbol-names.js(strict mode) -language/statements/class/fields-after-same-line-static-method-literal-names.js(default) -language/statements/class/fields-after-same-line-static-method-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-static-method-static-computed-names.js(default) -language/statements/class/fields-after-same-line-static-method-static-computed-names.js(strict mode) -language/statements/class/fields-after-same-line-static-method-static-computed-symbol-names.js(default) -language/statements/class/fields-after-same-line-static-method-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-after-same-line-static-method-static-literal-names.js(default) -language/statements/class/fields-after-same-line-static-method-static-literal-names.js(strict mode) -language/statements/class/fields-after-same-line-static-method-string-literal-names.js(default) -language/statements/class/fields-after-same-line-static-method-string-literal-names.js(strict mode) -language/statements/class/fields-multiple-definitions-computed-names.js(default) -language/statements/class/fields-multiple-definitions-computed-names.js(strict mode) -language/statements/class/fields-multiple-definitions-computed-symbol-names.js(default) -language/statements/class/fields-multiple-definitions-computed-symbol-names.js(strict mode) -language/statements/class/fields-multiple-definitions-literal-names.js(default) -language/statements/class/fields-multiple-definitions-literal-names.js(strict mode) -language/statements/class/fields-multiple-definitions-static-computed-names.js(default) -language/statements/class/fields-multiple-definitions-static-computed-names.js(strict mode) -language/statements/class/fields-multiple-definitions-static-computed-symbol-names.js(default) -language/statements/class/fields-multiple-definitions-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-multiple-definitions-static-literal-names.js(default) -language/statements/class/fields-multiple-definitions-static-literal-names.js(strict mode) -language/statements/class/fields-multiple-definitions-string-literal-names.js(default) -language/statements/class/fields-multiple-definitions-string-literal-names.js(strict mode) -language/statements/class/fields-multiple-stacked-definitions-computed-names.js(default) -language/statements/class/fields-multiple-stacked-definitions-computed-names.js(strict mode) -language/statements/class/fields-multiple-stacked-definitions-computed-symbol-names.js(default) -language/statements/class/fields-multiple-stacked-definitions-computed-symbol-names.js(strict mode) -language/statements/class/fields-multiple-stacked-definitions-literal-names.js(default) -language/statements/class/fields-multiple-stacked-definitions-literal-names.js(strict mode) -language/statements/class/fields-multiple-stacked-definitions-static-computed-names.js(default) -language/statements/class/fields-multiple-stacked-definitions-static-computed-names.js(strict mode) -language/statements/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js(default) -language/statements/class/fields-multiple-stacked-definitions-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-multiple-stacked-definitions-static-literal-names.js(default) -language/statements/class/fields-multiple-stacked-definitions-static-literal-names.js(strict mode) -language/statements/class/fields-multiple-stacked-definitions-string-literal-names.js(default) -language/statements/class/fields-multiple-stacked-definitions-string-literal-names.js(strict mode) -language/statements/class/fields-new-no-sc-line-method-computed-names.js(default) -language/statements/class/fields-new-no-sc-line-method-computed-names.js(strict mode) -language/statements/class/fields-new-no-sc-line-method-computed-symbol-names.js(default) -language/statements/class/fields-new-no-sc-line-method-computed-symbol-names.js(strict mode) -language/statements/class/fields-new-no-sc-line-method-literal-names.js(default) -language/statements/class/fields-new-no-sc-line-method-literal-names.js(strict mode) -language/statements/class/fields-new-no-sc-line-method-static-computed-names.js(default) -language/statements/class/fields-new-no-sc-line-method-static-computed-names.js(strict mode) -language/statements/class/fields-new-no-sc-line-method-static-computed-symbol-names.js(default) -language/statements/class/fields-new-no-sc-line-method-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-new-no-sc-line-method-static-literal-names.js(default) -language/statements/class/fields-new-no-sc-line-method-static-literal-names.js(strict mode) -language/statements/class/fields-new-no-sc-line-method-string-literal-names.js(default) -language/statements/class/fields-new-no-sc-line-method-string-literal-names.js(strict mode) -language/statements/class/fields-new-sc-line-gen-computed-names.js(default) -language/statements/class/fields-new-sc-line-gen-computed-names.js(strict mode) -language/statements/class/fields-new-sc-line-gen-computed-symbol-names.js(default) -language/statements/class/fields-new-sc-line-gen-computed-symbol-names.js(strict mode) -language/statements/class/fields-new-sc-line-gen-literal-names.js(default) -language/statements/class/fields-new-sc-line-gen-literal-names.js(strict mode) -language/statements/class/fields-new-sc-line-gen-static-computed-names.js(default) -language/statements/class/fields-new-sc-line-gen-static-computed-names.js(strict mode) -language/statements/class/fields-new-sc-line-gen-static-computed-symbol-names.js(default) -language/statements/class/fields-new-sc-line-gen-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-new-sc-line-gen-static-literal-names.js(default) -language/statements/class/fields-new-sc-line-gen-static-literal-names.js(strict mode) -language/statements/class/fields-new-sc-line-gen-string-literal-names.js(default) -language/statements/class/fields-new-sc-line-gen-string-literal-names.js(strict mode) -language/statements/class/fields-new-sc-line-method-computed-names.js(default) -language/statements/class/fields-new-sc-line-method-computed-names.js(strict mode) -language/statements/class/fields-new-sc-line-method-computed-symbol-names.js(default) -language/statements/class/fields-new-sc-line-method-computed-symbol-names.js(strict mode) -language/statements/class/fields-new-sc-line-method-literal-names.js(default) -language/statements/class/fields-new-sc-line-method-literal-names.js(strict mode) -language/statements/class/fields-new-sc-line-method-static-computed-names.js(default) -language/statements/class/fields-new-sc-line-method-static-computed-names.js(strict mode) -language/statements/class/fields-new-sc-line-method-static-computed-symbol-names.js(default) -language/statements/class/fields-new-sc-line-method-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-new-sc-line-method-static-literal-names.js(default) -language/statements/class/fields-new-sc-line-method-static-literal-names.js(strict mode) -language/statements/class/fields-new-sc-line-method-string-literal-names.js(default) -language/statements/class/fields-new-sc-line-method-string-literal-names.js(strict mode) -language/statements/class/fields-regular-definitions-computed-names.js(default) -language/statements/class/fields-regular-definitions-computed-names.js(strict mode) -language/statements/class/fields-regular-definitions-computed-symbol-names.js(default) -language/statements/class/fields-regular-definitions-computed-symbol-names.js(strict mode) -language/statements/class/fields-regular-definitions-literal-names.js(default) -language/statements/class/fields-regular-definitions-literal-names.js(strict mode) -language/statements/class/fields-regular-definitions-static-computed-names.js(default) -language/statements/class/fields-regular-definitions-static-computed-names.js(strict mode) -language/statements/class/fields-regular-definitions-static-computed-symbol-names.js(default) -language/statements/class/fields-regular-definitions-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-regular-definitions-static-literal-names.js(default) -language/statements/class/fields-regular-definitions-static-literal-names.js(strict mode) -language/statements/class/fields-regular-definitions-string-literal-names.js(default) -language/statements/class/fields-regular-definitions-string-literal-names.js(strict mode) -language/statements/class/fields-same-line-async-gen-computed-names.js(default) -language/statements/class/fields-same-line-async-gen-computed-names.js(strict mode) -language/statements/class/fields-same-line-async-gen-computed-symbol-names.js(default) -language/statements/class/fields-same-line-async-gen-computed-symbol-names.js(strict mode) -language/statements/class/fields-same-line-async-gen-literal-names.js(default) -language/statements/class/fields-same-line-async-gen-literal-names.js(strict mode) -language/statements/class/fields-same-line-async-gen-static-computed-names.js(default) -language/statements/class/fields-same-line-async-gen-static-computed-names.js(strict mode) -language/statements/class/fields-same-line-async-gen-static-computed-symbol-names.js(default) -language/statements/class/fields-same-line-async-gen-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-same-line-async-gen-static-literal-names.js(default) -language/statements/class/fields-same-line-async-gen-static-literal-names.js(strict mode) -language/statements/class/fields-same-line-async-gen-string-literal-names.js(default) -language/statements/class/fields-same-line-async-gen-string-literal-names.js(strict mode) -language/statements/class/fields-same-line-async-method-computed-names.js(default) -language/statements/class/fields-same-line-async-method-computed-names.js(strict mode) -language/statements/class/fields-same-line-async-method-computed-symbol-names.js(default) -language/statements/class/fields-same-line-async-method-computed-symbol-names.js(strict mode) -language/statements/class/fields-same-line-async-method-literal-names.js(default) -language/statements/class/fields-same-line-async-method-literal-names.js(strict mode) -language/statements/class/fields-same-line-async-method-static-computed-names.js(default) -language/statements/class/fields-same-line-async-method-static-computed-names.js(strict mode) -language/statements/class/fields-same-line-async-method-static-computed-symbol-names.js(default) -language/statements/class/fields-same-line-async-method-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-same-line-async-method-static-literal-names.js(default) -language/statements/class/fields-same-line-async-method-static-literal-names.js(strict mode) -language/statements/class/fields-same-line-async-method-string-literal-names.js(default) -language/statements/class/fields-same-line-async-method-string-literal-names.js(strict mode) -language/statements/class/fields-same-line-gen-computed-names.js(default) -language/statements/class/fields-same-line-gen-computed-names.js(strict mode) -language/statements/class/fields-same-line-gen-computed-symbol-names.js(default) -language/statements/class/fields-same-line-gen-computed-symbol-names.js(strict mode) -language/statements/class/fields-same-line-gen-literal-names.js(default) -language/statements/class/fields-same-line-gen-literal-names.js(strict mode) -language/statements/class/fields-same-line-gen-static-computed-names.js(default) -language/statements/class/fields-same-line-gen-static-computed-names.js(strict mode) -language/statements/class/fields-same-line-gen-static-computed-symbol-names.js(default) -language/statements/class/fields-same-line-gen-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-same-line-gen-static-literal-names.js(default) -language/statements/class/fields-same-line-gen-static-literal-names.js(strict mode) -language/statements/class/fields-same-line-gen-string-literal-names.js(default) -language/statements/class/fields-same-line-gen-string-literal-names.js(strict mode) -language/statements/class/fields-same-line-method-computed-names.js(default) -language/statements/class/fields-same-line-method-computed-names.js(strict mode) -language/statements/class/fields-same-line-method-computed-symbol-names.js(default) -language/statements/class/fields-same-line-method-computed-symbol-names.js(strict mode) -language/statements/class/fields-same-line-method-literal-names.js(default) -language/statements/class/fields-same-line-method-literal-names.js(strict mode) -language/statements/class/fields-same-line-method-static-computed-names.js(default) -language/statements/class/fields-same-line-method-static-computed-names.js(strict mode) -language/statements/class/fields-same-line-method-static-computed-symbol-names.js(default) -language/statements/class/fields-same-line-method-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-same-line-method-static-literal-names.js(default) -language/statements/class/fields-same-line-method-static-literal-names.js(strict mode) -language/statements/class/fields-same-line-method-string-literal-names.js(default) -language/statements/class/fields-same-line-method-string-literal-names.js(strict mode) -language/statements/class/fields-wrapped-in-sc-computed-names.js(default) -language/statements/class/fields-wrapped-in-sc-computed-names.js(strict mode) -language/statements/class/fields-wrapped-in-sc-computed-symbol-names.js(default) -language/statements/class/fields-wrapped-in-sc-computed-symbol-names.js(strict mode) -language/statements/class/fields-wrapped-in-sc-literal-names.js(default) -language/statements/class/fields-wrapped-in-sc-literal-names.js(strict mode) -language/statements/class/fields-wrapped-in-sc-static-computed-names.js(default) -language/statements/class/fields-wrapped-in-sc-static-computed-names.js(strict mode) -language/statements/class/fields-wrapped-in-sc-static-computed-symbol-names.js(default) -language/statements/class/fields-wrapped-in-sc-static-computed-symbol-names.js(strict mode) -language/statements/class/fields-wrapped-in-sc-static-literal-names.js(default) -language/statements/class/fields-wrapped-in-sc-static-literal-names.js(strict mode) -language/statements/class/fields-wrapped-in-sc-string-literal-names.js(default) -language/statements/class/fields-wrapped-in-sc-string-literal-names.js(strict mode) - -language/statements/labeled/let-identifier-with-newline.js(default) -language/statements/labeled/value-yield-non-strict-escaped.js(default) -language/statements/let/syntax/escaped-let.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-block-scoping.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-existing-block-fn-no-init.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-existing-block-fn-update.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-existing-fn-no-init.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-existing-fn-update.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-existing-var-no-init.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-existing-var-update.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-init.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-no-skip-try.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-skip-dft-param.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-block.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for-in.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for-of.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-switch.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-try.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-skip-param.js(default) +annexB/language/function-code/if-decl-else-decl-a-func-update.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-block-scoping.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-existing-block-fn-no-init.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-existing-block-fn-update.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-existing-fn-no-init.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-existing-fn-update.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-existing-var-no-init.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-existing-var-update.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-init.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-no-skip-try.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-skip-dft-param.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-block.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-for-in.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-for-of.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-for.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-switch.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-try.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-skip-param.js(default) +annexB/language/function-code/if-decl-else-decl-b-func-update.js(default) +annexB/language/function-code/if-decl-else-stmt-func-block-scoping.js(default) +annexB/language/function-code/if-decl-else-stmt-func-existing-block-fn-no-init.js(default) +annexB/language/function-code/if-decl-else-stmt-func-existing-block-fn-update.js(default) +annexB/language/function-code/if-decl-else-stmt-func-existing-fn-no-init.js(default) +annexB/language/function-code/if-decl-else-stmt-func-existing-fn-update.js(default) +annexB/language/function-code/if-decl-else-stmt-func-existing-var-no-init.js(default) +annexB/language/function-code/if-decl-else-stmt-func-existing-var-update.js(default) +annexB/language/function-code/if-decl-else-stmt-func-init.js(default) +annexB/language/function-code/if-decl-else-stmt-func-no-skip-try.js(default) +annexB/language/function-code/if-decl-else-stmt-func-skip-dft-param.js(default) +annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-block.js(default) +annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-for-in.js(default) +annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-for-of.js(default) +annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-for.js(default) +annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-switch.js(default) +annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-try.js(default) +annexB/language/function-code/if-decl-else-stmt-func-skip-early-err.js(default) +annexB/language/function-code/if-decl-else-stmt-func-skip-param.js(default) +annexB/language/function-code/if-decl-else-stmt-func-update.js(default) +annexB/language/function-code/if-decl-no-else-func-block-scoping.js(default) +annexB/language/function-code/if-decl-no-else-func-existing-block-fn-no-init.js(default) +annexB/language/function-code/if-decl-no-else-func-existing-block-fn-update.js(default) +annexB/language/function-code/if-decl-no-else-func-existing-fn-no-init.js(default) +annexB/language/function-code/if-decl-no-else-func-existing-fn-update.js(default) +annexB/language/function-code/if-decl-no-else-func-existing-var-no-init.js(default) +annexB/language/function-code/if-decl-no-else-func-existing-var-update.js(default) +annexB/language/function-code/if-decl-no-else-func-init.js(default) +annexB/language/function-code/if-decl-no-else-func-no-skip-try.js(default) +annexB/language/function-code/if-decl-no-else-func-skip-dft-param.js(default) +annexB/language/function-code/if-decl-no-else-func-skip-early-err-block.js(default) +annexB/language/function-code/if-decl-no-else-func-skip-early-err-for-in.js(default) +annexB/language/function-code/if-decl-no-else-func-skip-early-err-for-of.js(default) +annexB/language/function-code/if-decl-no-else-func-skip-early-err-for.js(default) +annexB/language/function-code/if-decl-no-else-func-skip-early-err-switch.js(default) +annexB/language/function-code/if-decl-no-else-func-skip-early-err-try.js(default) +annexB/language/function-code/if-decl-no-else-func-skip-early-err.js(default) +annexB/language/function-code/if-decl-no-else-func-skip-param.js(default) +annexB/language/function-code/if-decl-no-else-func-update.js(default) +annexB/language/function-code/if-stmt-else-decl-func-block-scoping.js(default) +annexB/language/function-code/if-stmt-else-decl-func-existing-block-fn-no-init.js(default) +annexB/language/function-code/if-stmt-else-decl-func-existing-block-fn-update.js(default) +annexB/language/function-code/if-stmt-else-decl-func-existing-fn-no-init.js(default) +annexB/language/function-code/if-stmt-else-decl-func-existing-fn-update.js(default) +annexB/language/function-code/if-stmt-else-decl-func-existing-var-no-init.js(default) +annexB/language/function-code/if-stmt-else-decl-func-existing-var-update.js(default) +annexB/language/function-code/if-stmt-else-decl-func-init.js(default) +annexB/language/function-code/if-stmt-else-decl-func-no-skip-try.js(default) +annexB/language/function-code/if-stmt-else-decl-func-skip-dft-param.js(default) +annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-block.js(default) +annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-for-in.js(default) +annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-for-of.js(default) +annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-for.js(default) +annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-switch.js(default) +annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-try.js(default) +annexB/language/function-code/if-stmt-else-decl-func-skip-early-err.js(default) +annexB/language/function-code/if-stmt-else-decl-func-skip-param.js(default) +annexB/language/function-code/if-stmt-else-decl-func-update.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-block-scoping.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-existing-block-fn-no-init.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-existing-block-fn-update.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-existing-fn-no-init.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-existing-fn-update.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-existing-var-no-init.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-existing-var-update.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-init.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-no-skip-try.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-block.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for-in.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for-of.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-switch.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-try.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err.js(default) +annexB/language/global-code/if-decl-else-decl-a-global-update.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-block-scoping.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-existing-block-fn-no-init.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-existing-block-fn-update.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-existing-fn-no-init.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-existing-fn-update.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-existing-var-no-init.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-existing-var-update.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-init.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-no-skip-try.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-block.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for-in.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for-of.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-switch.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-try.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err.js(default) +annexB/language/global-code/if-decl-else-decl-b-global-update.js(default) +annexB/language/global-code/if-decl-else-stmt-global-block-scoping.js(default) +annexB/language/global-code/if-decl-else-stmt-global-existing-block-fn-no-init.js(default) +annexB/language/global-code/if-decl-else-stmt-global-existing-block-fn-update.js(default) +annexB/language/global-code/if-decl-else-stmt-global-existing-fn-no-init.js(default) +annexB/language/global-code/if-decl-else-stmt-global-existing-fn-update.js(default) +annexB/language/global-code/if-decl-else-stmt-global-existing-var-no-init.js(default) +annexB/language/global-code/if-decl-else-stmt-global-existing-var-update.js(default) +annexB/language/global-code/if-decl-else-stmt-global-init.js(default) +annexB/language/global-code/if-decl-else-stmt-global-no-skip-try.js(default) +annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-block.js(default) +annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for-in.js(default) +annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for-of.js(default) +annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for.js(default) +annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-switch.js(default) +annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-try.js(default) +annexB/language/global-code/if-decl-else-stmt-global-skip-early-err.js(default) +annexB/language/global-code/if-decl-else-stmt-global-update.js(default) +annexB/language/global-code/if-decl-no-else-global-block-scoping.js(default) +annexB/language/global-code/if-decl-no-else-global-existing-block-fn-no-init.js(default) +annexB/language/global-code/if-decl-no-else-global-existing-block-fn-update.js(default) +annexB/language/global-code/if-decl-no-else-global-existing-fn-no-init.js(default) +annexB/language/global-code/if-decl-no-else-global-existing-fn-update.js(default) +annexB/language/global-code/if-decl-no-else-global-existing-var-no-init.js(default) +annexB/language/global-code/if-decl-no-else-global-existing-var-update.js(default) +annexB/language/global-code/if-decl-no-else-global-init.js(default) +annexB/language/global-code/if-decl-no-else-global-no-skip-try.js(default) +annexB/language/global-code/if-decl-no-else-global-skip-early-err-block.js(default) +annexB/language/global-code/if-decl-no-else-global-skip-early-err-for-in.js(default) +annexB/language/global-code/if-decl-no-else-global-skip-early-err-for-of.js(default) +annexB/language/global-code/if-decl-no-else-global-skip-early-err-for.js(default) +annexB/language/global-code/if-decl-no-else-global-skip-early-err-switch.js(default) +annexB/language/global-code/if-decl-no-else-global-skip-early-err-try.js(default) +annexB/language/global-code/if-decl-no-else-global-skip-early-err.js(default) +annexB/language/global-code/if-decl-no-else-global-update.js(default) +annexB/language/global-code/if-stmt-else-decl-global-block-scoping.js(default) +annexB/language/global-code/if-stmt-else-decl-global-existing-block-fn-no-init.js(default) +annexB/language/global-code/if-stmt-else-decl-global-existing-block-fn-update.js(default) +annexB/language/global-code/if-stmt-else-decl-global-existing-fn-no-init.js(default) +annexB/language/global-code/if-stmt-else-decl-global-existing-fn-update.js(default) +annexB/language/global-code/if-stmt-else-decl-global-existing-var-no-init.js(default) +annexB/language/global-code/if-stmt-else-decl-global-existing-var-update.js(default) +annexB/language/global-code/if-stmt-else-decl-global-init.js(default) +annexB/language/global-code/if-stmt-else-decl-global-no-skip-try.js(default) +annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-block.js(default) +annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for-in.js(default) +annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for-of.js(default) +annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for.js(default) +annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-switch.js(default) +annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-try.js(default) +annexB/language/global-code/if-stmt-else-decl-global-skip-early-err.js(default) +annexB/language/global-code/if-stmt-else-decl-global-update.js(default) built-ins/BigInt/asIntN/arithmetic.js(default) built-ins/BigInt/asIntN/arithmetic.js(strict mode) +built-ins/BigInt/asIntN/bigint-tobigint-toprimitive.js(default) +built-ins/BigInt/asIntN/bigint-tobigint-toprimitive.js(strict mode) +built-ins/BigInt/asIntN/bigint-tobigint-wrapped-values.js(default) +built-ins/BigInt/asIntN/bigint-tobigint-wrapped-values.js(strict mode) built-ins/BigInt/asIntN/bigint-tobigint.js(default) built-ins/BigInt/asIntN/bigint-tobigint.js(strict mode) +built-ins/BigInt/asIntN/bits-toindex-errors.js(default) +built-ins/BigInt/asIntN/bits-toindex-errors.js(strict mode) +built-ins/BigInt/asIntN/bits-toindex-toprimitive.js(default) +built-ins/BigInt/asIntN/bits-toindex-toprimitive.js(strict mode) +built-ins/BigInt/asIntN/bits-toindex-wrapped-values.js(default) +built-ins/BigInt/asIntN/bits-toindex-wrapped-values.js(strict mode) built-ins/BigInt/asIntN/bits-toindex.js(default) built-ins/BigInt/asIntN/bits-toindex.js(strict mode) built-ins/BigInt/asIntN/order-of-steps.js(default) built-ins/BigInt/asIntN/order-of-steps.js(strict mode) built-ins/BigInt/asUintN/arithmetic.js(default) built-ins/BigInt/asUintN/arithmetic.js(strict mode) +built-ins/BigInt/asUintN/bigint-tobigint-toprimitive.js(default) +built-ins/BigInt/asUintN/bigint-tobigint-toprimitive.js(strict mode) +built-ins/BigInt/asUintN/bigint-tobigint-wrapped-values.js(default) +built-ins/BigInt/asUintN/bigint-tobigint-wrapped-values.js(strict mode) built-ins/BigInt/asUintN/bigint-tobigint.js(default) built-ins/BigInt/asUintN/bigint-tobigint.js(strict mode) +built-ins/BigInt/asUintN/bits-toindex-errors.js(default) +built-ins/BigInt/asUintN/bits-toindex-errors.js(strict mode) +built-ins/BigInt/asUintN/bits-toindex-toprimitive.js(default) +built-ins/BigInt/asUintN/bits-toindex-toprimitive.js(strict mode) +built-ins/BigInt/asUintN/bits-toindex-wrapped-values.js(default) +built-ins/BigInt/asUintN/bits-toindex-wrapped-values.js(strict mode) built-ins/BigInt/asUintN/bits-toindex.js(default) built-ins/BigInt/asUintN/bits-toindex.js(strict mode) built-ins/BigInt/asUintN/order-of-steps.js(default) built-ins/BigInt/asUintN/order-of-steps.js(strict mode) -built-ins/BigInt/new-target-throws.js(default) -built-ins/BigInt/new-target-throws.js(strict mode) -built-ins/BigInt/parseInt/all-decimal-digits.js(default) -built-ins/BigInt/parseInt/all-decimal-digits.js(strict mode) -built-ins/BigInt/parseInt/arg-number.js(default) -built-ins/BigInt/parseInt/arg-number.js(strict mode) -built-ins/BigInt/parseInt/arg-primitive-coercion.js(default) -built-ins/BigInt/parseInt/arg-primitive-coercion.js(strict mode) -built-ins/BigInt/parseInt/arg-string-obj.js(default) -built-ins/BigInt/parseInt/arg-string-obj.js(strict mode) -built-ins/BigInt/parseInt/binary-negative.js(default) -built-ins/BigInt/parseInt/binary-negative.js(strict mode) -built-ins/BigInt/parseInt/binary.js(default) -built-ins/BigInt/parseInt/binary.js(strict mode) -built-ins/BigInt/parseInt/decimal-negative.js(default) -built-ins/BigInt/parseInt/decimal-negative.js(strict mode) -built-ins/BigInt/parseInt/hex-prefix-lc.js(default) -built-ins/BigInt/parseInt/hex-prefix-lc.js(strict mode) -built-ins/BigInt/parseInt/hex-prefix-uc.js(default) -built-ins/BigInt/parseInt/hex-prefix-uc.js(strict mode) -built-ins/BigInt/parseInt/hex.js(default) -built-ins/BigInt/parseInt/hex.js(strict mode) -built-ins/BigInt/parseInt/leading-cr.js(default) -built-ins/BigInt/parseInt/leading-cr.js(strict mode) -built-ins/BigInt/parseInt/leading-ff.js(default) -built-ins/BigInt/parseInt/leading-ff.js(strict mode) -built-ins/BigInt/parseInt/leading-lf.js(default) -built-ins/BigInt/parseInt/leading-lf.js(strict mode) -built-ins/BigInt/parseInt/leading-ls.js(default) -built-ins/BigInt/parseInt/leading-ls.js(strict mode) -built-ins/BigInt/parseInt/leading-nbsp.js(default) -built-ins/BigInt/parseInt/leading-nbsp.js(strict mode) -built-ins/BigInt/parseInt/leading-ps.js(default) -built-ins/BigInt/parseInt/leading-ps.js(strict mode) -built-ins/BigInt/parseInt/leading-space.js(default) -built-ins/BigInt/parseInt/leading-space.js(strict mode) -built-ins/BigInt/parseInt/leading-tab.js(default) -built-ins/BigInt/parseInt/leading-tab.js(strict mode) -built-ins/BigInt/parseInt/leading-vt.js(default) -built-ins/BigInt/parseInt/leading-vt.js(strict mode) -built-ins/BigInt/parseInt/leading-ws.js(default) -built-ins/BigInt/parseInt/leading-ws.js(strict mode) -built-ins/BigInt/parseInt/octal-prefix.js(default) -built-ins/BigInt/parseInt/octal-prefix.js(strict mode) -built-ins/BigInt/parseInt/parseInt.js(default) -built-ins/BigInt/parseInt/parseInt.js(strict mode) -built-ins/BigInt/parseInt/radix-boolean.js(default) -built-ins/BigInt/parseInt/radix-boolean.js(strict mode) -built-ins/BigInt/parseInt/radix-int32.js(default) -built-ins/BigInt/parseInt/radix-int32.js(strict mode) -built-ins/BigInt/parseInt/radix-number-obj.js(default) -built-ins/BigInt/parseInt/radix-number-obj.js(strict mode) -built-ins/BigInt/parseInt/radix-primitive-coercion.js(default) -built-ins/BigInt/parseInt/radix-primitive-coercion.js(strict mode) -built-ins/BigInt/parseInt/radix-string.js(default) -built-ins/BigInt/parseInt/radix-string.js(strict mode) -built-ins/BigInt/parseInt/radix-undefined-or-null.js(default) -built-ins/BigInt/parseInt/radix-undefined-or-null.js(strict mode) -built-ins/BigInt/parseInt/radix-undefined.js(default) -built-ins/BigInt/parseInt/radix-undefined.js(strict mode) -built-ins/BigInt/parseInt/radix-zero.js(default) -built-ins/BigInt/parseInt/radix-zero.js(strict mode) -built-ins/BigInt/parseInt/trailing-code-point.js(default) -built-ins/BigInt/parseInt/trailing-code-point.js(strict mode) +built-ins/BigInt/call-value-of-when-to-string-present.js(default) +built-ins/BigInt/call-value-of-when-to-string-present.js(strict mode) +built-ins/BigInt/constructor-empty-string.js(default) +built-ins/BigInt/constructor-empty-string.js(strict mode) +built-ins/BigInt/constructor-from-binary-string.js(default) +built-ins/BigInt/constructor-from-binary-string.js(strict mode) +built-ins/BigInt/constructor-from-decimal-string.js(default) +built-ins/BigInt/constructor-from-decimal-string.js(strict mode) +built-ins/BigInt/constructor-from-hex-string.js(default) +built-ins/BigInt/constructor-from-hex-string.js(strict mode) +built-ins/BigInt/constructor-from-octal-string.js(default) +built-ins/BigInt/constructor-from-octal-string.js(strict mode) +built-ins/BigInt/constructor-trailing-leading-spaces.js(default) +built-ins/BigInt/constructor-trailing-leading-spaces.js(strict mode) +built-ins/BigInt/issafeinteger-true.js(default) +built-ins/BigInt/issafeinteger-true.js(strict mode) +built-ins/BigInt/prototype/Symbol.toStringTag.js(default) +built-ins/BigInt/prototype/Symbol.toStringTag.js(strict mode) built-ins/BigInt/prototype/toString/radix-2-to-36.js(default) built-ins/BigInt/prototype/toString/radix-2-to-36.js(strict mode) built-ins/BigInt/prototype/toString/radix-err.js(default) built-ins/BigInt/prototype/toString/radix-err.js(strict mode) +built-ins/BigInt/prototype/toString/string-is-code-units-of-decimal-digits-only.js(default) +built-ins/BigInt/prototype/toString/string-is-code-units-of-decimal-digits-only.js(strict mode) built-ins/BigInt/prototype/toString/thisbigintvalue-not-valid-throws.js(default) built-ins/BigInt/prototype/toString/thisbigintvalue-not-valid-throws.js(strict mode) built-ins/BigInt/prototype/valueOf/return.js(default) built-ins/BigInt/prototype/valueOf/return.js(strict mode) +built-ins/DataView/prototype/getBigInt64/return-value-clean-arraybuffer.js(default) +built-ins/DataView/prototype/getBigInt64/return-value-clean-arraybuffer.js(strict mode) +built-ins/DataView/prototype/getBigInt64/return-values-custom-offset.js(default) +built-ins/DataView/prototype/getBigInt64/return-values-custom-offset.js(strict mode) +built-ins/DataView/prototype/getBigInt64/return-values.js(default) +built-ins/DataView/prototype/getBigInt64/return-values.js(strict mode) +built-ins/DataView/prototype/getBigInt64/to-boolean-littleendian.js(default) +built-ins/DataView/prototype/getBigInt64/to-boolean-littleendian.js(strict mode) +built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-errors.js(default) +built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-errors.js(strict mode) +built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-toprimitive.js(default) +built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-toprimitive.js(strict mode) +built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-wrapped-values.js(default) +built-ins/DataView/prototype/getBigInt64/toindex-byteoffset-wrapped-values.js(strict mode) +built-ins/DataView/prototype/getBigInt64/toindex-byteoffset.js(default) +built-ins/DataView/prototype/getBigInt64/toindex-byteoffset.js(strict mode) +built-ins/DataView/prototype/getBigUint64/return-value-clean-arraybuffer.js(default) +built-ins/DataView/prototype/getBigUint64/return-value-clean-arraybuffer.js(strict mode) +built-ins/DataView/prototype/getBigUint64/return-values-custom-offset.js(default) +built-ins/DataView/prototype/getBigUint64/return-values-custom-offset.js(strict mode) +built-ins/DataView/prototype/getBigUint64/return-values.js(default) +built-ins/DataView/prototype/getBigUint64/return-values.js(strict mode) +built-ins/DataView/prototype/getBigUint64/to-boolean-littleendian.js(default) +built-ins/DataView/prototype/getBigUint64/to-boolean-littleendian.js(strict mode) +built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-errors.js(default) +built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-errors.js(strict mode) +built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-toprimitive.js(default) +built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-toprimitive.js(strict mode) +built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-wrapped-values.js(default) +built-ins/DataView/prototype/getBigUint64/toindex-byteoffset-wrapped-values.js(strict mode) +built-ins/DataView/prototype/getBigUint64/toindex-byteoffset.js(default) +built-ins/DataView/prototype/getBigUint64/toindex-byteoffset.js(strict mode) +built-ins/DataView/prototype/setBigInt64/detached-buffer.js(default) +built-ins/DataView/prototype/setBigInt64/detached-buffer.js(strict mode) +built-ins/DataView/prototype/setBigInt64/index-is-out-of-range.js(default) +built-ins/DataView/prototype/setBigInt64/index-is-out-of-range.js(strict mode) +built-ins/DataView/prototype/setBigInt64/negative-byteoffset-throws.js(default) +built-ins/DataView/prototype/setBigInt64/negative-byteoffset-throws.js(strict mode) +built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset-symbol.js(default) +built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset-symbol.js(strict mode) +built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset.js(default) +built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tonumber-byteoffset.js(strict mode) +built-ins/DataView/prototype/setBigInt64/set-values-little-endian-order.js(default) +built-ins/DataView/prototype/setBigInt64/set-values-little-endian-order.js(strict mode) +built-ins/DataView/prototype/setBigInt64/to-boolean-littleendian.js(default) +built-ins/DataView/prototype/setBigInt64/to-boolean-littleendian.js(strict mode) +built-ins/DataView/prototype/setBigInt64/toindex-byteoffset.js(default) +built-ins/DataView/prototype/setBigInt64/toindex-byteoffset.js(strict mode) +built-ins/Function/prototype/toString/intrinsics.js(strict mode) built-ins/JSON/stringify/bigint-order.js(default) built-ins/JSON/stringify/bigint-order.js(strict mode) built-ins/JSON/stringify/bigint-replacer.js(default) @@ -1328,18 +306,901 @@ built-ins/Object/bigint.js(default) built-ins/Object/bigint.js(strict mode) built-ins/Object/setPrototypeOf/bigint.js(default) built-ins/Object/setPrototypeOf/bigint.js(strict mode) +built-ins/String/prototype/indexOf/position-tointeger-bigint.js(default) +built-ins/String/prototype/indexOf/position-tointeger-bigint.js(strict mode) +built-ins/String/prototype/indexOf/searchstring-tostring-bigint.js(default) +built-ins/String/prototype/indexOf/searchstring-tostring-bigint.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/coerced-values-end.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/coerced-values-end.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/coerced-values-start.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/coerced-values-start.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/coerced-values-target.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/coerced-values-target.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/negative-end.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/negative-end.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/negative-out-of-bounds-end.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/negative-out-of-bounds-end.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/negative-out-of-bounds-start.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/negative-out-of-bounds-start.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/negative-out-of-bounds-target.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/negative-out-of-bounds-target.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/negative-start.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/negative-start.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/negative-target.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/negative-target.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/non-negative-out-of-bounds-end.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/non-negative-out-of-bounds-end.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/non-negative-out-of-bounds-target-and-start.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/non-negative-out-of-bounds-target-and-start.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/non-negative-target-and-start.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/non-negative-target-and-start.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/non-negative-target-start-and-end.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/non-negative-target-start-and-end.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/return-this.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/return-this.js(strict mode) +built-ins/TypedArray/prototype/copyWithin/BigInt/undefined-end.js(default) +built-ins/TypedArray/prototype/copyWithin/BigInt/undefined-end.js(strict mode) +built-ins/TypedArray/prototype/entries/BigInt/iter-prototype.js(default) +built-ins/TypedArray/prototype/entries/BigInt/iter-prototype.js(strict mode) +built-ins/TypedArray/prototype/entries/BigInt/return-itor.js(default) +built-ins/TypedArray/prototype/entries/BigInt/return-itor.js(strict mode) +built-ins/TypedArray/prototype/every/BigInt/callbackfn-arguments-with-thisarg.js(default) +built-ins/TypedArray/prototype/every/BigInt/callbackfn-arguments-with-thisarg.js(strict mode) +built-ins/TypedArray/prototype/every/BigInt/callbackfn-arguments-without-thisarg.js(default) +built-ins/TypedArray/prototype/every/BigInt/callbackfn-arguments-without-thisarg.js(strict mode) +built-ins/TypedArray/prototype/every/BigInt/callbackfn-no-interaction-over-non-integer.js(default) +built-ins/TypedArray/prototype/every/BigInt/callbackfn-no-interaction-over-non-integer.js(strict mode) +built-ins/TypedArray/prototype/every/BigInt/callbackfn-return-does-not-change-instance.js(default) +built-ins/TypedArray/prototype/every/BigInt/callbackfn-return-does-not-change-instance.js(strict mode) +built-ins/TypedArray/prototype/every/BigInt/callbackfn-set-value-during-interaction.js(default) +built-ins/TypedArray/prototype/every/BigInt/callbackfn-set-value-during-interaction.js(strict mode) +built-ins/TypedArray/prototype/every/BigInt/get-length-uses-internal-arraylength.js(default) +built-ins/TypedArray/prototype/every/BigInt/get-length-uses-internal-arraylength.js(strict mode) +built-ins/TypedArray/prototype/every/BigInt/values-are-not-cached.js(default) +built-ins/TypedArray/prototype/every/BigInt/values-are-not-cached.js(strict mode) +built-ins/TypedArray/prototype/fill/BigInt/coerced-indexes.js(default) +built-ins/TypedArray/prototype/fill/BigInt/coerced-indexes.js(strict mode) +built-ins/TypedArray/prototype/fill/BigInt/fill-values-conversion-once.js(default) +built-ins/TypedArray/prototype/fill/BigInt/fill-values-conversion-once.js(strict mode) +built-ins/TypedArray/prototype/fill/BigInt/fill-values-custom-start-and-end.js(default) +built-ins/TypedArray/prototype/fill/BigInt/fill-values-custom-start-and-end.js(strict mode) +built-ins/TypedArray/prototype/fill/BigInt/fill-values-non-numeric.js(default) +built-ins/TypedArray/prototype/fill/BigInt/fill-values-non-numeric.js(strict mode) +built-ins/TypedArray/prototype/fill/BigInt/fill-values-relative-end.js(default) +built-ins/TypedArray/prototype/fill/BigInt/fill-values-relative-end.js(strict mode) +built-ins/TypedArray/prototype/fill/BigInt/fill-values-relative-start.js(default) +built-ins/TypedArray/prototype/fill/BigInt/fill-values-relative-start.js(strict mode) +built-ins/TypedArray/prototype/fill/BigInt/fill-values.js(default) +built-ins/TypedArray/prototype/fill/BigInt/fill-values.js(strict mode) +built-ins/TypedArray/prototype/fill/BigInt/get-length-ignores-length-prop.js(default) +built-ins/TypedArray/prototype/fill/BigInt/get-length-ignores-length-prop.js(strict mode) +built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-end.js(default) +built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-end.js(strict mode) +built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-set-value.js(default) +built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-set-value.js(strict mode) +built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-start.js(default) +built-ins/TypedArray/prototype/fill/BigInt/return-abrupt-from-start.js(strict mode) +built-ins/TypedArray/prototype/fill/BigInt/return-this.js(default) +built-ins/TypedArray/prototype/fill/BigInt/return-this.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-with-thisarg.js(default) +built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-with-thisarg.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-without-thisarg.js(default) +built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-without-thisarg.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/callbackfn-no-iteration-over-non-integer.js(default) +built-ins/TypedArray/prototype/filter/BigInt/callbackfn-no-iteration-over-non-integer.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/callbackfn-return-does-not-change-instance.js(default) +built-ins/TypedArray/prototype/filter/BigInt/callbackfn-return-does-not-change-instance.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/callbackfn-set-value-during-iteration.js(default) +built-ins/TypedArray/prototype/filter/BigInt/callbackfn-set-value-during-iteration.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/result-does-not-share-buffer.js(default) +built-ins/TypedArray/prototype/filter/BigInt/result-does-not-share-buffer.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/result-full-callbackfn-returns-true.js(default) +built-ins/TypedArray/prototype/filter/BigInt/result-full-callbackfn-returns-true.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-abrupt.js(default) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-abrupt.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-inherited.js(default) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-inherited.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-returns-throws.js(default) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-returns-throws.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor.js(default) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-invocation.js(default) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-invocation.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js(default) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor.js(default) +built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/values-are-not-cached.js(default) +built-ins/TypedArray/prototype/filter/BigInt/values-are-not-cached.js(strict mode) +built-ins/TypedArray/prototype/filter/BigInt/values-are-set.js(default) +built-ins/TypedArray/prototype/filter/BigInt/values-are-set.js(strict mode) +built-ins/TypedArray/prototype/find/BigInt/get-length-ignores-length-prop.js(default) +built-ins/TypedArray/prototype/find/BigInt/get-length-ignores-length-prop.js(strict mode) +built-ins/TypedArray/prototype/find/BigInt/predicate-call-changes-value.js(default) +built-ins/TypedArray/prototype/find/BigInt/predicate-call-changes-value.js(strict mode) +built-ins/TypedArray/prototype/find/BigInt/predicate-call-parameters.js(default) +built-ins/TypedArray/prototype/find/BigInt/predicate-call-parameters.js(strict mode) +built-ins/TypedArray/prototype/find/BigInt/return-found-value-predicate-result-is-true.js(default) +built-ins/TypedArray/prototype/find/BigInt/return-found-value-predicate-result-is-true.js(strict mode) +built-ins/TypedArray/prototype/findIndex/BigInt/get-length-ignores-length-prop.js(default) +built-ins/TypedArray/prototype/findIndex/BigInt/get-length-ignores-length-prop.js(strict mode) +built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-changes-value.js(default) +built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-changes-value.js(strict mode) +built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-parameters.js(default) +built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-parameters.js(strict mode) +built-ins/TypedArray/prototype/findIndex/BigInt/return-index-predicate-result-is-true.js(default) +built-ins/TypedArray/prototype/findIndex/BigInt/return-index-predicate-result-is-true.js(strict mode) +built-ins/TypedArray/prototype/findIndex/BigInt/return-negative-one-if-predicate-returns-false-value.js(default) +built-ins/TypedArray/prototype/findIndex/BigInt/return-negative-one-if-predicate-returns-false-value.js(strict mode) +built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-arguments-with-thisarg.js(default) +built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-arguments-with-thisarg.js(strict mode) +built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-arguments-without-thisarg.js(default) +built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-arguments-without-thisarg.js(strict mode) +built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-no-interaction-over-non-integer.js(default) +built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-no-interaction-over-non-integer.js(strict mode) +built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-return-does-not-change-instance.js(default) +built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-return-does-not-change-instance.js(strict mode) +built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-set-value-during-interaction.js(default) +built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-set-value-during-interaction.js(strict mode) +built-ins/TypedArray/prototype/forEach/BigInt/values-are-not-cached.js(default) +built-ins/TypedArray/prototype/forEach/BigInt/values-are-not-cached.js(strict mode) +built-ins/TypedArray/prototype/includes/BigInt/fromIndex-infinity.js(default) +built-ins/TypedArray/prototype/includes/BigInt/fromIndex-infinity.js(strict mode) +built-ins/TypedArray/prototype/includes/BigInt/fromIndex-minus-zero.js(default) +built-ins/TypedArray/prototype/includes/BigInt/fromIndex-minus-zero.js(strict mode) +built-ins/TypedArray/prototype/includes/BigInt/get-length-uses-internal-arraylength.js(default) +built-ins/TypedArray/prototype/includes/BigInt/get-length-uses-internal-arraylength.js(strict mode) +built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex-symbol.js(default) +built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex-symbol.js(strict mode) +built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex.js(default) +built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex.js(strict mode) +built-ins/TypedArray/prototype/includes/BigInt/search-found-returns-true.js(default) +built-ins/TypedArray/prototype/includes/BigInt/search-found-returns-true.js(strict mode) +built-ins/TypedArray/prototype/includes/BigInt/search-not-found-returns-false.js(default) +built-ins/TypedArray/prototype/includes/BigInt/search-not-found-returns-false.js(strict mode) +built-ins/TypedArray/prototype/includes/BigInt/tointeger-fromindex.js(default) +built-ins/TypedArray/prototype/includes/BigInt/tointeger-fromindex.js(strict mode) +built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-infinity.js(default) +built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-infinity.js(strict mode) +built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-minus-zero.js(default) +built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-minus-zero.js(strict mode) +built-ins/TypedArray/prototype/indexOf/BigInt/get-length-uses-internal-arraylength.js(default) +built-ins/TypedArray/prototype/indexOf/BigInt/get-length-uses-internal-arraylength.js(strict mode) +built-ins/TypedArray/prototype/indexOf/BigInt/search-found-returns-index.js(default) +built-ins/TypedArray/prototype/indexOf/BigInt/search-found-returns-index.js(strict mode) +built-ins/TypedArray/prototype/indexOf/BigInt/search-not-found-returns-minus-one.js(default) +built-ins/TypedArray/prototype/indexOf/BigInt/search-not-found-returns-minus-one.js(strict mode) +built-ins/TypedArray/prototype/indexOf/BigInt/tointeger-fromindex.js(default) +built-ins/TypedArray/prototype/indexOf/BigInt/tointeger-fromindex.js(strict mode) +built-ins/TypedArray/prototype/join/BigInt/custom-separator-result-from-tostring-on-each-simple-value.js(default) +built-ins/TypedArray/prototype/join/BigInt/custom-separator-result-from-tostring-on-each-simple-value.js(strict mode) +built-ins/TypedArray/prototype/join/BigInt/get-length-uses-internal-arraylength.js(default) +built-ins/TypedArray/prototype/join/BigInt/get-length-uses-internal-arraylength.js(strict mode) +built-ins/TypedArray/prototype/join/BigInt/result-from-tostring-on-each-simple-value.js(default) +built-ins/TypedArray/prototype/join/BigInt/result-from-tostring-on-each-simple-value.js(strict mode) +built-ins/TypedArray/prototype/keys/BigInt/iter-prototype.js(default) +built-ins/TypedArray/prototype/keys/BigInt/iter-prototype.js(strict mode) +built-ins/TypedArray/prototype/keys/BigInt/return-itor.js(default) +built-ins/TypedArray/prototype/keys/BigInt/return-itor.js(strict mode) +built-ins/TypedArray/prototype/lastIndexOf/BigInt/fromIndex-infinity.js(default) +built-ins/TypedArray/prototype/lastIndexOf/BigInt/fromIndex-infinity.js(strict mode) +built-ins/TypedArray/prototype/lastIndexOf/BigInt/fromIndex-minus-zero.js(default) +built-ins/TypedArray/prototype/lastIndexOf/BigInt/fromIndex-minus-zero.js(strict mode) +built-ins/TypedArray/prototype/lastIndexOf/BigInt/get-length-uses-internal-arraylength.js(default) +built-ins/TypedArray/prototype/lastIndexOf/BigInt/get-length-uses-internal-arraylength.js(strict mode) +built-ins/TypedArray/prototype/lastIndexOf/BigInt/search-found-returns-index.js(default) +built-ins/TypedArray/prototype/lastIndexOf/BigInt/search-found-returns-index.js(strict mode) +built-ins/TypedArray/prototype/lastIndexOf/BigInt/search-not-found-returns-minus-one.js(default) +built-ins/TypedArray/prototype/lastIndexOf/BigInt/search-not-found-returns-minus-one.js(strict mode) +built-ins/TypedArray/prototype/lastIndexOf/BigInt/tointeger-fromindex.js(default) +built-ins/TypedArray/prototype/lastIndexOf/BigInt/tointeger-fromindex.js(strict mode) +built-ins/TypedArray/prototype/map/BigInt/arraylength-internal.js(default) +built-ins/TypedArray/prototype/map/BigInt/arraylength-internal.js(strict mode) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-with-thisarg.js(default) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-with-thisarg.js(strict mode) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-without-thisarg.js(default) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-without-thisarg.js(strict mode) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-detachbuffer.js(default) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-detachbuffer.js(strict mode) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-no-interaction-over-non-integer-properties.js(default) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-no-interaction-over-non-integer-properties.js(strict mode) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-affects-returned-object.js(default) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-affects-returned-object.js(strict mode) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-change-instance.js(default) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-change-instance.js(strict mode) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-copy-non-integer-properties.js(default) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-copy-non-integer-properties.js(strict mode) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-set-value-during-interaction.js(default) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-set-value-during-interaction.js(strict mode) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-this.js(default) +built-ins/TypedArray/prototype/map/BigInt/callbackfn-this.js(strict mode) +built-ins/TypedArray/prototype/map/BigInt/values-are-not-cached.js(default) +built-ins/TypedArray/prototype/map/BigInt/values-are-not-cached.js(strict mode) +built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-custom-accumulator.js(default) +built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-custom-accumulator.js(strict mode) +built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-default-accumulator.js(default) +built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-default-accumulator.js(strict mode) +built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-no-iteration-over-non-integer-properties.js(default) +built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-no-iteration-over-non-integer-properties.js(strict mode) +built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-return-does-not-change-instance.js(default) +built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-return-does-not-change-instance.js(strict mode) +built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-set-value-during-iteration.js(default) +built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-set-value-during-iteration.js(strict mode) +built-ins/TypedArray/prototype/reduce/BigInt/get-length-uses-internal-arraylength.js(default) +built-ins/TypedArray/prototype/reduce/BigInt/get-length-uses-internal-arraylength.js(strict mode) +built-ins/TypedArray/prototype/reduce/BigInt/result-is-last-callbackfn-return.js(default) +built-ins/TypedArray/prototype/reduce/BigInt/result-is-last-callbackfn-return.js(strict mode) +built-ins/TypedArray/prototype/reduce/BigInt/result-of-any-type.js(default) +built-ins/TypedArray/prototype/reduce/BigInt/result-of-any-type.js(strict mode) +built-ins/TypedArray/prototype/reduce/BigInt/return-first-value-without-callbackfn.js(default) +built-ins/TypedArray/prototype/reduce/BigInt/return-first-value-without-callbackfn.js(strict mode) +built-ins/TypedArray/prototype/reduce/BigInt/values-are-not-cached.js(default) +built-ins/TypedArray/prototype/reduce/BigInt/values-are-not-cached.js(strict mode) +built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-arguments-custom-accumulator.js(default) +built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-arguments-custom-accumulator.js(strict mode) +built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-arguments-default-accumulator.js(default) +built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-arguments-default-accumulator.js(strict mode) +built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-no-iteration-over-non-integer-properties.js(default) +built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-no-iteration-over-non-integer-properties.js(strict mode) +built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-return-does-not-change-instance.js(default) +built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-return-does-not-change-instance.js(strict mode) +built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-set-value-during-iteration.js(default) +built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-set-value-during-iteration.js(strict mode) +built-ins/TypedArray/prototype/reduceRight/BigInt/get-length-uses-internal-arraylength.js(default) +built-ins/TypedArray/prototype/reduceRight/BigInt/get-length-uses-internal-arraylength.js(strict mode) +built-ins/TypedArray/prototype/reduceRight/BigInt/result-is-last-callbackfn-return.js(default) +built-ins/TypedArray/prototype/reduceRight/BigInt/result-is-last-callbackfn-return.js(strict mode) +built-ins/TypedArray/prototype/reduceRight/BigInt/result-of-any-type.js(default) +built-ins/TypedArray/prototype/reduceRight/BigInt/result-of-any-type.js(strict mode) +built-ins/TypedArray/prototype/reduceRight/BigInt/return-first-value-without-callbackfn.js(default) +built-ins/TypedArray/prototype/reduceRight/BigInt/return-first-value-without-callbackfn.js(strict mode) +built-ins/TypedArray/prototype/reduceRight/BigInt/values-are-not-cached.js(default) +built-ins/TypedArray/prototype/reduceRight/BigInt/values-are-not-cached.js(strict mode) +built-ins/TypedArray/prototype/reverse/BigInt/get-length-uses-internal-arraylength.js(default) +built-ins/TypedArray/prototype/reverse/BigInt/get-length-uses-internal-arraylength.js(strict mode) +built-ins/TypedArray/prototype/reverse/BigInt/reverts.js(default) +built-ins/TypedArray/prototype/reverse/BigInt/reverts.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-offset-tointeger.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-offset-tointeger.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-length.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-length.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-value.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-value.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length-symbol.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length-symbol.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value-symbol.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value-symbol.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-toobject-offset.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-toobject-offset.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values-in-order.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values-in-order.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-src-tonumber-value-type-conversions.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-src-tonumber-value-type-conversions.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-src-values-are-not-cached.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-src-values-are-not-cached.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-target-arraylength-internal.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-target-arraylength-internal.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/array-arg-targetbuffer-detached-on-get-src-value-throws.js(default) +built-ins/TypedArray/prototype/set/BigInt/array-arg-targetbuffer-detached-on-get-src-value-throws.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-offset-tointeger.js(default) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-offset-tointeger.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type-sab.js(default) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type-sab.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type.js(default) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type-sab.js(default) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type-sab.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type.js(default) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type-sab.js(default) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type-sab.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type.js(default) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-arraylength-internal.js(default) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-arraylength-internal.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-byteoffset-internal.js(default) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-byteoffset-internal.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-arraylength-internal.js(default) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-arraylength-internal.js(strict mode) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-byteoffset-internal.js(default) +built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-byteoffset-internal.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/arraylength-internal.js(default) +built-ins/TypedArray/prototype/slice/BigInt/arraylength-internal.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/infinity.js(default) +built-ins/TypedArray/prototype/slice/BigInt/infinity.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/minus-zero.js(default) +built-ins/TypedArray/prototype/slice/BigInt/minus-zero.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/result-does-not-copy-ordinary-properties.js(default) +built-ins/TypedArray/prototype/slice/BigInt/result-does-not-copy-ordinary-properties.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/results-with-different-length.js(default) +built-ins/TypedArray/prototype/slice/BigInt/results-with-different-length.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/results-with-empty-length.js(default) +built-ins/TypedArray/prototype/slice/BigInt/results-with-empty-length.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/results-with-same-length.js(default) +built-ins/TypedArray/prototype/slice/BigInt/results-with-same-length.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/set-values-from-different-ctor-type.js(default) +built-ins/TypedArray/prototype/slice/BigInt/set-values-from-different-ctor-type.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor-abrupt.js(default) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor-abrupt.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor-inherited.js(default) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor-inherited.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor-returns-throws.js(default) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor-returns-throws.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor.js(default) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-ctor.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor-invocation.js(default) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor-invocation.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js(default) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor.js(default) +built-ins/TypedArray/prototype/slice/BigInt/speciesctor-get-species-custom-ctor.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/tointeger-end.js(default) +built-ins/TypedArray/prototype/slice/BigInt/tointeger-end.js(strict mode) +built-ins/TypedArray/prototype/slice/BigInt/tointeger-start.js(default) +built-ins/TypedArray/prototype/slice/BigInt/tointeger-start.js(strict mode) +built-ins/TypedArray/prototype/some/BigInt/callbackfn-arguments-with-thisarg.js(default) +built-ins/TypedArray/prototype/some/BigInt/callbackfn-arguments-with-thisarg.js(strict mode) +built-ins/TypedArray/prototype/some/BigInt/callbackfn-arguments-without-thisarg.js(default) +built-ins/TypedArray/prototype/some/BigInt/callbackfn-arguments-without-thisarg.js(strict mode) +built-ins/TypedArray/prototype/some/BigInt/callbackfn-no-interaction-over-non-integer.js(default) +built-ins/TypedArray/prototype/some/BigInt/callbackfn-no-interaction-over-non-integer.js(strict mode) +built-ins/TypedArray/prototype/some/BigInt/callbackfn-return-does-not-change-instance.js(default) +built-ins/TypedArray/prototype/some/BigInt/callbackfn-return-does-not-change-instance.js(strict mode) +built-ins/TypedArray/prototype/some/BigInt/callbackfn-set-value-during-interaction.js(default) +built-ins/TypedArray/prototype/some/BigInt/callbackfn-set-value-during-interaction.js(strict mode) +built-ins/TypedArray/prototype/some/BigInt/get-length-uses-internal-arraylength.js(default) +built-ins/TypedArray/prototype/some/BigInt/get-length-uses-internal-arraylength.js(strict mode) +built-ins/TypedArray/prototype/some/BigInt/values-are-not-cached.js(default) +built-ins/TypedArray/prototype/some/BigInt/values-are-not-cached.js(strict mode) +built-ins/TypedArray/prototype/sort/BigInt/arraylength-internal.js(default) +built-ins/TypedArray/prototype/sort/BigInt/arraylength-internal.js(strict mode) +built-ins/TypedArray/prototype/sort/BigInt/comparefn-call-throws.js(default) +built-ins/TypedArray/prototype/sort/BigInt/comparefn-call-throws.js(strict mode) +built-ins/TypedArray/prototype/sort/BigInt/comparefn-calls.js(default) +built-ins/TypedArray/prototype/sort/BigInt/comparefn-calls.js(strict mode) +built-ins/TypedArray/prototype/sort/BigInt/comparefn-nonfunction-call-throws.js(default) +built-ins/TypedArray/prototype/sort/BigInt/comparefn-nonfunction-call-throws.js(strict mode) +built-ins/TypedArray/prototype/sort/BigInt/return-same-instance.js(default) +built-ins/TypedArray/prototype/sort/BigInt/return-same-instance.js(strict mode) +built-ins/TypedArray/prototype/sort/BigInt/sortcompare-with-no-tostring.js(default) +built-ins/TypedArray/prototype/sort/BigInt/sortcompare-with-no-tostring.js(strict mode) +built-ins/TypedArray/prototype/sort/BigInt/sorted-values.js(default) +built-ins/TypedArray/prototype/sort/BigInt/sorted-values.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/infinity.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/infinity.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/minus-zero.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/minus-zero.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/result-does-not-copy-ordinary-properties.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/result-does-not-copy-ordinary-properties.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/result-is-new-instance-from-same-ctor.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/result-is-new-instance-from-same-ctor.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/result-is-new-instance-with-shared-buffer.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/result-is-new-instance-with-shared-buffer.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/results-with-different-length.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/results-with-different-length.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/results-with-empty-length.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/results-with-empty-length.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/results-with-same-length.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/results-with-same-length.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor-abrupt.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor-abrupt.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor-inherited.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor-inherited.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor-returns-throws.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor-returns-throws.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-ctor.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-custom-ctor-invocation.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-custom-ctor-invocation.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-custom-ctor.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/speciesctor-get-species-custom-ctor.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/tointeger-begin.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/tointeger-begin.js(strict mode) +built-ins/TypedArray/prototype/subarray/BigInt/tointeger-end.js(default) +built-ins/TypedArray/prototype/subarray/BigInt/tointeger-end.js(strict mode) +built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tolocalestring-from-each-value.js(default) +built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tolocalestring-from-each-value.js(strict mode) +built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js(default) +built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js(strict mode) +built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-valueof-from-each-value.js(default) +built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-valueof-from-each-value.js(strict mode) +built-ins/TypedArray/prototype/toLocaleString/BigInt/get-length-uses-internal-arraylength.js(default) +built-ins/TypedArray/prototype/toLocaleString/BigInt/get-length-uses-internal-arraylength.js(strict mode) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tolocalestring.js(default) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tolocalestring.js(strict mode) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tostring.js(default) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tostring.js(strict mode) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-valueof.js(default) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-valueof.js(strict mode) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tolocalestring.js(default) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tolocalestring.js(strict mode) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tostring.js(default) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tostring.js(strict mode) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-valueof.js(default) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-valueof.js(strict mode) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-result.js(default) +built-ins/TypedArray/prototype/toLocaleString/BigInt/return-result.js(strict mode) +built-ins/TypedArray/prototype/values/BigInt/iter-prototype.js(default) +built-ins/TypedArray/prototype/values/BigInt/iter-prototype.js(strict mode) +built-ins/TypedArray/prototype/values/BigInt/return-itor.js(default) +built-ins/TypedArray/prototype/values/BigInt/return-itor.js(strict mode) +built-ins/TypedArrays/ctors-bigint/length-arg/init-zeros.js(default) +built-ins/TypedArrays/ctors-bigint/length-arg/init-zeros.js(strict mode) +built-ins/TypedArrays/ctors-bigint/object-arg/as-array-returns.js(default) +built-ins/TypedArrays/ctors-bigint/object-arg/as-array-returns.js(strict mode) +built-ins/TypedArrays/ctors-bigint/object-arg/as-generator-iterable-returns.js(default) +built-ins/TypedArrays/ctors-bigint/object-arg/as-generator-iterable-returns.js(strict mode) +built-ins/TypedArrays/ctors-bigint/object-arg/new-instance-extensibility.js(default) +built-ins/TypedArrays/ctors-bigint/object-arg/new-instance-extensibility.js(strict mode) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-from-property.js(default) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-from-property.js(strict mode) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-setting-obj-to-primitive-typeerror.js(default) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-setting-obj-to-primitive-typeerror.js(strict mode) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-setting-obj-to-primitive.js(default) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-setting-obj-to-primitive.js(strict mode) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-setting-obj-tostring.js(default) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-setting-obj-tostring.js(strict mode) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-setting-obj-valueof-typeerror.js(default) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-setting-obj-valueof-typeerror.js(strict mode) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-setting-obj-valueof.js(default) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-setting-obj-valueof.js(strict mode) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-setting-property.js(default) +built-ins/TypedArrays/ctors-bigint/object-arg/throws-setting-property.js(strict mode) +built-ins/TypedArrays/from/BigInt/custom-ctor-returns-other-instance.js(default) +built-ins/TypedArrays/from/BigInt/custom-ctor-returns-other-instance.js(strict mode) +built-ins/TypedArrays/from/BigInt/mapfn-arguments.js(default) +built-ins/TypedArrays/from/BigInt/mapfn-arguments.js(strict mode) +built-ins/TypedArrays/from/BigInt/mapfn-this-with-thisarg.js(default) +built-ins/TypedArrays/from/BigInt/mapfn-this-with-thisarg.js(strict mode) +built-ins/TypedArrays/from/BigInt/mapfn-this-without-thisarg-non-strict.js(default) +built-ins/TypedArrays/from/BigInt/mapfn-this-without-thisarg-strict.js(strict mode) +built-ins/TypedArrays/from/BigInt/new-instance-from-ordinary-object.js(default) +built-ins/TypedArrays/from/BigInt/new-instance-from-ordinary-object.js(strict mode) +built-ins/TypedArrays/from/BigInt/new-instance-from-sparse-array.js(default) +built-ins/TypedArrays/from/BigInt/new-instance-from-sparse-array.js(strict mode) +built-ins/TypedArrays/from/BigInt/new-instance-using-custom-ctor.js(default) +built-ins/TypedArrays/from/BigInt/new-instance-using-custom-ctor.js(strict mode) +built-ins/TypedArrays/from/BigInt/new-instance-with-mapfn.js(default) +built-ins/TypedArrays/from/BigInt/new-instance-with-mapfn.js(strict mode) +built-ins/TypedArrays/from/BigInt/new-instance-without-mapfn.js(default) +built-ins/TypedArrays/from/BigInt/new-instance-without-mapfn.js(strict mode) +built-ins/TypedArrays/from/BigInt/set-value-abrupt-completion.js(default) +built-ins/TypedArrays/from/BigInt/set-value-abrupt-completion.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/desc-value-throws.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/desc-value-throws.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-greater-than-last-index.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-greater-than-last-index.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-lower-than-zero.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-lower-than-zero.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-minus-zero.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-minus-zero.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-not-canonical-index.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-not-canonical-index.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-not-integer.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-not-integer.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-not-numeric-index.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-not-numeric-index.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-numericindex-accessor-desc.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-numericindex-accessor-desc.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-configurable.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-configurable.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-enumerable.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-numericindex-desc-not-writable.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-numericindex.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-numericindex.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-symbol.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/key-is-symbol.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/non-extensible-new-key.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/non-extensible-new-key.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/non-extensible-redefine-key.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/non-extensible-redefine-key.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/set-value.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/set-value.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/this-is-not-extensible.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/this-is-not-extensible.js(strict mode) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/tonumber-value-detached-buffer.js(default) +built-ins/TypedArrays/internals/DefineOwnProperty/BigInt/tonumber-value-detached-buffer.js(strict mode) +built-ins/TypedArrays/internals/Get/BigInt/detached-buffer-key-is-not-numeric-index.js(default) +built-ins/TypedArrays/internals/Get/BigInt/detached-buffer-key-is-not-numeric-index.js(strict mode) +built-ins/TypedArrays/internals/Get/BigInt/detached-buffer-key-is-symbol.js(default) +built-ins/TypedArrays/internals/Get/BigInt/detached-buffer-key-is-symbol.js(strict mode) +built-ins/TypedArrays/internals/Get/BigInt/detached-buffer.js(default) +built-ins/TypedArrays/internals/Get/BigInt/detached-buffer.js(strict mode) +built-ins/TypedArrays/internals/Get/BigInt/indexed-value-sab.js(default) +built-ins/TypedArrays/internals/Get/BigInt/indexed-value-sab.js(strict mode) +built-ins/TypedArrays/internals/Get/BigInt/indexed-value.js(default) +built-ins/TypedArrays/internals/Get/BigInt/indexed-value.js(strict mode) +built-ins/TypedArrays/internals/Get/BigInt/key-is-not-integer.js(default) +built-ins/TypedArrays/internals/Get/BigInt/key-is-not-integer.js(strict mode) +built-ins/TypedArrays/internals/Get/BigInt/key-is-not-minus-zero.js(default) +built-ins/TypedArrays/internals/Get/BigInt/key-is-not-minus-zero.js(strict mode) +built-ins/TypedArrays/internals/Get/BigInt/key-is-not-numeric-index.js(default) +built-ins/TypedArrays/internals/Get/BigInt/key-is-not-numeric-index.js(strict mode) +built-ins/TypedArrays/internals/Get/BigInt/key-is-out-of-bounds.js(default) +built-ins/TypedArrays/internals/Get/BigInt/key-is-out-of-bounds.js(strict mode) +built-ins/TypedArrays/internals/Get/BigInt/key-is-symbol.js(default) +built-ins/TypedArrays/internals/Get/BigInt/key-is-symbol.js(strict mode) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/detached-buffer-key-is-not-number.js(default) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/detached-buffer-key-is-not-number.js(strict mode) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/detached-buffer-key-is-symbol.js(default) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/detached-buffer-key-is-symbol.js(strict mode) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/index-prop-desc.js(default) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/index-prop-desc.js(strict mode) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/key-is-minus-zero.js(default) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/key-is-minus-zero.js(strict mode) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/key-is-not-canonical-index.js(default) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/key-is-not-canonical-index.js(strict mode) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/key-is-not-integer.js(default) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/key-is-not-integer.js(strict mode) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/key-is-not-numeric-index.js(default) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/key-is-not-numeric-index.js(strict mode) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/key-is-out-of-bounds.js(default) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/key-is-out-of-bounds.js(strict mode) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/key-is-symbol.js(default) +built-ins/TypedArrays/internals/GetOwnProperty/BigInt/key-is-symbol.js(strict mode) +built-ins/TypedArrays/internals/HasProperty/BigInt/detached-buffer-key-is-not-number.js(default) +built-ins/TypedArrays/internals/HasProperty/BigInt/detached-buffer-key-is-not-number.js(strict mode) +built-ins/TypedArrays/internals/HasProperty/BigInt/detached-buffer-key-is-symbol.js(default) +built-ins/TypedArrays/internals/HasProperty/BigInt/detached-buffer-key-is-symbol.js(strict mode) +built-ins/TypedArrays/internals/HasProperty/BigInt/indexed-value.js(default) +built-ins/TypedArrays/internals/HasProperty/BigInt/indexed-value.js(strict mode) +built-ins/TypedArrays/internals/HasProperty/BigInt/key-is-not-canonical-index.js(default) +built-ins/TypedArrays/internals/HasProperty/BigInt/key-is-not-canonical-index.js(strict mode) +built-ins/TypedArrays/internals/OwnPropertyKeys/BigInt/integer-indexes-and-string-and-symbol-keys-.js(default) +built-ins/TypedArrays/internals/OwnPropertyKeys/BigInt/integer-indexes-and-string-and-symbol-keys-.js(strict mode) +built-ins/TypedArrays/internals/OwnPropertyKeys/BigInt/integer-indexes-and-string-keys.js(default) +built-ins/TypedArrays/internals/OwnPropertyKeys/BigInt/integer-indexes-and-string-keys.js(strict mode) +built-ins/TypedArrays/internals/OwnPropertyKeys/BigInt/integer-indexes.js(default) +built-ins/TypedArrays/internals/OwnPropertyKeys/BigInt/integer-indexes.js(strict mode) +built-ins/TypedArrays/internals/Set/BigInt/detached-buffer-key-is-not-numeric-index.js(default) +built-ins/TypedArrays/internals/Set/BigInt/detached-buffer-key-is-not-numeric-index.js(strict mode) +built-ins/TypedArrays/internals/Set/BigInt/detached-buffer-key-is-symbol.js(default) +built-ins/TypedArrays/internals/Set/BigInt/detached-buffer-key-is-symbol.js(strict mode) +built-ins/TypedArrays/internals/Set/BigInt/detached-buffer.js(default) +built-ins/TypedArrays/internals/Set/BigInt/detached-buffer.js(strict mode) +built-ins/TypedArrays/internals/Set/BigInt/indexed-value.js(default) +built-ins/TypedArrays/internals/Set/BigInt/indexed-value.js(strict mode) +built-ins/TypedArrays/internals/Set/BigInt/key-is-minus-zero.js(default) +built-ins/TypedArrays/internals/Set/BigInt/key-is-minus-zero.js(strict mode) +built-ins/TypedArrays/internals/Set/BigInt/key-is-not-canonical-index.js(default) +built-ins/TypedArrays/internals/Set/BigInt/key-is-not-canonical-index.js(strict mode) +built-ins/TypedArrays/internals/Set/BigInt/key-is-not-integer.js(default) +built-ins/TypedArrays/internals/Set/BigInt/key-is-not-integer.js(strict mode) +built-ins/TypedArrays/internals/Set/BigInt/key-is-not-numeric-index.js(default) +built-ins/TypedArrays/internals/Set/BigInt/key-is-not-numeric-index.js(strict mode) +built-ins/TypedArrays/internals/Set/BigInt/key-is-out-of-bounds.js(default) +built-ins/TypedArrays/internals/Set/BigInt/key-is-out-of-bounds.js(strict mode) +built-ins/TypedArrays/internals/Set/BigInt/key-is-symbol.js(default) +built-ins/TypedArrays/internals/Set/BigInt/key-is-symbol.js(strict mode) +built-ins/TypedArrays/internals/Set/BigInt/tonumber-value-detached-buffer.js(default) +built-ins/TypedArrays/internals/Set/BigInt/tonumber-value-detached-buffer.js(strict mode) +built-ins/TypedArrays/internals/Set/BigInt/tonumber-value-throws.js(default) +built-ins/TypedArrays/internals/Set/BigInt/tonumber-value-throws.js(strict mode) +built-ins/TypedArrays/of/BigInt/argument-number-value-throws.js(default) +built-ins/TypedArrays/of/BigInt/argument-number-value-throws.js(strict mode) +built-ins/TypedArrays/of/BigInt/custom-ctor-does-not-instantiate-ta-throws.js(default) +built-ins/TypedArrays/of/BigInt/custom-ctor-does-not-instantiate-ta-throws.js(strict mode) +built-ins/TypedArrays/of/BigInt/custom-ctor-returns-other-instance.js(default) +built-ins/TypedArrays/of/BigInt/custom-ctor-returns-other-instance.js(strict mode) +built-ins/TypedArrays/of/BigInt/custom-ctor-returns-smaller-instance-throws.js(default) +built-ins/TypedArrays/of/BigInt/custom-ctor-returns-smaller-instance-throws.js(strict mode) +built-ins/TypedArrays/of/BigInt/custom-ctor.js(default) +built-ins/TypedArrays/of/BigInt/custom-ctor.js(strict mode) +built-ins/TypedArrays/of/BigInt/new-instance-using-custom-ctor.js(default) +built-ins/TypedArrays/of/BigInt/new-instance-using-custom-ctor.js(strict mode) +built-ins/TypedArrays/of/BigInt/new-instance.js(default) +built-ins/TypedArrays/of/BigInt/new-instance.js(strict mode) +built-ins/TypedArrays/of/BigInt/this-is-not-constructor.js(default) +built-ins/TypedArrays/of/BigInt/this-is-not-constructor.js(strict mode) +language/expressions/addition/bigint-and-number.js(default) +language/expressions/addition/bigint-and-number.js(strict mode) language/expressions/addition/bigint-arithmetic.js(default) language/expressions/addition/bigint-arithmetic.js(strict mode) +language/expressions/addition/bigint-errors.js(default) +language/expressions/addition/bigint-errors.js(strict mode) +language/expressions/addition/bigint-toprimitive.js(default) +language/expressions/addition/bigint-toprimitive.js(strict mode) +language/expressions/addition/bigint-wrapped-values.js(default) +language/expressions/addition/bigint-wrapped-values.js(strict mode) language/expressions/addition/coerce-bigint-to-string.js(default) language/expressions/addition/coerce-bigint-to-string.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-obj-id-identifier-yield-ident-valid.js(default) +language/expressions/bitwise-and/bigint-and-number.js(default) +language/expressions/bitwise-and/bigint-and-number.js(strict mode) +language/expressions/bitwise-and/bigint-errors.js(default) +language/expressions/bitwise-and/bigint-errors.js(strict mode) +language/expressions/bitwise-and/bigint-non-primitive.js(default) +language/expressions/bitwise-and/bigint-non-primitive.js(strict mode) +language/expressions/bitwise-and/bigint-toprimitive.js(default) +language/expressions/bitwise-and/bigint-toprimitive.js(strict mode) +language/expressions/bitwise-and/bigint-wrapped-values.js(default) +language/expressions/bitwise-and/bigint-wrapped-values.js(strict mode) +language/expressions/bitwise-and/bigint.js(default) +language/expressions/bitwise-and/bigint.js(strict mode) language/expressions/bitwise-not/bigint-non-primitive.js(default) language/expressions/bitwise-not/bigint-non-primitive.js(strict mode) language/expressions/bitwise-not/bigint.js(default) language/expressions/bitwise-not/bigint.js(strict mode) +language/expressions/bitwise-or/bigint-and-number.js(default) +language/expressions/bitwise-or/bigint-and-number.js(strict mode) +language/expressions/bitwise-or/bigint-errors.js(default) +language/expressions/bitwise-or/bigint-errors.js(strict mode) +language/expressions/bitwise-or/bigint-non-primitive.js(default) +language/expressions/bitwise-or/bigint-non-primitive.js(strict mode) +language/expressions/bitwise-or/bigint-toprimitive.js(default) +language/expressions/bitwise-or/bigint-toprimitive.js(strict mode) +language/expressions/bitwise-or/bigint-wrapped-values.js(default) +language/expressions/bitwise-or/bigint-wrapped-values.js(strict mode) +language/expressions/bitwise-or/bigint.js(default) +language/expressions/bitwise-or/bigint.js(strict mode) +language/expressions/bitwise-xor/bigint-and-number.js(default) +language/expressions/bitwise-xor/bigint-and-number.js(strict mode) +language/expressions/bitwise-xor/bigint-errors.js(default) +language/expressions/bitwise-xor/bigint-errors.js(strict mode) +language/expressions/bitwise-xor/bigint-non-primitive.js(default) +language/expressions/bitwise-xor/bigint-non-primitive.js(strict mode) +language/expressions/bitwise-xor/bigint-toprimitive.js(default) +language/expressions/bitwise-xor/bigint-toprimitive.js(strict mode) +language/expressions/bitwise-xor/bigint-wrapped-values.js(default) +language/expressions/bitwise-xor/bigint-wrapped-values.js(strict mode) +language/expressions/bitwise-xor/bigint.js(default) +language/expressions/bitwise-xor/bigint.js(strict mode) +language/expressions/class/fields-after-same-line-gen-computed-names.js(default) +language/expressions/class/fields-after-same-line-gen-computed-names.js(strict mode) +language/expressions/class/fields-after-same-line-gen-computed-symbol-names.js(default) +language/expressions/class/fields-after-same-line-gen-computed-symbol-names.js(strict mode) +language/expressions/class/fields-after-same-line-gen-literal-names.js(default) +language/expressions/class/fields-after-same-line-gen-literal-names.js(strict mode) +language/expressions/class/fields-after-same-line-gen-private-names.js(default) +language/expressions/class/fields-after-same-line-gen-private-names.js(strict mode) +language/expressions/class/fields-after-same-line-gen-string-literal-names.js(default) +language/expressions/class/fields-after-same-line-gen-string-literal-names.js(strict mode) +language/expressions/class/fields-after-same-line-method-computed-names.js(default) +language/expressions/class/fields-after-same-line-method-computed-names.js(strict mode) +language/expressions/class/fields-after-same-line-method-computed-symbol-names.js(default) +language/expressions/class/fields-after-same-line-method-computed-symbol-names.js(strict mode) +language/expressions/class/fields-after-same-line-method-literal-names.js(default) +language/expressions/class/fields-after-same-line-method-literal-names.js(strict mode) +language/expressions/class/fields-after-same-line-method-private-names.js(default) +language/expressions/class/fields-after-same-line-method-private-names.js(strict mode) +language/expressions/class/fields-after-same-line-method-string-literal-names.js(default) +language/expressions/class/fields-after-same-line-method-string-literal-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js(default) +language/expressions/class/fields-after-same-line-static-async-gen-computed-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js(default) +language/expressions/class/fields-after-same-line-static-async-gen-computed-symbol-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js(default) +language/expressions/class/fields-after-same-line-static-async-gen-literal-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-async-gen-private-names.js(default) +language/expressions/class/fields-after-same-line-static-async-gen-private-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js(default) +language/expressions/class/fields-after-same-line-static-async-gen-string-literal-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-async-method-computed-names.js(default) +language/expressions/class/fields-after-same-line-static-async-method-computed-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js(default) +language/expressions/class/fields-after-same-line-static-async-method-computed-symbol-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-async-method-literal-names.js(default) +language/expressions/class/fields-after-same-line-static-async-method-literal-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-async-method-private-names.js(default) +language/expressions/class/fields-after-same-line-static-async-method-private-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js(default) +language/expressions/class/fields-after-same-line-static-async-method-string-literal-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-gen-computed-names.js(default) +language/expressions/class/fields-after-same-line-static-gen-computed-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-gen-computed-symbol-names.js(default) +language/expressions/class/fields-after-same-line-static-gen-computed-symbol-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-gen-literal-names.js(default) +language/expressions/class/fields-after-same-line-static-gen-literal-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-gen-private-names.js(default) +language/expressions/class/fields-after-same-line-static-gen-private-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-gen-string-literal-names.js(default) +language/expressions/class/fields-after-same-line-static-gen-string-literal-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-method-computed-names.js(default) +language/expressions/class/fields-after-same-line-static-method-computed-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-method-computed-symbol-names.js(default) +language/expressions/class/fields-after-same-line-static-method-computed-symbol-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-method-literal-names.js(default) +language/expressions/class/fields-after-same-line-static-method-literal-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-method-private-names.js(default) +language/expressions/class/fields-after-same-line-static-method-private-names.js(strict mode) +language/expressions/class/fields-after-same-line-static-method-string-literal-names.js(default) +language/expressions/class/fields-after-same-line-static-method-string-literal-names.js(strict mode) +language/expressions/class/fields-asi-1.js(default) +language/expressions/class/fields-asi-1.js(strict mode) +language/expressions/class/fields-asi-2.js(default) +language/expressions/class/fields-asi-2.js(strict mode) +language/expressions/class/fields-asi-5.js(default) +language/expressions/class/fields-asi-5.js(strict mode) +language/expressions/class/fields-computed-name-propname-constructor.js(default) +language/expressions/class/fields-computed-name-propname-constructor.js(strict mode) +language/expressions/class/fields-computed-name-toprimitive-symbol.js(default) +language/expressions/class/fields-computed-name-toprimitive-symbol.js(strict mode) +language/expressions/class/fields-computed-name-toprimitive.js(default) +language/expressions/class/fields-computed-name-toprimitive.js(strict mode) +language/expressions/class/fields-computed-variable-name-propname-constructor.js(default) +language/expressions/class/fields-computed-variable-name-propname-constructor.js(strict mode) +language/expressions/class/fields-ctor-called-after-fields-init.js(default) +language/expressions/class/fields-ctor-called-after-fields-init.js(strict mode) +language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js(default) +language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js(strict mode) +language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js(default) +language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js(strict mode) +language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall.js(default) +language/expressions/class/fields-derived-cls-direct-eval-err-contains-supercall.js(strict mode) +language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js(default) +language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js(strict mode) +language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-2.js(default) +language/expressions/class/fields-derived-cls-direct-eval-err-contains-superproperty-2.js(strict mode) +language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js(default) +language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js(strict mode) +language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js(default) +language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js(strict mode) +language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall.js(default) +language/expressions/class/fields-derived-cls-indirect-eval-err-contains-supercall.js(strict mode) +language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js(default) +language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js(strict mode) +language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js(default) +language/expressions/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js(strict mode) +language/expressions/class/fields-direct-eval-err-contains-arguments.js(default) +language/expressions/class/fields-direct-eval-err-contains-arguments.js(strict mode) +language/expressions/class/fields-direct-eval-err-contains-newtarget.js(default) +language/expressions/class/fields-direct-eval-err-contains-newtarget.js(strict mode) +language/expressions/class/fields-evaluation-error-computed-name-referenceerror.js(default) +language/expressions/class/fields-evaluation-error-computed-name-referenceerror.js(strict mode) +language/expressions/class/fields-evaluation-error-computed-name-toprimitive-err.js(default) +language/expressions/class/fields-evaluation-error-computed-name-toprimitive-err.js(strict mode) +language/expressions/class/fields-evaluation-error-computed-name-tostring-err.js(default) +language/expressions/class/fields-evaluation-error-computed-name-tostring-err.js(strict mode) +language/expressions/class/fields-evaluation-error-computed-name-valueof-err.js(default) +language/expressions/class/fields-evaluation-error-computed-name-valueof-err.js(strict mode) +language/expressions/class/fields-indirect-eval-err-contains-arguments.js(default) +language/expressions/class/fields-indirect-eval-err-contains-arguments.js(strict mode) +language/expressions/class/fields-indirect-eval-err-contains-newtarget.js(default) +language/expressions/class/fields-indirect-eval-err-contains-newtarget.js(strict mode) +language/expressions/class/fields-init-err-evaluation.js(default) +language/expressions/class/fields-init-err-evaluation.js(strict mode) +language/expressions/class/fields-init-value-defined-after-class.js(default) +language/expressions/class/fields-init-value-defined-after-class.js(strict mode) +language/expressions/class/fields-init-value-incremental.js(default) +language/expressions/class/fields-init-value-incremental.js(strict mode) +language/expressions/class/fields-multiple-definitions-computed-names.js(default) +language/expressions/class/fields-multiple-definitions-computed-names.js(strict mode) +language/expressions/class/fields-multiple-definitions-computed-symbol-names.js(default) +language/expressions/class/fields-multiple-definitions-computed-symbol-names.js(strict mode) +language/expressions/class/fields-multiple-definitions-literal-names.js(default) +language/expressions/class/fields-multiple-definitions-literal-names.js(strict mode) +language/expressions/class/fields-multiple-definitions-private-names.js(default) +language/expressions/class/fields-multiple-definitions-private-names.js(strict mode) +language/expressions/class/fields-multiple-definitions-string-literal-names.js(default) +language/expressions/class/fields-multiple-definitions-string-literal-names.js(strict mode) +language/expressions/class/fields-multiple-stacked-definitions-computed-names.js(default) +language/expressions/class/fields-multiple-stacked-definitions-computed-names.js(strict mode) +language/expressions/class/fields-multiple-stacked-definitions-computed-symbol-names.js(default) +language/expressions/class/fields-multiple-stacked-definitions-computed-symbol-names.js(strict mode) +language/expressions/class/fields-multiple-stacked-definitions-literal-names.js(default) +language/expressions/class/fields-multiple-stacked-definitions-literal-names.js(strict mode) +language/expressions/class/fields-multiple-stacked-definitions-private-names.js(default) +language/expressions/class/fields-multiple-stacked-definitions-private-names.js(strict mode) +language/expressions/class/fields-multiple-stacked-definitions-string-literal-names.js(default) +language/expressions/class/fields-multiple-stacked-definitions-string-literal-names.js(strict mode) +language/expressions/class/fields-new-no-sc-line-method-computed-names.js(default) +language/expressions/class/fields-new-no-sc-line-method-computed-names.js(strict mode) +language/expressions/class/fields-new-no-sc-line-method-computed-symbol-names.js(default) +language/expressions/class/fields-new-no-sc-line-method-computed-symbol-names.js(strict mode) +language/expressions/class/fields-new-no-sc-line-method-literal-names.js(default) +language/expressions/class/fields-new-no-sc-line-method-literal-names.js(strict mode) +language/expressions/class/fields-new-no-sc-line-method-private-names.js(default) +language/expressions/class/fields-new-no-sc-line-method-private-names.js(strict mode) +language/expressions/class/fields-new-no-sc-line-method-string-literal-names.js(default) +language/expressions/class/fields-new-no-sc-line-method-string-literal-names.js(strict mode) +language/expressions/class/fields-new-sc-line-gen-computed-names.js(default) +language/expressions/class/fields-new-sc-line-gen-computed-names.js(strict mode) +language/expressions/class/fields-new-sc-line-gen-computed-symbol-names.js(default) +language/expressions/class/fields-new-sc-line-gen-computed-symbol-names.js(strict mode) +language/expressions/class/fields-new-sc-line-gen-literal-names.js(default) +language/expressions/class/fields-new-sc-line-gen-literal-names.js(strict mode) +language/expressions/class/fields-new-sc-line-gen-private-names.js(default) +language/expressions/class/fields-new-sc-line-gen-private-names.js(strict mode) +language/expressions/class/fields-new-sc-line-gen-string-literal-names.js(default) +language/expressions/class/fields-new-sc-line-gen-string-literal-names.js(strict mode) +language/expressions/class/fields-new-sc-line-method-computed-names.js(default) +language/expressions/class/fields-new-sc-line-method-computed-names.js(strict mode) +language/expressions/class/fields-new-sc-line-method-computed-symbol-names.js(default) +language/expressions/class/fields-new-sc-line-method-computed-symbol-names.js(strict mode) +language/expressions/class/fields-new-sc-line-method-literal-names.js(default) +language/expressions/class/fields-new-sc-line-method-literal-names.js(strict mode) +language/expressions/class/fields-new-sc-line-method-private-names.js(default) +language/expressions/class/fields-new-sc-line-method-private-names.js(strict mode) +language/expressions/class/fields-new-sc-line-method-string-literal-names.js(default) +language/expressions/class/fields-new-sc-line-method-string-literal-names.js(strict mode) +language/expressions/class/fields-redeclaration-symbol.js(default) +language/expressions/class/fields-redeclaration-symbol.js(strict mode) +language/expressions/class/fields-redeclaration.js(default) +language/expressions/class/fields-redeclaration.js(strict mode) +language/expressions/class/fields-regular-definitions-computed-names.js(default) +language/expressions/class/fields-regular-definitions-computed-names.js(strict mode) +language/expressions/class/fields-regular-definitions-computed-symbol-names.js(default) +language/expressions/class/fields-regular-definitions-computed-symbol-names.js(strict mode) +language/expressions/class/fields-regular-definitions-literal-names.js(default) +language/expressions/class/fields-regular-definitions-literal-names.js(strict mode) +language/expressions/class/fields-regular-definitions-private-names.js(default) +language/expressions/class/fields-regular-definitions-private-names.js(strict mode) +language/expressions/class/fields-regular-definitions-string-literal-names.js(default) +language/expressions/class/fields-regular-definitions-string-literal-names.js(strict mode) +language/expressions/class/fields-same-line-async-gen-computed-names.js(default) +language/expressions/class/fields-same-line-async-gen-computed-names.js(strict mode) +language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js(default) +language/expressions/class/fields-same-line-async-gen-computed-symbol-names.js(strict mode) +language/expressions/class/fields-same-line-async-gen-literal-names.js(default) +language/expressions/class/fields-same-line-async-gen-literal-names.js(strict mode) +language/expressions/class/fields-same-line-async-gen-private-names.js(default) +language/expressions/class/fields-same-line-async-gen-private-names.js(strict mode) +language/expressions/class/fields-same-line-async-gen-string-literal-names.js(default) +language/expressions/class/fields-same-line-async-gen-string-literal-names.js(strict mode) +language/expressions/class/fields-same-line-async-method-computed-names.js(default) +language/expressions/class/fields-same-line-async-method-computed-names.js(strict mode) +language/expressions/class/fields-same-line-async-method-computed-symbol-names.js(default) +language/expressions/class/fields-same-line-async-method-computed-symbol-names.js(strict mode) +language/expressions/class/fields-same-line-async-method-literal-names.js(default) +language/expressions/class/fields-same-line-async-method-literal-names.js(strict mode) +language/expressions/class/fields-same-line-async-method-private-names.js(default) +language/expressions/class/fields-same-line-async-method-private-names.js(strict mode) +language/expressions/class/fields-same-line-async-method-string-literal-names.js(default) +language/expressions/class/fields-same-line-async-method-string-literal-names.js(strict mode) +language/expressions/class/fields-same-line-gen-computed-names.js(default) +language/expressions/class/fields-same-line-gen-computed-names.js(strict mode) +language/expressions/class/fields-same-line-gen-computed-symbol-names.js(default) +language/expressions/class/fields-same-line-gen-computed-symbol-names.js(strict mode) +language/expressions/class/fields-same-line-gen-literal-names.js(default) +language/expressions/class/fields-same-line-gen-literal-names.js(strict mode) +language/expressions/class/fields-same-line-gen-private-names.js(default) +language/expressions/class/fields-same-line-gen-private-names.js(strict mode) +language/expressions/class/fields-same-line-gen-string-literal-names.js(default) +language/expressions/class/fields-same-line-gen-string-literal-names.js(strict mode) +language/expressions/class/fields-same-line-method-computed-names.js(default) +language/expressions/class/fields-same-line-method-computed-names.js(strict mode) +language/expressions/class/fields-same-line-method-computed-symbol-names.js(default) +language/expressions/class/fields-same-line-method-computed-symbol-names.js(strict mode) +language/expressions/class/fields-same-line-method-literal-names.js(default) +language/expressions/class/fields-same-line-method-literal-names.js(strict mode) +language/expressions/class/fields-same-line-method-private-names.js(default) +language/expressions/class/fields-same-line-method-private-names.js(strict mode) +language/expressions/class/fields-same-line-method-string-literal-names.js(default) +language/expressions/class/fields-same-line-method-string-literal-names.js(strict mode) +language/expressions/class/fields-wrapped-in-sc-computed-names.js(default) +language/expressions/class/fields-wrapped-in-sc-computed-names.js(strict mode) +language/expressions/class/fields-wrapped-in-sc-computed-symbol-names.js(default) +language/expressions/class/fields-wrapped-in-sc-computed-symbol-names.js(strict mode) +language/expressions/class/fields-wrapped-in-sc-literal-names.js(default) +language/expressions/class/fields-wrapped-in-sc-literal-names.js(strict mode) +language/expressions/class/fields-wrapped-in-sc-private-names.js(default) +language/expressions/class/fields-wrapped-in-sc-private-names.js(strict mode) +language/expressions/class/fields-wrapped-in-sc-string-literal-names.js(default) +language/expressions/class/fields-wrapped-in-sc-string-literal-names.js(strict mode) +language/expressions/division/bigint-and-number.js(default) +language/expressions/division/bigint-and-number.js(strict mode) language/expressions/division/bigint-arithmetic.js(default) language/expressions/division/bigint-arithmetic.js(strict mode) language/expressions/division/bigint-complex-infinity.js(default) language/expressions/division/bigint-complex-infinity.js(strict mode) +language/expressions/division/bigint-errors.js(default) +language/expressions/division/bigint-errors.js(strict mode) +language/expressions/division/bigint-toprimitive.js(default) +language/expressions/division/bigint-toprimitive.js(strict mode) +language/expressions/division/bigint-wrapped-values.js(default) +language/expressions/division/bigint-wrapped-values.js(strict mode) language/expressions/does-not-equals/bigint-and-bigint.js(default) language/expressions/does-not-equals/bigint-and-bigint.js(strict mode) language/expressions/does-not-equals/bigint-and-boolean.js(default) @@ -1372,10 +1233,18 @@ language/expressions/equals/bigint-and-object.js(default) language/expressions/equals/bigint-and-object.js(strict mode) language/expressions/equals/bigint-and-string.js(default) language/expressions/equals/bigint-and-string.js(strict mode) +language/expressions/exponentiation/bigint-and-number.js(default) +language/expressions/exponentiation/bigint-and-number.js(strict mode) language/expressions/exponentiation/bigint-arithmetic.js(default) language/expressions/exponentiation/bigint-arithmetic.js(strict mode) +language/expressions/exponentiation/bigint-errors.js(default) +language/expressions/exponentiation/bigint-errors.js(strict mode) language/expressions/exponentiation/bigint-exp-operator-negative-throws.js(default) language/expressions/exponentiation/bigint-exp-operator-negative-throws.js(strict mode) +language/expressions/exponentiation/bigint-toprimitive.js(default) +language/expressions/exponentiation/bigint-toprimitive.js(strict mode) +language/expressions/exponentiation/bigint-wrapped-values.js(default) +language/expressions/exponentiation/bigint-wrapped-values.js(strict mode) language/expressions/exponentiation/bigint-zero-base-zero-exponent.js(default) language/expressions/exponentiation/bigint-zero-base-zero-exponent.js(strict mode) language/expressions/greater-than/bigint-and-bigint.js(default) @@ -1394,6 +1263,18 @@ language/expressions/greater-than-or-equal/bigint-and-number-extremes.js(default language/expressions/greater-than-or-equal/bigint-and-number-extremes.js(strict mode) language/expressions/greater-than-or-equal/bigint-and-number.js(default) language/expressions/greater-than-or-equal/bigint-and-number.js(strict mode) +language/expressions/left-shift/bigint-and-number.js(default) +language/expressions/left-shift/bigint-and-number.js(strict mode) +language/expressions/left-shift/bigint-errors.js(default) +language/expressions/left-shift/bigint-errors.js(strict mode) +language/expressions/left-shift/bigint-non-primitive.js(default) +language/expressions/left-shift/bigint-non-primitive.js(strict mode) +language/expressions/left-shift/bigint-toprimitive.js(default) +language/expressions/left-shift/bigint-toprimitive.js(strict mode) +language/expressions/left-shift/bigint-wrapped-values.js(default) +language/expressions/left-shift/bigint-wrapped-values.js(strict mode) +language/expressions/left-shift/bigint.js(default) +language/expressions/left-shift/bigint.js(strict mode) language/expressions/less-than/bigint-and-bigint.js(default) language/expressions/less-than/bigint-and-bigint.js(strict mode) language/expressions/less-than/bigint-and-non-finite.js(default) @@ -1412,12 +1293,32 @@ language/expressions/less-than-or-equal/bigint-and-number.js(default) language/expressions/less-than-or-equal/bigint-and-number.js(strict mode) language/expressions/logical-not/bigint.js(default) language/expressions/logical-not/bigint.js(strict mode) +language/expressions/modulus/bigint-and-number.js(default) +language/expressions/modulus/bigint-and-number.js(strict mode) language/expressions/modulus/bigint-arithmetic.js(default) language/expressions/modulus/bigint-arithmetic.js(strict mode) +language/expressions/modulus/bigint-errors.js(default) +language/expressions/modulus/bigint-errors.js(strict mode) language/expressions/modulus/bigint-modulo-zero.js(default) language/expressions/modulus/bigint-modulo-zero.js(strict mode) +language/expressions/modulus/bigint-toprimitive.js(default) +language/expressions/modulus/bigint-toprimitive.js(strict mode) +language/expressions/modulus/bigint-wrapped-values.js(default) +language/expressions/modulus/bigint-wrapped-values.js(strict mode) +language/expressions/multiplication/bigint-and-number.js(default) +language/expressions/multiplication/bigint-and-number.js(strict mode) language/expressions/multiplication/bigint-arithmetic.js(default) language/expressions/multiplication/bigint-arithmetic.js(strict mode) +language/expressions/multiplication/bigint-errors.js(default) +language/expressions/multiplication/bigint-errors.js(strict mode) +language/expressions/multiplication/bigint-toprimitive.js(default) +language/expressions/multiplication/bigint-toprimitive.js(strict mode) +language/expressions/multiplication/bigint-wrapped-values.js(default) +language/expressions/multiplication/bigint-wrapped-values.js(strict mode) +language/expressions/object/let-non-strict-access.js(default) +language/expressions/object/let-non-strict-syntax.js(default) +language/expressions/object/yield-non-strict-access.js(default) +language/expressions/object/yield-non-strict-syntax.js(default) language/expressions/postfix-decrement/bigint.js(default) language/expressions/postfix-decrement/bigint.js(strict mode) language/expressions/postfix-increment/bigint.js(default) @@ -1426,6 +1327,18 @@ language/expressions/prefix-decrement/bigint.js(default) language/expressions/prefix-decrement/bigint.js(strict mode) language/expressions/prefix-increment/bigint.js(default) language/expressions/prefix-increment/bigint.js(strict mode) +language/expressions/right-shift/bigint-and-number.js(default) +language/expressions/right-shift/bigint-and-number.js(strict mode) +language/expressions/right-shift/bigint-errors.js(default) +language/expressions/right-shift/bigint-errors.js(strict mode) +language/expressions/right-shift/bigint-non-primitive.js(default) +language/expressions/right-shift/bigint-non-primitive.js(strict mode) +language/expressions/right-shift/bigint-toprimitive.js(default) +language/expressions/right-shift/bigint-toprimitive.js(strict mode) +language/expressions/right-shift/bigint-wrapped-values.js(default) +language/expressions/right-shift/bigint-wrapped-values.js(strict mode) +language/expressions/right-shift/bigint.js(default) +language/expressions/right-shift/bigint.js(strict mode) language/expressions/strict-does-not-equals/bigint-and-bigint.js(default) language/expressions/strict-does-not-equals/bigint-and-bigint.js(strict mode) language/expressions/strict-does-not-equals/bigint-and-boolean.js(default) @@ -1458,8 +1371,16 @@ language/expressions/strict-equals/bigint-and-object.js(default) language/expressions/strict-equals/bigint-and-object.js(strict mode) language/expressions/strict-equals/bigint-and-string.js(default) language/expressions/strict-equals/bigint-and-string.js(strict mode) +language/expressions/subtraction/bigint-and-number.js(default) +language/expressions/subtraction/bigint-and-number.js(strict mode) language/expressions/subtraction/bigint-arithmetic.js(default) language/expressions/subtraction/bigint-arithmetic.js(strict mode) +language/expressions/subtraction/bigint-errors.js(default) +language/expressions/subtraction/bigint-errors.js(strict mode) +language/expressions/subtraction/bigint-toprimitive.js(default) +language/expressions/subtraction/bigint-toprimitive.js(strict mode) +language/expressions/subtraction/bigint-wrapped-values.js(default) +language/expressions/subtraction/bigint-wrapped-values.js(strict mode) language/expressions/typeof/bigint.js(default) language/expressions/typeof/bigint.js(strict mode) language/expressions/unary-minus/bigint-non-primitive.js(default) @@ -1468,4 +1389,858 @@ language/expressions/unary-minus/bigint.js(default) language/expressions/unary-minus/bigint.js(strict mode) language/expressions/unary-plus/bigint-throws.js(default) language/expressions/unary-plus/bigint-throws.js(strict mode) +language/expressions/unsigned-right-shift/bigint-and-number.js(default) +language/expressions/unsigned-right-shift/bigint-and-number.js(strict mode) +language/expressions/unsigned-right-shift/bigint-errors.js(default) +language/expressions/unsigned-right-shift/bigint-errors.js(strict mode) +language/expressions/unsigned-right-shift/bigint-non-primitive.js(default) +language/expressions/unsigned-right-shift/bigint-non-primitive.js(strict mode) +language/expressions/unsigned-right-shift/bigint-toprimitive.js(default) +language/expressions/unsigned-right-shift/bigint-toprimitive.js(strict mode) +language/expressions/unsigned-right-shift/bigint-wrapped-values.js(default) +language/expressions/unsigned-right-shift/bigint-wrapped-values.js(strict mode) +language/expressions/unsigned-right-shift/bigint.js(default) +language/expressions/unsigned-right-shift/bigint.js(strict mode) +language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd.js(default) +language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bd.js(strict mode) +language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bds.js(default) +language/literals/numeric/numeric-separator-literal-bil-bd-nsl-bds.js(strict mode) +language/literals/numeric/numeric-separator-literal-bil-bds-nsl-bd.js(default) +language/literals/numeric/numeric-separator-literal-bil-bds-nsl-bd.js(strict mode) +language/literals/numeric/numeric-separator-literal-bil-bds-nsl-bds.js(default) +language/literals/numeric/numeric-separator-literal-bil-bds-nsl-bds.js(strict mode) +language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-minus-dd-nsl-dd.js(default) +language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-minus-dd-nsl-dd.js(strict mode) +language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-minus-dds-nsl-dd.js(default) +language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-minus-dds-nsl-dd.js(strict mode) +language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-plus-dd-nsl-dd.js(default) +language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-plus-dd-nsl-dd.js(strict mode) +language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-plus-dds-nsl-dd.js(default) +language/literals/numeric/numeric-separator-literal-dd-dot-dd-ep-sign-plus-dds-nsl-dd.js(strict mode) +language/literals/numeric/numeric-separator-literal-dd-nsl-dd-one-of.js(default) +language/literals/numeric/numeric-separator-literal-dd-nsl-dd-one-of.js(strict mode) +language/literals/numeric/numeric-separator-literal-dds-dot-dd-nsl-dd-ep-dd.js(default) +language/literals/numeric/numeric-separator-literal-dds-dot-dd-nsl-dd-ep-dd.js(strict mode) +language/literals/numeric/numeric-separator-literal-dds-nsl-dd.js(default) +language/literals/numeric/numeric-separator-literal-dds-nsl-dd.js(strict mode) +language/literals/numeric/numeric-separator-literal-dot-dd-nsl-dd-ep.js(default) +language/literals/numeric/numeric-separator-literal-dot-dd-nsl-dd-ep.js(strict mode) +language/literals/numeric/numeric-separator-literal-dot-dd-nsl-dds-ep.js(default) +language/literals/numeric/numeric-separator-literal-dot-dd-nsl-dds-ep.js(strict mode) +language/literals/numeric/numeric-separator-literal-dot-dds-nsl-dd-ep.js(default) +language/literals/numeric/numeric-separator-literal-dot-dds-nsl-dd-ep.js(strict mode) +language/literals/numeric/numeric-separator-literal-dot-dds-nsl-dds-ep.js(default) +language/literals/numeric/numeric-separator-literal-dot-dds-nsl-dds-ep.js(strict mode) +language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hd.js(default) +language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hd.js(strict mode) +language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hds.js(default) +language/literals/numeric/numeric-separator-literal-hil-hd-nsl-hds.js(strict mode) +language/literals/numeric/numeric-separator-literal-hil-hds-nsl-hd.js(default) +language/literals/numeric/numeric-separator-literal-hil-hds-nsl-hd.js(strict mode) +language/literals/numeric/numeric-separator-literal-hil-hds-nsl-hds.js(default) +language/literals/numeric/numeric-separator-literal-hil-hds-nsl-hds.js(strict mode) +language/literals/numeric/numeric-separator-literal-hil-od-nsl-od-one-of.js(default) +language/literals/numeric/numeric-separator-literal-hil-od-nsl-od-one-of.js(strict mode) +language/literals/numeric/numeric-separator-literal-nzd-nsl-dd-one-of.js(default) +language/literals/numeric/numeric-separator-literal-nzd-nsl-dd-one-of.js(strict mode) +language/literals/numeric/numeric-separator-literal-nzd-nsl-dd.js(default) +language/literals/numeric/numeric-separator-literal-nzd-nsl-dd.js(strict mode) +language/literals/numeric/numeric-separator-literal-nzd-nsl-dds.js(default) +language/literals/numeric/numeric-separator-literal-nzd-nsl-dds.js(strict mode) +language/literals/numeric/numeric-separator-literal-oil-od-nsl-od-one-of.js(default) +language/literals/numeric/numeric-separator-literal-oil-od-nsl-od-one-of.js(strict mode) +language/literals/numeric/numeric-separator-literal-oil-od-nsl-od.js(default) +language/literals/numeric/numeric-separator-literal-oil-od-nsl-od.js(strict mode) +language/literals/numeric/numeric-separator-literal-oil-od-nsl-ods.js(default) +language/literals/numeric/numeric-separator-literal-oil-od-nsl-ods.js(strict mode) +language/literals/numeric/numeric-separator-literal-oil-ods-nsl-od.js(default) +language/literals/numeric/numeric-separator-literal-oil-ods-nsl-od.js(strict mode) +language/literals/numeric/numeric-separator-literal-oil-ods-nsl-ods.js(default) +language/literals/numeric/numeric-separator-literal-oil-ods-nsl-ods.js(strict mode) +language/literals/numeric/numeric-separator-literal-sign-minus-dds-nsl-dd.js(default) +language/literals/numeric/numeric-separator-literal-sign-minus-dds-nsl-dd.js(strict mode) +language/literals/numeric/numeric-separator-literal-sign-plus-dds-nsl-dd.js(default) +language/literals/numeric/numeric-separator-literal-sign-plus-dds-nsl-dd.js(strict mode) +language/module-code/privatename-valid-no-earlyerr.js(default) +language/module-code/privatename-valid-no-earlyerr.js(strict mode) +language/statements/class/classelementname-abrupt-completion.js(default) +language/statements/class/classelementname-abrupt-completion.js(strict mode) +language/statements/class/fielddefinition-initializer-abrupt-completion.js(default) +language/statements/class/fielddefinition-initializer-abrupt-completion.js(strict mode) +language/statements/class/fields-after-same-line-gen-computed-names.js(default) +language/statements/class/fields-after-same-line-gen-computed-names.js(strict mode) +language/statements/class/fields-after-same-line-gen-computed-symbol-names.js(default) +language/statements/class/fields-after-same-line-gen-computed-symbol-names.js(strict mode) +language/statements/class/fields-after-same-line-gen-literal-names.js(default) +language/statements/class/fields-after-same-line-gen-literal-names.js(strict mode) +language/statements/class/fields-after-same-line-gen-private-names.js(default) +language/statements/class/fields-after-same-line-gen-private-names.js(strict mode) +language/statements/class/fields-after-same-line-gen-string-literal-names.js(default) +language/statements/class/fields-after-same-line-gen-string-literal-names.js(strict mode) +language/statements/class/fields-after-same-line-method-computed-names.js(default) +language/statements/class/fields-after-same-line-method-computed-names.js(strict mode) +language/statements/class/fields-after-same-line-method-computed-symbol-names.js(default) +language/statements/class/fields-after-same-line-method-computed-symbol-names.js(strict mode) +language/statements/class/fields-after-same-line-method-literal-names.js(default) +language/statements/class/fields-after-same-line-method-literal-names.js(strict mode) +language/statements/class/fields-after-same-line-method-private-names.js(default) +language/statements/class/fields-after-same-line-method-private-names.js(strict mode) +language/statements/class/fields-after-same-line-method-string-literal-names.js(default) +language/statements/class/fields-after-same-line-method-string-literal-names.js(strict mode) +language/statements/class/fields-after-same-line-static-async-gen-computed-names.js(default) +language/statements/class/fields-after-same-line-static-async-gen-computed-names.js(strict mode) +language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js(default) +language/statements/class/fields-after-same-line-static-async-gen-computed-symbol-names.js(strict mode) +language/statements/class/fields-after-same-line-static-async-gen-literal-names.js(default) +language/statements/class/fields-after-same-line-static-async-gen-literal-names.js(strict mode) +language/statements/class/fields-after-same-line-static-async-gen-private-names.js(default) +language/statements/class/fields-after-same-line-static-async-gen-private-names.js(strict mode) +language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js(default) +language/statements/class/fields-after-same-line-static-async-gen-string-literal-names.js(strict mode) +language/statements/class/fields-after-same-line-static-async-method-computed-names.js(default) +language/statements/class/fields-after-same-line-static-async-method-computed-names.js(strict mode) +language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js(default) +language/statements/class/fields-after-same-line-static-async-method-computed-symbol-names.js(strict mode) +language/statements/class/fields-after-same-line-static-async-method-literal-names.js(default) +language/statements/class/fields-after-same-line-static-async-method-literal-names.js(strict mode) +language/statements/class/fields-after-same-line-static-async-method-private-names.js(default) +language/statements/class/fields-after-same-line-static-async-method-private-names.js(strict mode) +language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js(default) +language/statements/class/fields-after-same-line-static-async-method-string-literal-names.js(strict mode) +language/statements/class/fields-after-same-line-static-gen-computed-names.js(default) +language/statements/class/fields-after-same-line-static-gen-computed-names.js(strict mode) +language/statements/class/fields-after-same-line-static-gen-computed-symbol-names.js(default) +language/statements/class/fields-after-same-line-static-gen-computed-symbol-names.js(strict mode) +language/statements/class/fields-after-same-line-static-gen-literal-names.js(default) +language/statements/class/fields-after-same-line-static-gen-literal-names.js(strict mode) +language/statements/class/fields-after-same-line-static-gen-private-names.js(default) +language/statements/class/fields-after-same-line-static-gen-private-names.js(strict mode) +language/statements/class/fields-after-same-line-static-gen-string-literal-names.js(default) +language/statements/class/fields-after-same-line-static-gen-string-literal-names.js(strict mode) +language/statements/class/fields-after-same-line-static-method-computed-names.js(default) +language/statements/class/fields-after-same-line-static-method-computed-names.js(strict mode) +language/statements/class/fields-after-same-line-static-method-computed-symbol-names.js(default) +language/statements/class/fields-after-same-line-static-method-computed-symbol-names.js(strict mode) +language/statements/class/fields-after-same-line-static-method-literal-names.js(default) +language/statements/class/fields-after-same-line-static-method-literal-names.js(strict mode) +language/statements/class/fields-after-same-line-static-method-private-names.js(default) +language/statements/class/fields-after-same-line-static-method-private-names.js(strict mode) +language/statements/class/fields-after-same-line-static-method-string-literal-names.js(default) +language/statements/class/fields-after-same-line-static-method-string-literal-names.js(strict mode) +language/statements/class/fields-asi-1.js(default) +language/statements/class/fields-asi-1.js(strict mode) +language/statements/class/fields-asi-2.js(default) +language/statements/class/fields-asi-2.js(strict mode) +language/statements/class/fields-asi-5.js(default) +language/statements/class/fields-asi-5.js(strict mode) +language/statements/class/fields-computed-name-propname-constructor.js(default) +language/statements/class/fields-computed-name-propname-constructor.js(strict mode) +language/statements/class/fields-computed-name-toprimitive-symbol.js(default) +language/statements/class/fields-computed-name-toprimitive-symbol.js(strict mode) +language/statements/class/fields-computed-name-toprimitive.js(default) +language/statements/class/fields-computed-name-toprimitive.js(strict mode) +language/statements/class/fields-computed-variable-name-propname-constructor.js(default) +language/statements/class/fields-computed-variable-name-propname-constructor.js(strict mode) +language/statements/class/fields-ctor-called-after-fields-init.js(default) +language/statements/class/fields-ctor-called-after-fields-init.js(strict mode) +language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js(default) +language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-1.js(strict mode) +language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js(default) +language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall-2.js(strict mode) +language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall.js(default) +language/statements/class/fields-derived-cls-direct-eval-err-contains-supercall.js(strict mode) +language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js(default) +language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-1.js(strict mode) +language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-2.js(default) +language/statements/class/fields-derived-cls-direct-eval-err-contains-superproperty-2.js(strict mode) +language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js(default) +language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-1.js(strict mode) +language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js(default) +language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall-2.js(strict mode) +language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js(default) +language/statements/class/fields-derived-cls-indirect-eval-err-contains-supercall.js(strict mode) +language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js(default) +language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-1.js(strict mode) +language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js(default) +language/statements/class/fields-derived-cls-indirect-eval-err-contains-superproperty-2.js(strict mode) +language/statements/class/fields-direct-eval-err-contains-arguments.js(default) +language/statements/class/fields-direct-eval-err-contains-arguments.js(strict mode) +language/statements/class/fields-direct-eval-err-contains-newtarget.js(default) +language/statements/class/fields-direct-eval-err-contains-newtarget.js(strict mode) +language/statements/class/fields-evaluation-error-computed-name-referenceerror.js(default) +language/statements/class/fields-evaluation-error-computed-name-referenceerror.js(strict mode) +language/statements/class/fields-evaluation-error-computed-name-toprimitive-err.js(default) +language/statements/class/fields-evaluation-error-computed-name-toprimitive-err.js(strict mode) +language/statements/class/fields-evaluation-error-computed-name-tostring-err.js(default) +language/statements/class/fields-evaluation-error-computed-name-tostring-err.js(strict mode) +language/statements/class/fields-evaluation-error-computed-name-valueof-err.js(default) +language/statements/class/fields-evaluation-error-computed-name-valueof-err.js(strict mode) +language/statements/class/fields-indirect-eval-err-contains-arguments.js(default) +language/statements/class/fields-indirect-eval-err-contains-arguments.js(strict mode) +language/statements/class/fields-indirect-eval-err-contains-newtarget.js(default) +language/statements/class/fields-indirect-eval-err-contains-newtarget.js(strict mode) +language/statements/class/fields-init-err-evaluation.js(default) +language/statements/class/fields-init-err-evaluation.js(strict mode) +language/statements/class/fields-init-value-defined-after-class.js(default) +language/statements/class/fields-init-value-defined-after-class.js(strict mode) +language/statements/class/fields-init-value-incremental.js(default) +language/statements/class/fields-init-value-incremental.js(strict mode) +language/statements/class/fields-multiple-definitions-computed-names.js(default) +language/statements/class/fields-multiple-definitions-computed-names.js(strict mode) +language/statements/class/fields-multiple-definitions-computed-symbol-names.js(default) +language/statements/class/fields-multiple-definitions-computed-symbol-names.js(strict mode) +language/statements/class/fields-multiple-definitions-literal-names.js(default) +language/statements/class/fields-multiple-definitions-literal-names.js(strict mode) +language/statements/class/fields-multiple-definitions-private-names.js(default) +language/statements/class/fields-multiple-definitions-private-names.js(strict mode) +language/statements/class/fields-multiple-definitions-string-literal-names.js(default) +language/statements/class/fields-multiple-definitions-string-literal-names.js(strict mode) +language/statements/class/fields-multiple-stacked-definitions-computed-names.js(default) +language/statements/class/fields-multiple-stacked-definitions-computed-names.js(strict mode) +language/statements/class/fields-multiple-stacked-definitions-computed-symbol-names.js(default) +language/statements/class/fields-multiple-stacked-definitions-computed-symbol-names.js(strict mode) +language/statements/class/fields-multiple-stacked-definitions-literal-names.js(default) +language/statements/class/fields-multiple-stacked-definitions-literal-names.js(strict mode) +language/statements/class/fields-multiple-stacked-definitions-private-names.js(default) +language/statements/class/fields-multiple-stacked-definitions-private-names.js(strict mode) +language/statements/class/fields-multiple-stacked-definitions-string-literal-names.js(default) +language/statements/class/fields-multiple-stacked-definitions-string-literal-names.js(strict mode) +language/statements/class/fields-new-no-sc-line-method-computed-names.js(default) +language/statements/class/fields-new-no-sc-line-method-computed-names.js(strict mode) +language/statements/class/fields-new-no-sc-line-method-computed-symbol-names.js(default) +language/statements/class/fields-new-no-sc-line-method-computed-symbol-names.js(strict mode) +language/statements/class/fields-new-no-sc-line-method-literal-names.js(default) +language/statements/class/fields-new-no-sc-line-method-literal-names.js(strict mode) +language/statements/class/fields-new-no-sc-line-method-private-names.js(default) +language/statements/class/fields-new-no-sc-line-method-private-names.js(strict mode) +language/statements/class/fields-new-no-sc-line-method-string-literal-names.js(default) +language/statements/class/fields-new-no-sc-line-method-string-literal-names.js(strict mode) +language/statements/class/fields-new-sc-line-gen-computed-names.js(default) +language/statements/class/fields-new-sc-line-gen-computed-names.js(strict mode) +language/statements/class/fields-new-sc-line-gen-computed-symbol-names.js(default) +language/statements/class/fields-new-sc-line-gen-computed-symbol-names.js(strict mode) +language/statements/class/fields-new-sc-line-gen-literal-names.js(default) +language/statements/class/fields-new-sc-line-gen-literal-names.js(strict mode) +language/statements/class/fields-new-sc-line-gen-private-names.js(default) +language/statements/class/fields-new-sc-line-gen-private-names.js(strict mode) +language/statements/class/fields-new-sc-line-gen-string-literal-names.js(default) +language/statements/class/fields-new-sc-line-gen-string-literal-names.js(strict mode) +language/statements/class/fields-new-sc-line-method-computed-names.js(default) +language/statements/class/fields-new-sc-line-method-computed-names.js(strict mode) +language/statements/class/fields-new-sc-line-method-computed-symbol-names.js(default) +language/statements/class/fields-new-sc-line-method-computed-symbol-names.js(strict mode) +language/statements/class/fields-new-sc-line-method-literal-names.js(default) +language/statements/class/fields-new-sc-line-method-literal-names.js(strict mode) +language/statements/class/fields-new-sc-line-method-private-names.js(default) +language/statements/class/fields-new-sc-line-method-private-names.js(strict mode) +language/statements/class/fields-new-sc-line-method-string-literal-names.js(default) +language/statements/class/fields-new-sc-line-method-string-literal-names.js(strict mode) +language/statements/class/fields-redeclaration-symbol.js(default) +language/statements/class/fields-redeclaration-symbol.js(strict mode) +language/statements/class/fields-redeclaration.js(default) +language/statements/class/fields-redeclaration.js(strict mode) +language/statements/class/fields-regular-definitions-computed-names.js(default) +language/statements/class/fields-regular-definitions-computed-names.js(strict mode) +language/statements/class/fields-regular-definitions-computed-symbol-names.js(default) +language/statements/class/fields-regular-definitions-computed-symbol-names.js(strict mode) +language/statements/class/fields-regular-definitions-literal-names.js(default) +language/statements/class/fields-regular-definitions-literal-names.js(strict mode) +language/statements/class/fields-regular-definitions-private-names.js(default) +language/statements/class/fields-regular-definitions-private-names.js(strict mode) +language/statements/class/fields-regular-definitions-string-literal-names.js(default) +language/statements/class/fields-regular-definitions-string-literal-names.js(strict mode) +language/statements/class/fields-same-line-async-gen-computed-names.js(default) +language/statements/class/fields-same-line-async-gen-computed-names.js(strict mode) +language/statements/class/fields-same-line-async-gen-computed-symbol-names.js(default) +language/statements/class/fields-same-line-async-gen-computed-symbol-names.js(strict mode) +language/statements/class/fields-same-line-async-gen-literal-names.js(default) +language/statements/class/fields-same-line-async-gen-literal-names.js(strict mode) +language/statements/class/fields-same-line-async-gen-private-names.js(default) +language/statements/class/fields-same-line-async-gen-private-names.js(strict mode) +language/statements/class/fields-same-line-async-gen-string-literal-names.js(default) +language/statements/class/fields-same-line-async-gen-string-literal-names.js(strict mode) +language/statements/class/fields-same-line-async-method-computed-names.js(default) +language/statements/class/fields-same-line-async-method-computed-names.js(strict mode) +language/statements/class/fields-same-line-async-method-computed-symbol-names.js(default) +language/statements/class/fields-same-line-async-method-computed-symbol-names.js(strict mode) +language/statements/class/fields-same-line-async-method-literal-names.js(default) +language/statements/class/fields-same-line-async-method-literal-names.js(strict mode) +language/statements/class/fields-same-line-async-method-private-names.js(default) +language/statements/class/fields-same-line-async-method-private-names.js(strict mode) +language/statements/class/fields-same-line-async-method-string-literal-names.js(default) +language/statements/class/fields-same-line-async-method-string-literal-names.js(strict mode) +language/statements/class/fields-same-line-gen-computed-names.js(default) +language/statements/class/fields-same-line-gen-computed-names.js(strict mode) +language/statements/class/fields-same-line-gen-computed-symbol-names.js(default) +language/statements/class/fields-same-line-gen-computed-symbol-names.js(strict mode) +language/statements/class/fields-same-line-gen-literal-names.js(default) +language/statements/class/fields-same-line-gen-literal-names.js(strict mode) +language/statements/class/fields-same-line-gen-private-names.js(default) +language/statements/class/fields-same-line-gen-private-names.js(strict mode) +language/statements/class/fields-same-line-gen-string-literal-names.js(default) +language/statements/class/fields-same-line-gen-string-literal-names.js(strict mode) +language/statements/class/fields-same-line-method-computed-names.js(default) +language/statements/class/fields-same-line-method-computed-names.js(strict mode) +language/statements/class/fields-same-line-method-computed-symbol-names.js(default) +language/statements/class/fields-same-line-method-computed-symbol-names.js(strict mode) +language/statements/class/fields-same-line-method-literal-names.js(default) +language/statements/class/fields-same-line-method-literal-names.js(strict mode) +language/statements/class/fields-same-line-method-private-names.js(default) +language/statements/class/fields-same-line-method-private-names.js(strict mode) +language/statements/class/fields-same-line-method-string-literal-names.js(default) +language/statements/class/fields-same-line-method-string-literal-names.js(strict mode) +language/statements/class/fields-wrapped-in-sc-computed-names.js(default) +language/statements/class/fields-wrapped-in-sc-computed-names.js(strict mode) +language/statements/class/fields-wrapped-in-sc-computed-symbol-names.js(default) +language/statements/class/fields-wrapped-in-sc-computed-symbol-names.js(strict mode) +language/statements/class/fields-wrapped-in-sc-literal-names.js(default) +language/statements/class/fields-wrapped-in-sc-literal-names.js(strict mode) +language/statements/class/fields-wrapped-in-sc-private-names.js(default) +language/statements/class/fields-wrapped-in-sc-private-names.js(strict mode) +language/statements/class/fields-wrapped-in-sc-string-literal-names.js(default) +language/statements/class/fields-wrapped-in-sc-string-literal-names.js(strict mode) +language/statements/class/privatefieldadd-typeerror.js(default) +language/statements/class/privatefieldadd-typeerror.js(strict mode) +language/statements/class/privatefieldget-success-1.js(default) +language/statements/class/privatefieldget-success-1.js(strict mode) +language/statements/class/privatefieldget-success-2.js(default) +language/statements/class/privatefieldget-success-2.js(strict mode) +language/statements/class/privatefieldget-success-3.js(default) +language/statements/class/privatefieldget-success-3.js(strict mode) +language/statements/class/privatefieldget-success-4.js(default) +language/statements/class/privatefieldget-success-4.js(strict mode) +language/statements/class/privatefieldget-success-5.js(default) +language/statements/class/privatefieldget-success-5.js(strict mode) +language/statements/class/privatefieldget-typeerror-1.js(default) +language/statements/class/privatefieldget-typeerror-1.js(strict mode) +language/statements/class/privatefieldget-typeerror-2.js(default) +language/statements/class/privatefieldget-typeerror-2.js(strict mode) +language/statements/class/privatefieldget-typeerror-3.js(default) +language/statements/class/privatefieldget-typeerror-3.js(strict mode) +language/statements/class/privatefieldget-typeerror-4.js(default) +language/statements/class/privatefieldget-typeerror-4.js(strict mode) +language/statements/class/privatefieldget-typeerror-5.js(default) +language/statements/class/privatefieldget-typeerror-5.js(strict mode) +language/statements/class/privatefieldset-typeerror-1.js(default) +language/statements/class/privatefieldset-typeerror-1.js(strict mode) +language/statements/class/privatefieldset-typeerror-2.js(default) +language/statements/class/privatefieldset-typeerror-2.js(strict mode) +language/statements/class/privatefieldset-typeerror-3.js(default) +language/statements/class/privatefieldset-typeerror-3.js(strict mode) +language/statements/class/privatefieldset-typeerror-4.js(default) +language/statements/class/privatefieldset-typeerror-4.js(strict mode) +language/statements/class/privatefieldset-typeerror-5.js(default) +language/statements/class/privatefieldset-typeerror-5.js(strict mode) +language/statements/class/privatename-not-valid-eval-earlyerr-3.js(default) +language/statements/class/privatename-not-valid-eval-earlyerr-3.js(strict mode) +language/statements/class/privatename-not-valid-eval-earlyerr-4.js(default) +language/statements/class/privatename-not-valid-eval-earlyerr-4.js(strict mode) +language/statements/class/privatename-not-valid-eval-earlyerr-5.js(default) +language/statements/class/privatename-not-valid-eval-earlyerr-5.js(strict mode) +language/statements/class/privatename-valid-no-earlyerr.js(default) +language/statements/class/privatename-valid-no-earlyerr.js(strict mode) +language/statements/class/super-fielddefinition-initializer-abrupt-completion.js(default) +language/statements/class/super-fielddefinition-initializer-abrupt-completion.js(strict mode) +language/statements/for/head-lhs-let.js(default) +language/statements/for/let-block-with-newline.js(default) +language/statements/for/let-identifier-with-newline.js(default) +language/statements/for-await-of/let-block-with-newline.js(default) +language/statements/for-await-of/let-identifier-with-newline.js(default) +language/statements/for-in/head-lhs-let.js(default) +language/statements/for-in/head-var-bound-names-let.js(default) language/statements/for-in/identifier-let-allowed-as-lefthandside-expression-not-strict.js(default) +language/statements/for-in/let-block-with-newline.js(default) +language/statements/for-in/let-identifier-with-newline.js(default) +language/statements/for-of/dstr-obj-id-identifier-yield-ident-valid.js(default) +language/statements/for-of/head-var-bound-names-let.js(default) +language/statements/for-of/let-block-with-newline.js(default) +language/statements/for-of/let-identifier-with-newline.js(default) +language/statements/if/let-block-with-newline.js(default) +language/statements/if/let-identifier-with-newline.js(default) +language/statements/labeled/let-block-with-newline.js(default) +language/statements/labeled/let-identifier-with-newline.js(default) +language/statements/labeled/value-yield-non-strict-escaped.js(default) +language/statements/labeled/value-yield-non-strict.js(default) +language/statements/let/syntax/escaped-let.js(default) +language/statements/while/let-block-with-newline.js(default) +language/statements/while/let-identifier-with-newline.js(default) +language/statements/with/let-block-with-newline.js(default) +language/statements/with/let-identifier-with-newline.js(default) +annexB/language/statements/for-in/bare-initializer.js(default) +annexB/language/statements/for-in/bare-initializer.js(strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/block-scope/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/block-scope/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/block-scope/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/block-scope/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/block-scope/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/expressions/assignment/dstr-array-rest-before-elision.js(default) +language/expressions/assignment/dstr-array-rest-before-elision.js(strict mode) +language/expressions/assignment/dstr-array-rest-elision-invalid.js(default) +language/expressions/assignment/dstr-array-rest-elision-invalid.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/async-arrow-function/early-errors-arrow-formals-body-duplicate.js(default) +language/expressions/async-arrow-function/early-errors-arrow-formals-body-duplicate.js(strict mode) +language/expressions/async-function/early-errors-expression-formals-body-duplicate.js(default) +language/expressions/async-function/early-errors-expression-formals-body-duplicate.js(strict mode) +language/expressions/async-function/named-dflt-params-duplicates.js(default) +language/expressions/async-function/nameless-dflt-params-duplicates.js(default) +language/expressions/async-generator/dflt-params-duplicates.js(default) +language/expressions/async-generator/early-errors-expression-await-as-function-binding-identifier.js(default) +language/expressions/async-generator/early-errors-expression-await-as-function-binding-identifier.js(strict mode) +language/expressions/async-generator/early-errors-expression-formals-body-duplicate-const.js(default) +language/expressions/async-generator/early-errors-expression-formals-body-duplicate-const.js(strict mode) +language/expressions/async-generator/early-errors-expression-formals-body-duplicate-let.js(default) +language/expressions/async-generator/early-errors-expression-formals-body-duplicate-let.js(strict mode) +language/expressions/async-generator/early-errors-expression-formals-contains-await.js(default) +language/expressions/async-generator/early-errors-expression-formals-contains-await.js(strict mode) +language/expressions/async-generator/named-dflt-params-duplicates.js(default) +language/expressions/function/dflt-params-duplicates.js(default) +language/expressions/generators/dflt-params-duplicates.js(default) +language/expressions/object/method-definition/async-gen-meth-dflt-params-duplicates.js(default) +language/expressions/object/method-definition/async-meth-dflt-params-duplicates.js(default) +language/expressions/object/method-definition/early-errors-object-method-async-lineterminator.js(default) +language/expressions/object/method-definition/early-errors-object-method-async-lineterminator.js(strict mode) +language/expressions/object/method-definition/early-errors-object-method-await-in-formals-default.js(default) +language/expressions/object/method-definition/early-errors-object-method-await-in-formals-default.js(strict mode) +language/expressions/object/method-definition/early-errors-object-method-await-in-formals.js(default) +language/expressions/object/method-definition/early-errors-object-method-await-in-formals.js(strict mode) +language/expressions/object/method-definition/early-errors-object-method-duplicate-parameters.js(default) +language/expressions/object/method-definition/gen-meth-dflt-params-duplicates.js(default) +language/expressions/object/method-definition/generator-param-redecl-const.js(default) +language/expressions/object/method-definition/generator-param-redecl-const.js(strict mode) +language/expressions/object/method-definition/generator-param-redecl-let.js(default) +language/expressions/object/method-definition/generator-param-redecl-let.js(strict mode) +language/expressions/object/method-definition/meth-dflt-params-duplicates.js(default) +language/expressions/object/method-definition/name-param-redecl.js(default) +language/expressions/object/method-definition/name-param-redecl.js(strict mode) +language/expressions/template-literal/invalid-legacy-octal-escape-sequence.js(default) +language/expressions/template-literal/invalid-legacy-octal-escape-sequence.js(strict mode) +language/expressions/yield/in-iteration-stmt.js(default) +language/expressions/yield/in-iteration-stmt.js(strict mode) +language/expressions/yield/star-in-iteration-stmt.js(default) +language/expressions/yield/star-in-iteration-stmt.js(strict mode) +language/global-code/new.target-arrow.js(default) +language/global-code/new.target-arrow.js(strict mode) +language/import/dup-bound-names.js(default) +language/import/dup-bound-names.js(strict mode) +language/literals/regexp/early-err-dup-flag.js(default) +language/literals/regexp/early-err-dup-flag.js(strict mode) +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/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-quantifiable-assertion.js(default) +language/literals/regexp/u-invalid-quantifiable-assertion.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/legacy-non-octal-escape-sequence-strict.js(strict mode) +language/module-code/early-export-global.js(default) +language/module-code/early-export-global.js(strict mode) +language/module-code/early-export-unresolvable.js(default) +language/module-code/early-export-unresolvable.js(strict mode) +language/module-code/early-lex-and-var.js(default) +language/module-code/early-lex-and-var.js(strict mode) +language/module-code/parse-err-hoist-lex-fun.js(default) +language/module-code/parse-err-hoist-lex-fun.js(strict mode) +language/module-code/parse-err-hoist-lex-gen.js(default) +language/module-code/parse-err-hoist-lex-gen.js(strict mode) +language/statements/async-function/dflt-params-duplicates.js(default) +language/statements/async-function/early-errors-declaration-await-in-formals-default.js(default) +language/statements/async-function/early-errors-declaration-await-in-formals-default.js(strict mode) +language/statements/async-function/early-errors-declaration-await-in-formals.js(default) +language/statements/async-function/early-errors-declaration-await-in-formals.js(strict mode) +language/statements/async-function/early-errors-declaration-formals-body-duplicate.js(default) +language/statements/async-function/early-errors-declaration-formals-body-duplicate.js(strict mode) +language/statements/async-generator/dflt-params-duplicates.js(default) +language/statements/class/async-gen-meth-escaped-async.js(default) +language/statements/class/async-gen-meth-escaped-async.js(strict mode) +language/statements/class/async-meth-escaped-async.js(default) +language/statements/class/async-meth-escaped-async.js(strict mode) +language/statements/class/definition/early-errors-class-method-await-in-formals-default.js(default) +language/statements/class/definition/early-errors-class-method-await-in-formals-default.js(strict mode) +language/statements/class/definition/early-errors-class-method-await-in-formals.js(default) +language/statements/class/definition/early-errors-class-method-await-in-formals.js(strict mode) +language/statements/class/strict-mode/with.js(default) +language/statements/class/syntax/early-errors/class-body-has-direct-super-missing-class-heritage.js(default) +language/statements/class/syntax/early-errors/class-body-has-direct-super-missing-class-heritage.js(strict mode) +language/statements/class/syntax/early-errors/class-definition-evaluation-block-duplicate-binding.js(default) +language/statements/class/syntax/early-errors/class-definition-evaluation-block-duplicate-binding.js(strict mode) +language/statements/class/syntax/early-errors/class-definition-evaluation-scriptbody-duplicate-binding.js(default) +language/statements/class/syntax/early-errors/class-definition-evaluation-scriptbody-duplicate-binding.js(strict mode) +language/statements/const/redeclaration-error-from-within-strict-mode-function-const.js(default) +language/statements/do-while/decl-async-fun.js(default) +language/statements/do-while/decl-async-fun.js(strict mode) +language/statements/do-while/decl-async-gen.js(default) +language/statements/do-while/decl-async-gen.js(strict mode) +language/statements/do-while/labelled-fn-stmt.js(default) +language/statements/for/decl-async-fun.js(default) +language/statements/for/decl-async-fun.js(strict mode) +language/statements/for/decl-async-gen.js(default) +language/statements/for/decl-async-gen.js(strict mode) +language/statements/for/head-let-bound-names-in-stmt.js(default) +language/statements/for/head-let-bound-names-in-stmt.js(strict mode) +language/statements/for/labelled-fn-stmt-expr.js(default) +language/statements/for/labelled-fn-stmt-let.js(default) +language/statements/for/labelled-fn-stmt-var.js(default) +language/statements/for-in/decl-async-fun.js(default) +language/statements/for-in/decl-async-fun.js(strict mode) +language/statements/for-in/decl-async-gen.js(default) +language/statements/for-in/decl-async-gen.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-in/head-const-bound-names-dup.js(default) +language/statements/for-in/head-const-bound-names-dup.js(strict mode) +language/statements/for-in/head-const-bound-names-in-stmt.js(default) +language/statements/for-in/head-const-bound-names-in-stmt.js(strict mode) +language/statements/for-in/head-let-bound-names-dup.js(default) +language/statements/for-in/head-let-bound-names-dup.js(strict mode) +language/statements/for-in/head-let-bound-names-in-stmt.js(default) +language/statements/for-in/head-let-bound-names-in-stmt.js(strict mode) +language/statements/for-in/labelled-fn-stmt-const.js(default) +language/statements/for-in/labelled-fn-stmt-let.js(default) +language/statements/for-in/labelled-fn-stmt-lhs.js(default) +language/statements/for-in/labelled-fn-stmt-var.js(default) +language/statements/for-of/decl-async-fun.js(default) +language/statements/for-of/decl-async-fun.js(strict mode) +language/statements/for-of/decl-async-gen.js(default) +language/statements/for-of/decl-async-gen.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) +language/statements/for-of/head-const-bound-names-dup.js(default) +language/statements/for-of/head-const-bound-names-dup.js(strict mode) +language/statements/for-of/head-const-bound-names-in-stmt.js(default) +language/statements/for-of/head-const-bound-names-in-stmt.js(strict mode) +language/statements/for-of/head-decl-no-expr.js(default) +language/statements/for-of/head-decl-no-expr.js(strict mode) +language/statements/for-of/head-expr-no-expr.js(default) +language/statements/for-of/head-expr-no-expr.js(strict mode) +language/statements/for-of/head-let-bound-names-dup.js(default) +language/statements/for-of/head-let-bound-names-dup.js(strict mode) +language/statements/for-of/head-let-bound-names-in-stmt.js(default) +language/statements/for-of/head-let-bound-names-in-stmt.js(strict mode) +language/statements/for-of/head-var-no-expr.js(default) +language/statements/for-of/head-var-no-expr.js(strict mode) +language/statements/for-of/labelled-fn-stmt-const.js(default) +language/statements/for-of/labelled-fn-stmt-let.js(default) +language/statements/for-of/labelled-fn-stmt-lhs.js(default) +language/statements/for-of/labelled-fn-stmt-var.js(default) +language/statements/function/dflt-params-duplicates.js(default) +language/statements/generators/dflt-params-duplicates.js(default) +language/statements/if/if-async-fun-else-async-fun.js(default) +language/statements/if/if-async-fun-else-async-fun.js(strict mode) +language/statements/if/if-async-fun-else-stmt.js(default) +language/statements/if/if-async-fun-else-stmt.js(strict mode) +language/statements/if/if-async-fun-no-else.js(default) +language/statements/if/if-async-fun-no-else.js(strict mode) +language/statements/if/if-async-gen-else-async-gen.js(default) +language/statements/if/if-async-gen-else-async-gen.js(strict mode) +language/statements/if/if-async-gen-else-stmt.js(default) +language/statements/if/if-async-gen-else-stmt.js(strict mode) +language/statements/if/if-async-gen-no-else.js(default) +language/statements/if/if-async-gen-no-else.js(strict mode) +language/statements/if/if-stmt-else-async-fun.js(default) +language/statements/if/if-stmt-else-async-fun.js(strict mode) +language/statements/if/if-stmt-else-async-gen.js(default) +language/statements/if/if-stmt-else-async-gen.js(strict mode) +language/statements/if/labelled-fn-stmt-first.js(default) +language/statements/if/labelled-fn-stmt-lone.js(default) +language/statements/if/labelled-fn-stmt-second.js(default) +language/statements/let/redeclaration-error-from-within-strict-mode-function.js(default) +language/statements/let/syntax/attempt-to-redeclare-let-binding-with-function-declaration.js(default) +language/statements/let/syntax/attempt-to-redeclare-let-binding-with-function-declaration.js(strict mode) +language/statements/let/syntax/attempt-to-redeclare-let-binding-with-var.js(default) +language/statements/let/syntax/attempt-to-redeclare-let-binding-with-var.js(strict mode) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/statements/switch/syntax/redeclaration/class-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/statements/switch/syntax/redeclaration/const-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/statements/switch/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-var-declaration.js(default) +language/statements/switch/syntax/redeclaration/let-declaration-attempt-to-redeclare-with-var-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-async-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js(default) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-class-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-const-declaration.js(default) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-const-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js(default) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-function-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js(default) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-generator-declaration.js(strict mode) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-let-declaration.js(default) +language/statements/switch/syntax/redeclaration/var-declaration-attempt-to-redeclare-with-let-declaration.js(strict mode) +language/statements/try/early-catch-lex.js(default) +language/statements/try/early-catch-lex.js(strict mode) +language/statements/try/early-catch-var.js(default) +language/statements/try/early-catch-var.js(strict mode) +language/statements/while/decl-async-fun.js(default) +language/statements/while/decl-async-fun.js(strict mode) +language/statements/while/decl-async-gen.js(default) +language/statements/while/decl-async-gen.js(strict mode) +language/statements/while/labelled-fn-stmt.js(default) +language/statements/with/decl-async-fun.js(default) +language/statements/with/decl-async-gen.js(default) +language/statements/with/labelled-fn-stmt.js(default) +language/white-space/mongolian-vowel-separator.js(default) +language/white-space/mongolian-vowel-separator.js(strict mode) diff --git a/test/mocha.opts b/test/mocha.opts deleted file mode 100644 index 939595b1b1d78..0000000000000 --- a/test/mocha.opts +++ /dev/null @@ -1 +0,0 @@ ---reporter dot --ui tdd --timeout 10000 --compilers js:@babel/register diff --git a/test/testSetupFile.js b/test/testSetupFile.js new file mode 100644 index 0000000000000..b5062b8542544 --- /dev/null +++ b/test/testSetupFile.js @@ -0,0 +1 @@ +jest.setTimeout(10000); diff --git a/test/warning.js b/test/warning.js deleted file mode 100644 index 072f4a8f07c26..0000000000000 --- a/test/warning.js +++ /dev/null @@ -1,2 +0,0 @@ -console.error("Don't run `mocha` directly. Use `make test`. See CONTRIBUTING.md for usage instructions."); -process.exit(0); diff --git a/yarn.lock b/yarn.lock index 2b1189861f8fd..65b0a27b7ef78 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,9 +2,9 @@ # yarn lockfile v1 -"@babel/cli@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.0.0-beta.39.tgz#0764d7ed63880ab322762f1401cc32bb9b4ec006" +"@babel/cli@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.0.0-beta.41.tgz#d9fa9d5409a1e73a63d0e3ccc0889afc1f20d946" dependencies: commander "^2.8.1" convert-source-map "^1.1.0" @@ -17,646 +17,766 @@ optionalDependencies: chokidar "^1.6.1" -"@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", "@babel/code-frame@^7.0.0-beta.35", "@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/code-frame@7.0.0-beta.38": - version "7.0.0-beta.38" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.38.tgz#c0af5930617e55e050336838e3a3670983b0b2b2" +"@babel/code-frame@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.41.tgz#68845c10a895050ab643e869100bbcf294b64e09" dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^3.0.0" + "@babel/highlight" "7.0.0-beta.41" -"@babel/code-frame@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.39.tgz#91c90bb65207fc5a55128cb54956ded39e850457" +"@babel/core@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.0.0-beta.41.tgz#796a318ffd2c46e006f133a474b3be67f94e9ca5" dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - -"@babel/core@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.0.0-beta.39.tgz#242b8c0b99573de0395eaaa94e2d82a9cd008cf3" - dependencies: - "@babel/code-frame" "7.0.0-beta.39" - "@babel/generator" "7.0.0-beta.39" - "@babel/helpers" "7.0.0-beta.39" - "@babel/template" "7.0.0-beta.39" - "@babel/traverse" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" - babylon "7.0.0-beta.39" + "@babel/code-frame" "7.0.0-beta.41" + "@babel/generator" "7.0.0-beta.41" + "@babel/helpers" "7.0.0-beta.41" + "@babel/template" "7.0.0-beta.41" + "@babel/traverse" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" + babylon "7.0.0-beta.41" convert-source-map "^1.1.0" - debug "^3.0.1" + debug "^3.1.0" json5 "^0.5.0" lodash "^4.2.0" micromatch "^2.3.11" resolve "^1.3.2" + semver "^5.4.1" source-map "^0.5.0" -"@babel/generator@7.0.0-beta.38": - version "7.0.0-beta.38" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.38.tgz#6115a66663e3adfd1d6844029ffb2354680182eb" +"@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.38" + "@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/generator@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.39.tgz#d2c9f0a9c47d5ff288f0306aedd0cf89983cb6ed" +"@babel/generator@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.41.tgz#5fce0676cea5acc1d493480d9fb7317ea2164d3f" dependencies: - "@babel/types" "7.0.0-beta.39" + "@babel/types" "7.0.0-beta.41" jsesc "^2.5.1" lodash "^4.2.0" source-map "^0.5.0" trim-right "^1.0.1" -"@babel/helper-annotate-as-pure@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0-beta.39.tgz#cf9506c721c838806ca5eabe15783507ba2edce0" +"@babel/helper-annotate-as-pure@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0-beta.41.tgz#dcf9a282d013cc68dc8944966939b9db951948af" dependencies: - "@babel/types" "7.0.0-beta.39" + "@babel/types" "7.0.0-beta.41" -"@babel/helper-builder-binary-assignment-operator-visitor@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.0.0-beta.39.tgz#ce97bd572aeb2b2c1200c7a49dba019659a95f3c" +"@babel/helper-builder-binary-assignment-operator-visitor@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.0.0-beta.41.tgz#7d30fa36fb7e2ac5d60d65990db41235718bc5df" dependencies: - "@babel/helper-explode-assignable-expression" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" + "@babel/helper-explode-assignable-expression" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" -"@babel/helper-call-delegate@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.0.0-beta.39.tgz#7851645811a4bc3eb7cf5f1c72b1c754d0a5e45d" +"@babel/helper-call-delegate@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-call-delegate/-/helper-call-delegate-7.0.0-beta.41.tgz#a95bfbe164ce3b2cb2579772639a60941f67c906" dependencies: - "@babel/helper-hoist-variables" "7.0.0-beta.39" - "@babel/traverse" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" + "@babel/helper-hoist-variables" "7.0.0-beta.41" + "@babel/traverse" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" -"@babel/helper-define-map@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.0.0-beta.39.tgz#3da7e7a94a213fde02f936b08dc458f546350caa" +"@babel/helper-define-map@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-define-map/-/helper-define-map-7.0.0-beta.41.tgz#7f0114bf0242441d96c2158b274843984b2f0b62" dependencies: - "@babel/helper-function-name" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" + "@babel/helper-function-name" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" lodash "^4.2.0" -"@babel/helper-explode-assignable-expression@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.0.0-beta.39.tgz#13d3068b6408b9c191d402df62bd356220884f8f" +"@babel/helper-explode-assignable-expression@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.0.0-beta.41.tgz#d390d4da67eaea6457ff202bc416fae3b9820c79" dependencies: - "@babel/traverse" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" + "@babel/traverse" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" -"@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.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.36" - "@babel/template" "7.0.0-beta.36" - "@babel/types" "7.0.0-beta.36" + "@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.38": - version "7.0.0-beta.38" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.38.tgz#dc6e74930efc7b0236b5ba72a633d34c778ba015" +"@babel/helper-function-name@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.41.tgz#5c50bc96c50b23383aad413b84a3ee806ceaa0e1" dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.38" - "@babel/template" "7.0.0-beta.38" - "@babel/types" "7.0.0-beta.38" + "@babel/helper-get-function-arity" "7.0.0-beta.41" + "@babel/template" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" -"@babel/helper-function-name@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.39.tgz#34f8ca0c46cdd7056ae706468a8078dab53dbc91" +"@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.39" - "@babel/template" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" + "@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/helper-get-function-arity@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.41.tgz#04b9e89d783f6c2223fbb81e11e59235a7781713" dependencies: - "@babel/types" "7.0.0-beta.36" + "@babel/types" "7.0.0-beta.41" -"@babel/helper-get-function-arity@7.0.0-beta.38": - version "7.0.0-beta.38" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.38.tgz#5c27de7641ac31da6e947dcc8009bd31282d9d84" +"@babel/helper-hoist-variables@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0-beta.41.tgz#c776a0c49cf359833b0cd8d4cacffb3fe78fe369" dependencies: - "@babel/types" "7.0.0-beta.38" + "@babel/types" "7.0.0-beta.41" -"@babel/helper-get-function-arity@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.39.tgz#f542cb644c7866f9335b1ffc0614bbe633bd60ce" +"@babel/helper-module-imports@7.0.0-beta.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0-beta.35.tgz#308e350e731752cdb4d0f058df1d704925c64e0a" dependencies: - "@babel/types" "7.0.0-beta.39" + "@babel/types" "7.0.0-beta.35" + lodash "^4.2.0" -"@babel/helper-hoist-variables@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0-beta.39.tgz#3a2d4929783ef3445686e768f52bfcf9ffb182b9" +"@babel/helper-module-imports@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0-beta.41.tgz#c639ad715483bb6ec585eb08793d3220a062bc70" dependencies: - "@babel/types" "7.0.0-beta.39" + "@babel/types" "7.0.0-beta.41" + lodash "^4.2.0" -"@babel/helper-module-imports@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0-beta.39.tgz#39e1fd4b8f5982b05417f73250a620070541192e" +"@babel/helper-module-transforms@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.0.0-beta.41.tgz#ecb27cdf7b7ced08bc6d1aa2cf67056a2596650b" dependencies: - "@babel/types" "7.0.0-beta.39" + "@babel/helper-module-imports" "7.0.0-beta.41" + "@babel/helper-simple-access" "7.0.0-beta.41" + "@babel/helper-split-export-declaration" "7.0.0-beta.41" + "@babel/template" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" lodash "^4.2.0" -"@babel/helper-module-transforms@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.0.0-beta.39.tgz#3ebf72bc2cb6453e9c5930a667496bdfa64bcf5e" +"@babel/helper-optimise-call-expression@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0-beta.41.tgz#4e2df61f5a0900ef113a3b861253136593d47f3d" + dependencies: + "@babel/types" "7.0.0-beta.41" + +"@babel/helper-plugin-utils@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0-beta.41.tgz#b515524853b2e509409ccbcd8b0bc3586da3e7f0" + +"@babel/helper-regex@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.0.0-beta.41.tgz#5c02e6e31546d4f4a928a82e1c1a28f0d8937637" dependencies: - "@babel/helper-module-imports" "7.0.0-beta.39" - "@babel/helper-simple-access" "7.0.0-beta.39" - "@babel/template" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" lodash "^4.2.0" -"@babel/helper-optimise-call-expression@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0-beta.39.tgz#2f2c76665fb9128feb0b84a162b3dcaecc53a102" +"@babel/helper-remap-async-to-generator@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.0.0-beta.41.tgz#212e2f3fc24635d25cc6f1bd394da1dde1f91c36" + dependencies: + "@babel/helper-annotate-as-pure" "7.0.0-beta.41" + "@babel/helper-wrap-function" "7.0.0-beta.41" + "@babel/template" "7.0.0-beta.41" + "@babel/traverse" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" + +"@babel/helper-replace-supers@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.0.0-beta.41.tgz#3c0c4a2e1f0cdd934ab0ef31bf41376f32f4ef74" dependencies: - "@babel/types" "7.0.0-beta.39" + "@babel/helper-optimise-call-expression" "7.0.0-beta.41" + "@babel/template" "7.0.0-beta.41" + "@babel/traverse" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" -"@babel/helper-regex@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-regex/-/helper-regex-7.0.0-beta.39.tgz#852d94c0eedcf1d9b8513cda01f18c4838592c41" +"@babel/helper-simple-access@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.0.0-beta.41.tgz#fd6791214dac026d6cc3f2a3b15477137205fbad" dependencies: + "@babel/template" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" lodash "^4.2.0" -"@babel/helper-remap-async-to-generator@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.0.0-beta.39.tgz#64e715ddd24fa60e02dd139acac0d58a55508433" +"@babel/helper-split-export-declaration@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.41.tgz#8a0a67ded225ab7abeb4ad1fc138b4e0e882abee" dependencies: - "@babel/helper-annotate-as-pure" "7.0.0-beta.39" - "@babel/helper-wrap-function" "7.0.0-beta.39" - "@babel/template" "7.0.0-beta.39" - "@babel/traverse" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" + "@babel/types" "7.0.0-beta.41" -"@babel/helper-replace-supers@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.0.0-beta.39.tgz#6ddb6167ad18904fd43d9f0df909b90fe09f0569" +"@babel/helper-wrap-function@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.0.0-beta.41.tgz#3f10b9f23de4fa9619af2ce65f666a037ee0fd43" dependencies: - "@babel/helper-optimise-call-expression" "7.0.0-beta.39" - "@babel/template" "7.0.0-beta.39" - "@babel/traverse" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" + "@babel/helper-function-name" "7.0.0-beta.41" + "@babel/template" "7.0.0-beta.41" + "@babel/traverse" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" -"@babel/helper-simple-access@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.0.0-beta.39.tgz#fbe9e70c4fe64e0dbe01e675b2bb97b5f3514d3a" +"@babel/helpers@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.0.0-beta.41.tgz#66e1b9512a09677e0c4102d0569a8d2b8aceb119" dependencies: - "@babel/template" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" - lodash "^4.2.0" + "@babel/template" "7.0.0-beta.41" + "@babel/traverse" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" -"@babel/helper-wrap-function@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.0.0-beta.39.tgz#ef4e6ef66791276351b6609545394900552b35c9" +"@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/helper-function-name" "7.0.0-beta.39" - "@babel/template" "7.0.0-beta.39" - "@babel/traverse" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" + +"@babel/highlight@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.41.tgz#7e1d634de3821e664bc8ad9688f240530d239b95" + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^3.0.0" -"@babel/helpers@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.0.0-beta.39.tgz#13f7d4b959ef3cc0f2af59179237f5d302ded176" +"@babel/plugin-proposal-async-generator-functions@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.0.0-beta.41.tgz#6e39a214a01ccda277d0db1aa9d542374d4a0c05" dependencies: - "@babel/template" "7.0.0-beta.39" - "@babel/traverse" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/helper-remap-async-to-generator" "7.0.0-beta.41" + "@babel/plugin-syntax-async-generators" "7.0.0-beta.41" -"@babel/plugin-proposal-async-generator-functions@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.0.0-beta.39.tgz#ae7fd6686c6709f374d5e531587afabd1fb19042" +"@babel/plugin-proposal-class-properties@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.0.0-beta.41.tgz#b02d89d773239abe043e3c9424155635f854ca18" dependencies: - "@babel/helper-remap-async-to-generator" "7.0.0-beta.39" - "@babel/plugin-syntax-async-generators" "7.0.0-beta.39" + "@babel/helper-function-name" "7.0.0-beta.41" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-class-properties" "7.0.0-beta.41" -"@babel/plugin-proposal-class-properties@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.0.0-beta.39.tgz#251bf1cdbaa2d533897b57d26ac39cf52e25c734" +"@babel/plugin-proposal-decorators@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.0.0-beta.41.tgz#850ad5a7ef321d24d498483da351c4eecc496e88" dependencies: - "@babel/helper-function-name" "7.0.0-beta.39" - "@babel/plugin-syntax-class-properties" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-decorators" "7.0.0-beta.41" -"@babel/plugin-proposal-decorators@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.0.0-beta.39.tgz#cfd96774bdeabfaca2055b3009d63423eb461259" +"@babel/plugin-proposal-do-expressions@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-do-expressions/-/plugin-proposal-do-expressions-7.0.0-beta.41.tgz#67c2ebb550c2f94c96752dd062ede82f7144c364" dependencies: - "@babel/plugin-syntax-decorators" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-do-expressions" "7.0.0-beta.41" -"@babel/plugin-proposal-do-expressions@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-do-expressions/-/plugin-proposal-do-expressions-7.0.0-beta.39.tgz#d1e9925ee3c91198baa15521c2b0243ca8c4b01b" +"@babel/plugin-proposal-export-default-from@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.0.0-beta.41.tgz#acb46d6dedab7a1df9a2de77ada7c64941e7275c" dependencies: - "@babel/plugin-syntax-do-expressions" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-export-default-from" "7.0.0-beta.41" -"@babel/plugin-proposal-export-default-from@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.0.0-beta.39.tgz#708146a7f8a3f71eedd9b9206437187d3ec50b43" +"@babel/plugin-proposal-export-namespace-from@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.0.0-beta.41.tgz#57b2e7a89a1d30f41b5d5d07a69db7d4b5bbb59e" dependencies: - "@babel/plugin-syntax-export-default-from" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-export-namespace-from" "7.0.0-beta.41" -"@babel/plugin-proposal-export-namespace-from@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.0.0-beta.39.tgz#861ca8b83e2df981e5022193760e459a0c41300a" +"@babel/plugin-proposal-function-bind@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-function-bind/-/plugin-proposal-function-bind-7.0.0-beta.41.tgz#5be8e03c3e75cc1a7ef7aae42e7f81859ca128c8" dependencies: - "@babel/plugin-syntax-export-namespace-from" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-function-bind" "7.0.0-beta.41" -"@babel/plugin-proposal-function-bind@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-function-bind/-/plugin-proposal-function-bind-7.0.0-beta.39.tgz#a5e6ad608b21427c4c2c99c3892cbb14211d1a66" +"@babel/plugin-proposal-function-sent@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-function-sent/-/plugin-proposal-function-sent-7.0.0-beta.41.tgz#57d1ba376a0f60df31fb681aa88c260cf125ae5a" dependencies: - "@babel/plugin-syntax-function-bind" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/helper-wrap-function" "7.0.0-beta.41" + "@babel/plugin-syntax-function-sent" "7.0.0-beta.41" -"@babel/plugin-proposal-function-sent@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-function-sent/-/plugin-proposal-function-sent-7.0.0-beta.39.tgz#af6d2995f3157727b9afe49902a9ec35e0b28931" +"@babel/plugin-proposal-logical-assignment-operators@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.0.0-beta.41.tgz#0aacb1f939dcc4f4c0e0e9924fd09d0fffaa7c59" dependencies: - "@babel/helper-wrap-function" "7.0.0-beta.39" - "@babel/plugin-syntax-function-sent" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-logical-assignment-operators" "7.0.0-beta.41" -"@babel/plugin-proposal-nullish-coalescing-operator@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.0.0-beta.39.tgz#fa966be1d8ecf19b54c82bde4858ba3e8e330a51" +"@babel/plugin-proposal-nullish-coalescing-operator@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.0.0-beta.41.tgz#a0ccb74ac86b15df4cf418ec11d9131065dfd19e" dependencies: - "@babel/plugin-syntax-nullish-coalescing-operator" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-nullish-coalescing-operator" "7.0.0-beta.41" -"@babel/plugin-proposal-numeric-separator@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.0.0-beta.39.tgz#781750e4d8f05c32dce7b37623e309f74bf13132" +"@babel/plugin-proposal-numeric-separator@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.0.0-beta.41.tgz#2caf59907e259f3feee78cea9427b218eabef80d" dependencies: - "@babel/plugin-syntax-numeric-separator" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-numeric-separator" "7.0.0-beta.41" -"@babel/plugin-proposal-object-rest-spread@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0-beta.39.tgz#ea4d6ea974a364028e5074b1abe6505924d179a3" +"@babel/plugin-proposal-object-rest-spread@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0-beta.41.tgz#4c779ce64867f5b51f6a5178128d732573f96b0a" dependencies: - "@babel/plugin-syntax-object-rest-spread" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-object-rest-spread" "7.0.0-beta.41" -"@babel/plugin-proposal-optional-catch-binding@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.0.0-beta.39.tgz#1335778b3a8fc4289a2cfb518f85c6001ea5d9b4" +"@babel/plugin-proposal-optional-catch-binding@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.0.0-beta.41.tgz#bed5b2dc81e4927714c333a278df16ecb3449813" dependencies: - "@babel/plugin-syntax-optional-catch-binding" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-optional-catch-binding" "7.0.0-beta.41" -"@babel/plugin-proposal-optional-chaining@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.0.0-beta.39.tgz#b4501f8252355df419c956c454b66619af41a5c4" +"@babel/plugin-proposal-optional-chaining@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.0.0-beta.41.tgz#946f2a4d5f5736dd5fe110f8ccaf768f8edfa54e" dependencies: - "@babel/plugin-syntax-optional-chaining" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-optional-chaining" "7.0.0-beta.41" -"@babel/plugin-proposal-pipeline-operator@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-pipeline-operator/-/plugin-proposal-pipeline-operator-7.0.0-beta.39.tgz#b81c30c3317dfc37d2fe602bbba54b5e9eb4faa2" +"@babel/plugin-proposal-pipeline-operator@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-pipeline-operator/-/plugin-proposal-pipeline-operator-7.0.0-beta.41.tgz#768273205d7755a946788057036ab292d79466a9" dependencies: - "@babel/plugin-syntax-pipeline-operator" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-pipeline-operator" "7.0.0-beta.41" -"@babel/plugin-proposal-throw-expressions@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-throw-expressions/-/plugin-proposal-throw-expressions-7.0.0-beta.39.tgz#f94092fe1b71453cd5040ea2e0b3a75600f4bc10" +"@babel/plugin-proposal-throw-expressions@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-throw-expressions/-/plugin-proposal-throw-expressions-7.0.0-beta.41.tgz#9a59c319de2afc5116d4ffffdbb6246d3b218609" dependencies: - "@babel/plugin-syntax-throw-expressions" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-throw-expressions" "7.0.0-beta.41" -"@babel/plugin-proposal-unicode-property-regex@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0-beta.39.tgz#7b6748fb69f767f883838c3bbd2aa4d428c65cff" +"@babel/plugin-proposal-unicode-property-regex@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0-beta.41.tgz#ff2451178d4e90da4366c821f900f4eb8c6c90d0" dependencies: - "@babel/helper-regex" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/helper-regex" "7.0.0-beta.41" regexpu-core "^4.1.3" -"@babel/plugin-syntax-async-generators@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.0.0-beta.39.tgz#ace93b8bb53e256a330b21d78304843fd6d72ab4" +"@babel/plugin-syntax-async-generators@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.0.0-beta.41.tgz#a4ff2eff7491e9f93d92ca2b51a0ef6f966d98c0" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-class-properties@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.0.0-beta.39.tgz#a1a0e89c6042635cd21aafbdec3f006f06c368aa" +"@babel/plugin-syntax-class-properties@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.0.0-beta.41.tgz#8ee660cf0115a1b9e24404acb6437bc58bf16be6" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-decorators@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.0.0-beta.39.tgz#7edaae1b4df9c2fafc9f8f0ce4b6ef3336cbc2a1" +"@babel/plugin-syntax-decorators@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.0.0-beta.41.tgz#e9a81d320589b8a7d0fe2520ba57a93468eee25e" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-do-expressions@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-do-expressions/-/plugin-syntax-do-expressions-7.0.0-beta.39.tgz#3c185549a1b8c64d5a0bcb9809681c65511737df" +"@babel/plugin-syntax-do-expressions@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-do-expressions/-/plugin-syntax-do-expressions-7.0.0-beta.41.tgz#e717b082cae97156d45bea78109b147ab6c21077" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-dynamic-import@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.0.0-beta.39.tgz#75c15750bc7df0d89d5d81dcf28cf84516b25e7c" +"@babel/plugin-syntax-dynamic-import@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.0.0-beta.41.tgz#7e8b3d1c53171a451e50ff790e582aa2ac582c53" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-export-default-from@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.0.0-beta.39.tgz#e46deae4bc12fb008d3a6efef934fc837eb3cbe0" +"@babel/plugin-syntax-export-default-from@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.0.0-beta.41.tgz#d49fb1e7be7ac519c25a5da56687103c00bbbeb2" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-export-namespace-from@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.0.0-beta.39.tgz#aa7b0b60c1c20250f89d09204c03fc67e3f9806c" +"@babel/plugin-syntax-export-namespace-from@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.0.0-beta.41.tgz#79a22db141438f4cbb6707e010d6cc6bc67cb28c" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-flow@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.0.0-beta.39.tgz#b9247a81e4dacaa57aac3670792d788a64253f68" +"@babel/plugin-syntax-flow@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.0.0-beta.41.tgz#5d5408faecd8cf5fd223cdcee32bbcf26db53dad" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-function-bind@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-function-bind/-/plugin-syntax-function-bind-7.0.0-beta.39.tgz#ad4a6604de10bc9579307089ecdd3451b963d21d" +"@babel/plugin-syntax-function-bind@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-function-bind/-/plugin-syntax-function-bind-7.0.0-beta.41.tgz#d1dc6b508b77da0093c3ce12f2c289b3cb16464f" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-function-sent@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-function-sent/-/plugin-syntax-function-sent-7.0.0-beta.39.tgz#95a3b02e3a8484d4233f9479c14f7a2e960cee37" +"@babel/plugin-syntax-function-sent@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-function-sent/-/plugin-syntax-function-sent-7.0.0-beta.41.tgz#fd2152c5b3c834b78b604e2c9dd54bbdad1f2b5f" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-import-meta@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.0.0-beta.39.tgz#56658e7487227ca7c350b67031c0e16ce987558d" +"@babel/plugin-syntax-import-meta@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.0.0-beta.41.tgz#a225e7ae1806a1083e82b53fbcb7dd67338590cb" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-nullish-coalescing-operator@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.0.0-beta.39.tgz#95f0937730ae77c8efa63189d0e47364bf23ceb4" +"@babel/plugin-syntax-logical-assignment-operators@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.0.0-beta.41.tgz#b8e2a0a7441369a195d8af0b337333f9b9be893b" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-numeric-separator@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.0.0-beta.39.tgz#347231ff2acf2479d38e4789a976c82c00d38818" +"@babel/plugin-syntax-nullish-coalescing-operator@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.0.0-beta.41.tgz#5406a412a0ddf6406b8faa9dd2fd742947a8e0ea" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-object-rest-spread@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0-beta.39.tgz#f19f0761ccebf1d579197705e2efda36e1a45545" +"@babel/plugin-syntax-numeric-separator@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.0.0-beta.41.tgz#39fb60bbcc9d85782d53065fdc7438bd162b3732" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" + +"@babel/plugin-syntax-object-rest-spread@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0-beta.41.tgz#e15b4ec0c9088f0ccd8f161c583545166a3df2c7" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-optional-catch-binding@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.0.0-beta.39.tgz#b6d3c27d2ceab69cfd132ba19a6d22fd37817fb2" +"@babel/plugin-syntax-optional-catch-binding@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.0.0-beta.41.tgz#115df4798d408731aed14cba981d369d40a7700e" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-optional-chaining@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.0.0-beta.39.tgz#28c593e8921000c3f8ed749cdcab55b08824f988" +"@babel/plugin-syntax-optional-chaining@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.0.0-beta.41.tgz#4db9b5c84140dfb8bfcbe6ec744161cd5d2ae465" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-pipeline-operator@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-pipeline-operator/-/plugin-syntax-pipeline-operator-7.0.0-beta.39.tgz#765ec595f30cd4888bd80d347be1fe866801cbe8" +"@babel/plugin-syntax-pipeline-operator@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-pipeline-operator/-/plugin-syntax-pipeline-operator-7.0.0-beta.41.tgz#d523a05974ce01ae549ff98a8c5089db00c20f98" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-syntax-throw-expressions@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-throw-expressions/-/plugin-syntax-throw-expressions-7.0.0-beta.39.tgz#b93bb8d80b615d17bd7205c2dccfbdfd9ca7cdf0" +"@babel/plugin-syntax-throw-expressions@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-throw-expressions/-/plugin-syntax-throw-expressions-7.0.0-beta.41.tgz#6b6522e8ee8207cd8c4497ac624a025381692dc0" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-arrow-functions@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0-beta.39.tgz#3e6b577392e009816c62a42fc97af10a95760a89" +"@babel/plugin-transform-arrow-functions@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0-beta.41.tgz#0394aa76c3d0aa373d9085ce15a666ea3ff9d3b3" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-async-to-generator@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.0.0-beta.39.tgz#25d05e410b3f6f3106781318e10952cdc10ed9d8" +"@babel/plugin-transform-async-to-generator@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.0.0-beta.41.tgz#f400c3a67b05b475cccc3d5319c71e48525346cc" dependencies: - "@babel/helper-module-imports" "7.0.0-beta.39" - "@babel/helper-remap-async-to-generator" "7.0.0-beta.39" + "@babel/helper-module-imports" "7.0.0-beta.41" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/helper-remap-async-to-generator" "7.0.0-beta.41" -"@babel/plugin-transform-block-scoped-functions@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.0.0-beta.39.tgz#aa1de36ba07a6c89b581c2c7d838a2821f014778" +"@babel/plugin-transform-block-scoped-functions@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.0.0-beta.41.tgz#cf149b92ed5cec02ed5874d290595a24d360ac07" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-block-scoping@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.0.0-beta.39.tgz#44a6f10edc255f600c5616e55f9f48b5fe1ed5d9" +"@babel/plugin-transform-block-scoping@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.0.0-beta.41.tgz#0adba984d5332d879879f98204ff89e9f316905f" dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" lodash "^4.2.0" -"@babel/plugin-transform-classes@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.0.0-beta.39.tgz#fe10e8cbcb6914c2b5cfa072d6ce8d9271f52a9c" - dependencies: - "@babel/helper-annotate-as-pure" "7.0.0-beta.39" - "@babel/helper-define-map" "7.0.0-beta.39" - "@babel/helper-function-name" "7.0.0-beta.39" - "@babel/helper-optimise-call-expression" "7.0.0-beta.39" - "@babel/helper-replace-supers" "7.0.0-beta.39" +"@babel/plugin-transform-classes@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.0.0-beta.41.tgz#bc5f1e1d7eb1c0a763cc912834f8cbaf4a12b31b" + dependencies: + "@babel/helper-annotate-as-pure" "7.0.0-beta.41" + "@babel/helper-define-map" "7.0.0-beta.41" + "@babel/helper-function-name" "7.0.0-beta.41" + "@babel/helper-optimise-call-expression" "7.0.0-beta.41" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/helper-replace-supers" "7.0.0-beta.41" + "@babel/helper-split-export-declaration" "7.0.0-beta.41" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.0.0-beta.39.tgz#7cc5bf14050380adfe7d119be099e6fe56c0a044" +"@babel/plugin-transform-computed-properties@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.0.0-beta.41.tgz#16ec1978eba075aba847a9a5d9f469cba6dcc40a" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-destructuring@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.0.0-beta.39.tgz#906cf55d8b5cbcd245634a128651397cbe6f0475" +"@babel/plugin-transform-destructuring@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.0.0-beta.41.tgz#057111be37ff7927a85acba5ef9aba93028c4bb5" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-dotall-regex@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.0.0-beta.39.tgz#cb403b70bad7f302832bdbc8eeeb53832852ca5d" +"@babel/plugin-transform-dotall-regex@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.0.0-beta.41.tgz#0dc2f0411a11b2821caf0d7a1ca82c079cb35db5" dependencies: - "@babel/helper-regex" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/helper-regex" "7.0.0-beta.41" regexpu-core "^4.1.3" -"@babel/plugin-transform-duplicate-keys@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.0.0-beta.39.tgz#5c402995e883d186941e230277df7f89c552f961" +"@babel/plugin-transform-duplicate-keys@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.0.0-beta.41.tgz#8aa99958326aece8b2c6b9e6d75151445c732ce5" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-exponentiation-operator@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.0.0-beta.39.tgz#d0115ee85e3d895ead38c6fd149df223bde6e069" +"@babel/plugin-transform-exponentiation-operator@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.0.0-beta.41.tgz#325fa6e2d53c9ee4e6757853c693a93a54ce0cdc" dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "7.0.0-beta.39" + "@babel/helper-builder-binary-assignment-operator-visitor" "7.0.0-beta.41" + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-flow-strip-types@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.0.0-beta.39.tgz#3a03fc8ebaa9eddd62bdf501ceeff2a8e048bc4d" +"@babel/plugin-transform-flow-strip-types@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.0.0-beta.41.tgz#c20f1c79a0d5cc61866066c34f646daf768db66f" dependencies: - "@babel/plugin-syntax-flow" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-syntax-flow" "7.0.0-beta.41" -"@babel/plugin-transform-for-of@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0-beta.39.tgz#77d11bcc9a21267c5848511431ad28b1aa1401db" +"@babel/plugin-transform-for-of@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0-beta.41.tgz#5f3519a5ffcca00eaa07f1c0faa83f35319fbff7" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-function-name@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.0.0-beta.39.tgz#c677d2cb90462b12fec9ce6e9972524a253340f9" +"@babel/plugin-transform-function-name@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.0.0-beta.41.tgz#700bd4414fe43d789eaad7b608ad83f789deb90f" dependencies: - "@babel/helper-function-name" "7.0.0-beta.39" + "@babel/helper-function-name" "7.0.0-beta.41" + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-literals@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.0.0-beta.39.tgz#5c6a097539a5d20cc285e97d785d418d6aad305d" +"@babel/plugin-transform-literals@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.0.0-beta.41.tgz#64cd9505667e48acd17f89ccb04118e2e8f74315" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-modules-amd@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.0.0-beta.39.tgz#130bb5c05411d5be7d17ff7d2740058298fa23c3" +"@babel/plugin-transform-modules-amd@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.0.0-beta.41.tgz#e24c47638b95b7d60a5390f2a7eca0c6d68642fe" dependencies: - "@babel/helper-module-transforms" "7.0.0-beta.39" + "@babel/helper-module-transforms" "7.0.0-beta.41" + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-modules-commonjs@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.0.0-beta.39.tgz#b946992db6883b633500231950cdbae19dcaf334" +"@babel/plugin-transform-modules-commonjs@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.0.0-beta.41.tgz#df49c63a95021b15c810c8a3277f72273b047981" dependencies: - "@babel/helper-module-transforms" "7.0.0-beta.39" - "@babel/helper-simple-access" "7.0.0-beta.39" + "@babel/helper-module-transforms" "7.0.0-beta.41" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/helper-simple-access" "7.0.0-beta.41" -"@babel/plugin-transform-modules-systemjs@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.0.0-beta.39.tgz#3ec4ba068077ac618e106273bb9636b2ee467406" +"@babel/plugin-transform-modules-systemjs@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.0.0-beta.41.tgz#f4159e05c1f82994be1e82e351a4edfe83354ac7" dependencies: - "@babel/helper-hoist-variables" "7.0.0-beta.39" + "@babel/helper-hoist-variables" "7.0.0-beta.41" + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-modules-umd@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.0.0-beta.39.tgz#25a68675091c39a5fbf72e0d76870f3b248d452e" +"@babel/plugin-transform-modules-umd@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.0.0-beta.41.tgz#ba74d9d23e7c4c7f74959226ccacb4e57c57ba57" dependencies: - "@babel/helper-module-transforms" "7.0.0-beta.39" + "@babel/helper-module-transforms" "7.0.0-beta.41" + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-new-target@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0-beta.39.tgz#deaf7e20bb67f8b8ea6fdd4b2b4c51867d450c0a" +"@babel/plugin-transform-new-target@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0-beta.41.tgz#c0d4549ac4c740bbd4595ae5bee7ab7d959e3ef3" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-object-super@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.0.0-beta.39.tgz#4db6dfffe5b70bdb068ecc5c69394aef24b85d8d" +"@babel/plugin-transform-object-super@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.0.0-beta.41.tgz#0fe352a9136431803778797ef5093b0df43c8057" dependencies: - "@babel/helper-replace-supers" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/helper-replace-supers" "7.0.0-beta.41" -"@babel/plugin-transform-parameters@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.0.0-beta.39.tgz#bcd6f99c7839f52fce3bd05e89841d187f1d4ef8" +"@babel/plugin-transform-parameters@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.0.0-beta.41.tgz#9a46ae4fe623b394a81dfddf465dc723730e2a46" dependencies: - "@babel/helper-call-delegate" "7.0.0-beta.39" - "@babel/helper-get-function-arity" "7.0.0-beta.39" + "@babel/helper-call-delegate" "7.0.0-beta.41" + "@babel/helper-get-function-arity" "7.0.0-beta.41" + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-regenerator@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0-beta.39.tgz#6f85c3ac987824fe037fc83dcda75c4d7502344c" +"@babel/plugin-transform-regenerator@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0-beta.41.tgz#1b376823ea0b3b357b4ff605a256cfa001017608" dependencies: regenerator-transform "^0.12.3" -"@babel/plugin-transform-shorthand-properties@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0-beta.39.tgz#caa480ecb159481df8e1c405aaac865a54781630" +"@babel/plugin-transform-shorthand-properties@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0-beta.41.tgz#93431505f2ea38245a0e7f4e7055253b240e49ca" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-spread@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.0.0-beta.39.tgz#75358c67a52cc2cc266ea598dc0447e0f4e239d7" +"@babel/plugin-transform-spread@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.0.0-beta.41.tgz#88c11a4854c0e274d74a091c5605721b6b05fc45" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-sticky-regex@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.0.0-beta.39.tgz#9e989e99efb9dc84928507adb260934f2e336713" +"@babel/plugin-transform-sticky-regex@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.0.0-beta.41.tgz#00a204ee9719c33d8a8c96526de4ec908084aacb" dependencies: - "@babel/helper-regex" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/helper-regex" "7.0.0-beta.41" -"@babel/plugin-transform-template-literals@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.0.0-beta.39.tgz#65b06d42ed0f04f18aeb45bc7a588db7783cc7d1" +"@babel/plugin-transform-template-literals@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.0.0-beta.41.tgz#03bdb3fab54784dd754c32aa8a6d122d9d9caafa" dependencies: - "@babel/helper-annotate-as-pure" "7.0.0-beta.39" + "@babel/helper-annotate-as-pure" "7.0.0-beta.41" + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-typeof-symbol@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.0.0-beta.39.tgz#ac2134df64e014e864f7678e46770ecd13f604e9" +"@babel/plugin-transform-typeof-symbol@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.0.0-beta.41.tgz#954ed7a16170d17c1928ab9cd52667011d69ab12" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" -"@babel/plugin-transform-unicode-regex@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0-beta.39.tgz#cbfd3e78bb7ce04597cbde55b177f8b61b6b20b3" +"@babel/plugin-transform-unicode-regex@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0-beta.41.tgz#20011f4f7b45b539516566b792668b9faf706638" dependencies: - "@babel/helper-regex" "7.0.0-beta.39" + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/helper-regex" "7.0.0-beta.41" regexpu-core "^4.1.3" -"@babel/preset-env@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.0.0-beta.39.tgz#3977e2d4dc7d196b07bb3bd23fb18bc280b20fa3" - dependencies: - "@babel/plugin-proposal-async-generator-functions" "7.0.0-beta.39" - "@babel/plugin-proposal-object-rest-spread" "7.0.0-beta.39" - "@babel/plugin-proposal-optional-catch-binding" "7.0.0-beta.39" - "@babel/plugin-proposal-unicode-property-regex" "7.0.0-beta.39" - "@babel/plugin-syntax-async-generators" "7.0.0-beta.39" - "@babel/plugin-syntax-object-rest-spread" "7.0.0-beta.39" - "@babel/plugin-syntax-optional-catch-binding" "7.0.0-beta.39" - "@babel/plugin-transform-arrow-functions" "7.0.0-beta.39" - "@babel/plugin-transform-async-to-generator" "7.0.0-beta.39" - "@babel/plugin-transform-block-scoped-functions" "7.0.0-beta.39" - "@babel/plugin-transform-block-scoping" "7.0.0-beta.39" - "@babel/plugin-transform-classes" "7.0.0-beta.39" - "@babel/plugin-transform-computed-properties" "7.0.0-beta.39" - "@babel/plugin-transform-destructuring" "7.0.0-beta.39" - "@babel/plugin-transform-dotall-regex" "7.0.0-beta.39" - "@babel/plugin-transform-duplicate-keys" "7.0.0-beta.39" - "@babel/plugin-transform-exponentiation-operator" "7.0.0-beta.39" - "@babel/plugin-transform-for-of" "7.0.0-beta.39" - "@babel/plugin-transform-function-name" "7.0.0-beta.39" - "@babel/plugin-transform-literals" "7.0.0-beta.39" - "@babel/plugin-transform-modules-amd" "7.0.0-beta.39" - "@babel/plugin-transform-modules-commonjs" "7.0.0-beta.39" - "@babel/plugin-transform-modules-systemjs" "7.0.0-beta.39" - "@babel/plugin-transform-modules-umd" "7.0.0-beta.39" - "@babel/plugin-transform-new-target" "7.0.0-beta.39" - "@babel/plugin-transform-object-super" "7.0.0-beta.39" - "@babel/plugin-transform-parameters" "7.0.0-beta.39" - "@babel/plugin-transform-regenerator" "7.0.0-beta.39" - "@babel/plugin-transform-shorthand-properties" "7.0.0-beta.39" - "@babel/plugin-transform-spread" "7.0.0-beta.39" - "@babel/plugin-transform-sticky-regex" "7.0.0-beta.39" - "@babel/plugin-transform-template-literals" "7.0.0-beta.39" - "@babel/plugin-transform-typeof-symbol" "7.0.0-beta.39" - "@babel/plugin-transform-unicode-regex" "7.0.0-beta.39" - browserslist "^2.4.0" +"@babel/preset-env@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.0.0-beta.41.tgz#b9638878277eba78659ec75e00c30ac09079d8f0" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-proposal-async-generator-functions" "7.0.0-beta.41" + "@babel/plugin-proposal-object-rest-spread" "7.0.0-beta.41" + "@babel/plugin-proposal-optional-catch-binding" "7.0.0-beta.41" + "@babel/plugin-proposal-unicode-property-regex" "7.0.0-beta.41" + "@babel/plugin-syntax-async-generators" "7.0.0-beta.41" + "@babel/plugin-syntax-object-rest-spread" "7.0.0-beta.41" + "@babel/plugin-syntax-optional-catch-binding" "7.0.0-beta.41" + "@babel/plugin-transform-arrow-functions" "7.0.0-beta.41" + "@babel/plugin-transform-async-to-generator" "7.0.0-beta.41" + "@babel/plugin-transform-block-scoped-functions" "7.0.0-beta.41" + "@babel/plugin-transform-block-scoping" "7.0.0-beta.41" + "@babel/plugin-transform-classes" "7.0.0-beta.41" + "@babel/plugin-transform-computed-properties" "7.0.0-beta.41" + "@babel/plugin-transform-destructuring" "7.0.0-beta.41" + "@babel/plugin-transform-dotall-regex" "7.0.0-beta.41" + "@babel/plugin-transform-duplicate-keys" "7.0.0-beta.41" + "@babel/plugin-transform-exponentiation-operator" "7.0.0-beta.41" + "@babel/plugin-transform-for-of" "7.0.0-beta.41" + "@babel/plugin-transform-function-name" "7.0.0-beta.41" + "@babel/plugin-transform-literals" "7.0.0-beta.41" + "@babel/plugin-transform-modules-amd" "7.0.0-beta.41" + "@babel/plugin-transform-modules-commonjs" "7.0.0-beta.41" + "@babel/plugin-transform-modules-systemjs" "7.0.0-beta.41" + "@babel/plugin-transform-modules-umd" "7.0.0-beta.41" + "@babel/plugin-transform-new-target" "7.0.0-beta.41" + "@babel/plugin-transform-object-super" "7.0.0-beta.41" + "@babel/plugin-transform-parameters" "7.0.0-beta.41" + "@babel/plugin-transform-regenerator" "7.0.0-beta.41" + "@babel/plugin-transform-shorthand-properties" "7.0.0-beta.41" + "@babel/plugin-transform-spread" "7.0.0-beta.41" + "@babel/plugin-transform-sticky-regex" "7.0.0-beta.41" + "@babel/plugin-transform-template-literals" "7.0.0-beta.41" + "@babel/plugin-transform-typeof-symbol" "7.0.0-beta.41" + "@babel/plugin-transform-unicode-regex" "7.0.0-beta.41" + browserslist "^3.0.0" invariant "^2.2.2" semver "^5.3.0" -"@babel/preset-flow@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.0.0-beta.39.tgz#2a104114c71fbce992af0ed6ba633ac8f1be7277" - dependencies: - "@babel/plugin-transform-flow-strip-types" "7.0.0-beta.39" - -"@babel/preset-stage-0@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/preset-stage-0/-/preset-stage-0-7.0.0-beta.39.tgz#ac56ef8988c282166303ede27e8d6ef5d9c29533" - dependencies: - "@babel/plugin-proposal-function-bind" "7.0.0-beta.39" - "@babel/preset-stage-1" "7.0.0-beta.39" - -"@babel/preset-stage-1@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/preset-stage-1/-/preset-stage-1-7.0.0-beta.39.tgz#b0a38c47a4683974433c79214a077162540c2cd4" - dependencies: - "@babel/plugin-proposal-decorators" "7.0.0-beta.39" - "@babel/plugin-proposal-do-expressions" "7.0.0-beta.39" - "@babel/plugin-proposal-export-default-from" "7.0.0-beta.39" - "@babel/plugin-proposal-nullish-coalescing-operator" "7.0.0-beta.39" - "@babel/plugin-proposal-optional-chaining" "7.0.0-beta.39" - "@babel/plugin-proposal-pipeline-operator" "7.0.0-beta.39" - "@babel/preset-stage-2" "7.0.0-beta.39" - -"@babel/preset-stage-2@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/preset-stage-2/-/preset-stage-2-7.0.0-beta.39.tgz#dc537fe1d822ec96d07e1c5659dc6635fc5cc130" - dependencies: - "@babel/plugin-proposal-export-namespace-from" "7.0.0-beta.39" - "@babel/plugin-proposal-function-sent" "7.0.0-beta.39" - "@babel/plugin-proposal-numeric-separator" "7.0.0-beta.39" - "@babel/plugin-proposal-throw-expressions" "7.0.0-beta.39" - "@babel/preset-stage-3" "7.0.0-beta.39" - -"@babel/preset-stage-3@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/preset-stage-3/-/preset-stage-3-7.0.0-beta.39.tgz#30a313d79369aa1b4d6652ae621dc1d162255ac9" - dependencies: - "@babel/plugin-proposal-async-generator-functions" "7.0.0-beta.39" - "@babel/plugin-proposal-class-properties" "7.0.0-beta.39" - "@babel/plugin-proposal-object-rest-spread" "7.0.0-beta.39" - "@babel/plugin-proposal-optional-catch-binding" "7.0.0-beta.39" - "@babel/plugin-proposal-unicode-property-regex" "7.0.0-beta.39" - "@babel/plugin-syntax-dynamic-import" "7.0.0-beta.39" - "@babel/plugin-syntax-import-meta" "7.0.0-beta.39" - -"@babel/register@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.0.0-beta.39.tgz#40994219d69963a88c55e259e32fd076cdd668dc" +"@babel/preset-flow@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.0.0-beta.41.tgz#f33914a40fd8578ad0b8dae7acd8bac5b4aa444f" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-transform-flow-strip-types" "7.0.0-beta.41" + +"@babel/preset-stage-0@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/preset-stage-0/-/preset-stage-0-7.0.0-beta.41.tgz#47a259ceae93a600cb59e1ab7c46c089cf89d9c6" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-proposal-function-bind" "7.0.0-beta.41" + "@babel/plugin-proposal-logical-assignment-operators" "7.0.0-beta.41" + "@babel/preset-stage-1" "7.0.0-beta.41" + +"@babel/preset-stage-1@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/preset-stage-1/-/preset-stage-1-7.0.0-beta.41.tgz#ac3bfe383578dda47782ec3c8ec7818c9ca350a5" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-proposal-decorators" "7.0.0-beta.41" + "@babel/plugin-proposal-do-expressions" "7.0.0-beta.41" + "@babel/plugin-proposal-export-default-from" "7.0.0-beta.41" + "@babel/plugin-proposal-nullish-coalescing-operator" "7.0.0-beta.41" + "@babel/plugin-proposal-optional-chaining" "7.0.0-beta.41" + "@babel/plugin-proposal-pipeline-operator" "7.0.0-beta.41" + "@babel/preset-stage-2" "7.0.0-beta.41" + +"@babel/preset-stage-2@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/preset-stage-2/-/preset-stage-2-7.0.0-beta.41.tgz#c03a746f54e761d4014568b97c7a5bcebe15d4ab" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-proposal-export-namespace-from" "7.0.0-beta.41" + "@babel/plugin-proposal-function-sent" "7.0.0-beta.41" + "@babel/plugin-proposal-numeric-separator" "7.0.0-beta.41" + "@babel/plugin-proposal-throw-expressions" "7.0.0-beta.41" + "@babel/preset-stage-3" "7.0.0-beta.41" + +"@babel/preset-stage-3@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/preset-stage-3/-/preset-stage-3-7.0.0-beta.41.tgz#2fbc17609c8ea14262cc4c7f8a4d76f7f98b14f5" + dependencies: + "@babel/helper-plugin-utils" "7.0.0-beta.41" + "@babel/plugin-proposal-async-generator-functions" "7.0.0-beta.41" + "@babel/plugin-proposal-class-properties" "7.0.0-beta.41" + "@babel/plugin-proposal-object-rest-spread" "7.0.0-beta.41" + "@babel/plugin-proposal-optional-catch-binding" "7.0.0-beta.41" + "@babel/plugin-proposal-unicode-property-regex" "7.0.0-beta.41" + "@babel/plugin-syntax-dynamic-import" "7.0.0-beta.41" + "@babel/plugin-syntax-import-meta" "7.0.0-beta.41" + +"@babel/register@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.0.0-beta.41.tgz#0df0ea8431607ba1a12187efaf472314ca6d6518" dependencies: core-js "^2.5.3" find-cache-dir "^1.0.0" @@ -666,93 +786,72 @@ pirates "^3.0.1" source-map-support "^0.4.2" -"@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.38": - version "7.0.0-beta.38" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.38.tgz#8a2d403a01da320beb8333dc6403500fa79e8597" +"@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.38" - "@babel/types" "7.0.0-beta.38" - babylon "7.0.0-beta.38" + "@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/template@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.39.tgz#98bd7b132d99f73547c473f2862f481ae84981c9" +"@babel/template@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.41.tgz#628eeb93f9b5b423a252d3b6183f12e09505ab55" dependencies: - "@babel/code-frame" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" - babylon "7.0.0-beta.39" + "@babel/code-frame" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" + babylon "7.0.0-beta.41" 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.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.41.tgz#1615f6fa87382c34511be8be1cd083eba9b1ae88" 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.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.39.tgz#ccb5abfb878403a39af249997dd6f36136de7694" - dependencies: - "@babel/code-frame" "7.0.0-beta.39" - "@babel/generator" "7.0.0-beta.39" - "@babel/helper-function-name" "7.0.0-beta.39" - "@babel/types" "7.0.0-beta.39" - babylon "7.0.0-beta.39" - debug "^3.0.1" + "@babel/code-frame" "7.0.0-beta.41" + "@babel/generator" "7.0.0-beta.41" + "@babel/helper-function-name" "7.0.0-beta.41" + "@babel/helper-split-export-declaration" "7.0.0-beta.41" + "@babel/types" "7.0.0-beta.41" + babylon "7.0.0-beta.41" + debug "^3.1.0" globals "^11.1.0" invariant "^2.2.0" lodash "^4.2.0" -"@babel/traverse@^7.0.0-beta.31": - version "7.0.0-beta.38" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.38.tgz#56462b91753dd5c6faf36e56a77c64077ddb85b8" +"@babel/traverse@^7.0.0-beta.31", "@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.38" - "@babel/generator" "7.0.0-beta.38" - "@babel/helper-function-name" "7.0.0-beta.38" - "@babel/types" "7.0.0-beta.38" - babylon "7.0.0-beta.38" + "@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.35": + version "7.0.0-beta.35" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.35.tgz#cf933a9a9a38484ca724b335b88d83726d5ab960" dependencies: esutils "^2.0.2" lodash "^4.2.0" to-fast-properties "^2.0.0" -"@babel/types@7.0.0-beta.38": - version "7.0.0-beta.38" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.38.tgz#2ce2443f7dc6ad535a67db4940cbd34e64035a6f" +"@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: esutils "^2.0.2" lodash "^4.2.0" to-fast-properties "^2.0.0" -"@babel/types@7.0.0-beta.39": - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.39.tgz#2ea0d97efe4781688751edc68cde640d6559938c" +"@babel/types@7.0.0-beta.41": + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.41.tgz#776e6ec154fb8ec11da697be35b705c6eeb00e75" dependencies: esutils "^2.0.2" lodash "^4.2.0" @@ -792,20 +891,20 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.35.tgz#8999974b34028686a8d61a719e61c138d3755107" "@types/lodash@^4.14.67": - version "4.14.92" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.92.tgz#6e3cb0b71a1e12180a47a42a744e856c3ae99a57" + version "4.14.104" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.104.tgz#53ee2357fa2e6e68379341d92eb2ecea4b11bb80" "@types/node@*": - version "9.3.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-9.3.0.tgz#3a129cda7c4e5df2409702626892cb4b96546dd5" + version "9.4.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.6.tgz#d8176d864ee48753d053783e4e463aec86b8d82e" "@types/node@^8.0.0": - version "8.5.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.5.9.tgz#7155cfb4ae405bca4dd8df1a214c339e939109bf" + version "8.9.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.9.4.tgz#dfd327582a06c114eb6e0441fa3d6fab35edad48" "@types/semver@^5.3.32": - version "5.4.0" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.4.0.tgz#f3658535af7f1f502acd6da7daf405ffeb1f7ee4" + version "5.5.0" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.5.0.tgz#146c2a29ee7d3bae4bf2fcb274636e264c813c45" "@types/tapable@*": version "0.2.4" @@ -818,12 +917,13 @@ source-map "^0.6.1" "@types/webpack@^3.0.0": - version "3.8.3" - resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-3.8.3.tgz#92501a9c7e41a560aa9b354345768b7348d80764" + version "3.8.8" + resolved "https://registry.yarnpkg.com/@types/webpack/-/webpack-3.8.8.tgz#fd9483edf2d6935eaab52aa530b1f737c188cd9a" dependencies: "@types/node" "*" "@types/tapable" "*" "@types/uglify-js" "*" + source-map "^0.6.0" JSONStream@^1.0.3, JSONStream@^1.0.4: version "1.3.2" @@ -832,6 +932,10 @@ JSONStream@^1.0.3, JSONStream@^1.0.4: 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" + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -842,12 +946,25 @@ acorn-dynamic-import@^2.0.0: dependencies: acorn "^4.0.3" +acorn-globals@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.1.0.tgz#ab716025dbe17c54d3ef81d32ece2b2d99fe2538" + dependencies: + acorn "^5.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-node@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/acorn-node/-/acorn-node-1.3.0.tgz#5f86d73346743810ef1269b901dbcbded020861b" + dependencies: + acorn "^5.4.1" + xtend "^4.0.1" + acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" @@ -856,18 +973,22 @@ acorn@^4.0.3: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" -acorn@^5.0.0, acorn@^5.0.3, acorn@^5.2.1: - version "5.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.3.0.tgz#7446d39459c54fb49a80e6ee6478149b940ec822" +acorn@^5.0.0, acorn@^5.0.3, acorn@^5.2.1, acorn@^5.3.0, acorn@^5.4.1, acorn@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.5.0.tgz#1abb587fbf051f94e3de20e6b26ef910b1828298" add-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" -ajv-keywords@^2.0.0, ajv-keywords@^2.1.0: +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.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.1.0.tgz#ac2b27939c543e95d2c06e7f7f5c27be4aa543be" + ajv@^4.9.1: version "4.11.8" resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" @@ -875,7 +996,7 @@ ajv@^4.9.1: co "^4.6.0" json-stable-stringify "^1.0.1" -ajv@^5.1.5, ajv@^5.2.3, ajv@^5.3.0: +ajv@^5.1.0, 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: @@ -884,6 +1005,14 @@ ajv@^5.1.5, ajv@^5.2.3, ajv@^5.3.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" +ajv@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.2.1.tgz#28a6abc493a2abe0fb4c8507acaedb43fa550671" + dependencies: + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + 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" @@ -896,6 +1025,12 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" +ansi-colors@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" + 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" @@ -934,13 +1069,13 @@ 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" +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" -ansi-wrap@0.1.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" @@ -955,6 +1090,13 @@ anymatch@^1.3.0: micromatch "^2.1.5" normalize-path "^2.0.0" +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + 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" @@ -981,8 +1123,8 @@ are-we-there-yet@~1.1.2: readable-stream "^2.0.6" 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" @@ -1023,6 +1165,10 @@ array-each@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + array-filter@~0.0.0: version "0.0.1" resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" @@ -1074,8 +1220,8 @@ arrify@^1.0.0, arrify@^1.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" asn1.js@^4.0.0: - version "4.9.2" - resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.2.tgz#8117ef4f7ed87cd8f89044b5bff97ac243a16c9a" + version "4.10.1" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" dependencies: bn.js "^4.0.0" inherits "^2.0.1" @@ -1111,6 +1257,10 @@ ast-types@0.9.6: version "0.9.6" resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9" +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" @@ -1121,11 +1271,15 @@ async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + async@^1.4.0, async@^1.5.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" -async@^2.1.2: +async@^2.1.2, async@^2.1.4: version "2.6.0" resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4" dependencies: @@ -1143,7 +1297,11 @@ aws-sign2@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" -aws4@^1.2.1: +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + +aws4@^1.2.1, aws4@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" @@ -1155,20 +1313,48 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: esutils "^2.0.2" js-tokens "^3.0.2" +babel-core@^6.0.0, babel-core@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.0" + debug "^2.6.8" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.7" + slash "^1.0.0" + source-map "^0.5.6" + +babel-core@^7.0.0-0: + version "7.0.0-bridge.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" + babel-eslint@^8.0.1: - version "8.2.1" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.1.tgz#136888f3c109edc65376c23ebf494f36a3e03951" + version "8.2.2" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.2.tgz#1102273354c6f0b29b4ea28a65f97d122296b68b" 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" -babel-generator@^6.18.0: - version "6.26.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5" +babel-generator@^6.18.0, babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" dependencies: babel-messages "^6.23.0" babel-runtime "^6.26.0" @@ -1176,9 +1362,23 @@ babel-generator@^6.18.0: detect-indent "^4.0.0" jsesc "^1.3.0" lodash "^4.17.4" - source-map "^0.5.6" + source-map "^0.5.7" trim-right "^1.0.1" +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-jest@^22.4.1: + version "22.4.1" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-22.4.1.tgz#ff53ebca45957347f27ff4666a31499fbb4c4ddd" + dependencies: + babel-plugin-istanbul "^4.1.5" + babel-preset-jest "^22.4.1" + babel-loader@8.0.0-beta.0: version "8.0.0-beta.0" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.0.0-beta.0.tgz#b85c3b52d1095949125c72c7ec1fa0fbb47a11ff" @@ -1193,7 +1393,7 @@ babel-messages@^6.23.0: dependencies: babel-runtime "^6.22.0" -babel-plugin-istanbul@^4.1.4: +babel-plugin-istanbul@^4.1.5: version "4.1.5" resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.5.tgz#6760cdd977f411d3e175bb064f2bc327d99b2b6e" dependencies: @@ -1201,13 +1401,40 @@ babel-plugin-istanbul@^4.1.4: istanbul-lib-instrument "^1.7.5" test-exclude "^4.1.1" -babel-plugin-transform-charcodes@0.0.10: - version "0.0.10" - resolved "https://registry.yarnpkg.com/babel-plugin-transform-charcodes/-/babel-plugin-transform-charcodes-0.0.10.tgz#cdb76363e1e91ac105f3f94b168f41cf27983e80" +babel-plugin-jest-hoist@^22.4.1: + version "22.4.1" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-22.4.1.tgz#d712fe5da8b6965f3191dacddbefdbdf4fb66d63" + +babel-plugin-syntax-object-rest-spread@^6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5" + +babel-plugin-transform-charcodes@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-charcodes/-/babel-plugin-transform-charcodes-0.1.0.tgz#c71b301019c90615b940faf0f15f275ec5c81a3d" dependencies: "@babel/traverse" "^7.0.0-beta.31" babylon "^7.0.0-beta.31" +babel-preset-jest@^22.4.1: + version "22.4.1" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-22.4.1.tgz#efa2e5f5334242a9457a068452d7d09735db172a" + dependencies: + babel-plugin-jest-hoist "^22.4.1" + babel-plugin-syntax-object-rest-spread "^6.13.0" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + babel-runtime@^6.22.0, babel-runtime@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" @@ -1215,7 +1442,7 @@ babel-runtime@^6.22.0, babel-runtime@^6.26.0: core-js "^2.4.0" regenerator-runtime "^0.11.0" -babel-template@^6.16.0: +babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" dependencies: @@ -1248,17 +1475,13 @@ babel-types@^6.18.0, babel-types@^6.26.0: lodash "^4.17.4" to-fast-properties "^1.0.3" -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.38, babylon@^7.0.0-beta.31: - version "7.0.0-beta.38" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.38.tgz#9b3a33e571a47464a2d20cb9dd5a570f00e3f996" +babylon@7.0.0-beta.40, babylon@^7.0.0-beta.31, 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.39: - version "7.0.0-beta.39" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.39.tgz#512833ea788f6570c6db026d743a7565e58d3aeb" +babylon@7.0.0-beta.41: + version "7.0.0-beta.41" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.41.tgz#e1b208d53a7a05ede2cf96cbecd86f5ed47f584f" babylon@^6.18.0: version "6.18.0" @@ -1269,8 +1492,8 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" base64-js@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.1.tgz#a91947da1f4a516ea38e5b4ec0ec3773675e0886" + version "1.2.3" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.3.tgz#fb13668233d9614cf5fb4bce95a9ba4096cdf801" base@^0.11.1: version "0.11.2" @@ -1328,9 +1551,21 @@ boom@2.x.x: dependencies: hoek "2.x.x" +boom@4.x.x: + version "4.3.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31" + dependencies: + hoek "4.x.x" + +boom@5.x.x: + version "5.2.0" + resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02" + dependencies: + hoek "4.x.x" + brace-expansion@^1.0.0, 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" @@ -1343,9 +1578,9 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" -braces@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.0.tgz#a46941cb5fb492156b3d6a656e06c35364e3e66e" +braces@^2.3.0, braces@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.1.tgz#7086c913b4e5a08dbe37ac0ee6a2500c4ba691bb" dependencies: arr-flatten "^1.1.0" array-unique "^0.3.2" @@ -1353,6 +1588,7 @@ braces@^2.3.0: extend-shallow "^2.0.1" fill-range "^4.0.0" isobject "^3.0.1" + kind-of "^6.0.2" repeat-element "^1.1.2" snapdragon "^0.8.1" snapdragon-node "^2.0.1" @@ -1374,8 +1610,8 @@ browser-pack@^5.0.1: umd "^3.0.0" browser-pack@^6.0.1: - version "6.0.3" - resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.0.3.tgz#91ca96518583ef580ab063a309de62e407767a39" + version "6.0.4" + resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.0.4.tgz#9a73beb3b48f9e36868be007b64400102c04a99f" dependencies: JSONStream "^1.0.3" combine-source-map "~0.8.0" @@ -1384,16 +1620,16 @@ browser-pack@^6.0.1: through2 "^2.0.0" umd "^3.0.0" -browser-resolve@^1.11.0, browser-resolve@^1.7.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" + +browser-resolve@^1.11.0, browser-resolve@^1.11.2, browser-resolve@^1.7.0: version "1.11.2" resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" dependencies: resolve "1.1.7" -browser-stdout@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" - browser-unpack@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/browser-unpack/-/browser-unpack-1.2.0.tgz#357aee31fc467831684d063e4355e070a782970d" @@ -1513,12 +1749,18 @@ browserify@^13.1.1: vm-browserify "~0.0.1" xtend "^4.0.0" -browserslist@^2.4.0: - version "2.11.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-2.11.3.tgz#fe36167aed1bbcde4827ebfe71347a2cc70b99b2" +browserslist@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.1.1.tgz#d380fc048bc3a33e60fb87dc135110ebaaa6320a" + dependencies: + caniuse-lite "^1.0.30000809" + electron-to-chromium "^1.3.33" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" dependencies: - caniuse-lite "^1.0.30000792" - electron-to-chromium "^1.3.30" + node-int64 "^0.4.0" buffer-xor@^1.0.3: version "1.0.3" @@ -1573,14 +1815,6 @@ 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" -caching-transform@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-1.0.1.tgz#6dbdb2f20f8d8fbce79f3e94e9d1742dcdf5c0a1" - dependencies: - md5-hex "^1.2.0" - mkdirp "^0.5.1" - write-file-atomic "^1.1.4" - caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" @@ -1591,6 +1825,10 @@ callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + camel-case@3.0.x: version "3.0.0" resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" @@ -1605,6 +1843,14 @@ camelcase-keys@^2.0.0: camelcase "^2.0.0" map-obj "^1.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" + dependencies: + camelcase "^4.1.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" @@ -1621,9 +1867,9 @@ camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" -caniuse-lite@^1.0.30000792: - version "1.0.30000792" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000792.tgz#d0cea981f8118f3961471afbb43c9a1e5bbf0332" +caniuse-lite@^1.0.30000809: + version "1.0.30000812" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000812.tgz#d173b686b49bc941fa18ff2e7e533048e20ed92c" caseless@~0.12.0: version "0.12.0" @@ -1657,17 +1903,17 @@ 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.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65" dependencies: - ansi-styles "^3.1.0" + ansi-styles "^3.2.1" escape-string-regexp "^1.0.5" - supports-color "^4.0.0" + supports-color "^5.3.0" -charcodes@0.0.10: - version "0.0.10" - resolved "https://registry.yarnpkg.com/charcodes/-/charcodes-0.0.10.tgz#98d67a7a1e17ce154d1faafd01e72e9a6cff54f5" +charcodes@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/charcodes/-/charcodes-0.1.0.tgz#61f8c244fc7f94f186fe74f31078901a3ed7928e" chardet@^0.4.0: version "0.4.2" @@ -1688,7 +1934,7 @@ cheerio@^1.0.0-rc.1: lodash "^4.15.0" parse5 "^3.0.1" -chokidar@^1.6.1, chokidar@^1.7.0: +chokidar@^1.6.1: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" dependencies: @@ -1703,6 +1949,24 @@ chokidar@^1.6.1, chokidar@^1.7.0: optionalDependencies: fsevents "^1.0.0" +chokidar@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.2.tgz#4dc65139eeb2714977735b6a35d06e97b494dfd7" + dependencies: + anymatch "^2.0.0" + async-each "^1.0.0" + braces "^2.3.0" + glob-parent "^3.1.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^2.1.1" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + upath "^1.0.0" + optionalDependencies: + fsevents "^1.0.0" + ci-info@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.1.2.tgz#03561259db48d0474c8bdc90f5b47b068b6bbfb4" @@ -1886,9 +2150,9 @@ combine-source-map@~0.8.0: lodash.memoize "~3.0.3" source-map "~0.5.3" -combined-stream@^1.0.5, combined-stream@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" +combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.6" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" dependencies: delayed-stream "~1.0.0" @@ -1896,19 +2160,9 @@ command-join@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/command-join/-/command-join-2.0.0.tgz#52e8b984f4872d952ff1bdc8b98397d27c7144cf" -commander@2.12.x: - version "2.12.2" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555" - -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.8.1, commander@^2.9.0, commander@~2.13.0: - version "2.13.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" +commander@2.14.x, commander@^2.11.0, 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" commondir@^1.0.1: version "1.0.1" @@ -1930,8 +2184,8 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" concat-stream@^1.4.10, concat-stream@^1.4.6, concat-stream@^1.5.0, concat-stream@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + version "1.6.1" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.1.tgz#261b8f518301f1d834e36342b9fea095d2620a26" dependencies: inherits "^2.0.3" readable-stream "^2.2.2" @@ -1959,70 +2213,74 @@ 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" -conventional-changelog-angular@^1.5.2: - version "1.6.0" - resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.6.0.tgz#0a26a071f2c9fcfcf2b86ba0cfbf6e6301b75bfa" +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@^1.6.6: + version "1.6.6" + resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-1.6.6.tgz#b27f2b315c16d0a1f23eb181309d0e6a4698ea0f" dependencies: compare-func "^1.3.1" - q "^1.4.1" + q "^1.5.1" -conventional-changelog-atom@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-0.1.2.tgz#12595ad5267a6937c34cf900281b1c65198a4c63" +conventional-changelog-atom@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/conventional-changelog-atom/-/conventional-changelog-atom-0.2.4.tgz#4917759947f4db86073f9d3838a2d54302d5843d" dependencies: - q "^1.4.1" + q "^1.5.1" conventional-changelog-cli@^1.3.1: - version "1.3.5" - resolved "https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-1.3.5.tgz#46c51496216b7406588883defa6fac589e9bb31e" + version "1.3.16" + resolved "https://registry.yarnpkg.com/conventional-changelog-cli/-/conventional-changelog-cli-1.3.16.tgz#69acdcc4b68b4d123c5945868dffe394960cea9d" dependencies: add-stream "^1.0.0" - conventional-changelog "^1.1.7" - lodash "^4.1.0" - meow "^3.7.0" + conventional-changelog "^1.1.18" + lodash "^4.2.1" + meow "^4.0.0" tempfile "^1.1.1" -conventional-changelog-codemirror@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.2.1.tgz#299a4f7147baf350e6c8158fc54954a291c5cc09" +conventional-changelog-codemirror@^0.3.4: + version "0.3.4" + resolved "https://registry.yarnpkg.com/conventional-changelog-codemirror/-/conventional-changelog-codemirror-0.3.4.tgz#debc43991d487d7964e65087fbbe034044bd51fb" dependencies: - q "^1.4.1" + q "^1.5.1" -conventional-changelog-core@^1.9.3: - version "1.9.5" - resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-1.9.5.tgz#5db7566dad7c0cb75daf47fbb2976f7bf9928c1d" +conventional-changelog-core@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-2.0.5.tgz#45b6347c4c6512e1f163f7ff55c9f5bcb88fd990" dependencies: - conventional-changelog-writer "^2.0.3" - conventional-commits-parser "^2.1.0" - dateformat "^1.0.12" + conventional-changelog-writer "^3.0.4" + conventional-commits-parser "^2.1.5" + dateformat "^3.0.0" get-pkg-repo "^1.0.0" - git-raw-commits "^1.3.0" + git-raw-commits "^1.3.4" git-remote-origin-url "^2.0.0" - git-semver-tags "^1.2.3" - lodash "^4.0.0" + git-semver-tags "^1.3.4" + lodash "^4.2.1" normalize-package-data "^2.3.5" - q "^1.4.1" + q "^1.5.1" read-pkg "^1.1.0" read-pkg-up "^1.0.1" through2 "^2.0.0" -conventional-changelog-ember@^0.2.9: - version "0.2.10" - resolved "https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-0.2.10.tgz#dcd6e4cdc2e6c2b58653cf4d2cb1656a60421929" +conventional-changelog-ember@^0.3.6: + version "0.3.6" + resolved "https://registry.yarnpkg.com/conventional-changelog-ember/-/conventional-changelog-ember-0.3.6.tgz#f3825d7434168f3d9211b5532dc1d5769532b668" dependencies: - q "^1.4.1" + q "^1.5.1" -conventional-changelog-eslint@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-0.2.1.tgz#2c2a11beb216f80649ba72834180293b687c0662" +conventional-changelog-eslint@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/conventional-changelog-eslint/-/conventional-changelog-eslint-1.0.5.tgz#8bae05ebbf574e6506caf7b37dc51ca21b74d220" dependencies: - q "^1.4.1" + q "^1.5.1" -conventional-changelog-express@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/conventional-changelog-express/-/conventional-changelog-express-0.2.1.tgz#838d9e1e6c9099703b150b9c19aa2d781742bd6c" +conventional-changelog-express@^0.3.4: + version "0.3.4" + resolved "https://registry.yarnpkg.com/conventional-changelog-express/-/conventional-changelog-express-0.3.4.tgz#812a9cf778677e12f978ac9c40d85297c0bfcca9" dependencies: - q "^1.4.1" + q "^1.5.1" conventional-changelog-jquery@^0.1.0: version "0.1.0" @@ -2036,75 +2294,80 @@ conventional-changelog-jscs@^0.1.0: dependencies: q "^1.4.1" -conventional-changelog-jshint@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/conventional-changelog-jshint/-/conventional-changelog-jshint-0.2.1.tgz#86139bb3ac99899f2b177e9617e09b37d99bcf3a" +conventional-changelog-jshint@^0.3.4: + version "0.3.4" + resolved "https://registry.yarnpkg.com/conventional-changelog-jshint/-/conventional-changelog-jshint-0.3.4.tgz#b2de33cd0870d9af804ac6a4fded0ee25b69c9bb" dependencies: compare-func "^1.3.1" - q "^1.4.1" + q "^1.5.1" -conventional-changelog-writer@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-2.0.3.tgz#073b0c39f1cc8fc0fd9b1566e93833f51489c81c" +conventional-changelog-preset-loader@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-1.1.6.tgz#b29af6332f9313857be36427623c9016bfeeaf33" + +conventional-changelog-writer@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-3.0.4.tgz#705b46a8b8277bd7fd79cad8032095b5d803864c" dependencies: compare-func "^1.3.1" - conventional-commits-filter "^1.1.1" - dateformat "^1.0.11" + conventional-commits-filter "^1.1.5" + dateformat "^3.0.0" handlebars "^4.0.2" json-stringify-safe "^5.0.1" - lodash "^4.0.0" - meow "^3.3.0" - semver "^5.0.1" + lodash "^4.2.1" + meow "^4.0.0" + semver "^5.5.0" split "^1.0.0" through2 "^2.0.0" -conventional-changelog@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.7.tgz#9151a62b1d8edb2d82711dabf5b7cf71041f82b1" - dependencies: - conventional-changelog-angular "^1.5.2" - conventional-changelog-atom "^0.1.2" - conventional-changelog-codemirror "^0.2.1" - conventional-changelog-core "^1.9.3" - conventional-changelog-ember "^0.2.9" - conventional-changelog-eslint "^0.2.1" - conventional-changelog-express "^0.2.1" +conventional-changelog@^1.1.18: + version "1.1.18" + resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-1.1.18.tgz#ffe28798e4ddef5f6e2f74398e8248bcb233360b" + dependencies: + conventional-changelog-angular "^1.6.6" + conventional-changelog-atom "^0.2.4" + conventional-changelog-codemirror "^0.3.4" + conventional-changelog-core "^2.0.5" + conventional-changelog-ember "^0.3.6" + conventional-changelog-eslint "^1.0.5" + conventional-changelog-express "^0.3.4" conventional-changelog-jquery "^0.1.0" conventional-changelog-jscs "^0.1.0" - conventional-changelog-jshint "^0.2.1" + conventional-changelog-jshint "^0.3.4" + conventional-changelog-preset-loader "^1.1.6" -conventional-commits-filter@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-1.1.1.tgz#72172319c0c88328a015b30686b55527b3a5e54a" +conventional-commits-filter@^1.1.1, conventional-commits-filter@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/conventional-commits-filter/-/conventional-commits-filter-1.1.5.tgz#77aac065e3de9c1a74b801e8e25c9affb3184f65" dependencies: is-subset "^0.1.1" modify-values "^1.0.0" -conventional-commits-parser@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-2.1.0.tgz#9b4b7c91124bf2a1a9a2cc1c72760d382cbbb229" +conventional-commits-parser@^2.1.1, conventional-commits-parser@^2.1.5: + version "2.1.5" + resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-2.1.5.tgz#9ac3a4ab221c0c3c9e9dd2c09ae01e6d1e1dabe0" dependencies: JSONStream "^1.0.4" is-text-path "^1.0.0" lodash "^4.2.1" - meow "^3.3.0" + meow "^4.0.0" split2 "^2.0.0" through2 "^2.0.0" trim-off-newlines "^1.0.0" conventional-recommended-bump@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-1.1.0.tgz#964d4fcc70fb5259d41fa9b39d3df6afdb87d253" + version "1.2.1" + resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-1.2.1.tgz#1b7137efb5091f99fe009e2fe9ddb7cc490e9375" dependencies: concat-stream "^1.4.10" conventional-commits-filter "^1.1.1" - conventional-commits-parser "^2.1.0" + conventional-commits-parser "^2.1.1" git-raw-commits "^1.3.0" - git-semver-tags "^1.2.3" + git-semver-tags "^1.3.0" meow "^3.3.0" object-assign "^4.0.1" -convert-source-map@^1.1.0, convert-source-map@^1.3.0: +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" @@ -2116,7 +2379,7 @@ copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" -core-js@^2.4.0, core-js@^2.5.3: +core-js@^2.4.0, core-js@^2.5.0, core-js@^2.5.3: version "2.5.3" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" @@ -2160,13 +2423,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@^4: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" - dependencies: - lru-cache "^4.0.1" - which "^1.2.9" - 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" @@ -2181,6 +2437,12 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" +cryptiles@3.x.x: + version "3.1.2" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" + dependencies: + boom "5.x.x" + 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" @@ -2210,6 +2472,16 @@ css-what@2.1: version "2.1.0" resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.0.tgz#9467d032c38cfaefb9f2d79501253062f87fa1bd" +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" + +"cssstyle@>= 0.2.37 < 0.3.0": + version "0.2.37" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" + 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" @@ -2242,26 +2514,13 @@ date-now@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" -dateformat@^1.0.11, dateformat@^1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" - dependencies: - get-stdin "^4.0.1" - meow "^3.3.0" - dateformat@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062" -debug-log@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" - -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" +dateformat@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: version "2.6.9" @@ -2275,7 +2534,14 @@ debug@^3.0.0, debug@^3.0.1, debug@^3.1.0: dependencies: ms "2.0.0" -decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: +decamelize-keys@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/decamelize-keys/-/decamelize-keys-1.1.0.tgz#d171a87933252807eb3cb61dc1c1445d078df2d9" + dependencies: + 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: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -2332,6 +2598,13 @@ define-property@^1.0.0: 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" + defined@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" @@ -2404,6 +2677,10 @@ detect-libc@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + detective@^4.0.0: version "4.7.1" resolved "https://registry.yarnpkg.com/detective/-/detective-4.7.1.tgz#0eca7314338442febb6d65da54c10bb1c82b246e" @@ -2411,9 +2688,9 @@ detective@^4.0.0: acorn "^5.2.1" defined "^1.0.0" -diff@3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" +diff@^3.2.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" diffie-hellman@^5.0.0: version "5.0.2" @@ -2423,7 +2700,7 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" -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: @@ -2436,7 +2713,11 @@ dom-serializer@0, dom-serializer@~0.1.0: domelementtype "~1.1.1" entities "~1.1.1" -domain-browser@^1.1.1, domain-browser@~1.1.0: +domain-browser@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.2.0.tgz#3d31f50191a6749dd1375a7f522e823d42e54eda" + +domain-browser@~1.1.0: version "1.1.7" resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" @@ -2448,6 +2729,12 @@ domelementtype@~1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" +domexception@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + 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" @@ -2462,8 +2749,8 @@ domutils@1.5.1: domelementtype "1" domutils@^1.5.1: - version "1.6.2" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.6.2.tgz#1958cc0b4c9426e9ed367fb1c8e854891b0fa3ff" + version "1.7.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" dependencies: dom-serializer "0" domelementtype "1" @@ -2496,9 +2783,9 @@ ecc-jsbn@~0.1.1: dependencies: jsbn "~0.1.0" -electron-to-chromium@^1.3.30: - version "1.3.31" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.31.tgz#00d832cba9fe2358652b0c48a8816c8e3a037e9f" +electron-to-chromium@^1.3.33: + version "1.3.34" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.34.tgz#d93498f40391bb0c16a603d8241b9951404157ed" elegant-spinner@^1.0.1: version "1.0.1" @@ -2538,7 +2825,7 @@ end-of-stream@~0.1.5: dependencies: once "~1.3.0" -enhanced-resolve@^3.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" dependencies: @@ -2552,8 +2839,8 @@ entities@^1.1.1, entities@~1.1.1: resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" errno@^0.1.3: - version "0.1.6" - resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.6.tgz#c386ce8a6283f14fc09563b71560908c9bf53026" + version "0.1.7" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618" dependencies: prr "~1.0.1" @@ -2582,8 +2869,8 @@ es-to-primitive@^1.1.1: is-symbol "^1.0.1" es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.38" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.38.tgz#fa7d40d65bbc9bb8a67e1d3f9cc656a00530eed3" + version "0.10.39" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.39.tgz#fca21b67559277ca4ac1a1ed7048b107b6f76d87" dependencies: es6-iterator "~2.0.3" es6-symbol "~3.1.1" @@ -2640,10 +2927,21 @@ es6-weak-map@^2.0.1: 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: +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" +escodegen@^1.9.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.9.1.tgz#dbae17ef96c8e4bedb1356f4504fa4cc2f7cb7e2" + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + escope@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" @@ -2658,14 +2956,14 @@ eslint-config-babel@^7.0.2: resolved "https://registry.yarnpkg.com/eslint-config-babel/-/eslint-config-babel-7.0.2.tgz#cbde74f61cee087d8cd6e607fcfa087869a02d99" eslint-plugin-flowtype@^2.20.0: - version "2.41.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.41.0.tgz#fd5221c60ba917c059d7ef69686a99cca09fd871" + version "2.46.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.46.1.tgz#c4f81d580cd89c82bc3a85a1ccf4ae3a915143a4" dependencies: lodash "^4.15.0" eslint-plugin-prettier@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.5.0.tgz#39a91dd7528eaf19cd42c0ee3f2c1f684606a05f" + 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 "^21.0.0" @@ -2681,9 +2979,9 @@ 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.5.0: - version "4.15.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.15.0.tgz#89ab38c12713eec3d13afac14e4a89e75ef08145" +eslint@^4.18.2: + version "4.18.2" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.2.tgz#0f81267ad1012e7d2051e186a9004cc2267b8d45" dependencies: ajv "^5.3.0" babel-code-frame "^6.22.0" @@ -2691,7 +2989,7 @@ eslint@^4.5.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" @@ -2720,24 +3018,24 @@ eslint@^4.5.0: semver "^5.3.0" strip-ansi "^4.0.0" strip-json-comments "~2.0.1" - table "^4.0.1" + table "4.0.2" 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.4" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" dependencies: - acorn "^5.2.1" + acorn "^5.5.0" acorn-jsx "^3.0.0" +esprima@^3.1.3, esprima@~3.1.0: + 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" -esprima@~3.1.0: - 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" @@ -2745,19 +3043,18 @@ 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.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" -estree-walker@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" +estree-walker@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.3.1.tgz#e6b1a51cf7292524e7237c312e5fe6660c1ce1aa" esutils@^2.0.2: version "2.0.2" @@ -2781,6 +3078,12 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: md5.js "^1.3.4" safe-buffer "^5.1.1" +exec-sh@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.1.tgz#163b98a6e89e6b65b47c2a28d215bc1f63989c38" + dependencies: + merge "^1.1.3" + execa@^0.6.3: version "0.6.3" resolved "https://registry.yarnpkg.com/execa/-/execa-0.6.3.tgz#57b69a594f081759c69e5370f0d17b9cb11658fe" @@ -2821,6 +3124,10 @@ exit-hook@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" @@ -2851,6 +3158,17 @@ expand-tilde@^2.0.0, expand-tilde@^2.0.2: dependencies: homedir-polyfill "^1.0.1" +expect@^22.4.0: + version "22.4.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-22.4.0.tgz#371edf1ae15b83b5bf5ec34b42f1584660a36c16" + dependencies: + ansi-styles "^3.2.0" + jest-diff "^22.4.0" + jest-get-type "^22.1.0" + jest-matcher-utils "^22.4.0" + jest-message-util "^22.4.0" + jest-regex-util "^22.1.0" + extend-shallow@^1.1.2: version "1.1.4" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-1.1.4.tgz#19d6bf94dfc09d76ba711f39b872d21ff4dd9071" @@ -2863,14 +3181,14 @@ extend-shallow@^2.0.1: dependencies: is-extendable "^0.1.0" -extend-shallow@^3.0.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" -extend@^3.0.0, extend@~3.0.0: +extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" @@ -2888,7 +3206,7 @@ extglob@^0.3.1: dependencies: is-extglob "^1.0.0" -extglob@^2.0.2: +extglob@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" dependencies: @@ -2927,8 +3245,8 @@ fancy-log@^1.1.0, fancy-log@^1.3.2: time-stamp "^1.0.0" 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" + version "1.1.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" fast-diff@^1.1.1: version "1.1.2" @@ -2946,6 +3264,12 @@ fastparse@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.1.tgz#d1e2643b38a94d7583b479060e6c4affc94071f8" +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + figures@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" @@ -2970,6 +3294,13 @@ filename-regex@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" +fileset@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + dependencies: + glob "^7.0.3" + minimatch "^3.0.3" + fill-range@^2.1.0: version "2.2.3" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" @@ -2989,14 +3320,6 @@ fill-range@^4.0.0: repeat-string "^1.6.1" to-regex-range "^2.1.0" -find-cache-dir@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" - dependencies: - commondir "^1.0.1" - mkdirp "^0.5.1" - pkg-dir "^1.0.0" - find-cache-dir@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-1.0.0.tgz#9288e3e9e3cc3748717d39eade17cf71fc30ee6f" @@ -3068,9 +3391,9 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.59.0: - version "0.59.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.59.0.tgz#8c151ee7f09f1deed9bf0b9d1f2e8ab9d470f1bb" +flow-bin@^0.66.0: + version "0.66.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.66.0.tgz#a96dde7015dc3343fd552a7b4963c02be705ca26" for-in@^1.0.1, for-in@^1.0.2: version "1.0.2" @@ -3092,13 +3415,6 @@ foreach@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" -foreground-child@^1.5.3, foreground-child@^1.5.6: - version "1.5.6" - resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" - dependencies: - cross-spawn "^4" - signal-exit "^3.0.0" - forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -3111,6 +3427,14 @@ form-data@~2.1.1: combined-stream "^1.0.5" mime-types "^2.1.12" +form-data@~2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" + dependencies: + asynckit "^0.4.0" + combined-stream "1.0.6" + mime-types "^2.1.12" + fragment-cache@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" @@ -3133,7 +3457,7 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" -fsevents@^1.0.0: +fsevents@^1.0.0, fsevents@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.3.tgz#11f82318f5fe7bb2cd22965a108e9306208216d8" dependencies: @@ -3228,13 +3552,13 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -git-raw-commits@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-1.3.0.tgz#0bc8596e90d5ffe736f7f5546bd2d12f73abaac6" +git-raw-commits@^1.3.0, git-raw-commits@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-1.3.4.tgz#442c3df5985b4f5689e9e43597f5194736aac001" dependencies: dargs "^4.0.1" lodash.template "^4.0.2" - meow "^3.3.0" + meow "^4.0.0" split2 "^2.0.0" through2 "^2.0.0" @@ -3245,12 +3569,12 @@ git-remote-origin-url@^2.0.0: gitconfiglocal "^1.0.0" pify "^2.3.0" -git-semver-tags@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-1.2.3.tgz#188b453882bf9d7a23afd31baba537dab7388d5d" +git-semver-tags@^1.3.0, git-semver-tags@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-1.3.4.tgz#2ceb2a355c6d7514c123c35e297067d08caf3a92" dependencies: - meow "^3.3.0" - semver "^5.0.1" + meow "^4.0.0" + semver "^5.5.0" gitconfiglocal@^1.0.0: version "1.0.0" @@ -3271,7 +3595,7 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" -glob-parent@^3.0.1: +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" dependencies: @@ -3301,17 +3625,6 @@ glob2base@^0.0.12: dependencies: find-index "^0.1.1" -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@^4.3.1: version "4.5.3" resolved "https://registry.yarnpkg.com/glob/-/glob-4.5.3.tgz#c6cb73d3226c1efef04de3c56d012f03377ee15f" @@ -3321,7 +3634,7 @@ glob@^4.3.1: minimatch "^2.0.1" once "^1.3.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.0, glob@^7.1.2: +glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.0, glob@^7.1.1, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -3359,8 +3672,8 @@ global-prefix@^1.0.1: which "^1.2.14" globals@^11.0.1, globals@^11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.1.0.tgz#632644457f5f0e3ae711807183700ebf2e4633e4" + version "11.3.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.3.0.tgz#e04fdb7b9796d8adac9c8f64c14837b2313378b0" globals@^9.18.0: version "9.18.0" @@ -3396,8 +3709,8 @@ globule@~0.1.0: minimatch "~0.2.11" glogg@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.0.tgz#7fe0f199f57ac906cf512feead8f90ee4a284fc5" + version "1.0.1" + resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.1.tgz#dcf758e44789cc3f3d32c1f3562a3676e6a34810" dependencies: sparkles "^1.0.0" @@ -3407,7 +3720,7 @@ graceful-fs@^3.0.0: dependencies: natives "^1.1.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -3415,20 +3728,16 @@ graceful-fs@~1.2.0: version "1.2.3" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-1.2.3.tgz#15a4806a57547cb2d2dbf27f42e89a8c3451b364" -"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" +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" -gulp-babel@^8.0.0-beta.0: - version "8.0.0-beta.0" - resolved "https://registry.yarnpkg.com/gulp-babel/-/gulp-babel-8.0.0-beta.0.tgz#91f84414fec6920619fca58a8d8d62171ccf8ccf" +gulp-babel@^8.0.0-beta.2: + version "8.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gulp-babel/-/gulp-babel-8.0.0-beta.2.tgz#0ceed820eeece53da75bbb466b56db336c4136dd" dependencies: - gulp-util "^3.0.0" - replace-ext "0.0.1" + plugin-error "^1.0.1" + replace-ext "^1.0.0" through2 "^2.0.0" vinyl-sourcemaps-apply "^0.2.0" @@ -3549,6 +3858,10 @@ har-schema@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e" +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + har-validator@~4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a" @@ -3556,6 +3869,13 @@ har-validator@~4.2.1: ajv "^4.9.1" har-schema "^1.0.5" +har-validator@~5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" + dependencies: + ajv "^5.1.0" + har-schema "^2.0.0" + has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -3570,6 +3890,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-gulplog@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/has-gulplog/-/has-gulplog-0.1.0.tgz#6414c82913697da51590397dafb12f22967811ce" @@ -3642,7 +3966,16 @@ hawk@3.1.3, hawk@~3.1.3: hoek "2.x.x" sntp "1.x.x" -he@1.1.1, he@1.1.x: +hawk@~6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038" + dependencies: + boom "4.x.x" + cryptiles "3.x.x" + hoek "4.x.x" + sntp "2.x.x" + +he@1.1.x: version "1.1.1" resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" @@ -3658,6 +3991,17 @@ hoek@2.x.x: version "2.16.3" resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" +hoek@4.x.x: + version "4.2.1" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb" + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + home-or-tmp@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-3.0.0.tgz#57a8fe24cf33cdd524860a15821ddc25c86671fb" @@ -3672,6 +4016,12 @@ 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" +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" + 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" @@ -3683,12 +4033,12 @@ html-loader@^0.4.5: object-assign "^4.1.0" html-minifier@^3.0.1: - version "3.5.8" - resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.8.tgz#5ccdb1f73a0d654e6090147511f6e6b2ee312700" + version "3.5.10" + resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.10.tgz#8522c772c388db81aa5c26f62033302d906ea1c7" dependencies: camel-case "3.0.x" clean-css "4.1.x" - commander "2.12.x" + commander "2.14.x" he "1.1.x" ncname "1.0.x" param-case "2.1.x" @@ -3718,6 +4068,14 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + https-browserify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" @@ -3734,7 +4092,7 @@ husky@^0.14.3: normalize-path "^1.0.0" strip-indent "^2.0.0" -iconv-lite@^0.4.17, iconv-lite@~0.4.13: +iconv-lite@0.4.19, iconv-lite@^0.4.17, iconv-lite@~0.4.13: version "0.4.19" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.19.tgz#f7468f60135f5e5dad3399c0a81be9a1603a082b" @@ -3746,6 +4104,13 @@ ignore@^3.3.3: version "3.3.7" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.7.tgz#612289bfb3c220e186a58118618d5be8c1bab021" +import-local@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" + dependencies: + pkg-dir "^2.0.0" + resolve-cwd "^2.0.0" + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -3819,8 +4184,8 @@ inquirer@^3.0.6: through "^2.3.6" insert-module-globals@^7.0.0: - version "7.0.1" - resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.0.1.tgz#c03bf4e01cb086d5b5e5ace8ad0afe7889d638c3" + version "7.0.2" + resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.0.2.tgz#012c56baa7d3307a8b417d4ec5270cf9741c18f4" dependencies: JSONStream "^1.0.3" combine-source-map "~0.7.1" @@ -3836,8 +4201,8 @@ interpret@^1.0.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" invariant@^2.2.0, invariant@^2.2.2: - 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" @@ -3918,7 +4283,7 @@ is-descriptor@^0.1.0: is-data-descriptor "^0.1.4" kind-of "^5.0.0" -is-descriptor@^1.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: @@ -3974,6 +4339,10 @@ 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-generator-fn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-1.0.0.tgz#969d49e1bb3329f6bb7f09089be26578b2ddd46a" + 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" @@ -4008,6 +4377,10 @@ is-number@^3.0.0: 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" + 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" @@ -4018,11 +4391,11 @@ is-observable@^0.2.0: dependencies: symbol-observable "^0.2.2" -is-odd@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-odd/-/is-odd-1.0.0.tgz#3b8a932eb028b3775c39bb09e91767accdb69088" +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 "^3.0.0" + is-number "^4.0.0" is-path-cwd@^1.0.0: version "1.0.0" @@ -4079,8 +4452,8 @@ is-relative@^1.0.0: is-unc-path "^1.0.0" is-resolvable@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.1.tgz#acca1cd36dbe44b974b924321555a70ba03b1cf4" + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" @@ -4114,9 +4487,9 @@ is-utf8@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" -is-windows@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.1.tgz#310db70f742d259a16a369202b51af84233310d9" +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" isarray@0.0.1, isarray@~0.0.1: version "0.0.1" @@ -4144,9 +4517,25 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" -istanbul-lib-coverage@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" +istanbul-api@^1.1.14: + version "1.2.2" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.2.2.tgz#e17cd519dd5ec4141197f246fdf380b75487f3b1" + dependencies: + async "^2.1.4" + fileset "^2.0.2" + istanbul-lib-coverage "^1.1.2" + istanbul-lib-hook "^1.1.0" + istanbul-lib-instrument "^1.9.2" + istanbul-lib-report "^1.1.3" + istanbul-lib-source-maps "^1.2.3" + istanbul-reports "^1.1.4" + js-yaml "^3.7.0" + mkdirp "^0.5.1" + once "^1.4.0" + +istanbul-lib-coverage@^1.1.1, istanbul-lib-coverage@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.2.tgz#4113c8ff6b7a40a1ef7350b01016331f63afde14" istanbul-lib-hook@^1.1.0: version "1.1.0" @@ -4154,51 +4543,287 @@ istanbul-lib-hook@^1.1.0: dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.7.5, istanbul-lib-instrument@^1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.1.tgz#250b30b3531e5d3251299fdd64b0b2c9db6b558e" +istanbul-lib-instrument@^1.7.5, istanbul-lib-instrument@^1.8.0, istanbul-lib-instrument@^1.9.2: + version "1.9.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.2.tgz#84905bf47f7e0b401d6b840da7bad67086b4aab6" dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" babylon "^6.18.0" - istanbul-lib-coverage "^1.1.1" + istanbul-lib-coverage "^1.1.2" semver "^5.3.0" -istanbul-lib-report@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.2.tgz#922be27c13b9511b979bd1587359f69798c1d425" +istanbul-lib-report@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.3.tgz#2df12188c0fa77990c0d2176d2d0ba3394188259" dependencies: - istanbul-lib-coverage "^1.1.1" + istanbul-lib-coverage "^1.1.2" mkdirp "^0.5.1" path-parse "^1.0.5" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.2.tgz#750578602435f28a0c04ee6d7d9e0f2960e62c1c" +istanbul-lib-source-maps@^1.2.1, istanbul-lib-source-maps@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.3.tgz#20fb54b14e14b3fb6edb6aca3571fd2143db44e6" dependencies: debug "^3.1.0" - istanbul-lib-coverage "^1.1.1" + istanbul-lib-coverage "^1.1.2" mkdirp "^0.5.1" rimraf "^2.6.1" source-map "^0.5.3" -istanbul-reports@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.3.tgz#3b9e1e8defb6d18b1d425da8e8b32c5a163f2d10" +istanbul-reports@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.4.tgz#5ccba5e22b7b5a5d91d5e0a830f89be334bf97bd" dependencies: handlebars "^4.0.3" +jest-changed-files@^22.2.0: + version "22.2.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-22.2.0.tgz#517610c4a8ca0925bdc88b0ca53bd678aa8d019e" + dependencies: + throat "^4.0.0" + +jest-cli@^22.4.2: + version "22.4.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-22.4.2.tgz#e6546dc651e13d164481aa3e76e53ac4f4edab06" + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + graceful-fs "^4.1.11" + import-local "^1.0.0" + is-ci "^1.0.10" + istanbul-api "^1.1.14" + istanbul-lib-coverage "^1.1.1" + istanbul-lib-instrument "^1.8.0" + istanbul-lib-source-maps "^1.2.1" + jest-changed-files "^22.2.0" + jest-config "^22.4.2" + jest-environment-jsdom "^22.4.1" + jest-get-type "^22.1.0" + jest-haste-map "^22.4.2" + jest-message-util "^22.4.0" + jest-regex-util "^22.1.0" + jest-resolve-dependencies "^22.1.0" + jest-runner "^22.4.2" + jest-runtime "^22.4.2" + jest-snapshot "^22.4.0" + jest-util "^22.4.1" + jest-validate "^22.4.2" + jest-worker "^22.2.2" + micromatch "^2.3.11" + node-notifier "^5.2.1" + realpath-native "^1.0.0" + rimraf "^2.5.4" + slash "^1.0.0" + string-length "^2.0.0" + strip-ansi "^4.0.0" + which "^1.2.12" + yargs "^10.0.3" + +jest-config@^22.4.2: + version "22.4.2" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-22.4.2.tgz#580ba5819bf81a5e48f4fd470e8b81834f45c855" + dependencies: + chalk "^2.0.1" + glob "^7.1.1" + jest-environment-jsdom "^22.4.1" + jest-environment-node "^22.4.1" + jest-get-type "^22.1.0" + jest-jasmine2 "^22.4.2" + jest-regex-util "^22.1.0" + jest-resolve "^22.4.2" + jest-util "^22.4.1" + jest-validate "^22.4.2" + pretty-format "^22.4.0" + +jest-diff@^22.4.0: + version "22.4.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-22.4.0.tgz#384c2b78519ca44ca126382df53f134289232525" + dependencies: + chalk "^2.0.1" + diff "^3.2.0" + jest-get-type "^22.1.0" + pretty-format "^22.4.0" + jest-docblock@^21.0.0: version "21.2.0" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" +jest-docblock@^22.4.0: + version "22.4.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-22.4.0.tgz#dbf1877e2550070cfc4d9b07a55775a0483159b8" + dependencies: + detect-newline "^2.1.0" + +jest-environment-jsdom@^22.4.1: + version "22.4.1" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-22.4.1.tgz#754f408872441740100d3917e5ec40c74de6447f" + dependencies: + jest-mock "^22.2.0" + jest-util "^22.4.1" + jsdom "^11.5.1" + +jest-environment-node@^22.4.1: + version "22.4.1" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-22.4.1.tgz#418850eb654596b8d6e36c2021cbedbc23df8e16" + dependencies: + jest-mock "^22.2.0" + jest-util "^22.4.1" + 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.1.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-22.1.0.tgz#4e90af298ed6181edc85d2da500dbd2753e0d5a9" + +jest-haste-map@^22.4.2: + version "22.4.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-22.4.2.tgz#a90178e66146d4378bb076345a949071f3b015b4" + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.11" + jest-docblock "^22.4.0" + jest-serializer "^22.4.0" + jest-worker "^22.2.2" + micromatch "^2.3.11" + sane "^2.0.0" + +jest-jasmine2@^22.4.2: + version "22.4.2" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-22.4.2.tgz#dfd3d259579ed6f52510d8f1ab692808f0d40691" + dependencies: + chalk "^2.0.1" + co "^4.6.0" + expect "^22.4.0" + graceful-fs "^4.1.11" + is-generator-fn "^1.0.0" + jest-diff "^22.4.0" + jest-matcher-utils "^22.4.0" + jest-message-util "^22.4.0" + jest-snapshot "^22.4.0" + jest-util "^22.4.1" + source-map-support "^0.5.0" + +jest-leak-detector@^22.4.0: + version "22.4.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-22.4.0.tgz#64da77f05b001c96d2062226e079f89989c4aa2f" + dependencies: + pretty-format "^22.4.0" + +jest-matcher-utils@^22.4.0: + version "22.4.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-22.4.0.tgz#d55f5faf2270462736bdf7c7485ee931c9d4b6a1" + dependencies: + chalk "^2.0.1" + jest-get-type "^22.1.0" + pretty-format "^22.4.0" + +jest-message-util@^22.4.0: + version "22.4.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-22.4.0.tgz#e3d861df16d2fee60cb2bc8feac2188a42579642" + dependencies: + "@babel/code-frame" "^7.0.0-beta.35" + chalk "^2.0.1" + micromatch "^2.3.11" + slash "^1.0.0" + stack-utils "^1.0.1" + +jest-mock@^22.2.0: + version "22.2.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-22.2.0.tgz#444b3f9488a7473adae09bc8a77294afded397a7" + +jest-regex-util@^22.1.0: + version "22.1.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-22.1.0.tgz#5daf2fe270074b6da63e5d85f1c9acc866768f53" + +jest-resolve-dependencies@^22.1.0: + version "22.1.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-22.1.0.tgz#340e4139fb13315cd43abc054e6c06136be51e31" + dependencies: + jest-regex-util "^22.1.0" + +jest-resolve@^22.4.2: + version "22.4.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-22.4.2.tgz#25d88aa4147462c9c1c6a1ba16250d3794c24d00" + dependencies: + browser-resolve "^1.11.2" + chalk "^2.0.1" + +jest-runner@^22.4.2: + version "22.4.2" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-22.4.2.tgz#19390ea9d99f768973e16f95a1efa351c0017e87" + dependencies: + exit "^0.1.2" + jest-config "^22.4.2" + jest-docblock "^22.4.0" + jest-haste-map "^22.4.2" + jest-jasmine2 "^22.4.2" + jest-leak-detector "^22.4.0" + jest-message-util "^22.4.0" + jest-runtime "^22.4.2" + jest-util "^22.4.1" + jest-worker "^22.2.2" + throat "^4.0.0" + +jest-runtime@^22.4.2: + version "22.4.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-22.4.2.tgz#0de0444f65ce15ee4f2e0055133fc7c17b9168f3" + dependencies: + babel-core "^6.0.0" + babel-jest "^22.4.1" + babel-plugin-istanbul "^4.1.5" + chalk "^2.0.1" + convert-source-map "^1.4.0" + exit "^0.1.2" + graceful-fs "^4.1.11" + jest-config "^22.4.2" + jest-haste-map "^22.4.2" + jest-regex-util "^22.1.0" + jest-resolve "^22.4.2" + jest-util "^22.4.1" + jest-validate "^22.4.2" + json-stable-stringify "^1.0.1" + micromatch "^2.3.11" + realpath-native "^1.0.0" + slash "^1.0.0" + strip-bom "3.0.0" + write-file-atomic "^2.1.0" + yargs "^10.0.3" + +jest-serializer@^22.4.0: + version "22.4.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-22.4.0.tgz#b5d145b98c4b0d2c20ab686609adbb81fe23b566" + +jest-snapshot@^22.4.0: + version "22.4.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-22.4.0.tgz#03d3ce63f8fa7352388afc6a3c8b5ccc3a180ed7" + dependencies: + chalk "^2.0.1" + jest-diff "^22.4.0" + jest-matcher-utils "^22.4.0" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + pretty-format "^22.4.0" + +jest-util@^22.4.1: + version "22.4.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-22.4.1.tgz#dd17c3bdb067f8e90591563ec0c42bf847dc249f" + dependencies: + callsites "^2.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.11" + is-ci "^1.0.10" + jest-message-util "^22.4.0" + mkdirp "^0.5.1" + source-map "^0.6.0" + jest-validate@^21.1.0: version "21.2.1" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-21.2.1.tgz#cc0cbca653cd54937ba4f2a111796774530dd3c7" @@ -4208,13 +4833,36 @@ jest-validate@^21.1.0: leven "^2.1.0" pretty-format "^21.2.1" +jest-validate@^22.4.2: + version "22.4.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-22.4.2.tgz#e789a4e056173bf97fe797a2df2d52105c57d4f4" + dependencies: + chalk "^2.0.1" + jest-config "^22.4.2" + jest-get-type "^22.1.0" + leven "^2.1.0" + pretty-format "^22.4.0" + +jest-worker@^22.2.2: + version "22.2.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-22.2.2.tgz#c1f5dc39976884b81f68ec50cb8532b2cbab3390" + dependencies: + merge-stream "^1.0.1" + +jest@^22.4.2: + version "22.4.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-22.4.2.tgz#34012834a49bf1bdd3bc783850ab44e4499afc20" + dependencies: + import-local "^1.0.0" + jest-cli "^22.4.2" + 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" +js-yaml@^3.2.1, js-yaml@^3.7.0, js-yaml@^3.9.0, 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" @@ -4223,6 +4871,37 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" +jsdom@^11.5.1: + version "11.6.2" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.6.2.tgz#25d1ef332d48adf77fc5221fe2619967923f16bb" + dependencies: + abab "^1.0.4" + acorn "^5.3.0" + 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" + html-encoding-sniffer "^1.0.2" + left-pad "^1.2.0" + nwmatcher "^1.4.3" + parse5 "4.0.0" + pn "^1.1.0" + request "^2.83.0" + request-promise-native "^1.0.5" + sax "^1.2.4" + symbol-tree "^3.2.2" + tough-cookie "^2.3.3" + 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" + xml-name-validator "^3.0.0" + jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" @@ -4271,10 +4950,6 @@ 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" -json3@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" - json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -4322,7 +4997,7 @@ kind-of@^4.0.0: dependencies: is-buffer "^1.1.5" -kind-of@^5.0.0, kind-of@^5.0.2: +kind-of@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" @@ -4330,6 +5005,12 @@ 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" +klaw@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-2.1.1.tgz#42b76894701169cc910fd0d19ce677b5fb378af1" + dependencies: + graceful-fs "^4.1.9" + 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" @@ -4354,6 +5035,10 @@ lcid@^1.0.0: dependencies: invert-kv "^1.0.0" +left-pad@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.2.0.tgz#d30a73c6b8201d8f7d8e7956ba9616087a68e0ee" + lerna-changelog@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/lerna-changelog/-/lerna-changelog-0.5.0.tgz#1617a8193a1309451ffa1e686b425faf0424b3f8" @@ -4437,8 +5122,8 @@ liftoff@^2.1.0: resolve "^1.1.7" lint-staged@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-6.0.1.tgz#855f2993ab4a265430e2fd9828427e648d65e6b4" + 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" chalk "^2.1.0" @@ -4458,7 +5143,7 @@ lint-staged@^6.0.1: p-map "^1.1.1" path-is-inside "^1.0.2" pify "^3.0.0" - staged-git-files "0.0.4" + staged-git-files "1.0.0" stringify-object "^3.2.0" listr-silent-renderer@^1.1.1: @@ -4528,6 +5213,15 @@ load-json-file@^2.0.0: pify "^2.0.0" strip-bom "^3.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" + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.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" @@ -4547,21 +5241,10 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -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._basetostring@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz#d1861d877f824a52f669832dcaf3ee15566a07d5" @@ -4598,14 +5281,6 @@ lodash.clone@^4.3.2: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6" -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.escape@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" @@ -4640,6 +5315,10 @@ lodash.some@^4.2.2: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + lodash.template@^3.0.0: version "3.6.2" resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f" @@ -4674,9 +5353,9 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "~3.0.0" -lodash@^4.0.0, lodash@^4.1.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: - version "4.17.4" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" +lodash@^4.13.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: + version "4.17.5" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511" lodash@~1.0.1: version "1.0.2" @@ -4734,8 +5413,8 @@ lru-cache@^4.0.1: yallist "^2.1.2" make-dir@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.1.0.tgz#19b4369fe48c116f53c2af95ad102c0e39e85d51" + version "1.2.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.2.0.tgz#6d6a49eead4aae296c53bbf3a1a008bd6c89469b" dependencies: pify "^3.0.0" @@ -4746,8 +5425,8 @@ make-error-cause@^1.1.1: make-error "^1.2.0" make-error@^1.2.0: - version "1.3.2" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.2.tgz#8762ffad2444dd8ff1f7c819629fa28e24fea1c4" + version "1.3.4" + resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.4.tgz#19978ed575f9e9545d2ff8c13e33b5d18a67d535" make-iterator@^1.0.0: version "1.0.0" @@ -4755,6 +5434,12 @@ make-iterator@^1.0.0: dependencies: kind-of "^3.1.0" +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + 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" @@ -4763,22 +5448,16 @@ 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" +map-obj@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-2.0.0.tgz#a65cd29087a92598b8791257a523e021222ac1f9" + 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" -md5-hex@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" - dependencies: - md5-o-matic "^0.1.1" - -md5-o-matic@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" - md5.js@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d" @@ -4799,7 +5478,7 @@ memory-fs@^0.4.0, memory-fs@^0.4.1, memory-fs@~0.4.1: errno "^0.1.3" readable-stream "^2.0.1" -meow@^3.3.0, meow@^3.7.0: +meow@^3.3.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" dependencies: @@ -4814,11 +5493,19 @@ meow@^3.3.0, meow@^3.7.0: redent "^1.0.0" trim-newlines "^1.0.0" -merge-source-map@^1.0.2: - version "1.1.0" - resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.1.0.tgz#2fdde7e6020939f70906a68f2d7ae685e4c8c646" +meow@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-4.0.0.tgz#fd5855dd008db5b92c552082db1c307cba20b29d" dependencies: - source-map "^0.6.1" + camelcase-keys "^4.0.0" + decamelize-keys "^1.0.0" + loud-rejection "^1.0.0" + minimist "^1.1.3" + 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" merge-stream@^1.0.1: version "1.0.1" @@ -4826,6 +5513,10 @@ merge-stream@^1.0.1: dependencies: readable-stream "^2.0.1" +merge@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" + micromatch@^2.1.5, micromatch@^2.3.11: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" @@ -4844,19 +5535,19 @@ micromatch@^2.1.5, micromatch@^2.3.11: parse-glob "^3.0.4" regex-cache "^0.4.2" -micromatch@^3.0.4: - version "3.1.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.5.tgz#d05e168c206472dfbca985bfef4f57797b4cd4ba" +micromatch@^3.0.4, micromatch@^3.1.4: + version "3.1.9" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.9.tgz#15dc93175ae39e52e93087847096effc73efcf89" dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" - braces "^2.3.0" - define-property "^1.0.0" - extend-shallow "^2.0.1" - extglob "^2.0.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.0" - nanomatch "^1.2.5" + kind-of "^6.0.2" + nanomatch "^1.2.9" object.pick "^1.3.0" regex-not "^1.0.0" snapdragon "^0.8.1" @@ -4869,19 +5560,19 @@ miller-rabin@^4.0.0: bn.js "^4.0.0" brorand "^1.0.1" -mime-db@~1.30.0: - version "1.30.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01" +mime-db@~1.33.0: + version "1.33.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" -mime-types@^2.1.12, mime-types@~2.1.7: - version "2.1.17" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" +mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.7: + version "2.1.18" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" dependencies: - mime-db "~1.30.0" + mime-db "~1.33.0" 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" minimalistic-assert@^1.0.0: version "1.0.0" @@ -4897,7 +5588,7 @@ minimatch@^2.0.1: dependencies: brace-expansion "^1.0.0" -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: @@ -4910,6 +5601,13 @@ minimatch@~0.2.11: lru-cache "2" sigmund "~1.0.0" +minimist-options@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-3.0.2.tgz#fba4c8191339e13ecf4d61beb03f070103f3d954" + dependencies: + arrify "^1.0.1" + is-plain-obj "^1.1.0" + minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" @@ -4927,35 +5625,18 @@ minimist@~0.0.1: resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" mixin-deep@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.0.tgz#47a8732ba97799457c8c1eca28f95132d7e8150a" + 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 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +"mkdirp@>=0.5 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" dependencies: minimist "0.0.8" -mocha@^3.0.0: - version "3.5.3" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.5.3.tgz#1e0480fe36d2da5858d1eb6acc38418b26eaa20d" - dependencies: - browser-stdout "1.3.0" - commander "2.9.0" - debug "2.6.8" - diff "3.2.0" - escape-string-regexp "1.0.5" - glob "7.1.1" - growl "1.9.2" - he "1.1.1" - json3 "3.3.2" - lodash.create "3.1.1" - mkdirp "0.5.1" - supports-color "3.1.2" - modify-values@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.0.tgz#e2b6cdeb9ce19f99317a53722f3dbf5df5eaaab2" @@ -4981,8 +5662,8 @@ module-deps@^4.0.8: xtend "^4.0.0" moment@^2.6.0: - version "2.20.1" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.20.1.tgz#d6eb1a46cbcc14a2b2f9434112c1ff8907f313fd" + version "2.21.0" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.21.0.tgz#2a114b51d2a6ec9e6d83cf803f838a878d8a023a" ms@2.0.0: version "2.0.0" @@ -5008,20 +5689,21 @@ mute-stream@0.0.7: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" nan@^2.3.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" + version "2.9.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.9.2.tgz#f564d75f5f8f36a6d9456cca7a6c4fe488ab7866" -nanomatch@^1.2.5: - version "1.2.7" - resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.7.tgz#53cd4aa109ff68b7f869591fdc9d10daeeea3e79" +nanomatch@^1.2.9: + version "1.2.9" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.9.tgz#879f7150cb2dab7a471259066c104eee6e0fa7c2" dependencies: arr-diff "^4.0.0" array-unique "^0.3.2" - define-property "^1.0.0" - extend-shallow "^2.0.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" fragment-cache "^0.2.1" - is-odd "^1.0.0" - kind-of "^5.0.2" + is-odd "^2.0.0" + is-windows "^1.0.2" + kind-of "^6.0.2" object.pick "^1.3.0" regex-not "^1.0.0" snapdragon "^0.8.1" @@ -5041,6 +5723,10 @@ ncname@1.0.x: dependencies: xml-char-classes "^1.0.0" +neo-async@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.0.tgz#76b1c823130cca26acfbaccc8fbaf0a2fa33b18f" + no-case@^2.2.0: version "2.3.2" resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.2.tgz#60b813396be39b3f1288a4c1ed5d1e7d28b464ac" @@ -5054,6 +5740,10 @@ node-fetch@^1.7.0: encoding "^0.1.11" is-stream "^1.0.1" +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + 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" @@ -5086,6 +5776,15 @@ 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" +node-notifier@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.2.1.tgz#fa313dd08f5517db0e2502e5758d664ac69f9dea" + dependencies: + growly "^1.3.0" + semver "^5.4.1" + shellwords "^0.1.1" + which "^1.3.0" + node-pre-gyp@^0.6.39: version "0.6.39" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649" @@ -5122,7 +5821,7 @@ normalize-path@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" -normalize-path@^2.0.0, normalize-path@^2.0.1: +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" dependencies: @@ -5167,39 +5866,11 @@ 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" -nyc@^11.0.3: - version "11.4.1" - resolved "https://registry.yarnpkg.com/nyc/-/nyc-11.4.1.tgz#13fdf7e7ef22d027c61d174758f6978a68f4f5e5" - dependencies: - archy "^1.0.0" - arrify "^1.0.1" - caching-transform "^1.0.0" - convert-source-map "^1.3.0" - debug-log "^1.0.1" - default-require-extensions "^1.0.0" - find-cache-dir "^0.1.1" - find-up "^2.1.0" - foreground-child "^1.5.3" - glob "^7.0.6" - istanbul-lib-coverage "^1.1.1" - istanbul-lib-hook "^1.1.0" - istanbul-lib-instrument "^1.9.1" - istanbul-lib-report "^1.1.2" - istanbul-lib-source-maps "^1.2.2" - istanbul-reports "^1.1.3" - md5-hex "^1.2.0" - merge-source-map "^1.0.2" - micromatch "^2.3.11" - mkdirp "^0.5.0" - resolve-from "^2.0.0" - rimraf "^2.5.4" - signal-exit "^3.0.1" - spawn-wrap "^1.4.2" - test-exclude "^4.1.1" - yargs "^10.0.3" - yargs-parser "^8.0.0" +nwmatcher@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.4.3.tgz#64348e3b3d80f035b40ac11563d278f8b72db89c" -oauth-sign@~0.8.1: +oauth-sign@~0.8.1, oauth-sign@~0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" @@ -5294,7 +5965,7 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.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" dependencies: @@ -5334,7 +6005,7 @@ os-browserify@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.1.2.tgz#49ca0293e0b19590a5f5de10c7f265a617d8fe54" -os-homedir@^1.0.0, os-homedir@^1.0.1: +os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" @@ -5352,20 +6023,20 @@ os-locale@^2.0.0: lcid "^1.0.0" mem "^1.1.0" -os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: +os-tmpdir@^1.0.0, 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" osenv@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" dependencies: os-homedir "^1.0.0" os-tmpdir "^1.0.0" output-file-sync@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-2.0.0.tgz#5d348a1a1eaed1ad168648a01a2d6d13078ce987" + version "2.0.1" + resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-2.0.1.tgz#f53118282f5f553c2799541792b723a4c71430c0" dependencies: graceful-fs "^4.1.11" is-plain-obj "^1.1.0" @@ -5463,6 +6134,10 @@ parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" +parse5@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + parse5@^3.0.1: version "3.0.3" resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" @@ -5535,6 +6210,12 @@ path-type@^2.0.0: 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" + dependencies: + pify "^3.0.0" + pathval@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" @@ -5553,6 +6234,10 @@ performance-now@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5" +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + pify@^2.0.0, pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -5577,12 +6262,6 @@ pirates@^3.0.1: dependencies: node-modules-regexp "^1.0.0" -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" - pkg-dir@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-2.0.0.tgz#f6d5d1109e19d63edf428e0bd57e12777615334b" @@ -5599,10 +6278,23 @@ plugin-error@^0.1.2: arr-union "^2.0.1" extend-shallow "^1.1.2" +plugin-error@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c" + dependencies: + ansi-colors "^1.0.1" + arr-diff "^4.0.0" + arr-union "^3.1.0" + extend-shallow "^3.0.2" + pluralize@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + 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" @@ -5615,9 +6307,9 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@1.10.2: - version "1.10.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.10.2.tgz#1af8356d1842276a99a5b5529c82dd9e9ad3cc93" +prettier@1.11.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75" pretty-format@^21.2.1: version "21.2.1" @@ -5626,11 +6318,18 @@ pretty-format@^21.2.1: ansi-regex "^3.0.0" ansi-styles "^3.2.0" +pretty-format@^22.4.0: + version "22.4.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-22.4.0.tgz#237b1f7e1c50ed03bc65c03ccc29d7c8bb7beb94" + dependencies: + ansi-regex "^3.0.0" + ansi-styles "^3.2.0" + pretty-hrtime@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1" -private@^0.1.6, private@~0.1.5: +private@^0.1.6, private@^0.1.7, private@~0.1.5: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" @@ -5638,6 +6337,10 @@ process-nextick-args@^1.0.6, 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@^0.11.10, process@~0.11.0: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" @@ -5683,7 +6386,11 @@ 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" -q@^1.4.1: +punycode@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + +q@^1.4.1, q@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -5691,6 +6398,10 @@ qs@~6.4.0: version "6.4.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233" +qs@~6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" + 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" @@ -5699,6 +6410,10 @@ querystring@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" +quick-lru@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-1.1.0.tgz#4360b17c61136ad38078397ff11416e186dcfbb8" + randomatic@^1.1.3: version "1.1.7" resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" @@ -5713,15 +6428,15 @@ randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: safe-buffer "^5.1.0" randomfill@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.3.tgz#b96b7df587f01dd91726c418f30553b1418e3d62" + version "1.0.4" + resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.4.tgz#c92196fc86ab42be983f1bf31778224931d61458" dependencies: randombytes "^2.0.5" safe-buffer "^5.1.0" rc@^1.1.7: - version "1.2.4" - resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.4.tgz#a0f606caae2a3b862bbd0ef85482c0125b315fa3" + version "1.2.5" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.5.tgz#275cd687f6e3b36cc756baa26dfee80a790301fd" dependencies: deep-extend "~0.4.0" ini "~1.3.0" @@ -5754,6 +6469,13 @@ read-pkg-up@^2.0.0: find-up "^2.0.0" read-pkg "^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" + dependencies: + find-up "^2.0.0" + read-pkg "^3.0.0" + read-pkg@^1.0.0, read-pkg@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" @@ -5770,6 +6492,14 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^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" + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + "readable-stream@>=1.0.33-1 <1.1.0-0": version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" @@ -5789,13 +6519,13 @@ read-pkg@^2.0.0: string_decoder "~0.10.x" readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3: - version "2.3.3" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" + version "2.3.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.5.tgz#b4f85003a938cbb6ecbce2a124fb1012bd1a838d" dependencies: core-util-is "~1.0.0" inherits "~2.0.3" isarray "~1.0.0" - process-nextick-args "~1.0.6" + process-nextick-args "~2.0.0" safe-buffer "~5.1.1" string_decoder "~1.0.3" util-deprecate "~1.0.1" @@ -5820,6 +6550,12 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" +realpath-native@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.0.0.tgz#7885721a83b43bd5327609f0ddecb2482305fdf0" + 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" @@ -5842,6 +6578,13 @@ redent@^1.0.0: indent-string "^2.1.0" strip-indent "^1.0.1" +redent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-2.0.0.tgz#c1b2007b42d57eb1389079b3c8333639d5e1ccaa" + dependencies: + indent-string "^3.0.0" + strip-indent "^2.0.0" + regenerate-unicode-properties@^5.1.1: version "5.1.3" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-5.1.3.tgz#54f5891543468f36f2274b67c6bc4c033c27b308" @@ -5868,11 +6611,12 @@ regex-cache@^0.4.2: dependencies: is-equal-shallow "^0.1.3" -regex-not@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.0.tgz#42f83e39771622df826b02af176525d6a5f157f9" +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 "^2.0.1" + extend-shallow "^3.0.2" + safe-regex "^1.1.0" regexpu-core@^4.1.3: version "4.1.3" @@ -5925,6 +6669,20 @@ replace-ext@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" +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" + dependencies: + lodash "^4.13.1" + +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" + dependencies: + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + request@2.81.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" @@ -5952,6 +6710,33 @@ request@2.81.0: tunnel-agent "^0.6.0" uuid "^3.0.0" +request@^2.83.0: + version "2.83.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.6.0" + caseless "~0.12.0" + combined-stream "~1.0.5" + extend "~3.0.1" + forever-agent "~0.6.1" + form-data "~2.3.1" + har-validator "~5.0.3" + hawk "~6.0.2" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.17" + oauth-sign "~0.8.2" + performance-now "^2.1.0" + qs "~6.5.1" + safe-buffer "^5.1.1" + stringstream "~0.0.5" + tough-cookie "~2.3.3" + tunnel-agent "^0.6.0" + uuid "^3.1.0" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -5971,6 +6756,12 @@ require-uncached@^1.0.3: caller-path "^0.1.0" resolve-from "^1.0.0" +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + 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" @@ -5982,9 +6773,9 @@ resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" -resolve-from@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" resolve-url@^0.2.1: version "0.2.1" @@ -6014,13 +6805,17 @@ 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" + right-align@^0.1.1: version "0.1.3" resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.2.8, rimraf@^2.4.3, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: +rimraf@2, rimraf@^2.2.8, rimraf@^2.4.3, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -6034,25 +6829,26 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: inherits "^2.0.1" rollup-plugin-babel@^4.0.0-beta.0: - version "4.0.0-beta.0" - resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-4.0.0-beta.0.tgz#2fccbc30bf620bfac0cf870324248e30ba824ded" + version "4.0.0-beta.2" + resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-4.0.0-beta.2.tgz#abc05af4644aa52180e3fa2452f909b39b4ef145" dependencies: - rollup-pluginutils "^1.5.0" + "@babel/helper-module-imports" "7.0.0-beta.35" + rollup-pluginutils "^2.0.1" rollup-plugin-node-resolve@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.2.tgz#38babc12fd404cc2ba1ff68648fe43fa3ffee6b0" + version "3.0.3" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.3.tgz#8f57b253edd00e5b0ad0aed7b7e9cf5982e98fa4" dependencies: builtin-modules "^1.1.0" is-module "^1.0.0" resolve "^1.1.6" -rollup-pluginutils@^1.5.0: - version "1.5.2" - resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" +rollup-pluginutils@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.0.1.tgz#7ec95b3573f6543a46a6461bd9a7c544525d0fc0" dependencies: - estree-walker "^0.2.1" - minimatch "^3.0.2" + estree-walker "^0.3.0" + micromatch "^2.3.11" rollup-stream@^1.24.1: version "1.24.1" @@ -6090,7 +6886,31 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, 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.0.0, semver@^5.0.1, semver@^5.1.0, semver@^5.3.0: +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" + +sane@^2.0.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/sane/-/sane-2.4.1.tgz#29f991208cf28636720efdc584293e7fd66663a5" + dependencies: + anymatch "^1.3.0" + exec-sh "^0.2.0" + fb-watchman "^2.0.0" + minimatch "^3.0.2" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.18.0" + optionalDependencies: + fsevents "^1.1.1" + +sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + +"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" @@ -6171,11 +6991,15 @@ shell-quote@^1.6.1: array-reduce "~0.0.0" jsonify "~0.0.0" +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + sigmund@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" -signal-exit@^3.0.0, signal-exit@^3.0.1, signal-exit@^3.0.2: +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" @@ -6193,10 +7017,6 @@ slice-ansi@1.0.0: dependencies: is-fullwidth-code-point "^2.0.0" -slide@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" - snapdragon-node@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" @@ -6230,6 +7050,12 @@ sntp@1.x.x: dependencies: hoek "2.x.x" +sntp@2.x.x: + version "2.1.0" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8" + dependencies: + hoek "4.x.x" + sort-keys@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" @@ -6250,17 +7076,23 @@ source-map-resolve@^0.5.0: source-map-url "^0.4.0" urix "^0.1.0" -source-map-support@^0.4.2: +source-map-support@^0.4.15, source-map-support@^0.4.2: version "0.4.18" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" dependencies: source-map "^0.5.6" +source-map-support@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.3.tgz#2b3d5fff298cfa4d1afd7d4352d569e9a0158e76" + dependencies: + source-map "^0.6.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.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.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.7, 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" @@ -6270,7 +7102,7 @@ source-map@^0.4.4, source-map@~0.4.0, source-map@~0.4.2: dependencies: amdefine ">=0.0.4" -source-map@^0.6.1, 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" @@ -6278,30 +7110,27 @@ sparkles@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/sparkles/-/sparkles-1.0.0.tgz#1acbbfb592436d10bbe8f785b7cc6f82815012c3" -spawn-wrap@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.4.2.tgz#cff58e73a8224617b6561abdc32586ea0c82248c" +spdx-correct@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" dependencies: - foreground-child "^1.5.6" - mkdirp "^0.5.0" - os-homedir "^1.0.1" - rimraf "^2.6.2" - signal-exit "^3.0.2" - which "^1.3.0" + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" -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-exceptions@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9" -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-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" + 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.0" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" @@ -6339,9 +7168,13 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" -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" +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.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-1.0.0.tgz#cdb847837c1fcc52c08a872d4883cc0877668a80" static-extend@^0.1.1: version "0.1.2" @@ -6350,6 +7183,10 @@ static-extend@^0.1.1: define-property "^0.2.5" object-copy "^0.1.0" +stealthy-require@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + 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" @@ -6365,8 +7202,8 @@ stream-combiner2@^1.1.1: readable-stream "^2.0.2" stream-consume@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.0.tgz#a41ead1a6d6081ceb79f65b061901b6d8f3d1d0f" + version "0.1.1" + resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.1.tgz#d3bdb598c2bd0ae82b8cac7ac50b1107a7996c48" stream-http@^2.0.0, stream-http@^2.7.2: version "2.8.0" @@ -6397,6 +7234,13 @@ streamfilter@^1.0.5: dependencies: readable-stream "^2.0.2" +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + dependencies: + astral-regex "^1.0.0" + strip-ansi "^4.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" @@ -6431,14 +7275,14 @@ string_decoder@~0.10.0, string_decoder@~0.10.x: resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" stringify-object@^3.2.0: - version "3.2.1" - resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.2.1.tgz#2720c2eff940854c819f6ee252aaeb581f30624d" + 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" -stringstream@~0.0.4: +stringstream@~0.0.4, stringstream@~0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -6461,6 +7305,10 @@ strip-bom-stream@^2.0.0: first-chunk-stream "^2.0.0" strip-bom "^2.0.0" +strip-bom@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-bom@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-1.0.0.tgz#85b8862f3844b5a6d5ec8467a93598173a36f794" @@ -6474,10 +7322,6 @@ strip-bom@^2.0.0: 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" - strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" @@ -6512,12 +7356,6 @@ subarg@^1.0.0: dependencies: minimist "^1.1.0" -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" @@ -6528,12 +7366,18 @@ supports-color@^3.1.2: dependencies: has-flag "^1.0.0" -supports-color@^4.0.0, supports-color@^4.2.1: +supports-color@^4.2.1: version "4.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.5.0.tgz#be7a0de484dec5c5cddf8b3d59125044912f635b" 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" + 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" @@ -6542,13 +7386,17 @@ symbol-observable@^0.2.2: version "0.2.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-0.2.4.tgz#95a83db26186d6af7e7a18dbd9760a2f86d08f40" +symbol-tree@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + syntax-error@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.3.0.tgz#1ed9266c4d40be75dc55bf9bb1cb77062bb96ca1" + version "1.4.0" + resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.4.0.tgz#2d9d4ff5c064acb711594a3e3b95054ad51d907c" dependencies: - acorn "^4.0.3" + acorn-node "^1.2.0" -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: @@ -6607,8 +7455,8 @@ tempfile@^1.1.1: uuid "^2.0.1" test-exclude@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" + version "4.2.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.2.0.tgz#07e3613609a362c74516a717515e13322ab45b3c" dependencies: arrify "^1.0.1" micromatch "^2.3.11" @@ -6616,6 +7464,20 @@ test-exclude@^4.1.1: read-pkg-up "^1.0.1" 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" + +test262-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/test262-stream/-/test262-stream-1.1.0.tgz#18265217b8ca800d9ec432e37e6b8d192e12c6fd" + dependencies: + 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" @@ -6624,6 +7486,10 @@ text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + through2@^0.6.1: version "0.6.5" resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" @@ -6666,8 +7532,8 @@ timers-browserify@^1.0.1: process "~0.11.0" timers-browserify@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.4.tgz#96ca53f4b794a5e7c0e1bd7cc88a372298fa01e6" + version "2.0.6" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-2.0.6.tgz#241e76927d9ca05f4d959819022f5b3664b64bae" dependencies: setimmediate "^1.0.4" @@ -6677,6 +7543,10 @@ tmp@^0.0.33: 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" + to-arraybuffer@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" @@ -6703,23 +7573,34 @@ to-regex-range@^2.1.0: repeat-string "^1.6.1" to-regex@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.1.tgz#15358bee4a2c83bd76377ba1dc049d0f18837aae" + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" dependencies: - define-property "^0.2.5" - extend-shallow "^2.0.1" - regex-not "^1.0.0" + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" -tough-cookie@~2.3.0: - version "2.3.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561" +tough-cookie@>=2.3.3, tough-cookie@^2.3.3, tough-cookie@~2.3.0, tough-cookie@~2.3.3: + version "2.3.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" dependencies: punycode "^1.4.1" +tr46@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + 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" +trim-newlines@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-2.0.0.tgz#b403d0b91be50c331dfc4b82eeceb22c3de16d20" + 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" @@ -6728,10 +7609,14 @@ trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" -tty-browserify@0.0.0, tty-browserify@~0.0.0: +tty-browserify@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" +tty-browserify@~0.0.0: + version "0.0.1" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.1.tgz#3f05251ee17904dfd0677546670db9651682b811" + tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -6749,18 +7634,18 @@ type-check@~0.3.2: prelude-ls "~1.1.2" type-detect@^4.0.0: - version "4.0.6" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.6.tgz#88cbce3d13bc675a63f840b3225c180f870786d7" + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" typedarray@^0.0.6, typedarray@~0.0.5: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" uglify-js@3.3.x, uglify-js@^3.0.5: - version "3.3.7" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.7.tgz#28463e7c7451f89061d2b235e30925bf5625e14d" + version "3.3.13" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.13.tgz#8a1a89eeb16e2d6a66b0db2b04cb871af3c669cf" dependencies: - commander "~2.13.0" + commander "~2.14.1" source-map "~0.6.1" uglify-js@^2.4.16, uglify-js@^2.6, uglify-js@^2.8.29: @@ -6839,6 +7724,10 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" +upath@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.0.4.tgz#ee2321ba0a786c50973db043a50b7bcba822361d" + upper-case@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" @@ -6887,7 +7776,7 @@ uuid@^2.0.1: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -uuid@^3.0.0, uuid@^3.0.1: +uuid@^3.0.0, uuid@^3.0.1, uuid@^3.1.0: version "3.2.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" @@ -6898,11 +7787,11 @@ v8flags@^2.0.2: user-home "^1.1.1" 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.3" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz#81643bcbef1bdfecd4623793dc4648948ba98338" dependencies: - spdx-correct "~1.0.0" - spdx-expression-parse "~1.0.0" + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" verror@1.10.0: version "1.10.0" @@ -6996,13 +7885,32 @@ vm-browserify@0.0.4, vm-browserify@~0.0.1: dependencies: indexof "0.0.1" +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" + dependencies: + browser-process-hrtime "^0.1.2" + +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +watch@~0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.18.0.tgz#28095476c6df7c90c963138990c0a5423eb4b986" + dependencies: + exec-sh "^0.2.0" + minimist "^1.2.0" + watchpack@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.4.0.tgz#4a1472bcbb952bd0a9bb4036801f954dfb39faac" + version "1.5.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.5.0.tgz#231e783af830a22f8966f65c4c4bacc814072eed" dependencies: - async "^2.1.2" - chokidar "^1.7.0" + chokidar "^2.0.2" graceful-fs "^4.1.2" + neo-async "^2.5.0" wcwidth@^1.0.0: version "1.0.1" @@ -7010,6 +7918,10 @@ wcwidth@^1.0.0: dependencies: defaults "^1.0.3" +webidl-conversions@^4.0.1, webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + 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" @@ -7042,25 +7954,27 @@ webpack-sources@^1.0.1: source-map "~0.6.1" webpack-stream@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/webpack-stream/-/webpack-stream-4.0.0.tgz#f3673dd907d6d9b1ea7bf51fcd1db85b5fd9e0f2" + version "4.0.2" + resolved "https://registry.yarnpkg.com/webpack-stream/-/webpack-stream-4.0.2.tgz#7b90aec71d45c8a4519ff8b5a4d59e039cfd02c0" dependencies: - gulp-util "^3.0.7" + 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" through "^2.3.8" vinyl "^2.1.0" webpack "^3.4.1" webpack@^3.4.1: - version "3.10.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.10.0.tgz#5291b875078cf2abf42bdd23afe3f8f96c17d725" + version "3.11.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.11.0.tgz#77da451b1d7b4b117adaf41a1a93b5742f24d894" dependencies: acorn "^5.0.0" acorn-dynamic-import "^2.0.0" - ajv "^5.1.5" - ajv-keywords "^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" @@ -7080,6 +7994,20 @@ webpack@^3.4.1: webpack-sources "^1.0.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" + dependencies: + iconv-lite "0.4.19" + +whatwg-url@^6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.4.0.tgz#08fdf2b9e872783a7a1f6216260a1d66cc722e08" + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.0" + webidl-conversions "^4.0.1" + which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" @@ -7088,7 +8016,7 @@ which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" -which@^1.2.10, which@^1.2.14, which@^1.2.9, which@^1.3.0: +which@^1.2.10, which@^1.2.12, which@^1.2.14, which@^1.2.9, which@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" dependencies: @@ -7127,14 +8055,6 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" -write-file-atomic@^1.1.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - slide "^1.1.5" - write-file-atomic@^2.0.0, write-file-atomic@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" @@ -7167,11 +8087,22 @@ write@^0.2.1: 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" + 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" -"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@~4.0.1: +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" + +"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" @@ -7195,15 +8126,15 @@ yargs-parser@^7.0.0: dependencies: camelcase "^4.1.0" -yargs-parser@^8.0.0, yargs-parser@^8.1.0: +yargs-parser@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.1.0.tgz#f1376a33b6629a5d063782944da732631e966950" dependencies: camelcase "^4.1.0" yargs@^10.0.3: - version "10.1.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.1.1.tgz#5fe1ea306985a099b33492001fa19a1e61efe285" + version "10.1.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-10.1.2.tgz#454d074c2b16a51a43e2fb7807e4f9de69ccb5c5" dependencies: cliui "^4.0.0" decamelize "^1.1.1"