Compare commits
40 Commits
v7.0.0-bet
...
v7.0.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6695f5e2f7 | ||
|
|
86ce2e4e0d | ||
|
|
8cffbbae75 | ||
|
|
cb51704745 | ||
|
|
a8224d40e2 | ||
|
|
3210a7a873 | ||
|
|
9c598a8e28 | ||
|
|
a149466001 | ||
|
|
ec8330870e | ||
|
|
363c5923f0 | ||
|
|
8173b6e694 | ||
|
|
e2d64f146c | ||
|
|
9392783738 | ||
|
|
810b7916c2 | ||
|
|
eb0e999987 | ||
|
|
5c728ea609 | ||
|
|
b8f9ebf638 | ||
|
|
55ca90b3fc | ||
|
|
1a0fe993f5 | ||
|
|
02760d0f70 | ||
|
|
adca165ee9 | ||
|
|
fa86b2ddf0 | ||
|
|
5eb193c61f | ||
|
|
ec69b4bb12 | ||
|
|
5fdcd29ef9 | ||
|
|
8ee24fdfc0 | ||
|
|
db2a9fc96e | ||
|
|
75767e9273 | ||
|
|
4346a95b88 | ||
|
|
26cbbb569f | ||
|
|
a811cf78e1 | ||
|
|
c70a32ab9d | ||
|
|
6f3a800677 | ||
|
|
d781e207c8 | ||
|
|
8b10a44fe1 | ||
|
|
adae1501ac | ||
|
|
c8038f69fe | ||
|
|
30ea328e97 | ||
|
|
16b1f8c427 | ||
|
|
a582cc5bd8 |
@@ -4,8 +4,9 @@
|
||||
package.json
|
||||
lerna.json
|
||||
packages/babel-runtime
|
||||
!packages/babel-runtime/scripts
|
||||
!packages/babel-runtime/core-js.js
|
||||
!packages/babel-plugin-transform-runtime/scripts
|
||||
!packages/babel-runtime-corejs2/core-js.js
|
||||
packages/babel-runtime-corejs2
|
||||
packages/*/node_modules
|
||||
packages/*/lib
|
||||
packages/*/dist
|
||||
|
||||
31
.gitignore
vendored
31
.gitignore
vendored
@@ -12,24 +12,27 @@ coverage
|
||||
dist
|
||||
/.package.json
|
||||
package-lock.json
|
||||
/packages/babel-runtime/core-js/**/*.js
|
||||
!/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-runtime/helpers/esm/*.js
|
||||
!/packages/babel-runtime/helpers/esm/toArray.js
|
||||
!/packages/babel-runtime/helpers/esm/iterableToArray.js
|
||||
!/packages/babel-runtime/helpers/esm/temporalRef.js
|
||||
|
||||
/packages/babel-runtime-corejs2/helpers/*.js
|
||||
!/packages/babel-runtime-corejs2/helpers/toArray.js
|
||||
!/packages/babel-runtime-corejs2/helpers/iterableToArray.js
|
||||
!/packages/babel-runtime-corejs2/helpers/temporalRef.js
|
||||
/packages/babel-runtime-corejs2/helpers/esm/*.js
|
||||
!/packages/babel-runtime-corejs2/helpers/esm/toArray.js
|
||||
!/packages/babel-runtime-corejs2/helpers/esm/iterableToArray.js
|
||||
!/packages/babel-runtime-corejs2/helpers/esm/temporalRef.js
|
||||
/packages/babel-runtime-corejs2/core-js/**/*.js
|
||||
!/packages/babel-runtime-corejs2/core-js/map.js
|
||||
|
||||
/packages/babel-register/test/.babel
|
||||
/packages/babel-cli/test/tmp
|
||||
/packages/babel-node/test/tmp
|
||||
|
||||
62
CHANGELOG.md
62
CHANGELOG.md
@@ -15,6 +15,68 @@ See [CHANGELOG - v4-v6](/.github/CHANGELOG-v4-v6.md) for the v4.x-v6.x changelog
|
||||
See [CHANGELOG - 6to5](/.github/CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
|
||||
See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0.0-beta.29 version changelog.
|
||||
|
||||
## v7.0.0-beta.54 (2018-07-16)
|
||||
|
||||
> Regarding https://github.com/babel/babel/issues/8184, we aren't using `micromatch` for paths, just basic `*/**` substitution now. For anything more complicated we will recommend using a regex/`.js` config.
|
||||
> Fixed a bug in the stage presets (https://github.com/babel/babel/issues/8307), so we just removed the requirements for setting options in the meantime for ease of use. We are removing the Stage presets next release. https://github.com/babel/babel/pull/8293
|
||||
|
||||
#### :boom: Breaking Change
|
||||
* `babel-core`, `babel-register`, `babel-traverse`
|
||||
* [#8327](https://github.com/babel/babel/pull/8327) Treat string ignore/only/test/include/exclude values as paths with only basic pattern matching. ([@loganfsmyth](https://github.com/loganfsmyth))
|
||||
|
||||
#### :bug: Bug Fix
|
||||
* `babel-core`, `babel-register`, `babel-traverse`
|
||||
* [#8327](https://github.com/babel/babel/pull/8327) Treat string ignore/only/test/include/exclude values as paths with only basic pattern matching. ([@loganfsmyth](https://github.com/loganfsmyth))
|
||||
* `babel-preset-stage-0`, `babel-preset-stage-1`
|
||||
* [#8317](https://github.com/babel/babel/pull/8317) Fix stage-0/1 import of pipeline proposals array. ([@mAAdhaTTah](https://github.com/mAAdhaTTah))
|
||||
* `babel-helper-module-transforms`, `babel-plugin-transform-modules-commonjs`
|
||||
* [#8316](https://github.com/babel/babel/pull/8316) Ensure that the wildcard interop is used with re-export + default.. ([@loganfsmyth](https://github.com/loganfsmyth))
|
||||
* `babel-core`
|
||||
* [#8315](https://github.com/babel/babel/pull/8315) Remove option-filtering options from the final options results.. ([@loganfsmyth](https://github.com/loganfsmyth))
|
||||
|
||||
#### :memo: Documentation
|
||||
* [#8320](https://github.com/babel/babel/pull/8320) Add link to audio version of song. ([@rugk](https://github.com/rugk))
|
||||
|
||||
## v7.0.0-beta.53 (2018-07-11)
|
||||
|
||||
- Fix for regression with paths on windows due to micromatch upgrade, remove yearly presets (not published)
|
||||
- (There was an issue with the Stage presets in this release, but it is also deprecated)
|
||||
|
||||
#### :boom: Breaking Change
|
||||
* `babel-*`
|
||||
* [#8274](https://github.com/babel/babel/pull/8274) Remove yearly presets from repo. ([@hzoo](https://github.com/hzoo))
|
||||
|
||||
#### :rocket: New Feature
|
||||
* `babel-generator`, `babel-parser`, `babel-plugin-transform-typescript`, `babel-types`
|
||||
* [#7799](https://github.com/babel/babel/pull/7799) TypeScript: Support type arguments on JSX opening and self-closing tags. ([@andy-ms](https://github.com/andy-ms))
|
||||
* `babel-parser`
|
||||
* [#8291](https://github.com/babel/babel/pull/8291) Support pipeline proposal flag in `@babel/parser`. ([@mAAdhaTTah](https://github.com/mAAdhaTTah))
|
||||
* `babel-plugin-proposal-object-rest-spread`
|
||||
* [#8264](https://github.com/babel/babel/pull/8264) Remove unused bindings when excluding keys with rest in loose mode. ([@Andarist](https://github.com/Andarist))
|
||||
* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-destructuring`, `babel-preset-env`
|
||||
* [#8261](https://github.com/babel/babel/pull/8261) Introduce objectWithoutPropertiesLoose helper. ([@Andarist](https://github.com/Andarist))
|
||||
|
||||
#### :bug: Bug Fix
|
||||
* `babel-core`
|
||||
* [#8281](https://github.com/babel/babel/pull/8281) Revert micromatch upgrade (regression) [skip ci]. ([@hzoo](https://github.com/hzoo))
|
||||
* `babel-types`
|
||||
* [#8165](https://github.com/babel/babel/pull/8165) [babel-types] Fix isNodesEquivalent() behavior for TemplateElements. ([@timkendrick](https://github.com/timkendrick))
|
||||
|
||||
#### :nail_care: Polish
|
||||
* `babel-plugin-syntax-pipeline-operator`, `babel-preset-stage-0`, `babel-preset-stage-1`
|
||||
* [#8279](https://github.com/babel/babel/pull/8279) Improve error messages around pipeline option. ([@mAAdhaTTah](https://github.com/mAAdhaTTah))
|
||||
|
||||
#### :memo: Documentation
|
||||
* [#8286](https://github.com/babel/babel/pull/8286) Move v4-v6 changelog to another file and all prerelease 7.0 logs [ski…. ([@hzoo](https://github.com/hzoo))
|
||||
|
||||
#### :house: Internal
|
||||
* `babel-preset-env`
|
||||
* [#8299](https://github.com/babel/babel/pull/8299) Make env preset build-data scripts reproducible. ([@rtsao](https://github.com/rtsao))
|
||||
* `babel-plugin-proposal-object-rest-spread`
|
||||
* [#8287](https://github.com/babel/babel/pull/8287) Fixed fixture tests after merge. ([@Andarist](https://github.com/Andarist))
|
||||
* Other
|
||||
* [#8187](https://github.com/babel/babel/pull/8187) Invoke Jest main file directly. ([@ishitatsuyuki](https://github.com/ishitatsuyuki))
|
||||
|
||||
## v7.0.0-beta.52 (2018-07-06)
|
||||
|
||||
Deprecating the yearly/stage presets in v7 (will remove next beta). Ran `npm deprecate` on `@babel/preset-es2015`, `@babel/preset-es2016`, `@babel/preset-es2017`, `@babel/preset-stage-0`, `@babel/preset-stage-1`, `@babel/preset-stage-2`, `@babel/preset-stage-3` only for versions `>v7.0.0-beta.52`. This means this will only break your build if you are using `^` in Babel v7 beta (which we have recommended against each release). (It is unfortunate that the default behavior of npm is to use `^` when using `npm install` though; haven't made an RFC for it yet).
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
contributors and maintainers pledge to make participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||
nationality, personal appearance, race, religion, or sexual identity and
|
||||
|
||||
@@ -186,7 +186,7 @@ For example, in [`@babel/plugin-transform-exponentiation-operator/test`](https:/
|
||||
- If you need to expect an error, you can ignore creating the `output.js` file and pass a new `throws` key to the `options.json` that contains the error string that is created.
|
||||
- The second and preferred type is a test that actually evaluates the produced code and asserts that certain properties are true or false. We do this by creating an [`exec.js`](https://github.com/babel/babel/blob/master/packages/babel-plugin-transform-exponentiation-operator/test/fixtures/exponentian-operator/comprehensive/exec.js) file.
|
||||
|
||||
In a fixture test, you simply write out the code you want transformed in `input.js`.
|
||||
In a fixture test, you simply write out the code you want to transform in `input.js`.
|
||||
|
||||
```js
|
||||
// input.js
|
||||
@@ -230,7 +230,7 @@ If the test requires a minimum Node version, you can add `minNodeVersion` (must
|
||||
|
||||
Writing tests for the babel parser is very
|
||||
similar to the other packages.
|
||||
Inside the `packages/babel-parser/tests/fixtures` folder are categories/groupings of test fixtures (es2015, flow,
|
||||
Inside the `packages/babel-parser/test/fixtures` folder are categories/groupings of test fixtures (es2015, flow,
|
||||
etc.). To add a test, create a folder under one of these groupings (or create a new one) with a
|
||||
descriptive name, and add the following:
|
||||
|
||||
|
||||
9
Makefile
9
Makefile
@@ -1,5 +1,5 @@
|
||||
MAKEFLAGS = -j1
|
||||
FLOW_COMMIT = 395e045c18d537fcbbc552a96ef2cdcd70b4ab52
|
||||
FLOW_COMMIT = bea8b83f50f597454941d2a7ecef6e93a881e576
|
||||
TEST262_COMMIT = f90a52b39609a620c0854e0bd0b3a906c930fd17
|
||||
|
||||
# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
|
||||
@@ -31,7 +31,7 @@ build-preset-env-standalone:
|
||||
build-dist: build
|
||||
cd packages/babel-polyfill; \
|
||||
scripts/build-dist.sh
|
||||
cd packages/babel-runtime; \
|
||||
cd packages/babel-plugin-transform-runtime; \
|
||||
node scripts/build-dist.js
|
||||
|
||||
watch: clean clean-lib
|
||||
@@ -108,7 +108,8 @@ publish:
|
||||
git pull --rebase
|
||||
make clean-lib
|
||||
rm -rf packages/babel-runtime/helpers
|
||||
rm -rf packages/babel-runtime/core-js
|
||||
rm -rf packages/babel-runtime-corejs2/helpers
|
||||
rm -rf packages/babel-runtime-corejs2/core-js
|
||||
BABEL_ENV=production make build-dist
|
||||
make test
|
||||
# not using lerna independent mode atm, so only update packages that have changed since we use ^
|
||||
@@ -120,7 +121,7 @@ bootstrap: clean-all
|
||||
yarn --ignore-engines
|
||||
./node_modules/.bin/lerna bootstrap -- --ignore-engines
|
||||
make build
|
||||
cd packages/babel-runtime; \
|
||||
cd packages/babel-plugin-transform-runtime; \
|
||||
node scripts/build-dist.js
|
||||
|
||||
clean-lib:
|
||||
|
||||
@@ -13,13 +13,18 @@ module.exports = function(api) {
|
||||
|
||||
let convertESM = true;
|
||||
let ignoreLib = true;
|
||||
let includeRuntime = false;
|
||||
|
||||
switch (env) {
|
||||
// Configs used during bundling builds.
|
||||
case "babel-parser":
|
||||
convertESM = false;
|
||||
ignoreLib = false;
|
||||
break;
|
||||
case "standalone":
|
||||
convertESM = false;
|
||||
ignoreLib = false;
|
||||
includeRuntime = true;
|
||||
break;
|
||||
case "production":
|
||||
// Config during builds before publish.
|
||||
@@ -41,6 +46,10 @@ module.exports = function(api) {
|
||||
}
|
||||
|
||||
const config = {
|
||||
// Our dependencies are all standard CommonJS, along with all sorts of
|
||||
// other random files in Babel's codebase, so we use script as the default,
|
||||
// and then mark actual modules as modules farther down.
|
||||
sourceType: "script",
|
||||
comments: false,
|
||||
ignore: [
|
||||
// These may not be strictly necessary with the newly-limited scope of
|
||||
@@ -84,7 +93,29 @@ module.exports = function(api) {
|
||||
convertESM ? "@babel/transform-modules-commonjs" : null,
|
||||
].filter(Boolean),
|
||||
},
|
||||
],
|
||||
{
|
||||
// The vast majority of our src files are modules, but we use
|
||||
// unambiguous to keep things simple until we get around to renaming
|
||||
// the modules to be more easily distinguished from CommonJS
|
||||
test: [
|
||||
"packages/*/src",
|
||||
"packages/*/test",
|
||||
"codemods/*/src",
|
||||
"codemods/*/test",
|
||||
],
|
||||
sourceType: "unambiguous",
|
||||
},
|
||||
{
|
||||
// The runtime transform shouldn't process its own runtime or core-js.
|
||||
exclude: [
|
||||
"packages/babel-runtime",
|
||||
/[\\/]node_modules[\\/](?:@babel\/runtime|babel-runtime|core-js)[\\/]/,
|
||||
],
|
||||
plugins: [includeRuntime ? "@babel/transform-runtime" : null].filter(
|
||||
Boolean
|
||||
),
|
||||
},
|
||||
].filter(Boolean),
|
||||
};
|
||||
|
||||
// we need to do this as long as we do not test everything from source
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-codemod-object-assign-to-object-spread",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Transforms Object.assign into object spread syntax",
|
||||
"repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-object-assign-to-object-spread",
|
||||
"license": "MIT",
|
||||
@@ -10,14 +10,14 @@
|
||||
"@babel/plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.54"
|
||||
"@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.56"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": ">=7.0.0-beta.50 <7.0.0-rc.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.54",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.54"
|
||||
"@babel/core": "7.0.0-beta.56",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.56"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-codemod-optional-catch-binding",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Remove unused catch bindings",
|
||||
"repository": "https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-remove-unused-catch-binding",
|
||||
"license": "MIT",
|
||||
@@ -10,13 +10,13 @@
|
||||
"@babel/plugin"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.54"
|
||||
"@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.56"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": ">=7.0.0-beta.50 <7.0.0-rc.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.54",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.54"
|
||||
"@babel/core": "7.0.0-beta.56",
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"lerna": "2.11.0",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"changelog": {
|
||||
"repo": "babel/babel",
|
||||
"cacheDir": ".changelog",
|
||||
|
||||
@@ -32,6 +32,20 @@ declare module "lodash/merge" {
|
||||
declare export default <T: Object>(T, Object) => T;
|
||||
}
|
||||
|
||||
declare module "semver" {
|
||||
declare module.exports: {
|
||||
valid(v: string): boolean;
|
||||
gt(v1: string, v2: string): boolean;
|
||||
lt(v1: string, v2: string): boolean;
|
||||
major(v: string): number;
|
||||
minor(v: string): number;
|
||||
patch(v: string): number;
|
||||
satisfies(v1: string, r1: string): boolean;
|
||||
|
||||
intersects(r1: string, r2: string): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare module "source-map" {
|
||||
declare export type SourceMap = {
|
||||
version: 3,
|
||||
|
||||
24
package.json
24
package.json
@@ -12,14 +12,18 @@
|
||||
"devDependencies": {
|
||||
"@babel/cli": "7.0.0-beta.52",
|
||||
"@babel/core": "7.0.0-beta.52",
|
||||
"@babel/plugin-transform-runtime": "7.0.0-beta.52",
|
||||
"@babel/plugin-proposal-class-properties": "7.0.0-beta.52",
|
||||
"@babel/plugin-proposal-export-namespace-from": "7.0.0-beta.52",
|
||||
"@babel/plugin-proposal-numeric-separator": "7.0.0-beta.52",
|
||||
"@babel/plugin-transform-modules-commonjs": "7.0.0-beta.52",
|
||||
"@babel/preset-env": "7.0.0-beta.52",
|
||||
"@babel/preset-flow": "7.0.0-beta.52",
|
||||
"@babel/preset-stage-0": "7.0.0-beta.52",
|
||||
"@babel/register": "7.0.0-beta.52",
|
||||
"@babel/runtime": "7.0.0-beta.52",
|
||||
"babel-core": "^7.0.0-0",
|
||||
"babel-eslint": "^8.2.5",
|
||||
"babel-jest": "^22.4.1",
|
||||
"babel-eslint": "^8.2.6",
|
||||
"babel-jest": "^23.4.0",
|
||||
"babel-loader": "8.0.0-beta.0",
|
||||
"babel-plugin-transform-charcodes": "^0.1.0",
|
||||
"browserify": "^13.1.1",
|
||||
@@ -28,11 +32,11 @@
|
||||
"charcodes": "^0.1.0",
|
||||
"derequire": "^2.0.2",
|
||||
"enhanced-resolve": "^3.0.0",
|
||||
"eslint": "^5.0.1",
|
||||
"eslint": "^5.1.0",
|
||||
"eslint-config-babel": "^7.0.2",
|
||||
"eslint-plugin-flowtype": "^2.49.3",
|
||||
"eslint-plugin-prettier": "^2.6.1",
|
||||
"flow-bin": "^0.75.0",
|
||||
"eslint-plugin-flowtype": "^2.50.0",
|
||||
"eslint-plugin-prettier": "^2.6.2",
|
||||
"flow-bin": "^0.76.0",
|
||||
"graceful-fs": "^4.1.11",
|
||||
"gulp": "^4.0.0",
|
||||
"gulp-babel": "^8.0.0-beta.2",
|
||||
@@ -44,14 +48,14 @@
|
||||
"gulp-util": "^3.0.7",
|
||||
"gulp-watch": "^5.0.0",
|
||||
"husky": "^0.14.3",
|
||||
"jest": "^22.4.2",
|
||||
"jest": "^23.4.1",
|
||||
"lerna": "^2.11.0",
|
||||
"lerna-changelog": "^0.5.0",
|
||||
"lint-staged": "^6.0.1",
|
||||
"lodash": "^4.17.5",
|
||||
"lodash": "^4.17.10",
|
||||
"merge-stream": "^1.0.1",
|
||||
"output-file-sync": "^2.0.0",
|
||||
"prettier": "1.13.2",
|
||||
"prettier": "^1.13.7",
|
||||
"pump": "^1.0.2",
|
||||
"rimraf": "^2.4.3",
|
||||
"rollup-plugin-babel": "^4.0.0-beta.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/cli",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Babel command line.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -20,7 +20,7 @@
|
||||
"convert-source-map": "^1.1.0",
|
||||
"fs-readdir-recursive": "^1.0.0",
|
||||
"glob": "^7.0.0",
|
||||
"lodash": "^4.17.5",
|
||||
"lodash": "^4.17.10",
|
||||
"mkdirp": "^0.5.1",
|
||||
"output-file-sync": "^2.0.0",
|
||||
"slash": "^1.0.0",
|
||||
@@ -33,8 +33,8 @@
|
||||
"@babel/core": ">=7.0.0-beta.50 <7.0.0-rc.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.54",
|
||||
"@babel/helper-fixtures": "7.0.0-beta.54"
|
||||
"@babel/core": "7.0.0-beta.56",
|
||||
"@babel/helper-fixtures": "7.0.0-beta.56"
|
||||
},
|
||||
"bin": {
|
||||
"babel": "./bin/babel.js",
|
||||
|
||||
@@ -89,7 +89,7 @@ export default async function({ cliOptions, babelOptions }) {
|
||||
|
||||
const stat = fs.statSync(filenameOrDir);
|
||||
|
||||
if (stat.isDirectory(filenameOrDir)) {
|
||||
if (stat.isDirectory()) {
|
||||
const dirname = filenameOrDir;
|
||||
|
||||
let count = 0;
|
||||
|
||||
@@ -15,11 +15,15 @@ export function readdir(
|
||||
includeDotfiles: boolean,
|
||||
filter: ReaddirFilter,
|
||||
) {
|
||||
return readdirRecursive(
|
||||
dirname,
|
||||
filename =>
|
||||
(includeDotfiles || filename[0] !== ".") && (!filter || filter(filename)),
|
||||
);
|
||||
return readdirRecursive(dirname, (filename, _index, currentDirectory) => {
|
||||
const stat = fs.statSync(path.join(currentDirectory, filename));
|
||||
|
||||
if (stat.isDirectory()) return true;
|
||||
|
||||
return (
|
||||
(includeDotfiles || filename[0] !== ".") && (!filter || filter(filename))
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
export function readdirForCompilable(
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
arr.map(function (x) {
|
||||
return x * MULTIPLIER;
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9mb28uanMiXSwibmFtZXMiOlsiYXJyIiwibWFwIiwieCIsIk1VTFRJUExJRVIiXSwibWFwcGluZ3MiOiI7O0FBQUFBLElBQUlDLEdBQUosQ0FBUTtBQUFBLFNBQUtDLElBQUlDLFVBQVQ7QUFBQSxDQUFSIiwic291cmNlc0NvbnRlbnQiOlsiYXJyLm1hcCh4ID0+IHggKiBNVUxUSVBMSUVSKTsiXX0=
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9mb28uanMiXSwibmFtZXMiOlsiYXJyIiwibWFwIiwieCIsIk1VTFRJUExJRVIiXSwibWFwcGluZ3MiOiI7O0FBQUFBLEdBQUcsQ0FBQ0MsR0FBSixDQUFRLFVBQUFDLENBQUM7QUFBQSxTQUFJQSxDQUFDLEdBQUdDLFVBQVI7QUFBQSxDQUFUIiwic291cmNlc0NvbnRlbnQiOlsiYXJyLm1hcCh4ID0+IHggKiBNVUxUSVBMSUVSKTsiXX0=
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"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"}
|
||||
{"version":3,"sources":["../src/foo.js"],"names":["arr","map","x","MULTIPLIER"],"mappings":";;AAAAA,GAAG,CAACC,GAAJ,CAAQ,UAAAC,CAAC;AAAA,SAAIA,CAAC,GAAGC,UAAR;AAAA,CAAT","sourcesContent":["arr.map(x => x * MULTIPLIER);"],"file":"foo.js"}
|
||||
|
||||
1
packages/babel-cli/test/fixtures/babel/dir --out-file/in-files/src/bar/bar.js
vendored
Normal file
1
packages/babel-cli/test/fixtures/babel/dir --out-file/in-files/src/bar/bar.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(() => 42)
|
||||
1
packages/babel-cli/test/fixtures/babel/dir --out-file/in-files/src/foo.js
vendored
Normal file
1
packages/babel-cli/test/fixtures/babel/dir --out-file/in-files/src/foo.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
arr.map(x => x * MULTIPLIER);
|
||||
3
packages/babel-cli/test/fixtures/babel/dir --out-file/options.json
vendored
Normal file
3
packages/babel-cli/test/fixtures/babel/dir --out-file/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"args": ["src", "--out-file", "test.js"]
|
||||
}
|
||||
10
packages/babel-cli/test/fixtures/babel/dir --out-file/out-files/test.js
vendored
Normal file
10
packages/babel-cli/test/fixtures/babel/dir --out-file/out-files/test.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
(function () {
|
||||
return 42;
|
||||
});
|
||||
"use strict";
|
||||
|
||||
arr.map(function (x) {
|
||||
return x * MULTIPLIER;
|
||||
});
|
||||
0
packages/babel-cli/test/fixtures/babel/dir --out-file/stdout.txt
vendored
Normal file
0
packages/babel-cli/test/fixtures/babel/dir --out-file/stdout.txt
vendored
Normal file
@@ -4,4 +4,4 @@ arr.map(function (x) {
|
||||
return x * MULTIPLIER;
|
||||
});
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLElBQUksR0FBSixDQUFRO0FBQUEsU0FBSyxJQUFJLFVBQVQ7QUFBQSxDQUFSIiwiZmlsZSI6InNjcmlwdDIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJhcnIubWFwKHggPT4geCAqIE1VTFRJUExJRVIpOyJdfQ==
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLEdBQUcsQ0FBQyxHQUFKLENBQVEsVUFBQSxDQUFDO0FBQUEsU0FBSSxDQUFDLEdBQUcsVUFBUjtBQUFBLENBQVQiLCJmaWxlIjoic2NyaXB0Mi5qcyIsInNvdXJjZXNDb250ZW50IjpbImFyci5tYXAoeCA9PiB4ICogTVVMVElQTElFUik7Il19
|
||||
|
||||
@@ -4,4 +4,4 @@ arr.map(function (x) {
|
||||
return x * MULTIPLIER;
|
||||
});
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9yaWdpbmFsLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBQSxHQUFBLENBQUE7QUFBQSxTQUFVLElBQUEsVUFBVjtBQUFBLENBQUEiLCJmaWxlIjoic2NyaXB0Mi5qcyIsInNvdXJjZXNDb250ZW50IjpbInZhciBmb28gPSAoKSA9PiA0OyJdfQ==
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm9yaWdpbmFsLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsR0FBQSxDQUFBLEdBQUEsQ0FBQSxVQUFBLENBQUE7QUFBQSxTQUFVLENBQUEsR0FBQSxVQUFWO0FBQUEsQ0FBQSIsImZpbGUiOiJzY3JpcHQyLmpzIiwic291cmNlc0NvbnRlbnQiOlsidmFyIGZvbyA9ICgpID0+IDQ7Il19
|
||||
|
||||
@@ -9,4 +9,4 @@ arr.map(function (x) {
|
||||
return x * MULTIPLIER;
|
||||
});
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyIsInNjcmlwdDIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxDQUFDO0FBQUEsU0FBTSxFQUFOO0FBQUEsQ0FBRDs7O0FDQUEsSUFBSSxHQUFKLENBQVE7QUFBQSxTQUFLLElBQUksVUFBVDtBQUFBLENBQVIiLCJmaWxlIjoic2NyaXB0My5qcyIsInNvdXJjZXNDb250ZW50IjpbIigoKSA9PiA0MikiLCJhcnIubWFwKHggPT4geCAqIE1VTFRJUExJRVIpOyJdfQ==
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyIsInNjcmlwdDIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxDQUFDO0FBQUEsU0FBTSxFQUFOO0FBQUEsQ0FBRDs7O0FDQUEsR0FBRyxDQUFDLEdBQUosQ0FBUSxVQUFBLENBQUM7QUFBQSxTQUFJLENBQUMsR0FBRyxVQUFSO0FBQUEsQ0FBVCIsImZpbGUiOiJzY3JpcHQzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiKCgpID0+IDQyKSIsImFyci5tYXAoeCA9PiB4ICogTVVMVElQTElFUik7Il19
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["script.js","script2.js"],"names":[],"mappings":";;AAAA,CAAC;AAAA,SAAM,EAAN;AAAA,CAAD;;;ACAA,IAAI,GAAJ,CAAQ;AAAA,SAAK,IAAI,UAAT;AAAA,CAAR","file":"script3.js","sourcesContent":["(() => 42)","arr.map(x => x * MULTIPLIER);"]}
|
||||
{"version":3,"sources":["script.js","script2.js"],"names":[],"mappings":";;AAAA,CAAC;AAAA,SAAM,EAAN;AAAA,CAAD;;;ACAA,GAAG,CAAC,GAAJ,CAAQ,UAAA,CAAC;AAAA,SAAI,CAAC,GAAG,UAAR;AAAA,CAAT","file":"script3.js","sourcesContent":["(() => 42)","arr.map(x => x * MULTIPLIER);"]}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/code-frame",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Generate errors that contain a code frame that point to source locations.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -8,7 +8,7 @@
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-code-frame",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/highlight": "7.0.0-beta.54"
|
||||
"@babel/highlight": "7.0.0-beta.56"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chalk": "^2.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/core",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Babel compiler core.",
|
||||
"main": "lib/index.js",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
@@ -30,23 +30,23 @@
|
||||
"./lib/transform-file.js": "./lib/transform-file-browser.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "7.0.0-beta.54",
|
||||
"@babel/generator": "7.0.0-beta.54",
|
||||
"@babel/helpers": "7.0.0-beta.54",
|
||||
"@babel/parser": "7.0.0-beta.54",
|
||||
"@babel/template": "7.0.0-beta.54",
|
||||
"@babel/traverse": "7.0.0-beta.54",
|
||||
"@babel/types": "7.0.0-beta.54",
|
||||
"@babel/code-frame": "7.0.0-beta.56",
|
||||
"@babel/generator": "7.0.0-beta.56",
|
||||
"@babel/helpers": "7.0.0-beta.56",
|
||||
"@babel/parser": "7.0.0-beta.56",
|
||||
"@babel/template": "7.0.0-beta.56",
|
||||
"@babel/traverse": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56",
|
||||
"convert-source-map": "^1.1.0",
|
||||
"debug": "^3.1.0",
|
||||
"json5": "^0.5.0",
|
||||
"lodash": "^4.17.5",
|
||||
"lodash": "^4.17.10",
|
||||
"resolve": "^1.3.2",
|
||||
"semver": "^5.4.1",
|
||||
"source-map": "^0.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-transform-fixture-test-runner": "7.0.0-beta.54",
|
||||
"@babel/register": "7.0.0-beta.54"
|
||||
"@babel/helper-transform-fixture-test-runner": "7.0.0-beta.56",
|
||||
"@babel/register": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ export function assertBabelrcSearch(
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
value.forEach((item, i) => {
|
||||
if (!checkValidTest(value)) {
|
||||
if (!checkValidTest(item)) {
|
||||
throw new Error(`.${key}[${i}] must be a string/Function/RegExp.`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -24,8 +24,8 @@ type Parse = {
|
||||
|
||||
export const parse: Parse = (function parse(code, opts, callback) {
|
||||
if (typeof opts === "function") {
|
||||
opts = undefined;
|
||||
callback = opts;
|
||||
opts = undefined;
|
||||
}
|
||||
|
||||
// For backward-compat with Babel 7's early betas, we allow sync parsing when
|
||||
|
||||
@@ -31,8 +31,8 @@ export const transformFromAst: TransformFromAst = (function transformFromAst(
|
||||
callback,
|
||||
) {
|
||||
if (typeof opts === "function") {
|
||||
opts = undefined;
|
||||
callback = opts;
|
||||
opts = undefined;
|
||||
}
|
||||
|
||||
// For backward-compat with Babel 6, we allow sync transformation when
|
||||
|
||||
@@ -18,8 +18,8 @@ type Transform = {
|
||||
|
||||
export const transform: Transform = (function transform(code, opts, callback) {
|
||||
if (typeof opts === "function") {
|
||||
opts = undefined;
|
||||
callback = opts;
|
||||
opts = undefined;
|
||||
}
|
||||
|
||||
// For backward-compat with Babel 6, we allow sync transformation when
|
||||
|
||||
@@ -5,6 +5,7 @@ import { NodePath, Hub, Scope } from "@babel/traverse";
|
||||
import { codeFrameColumns } from "@babel/code-frame";
|
||||
import traverse from "@babel/traverse";
|
||||
import * as t from "@babel/types";
|
||||
import semver from "semver";
|
||||
|
||||
import type { NormalizedFile } from "../normalize-file";
|
||||
|
||||
@@ -64,6 +65,16 @@ export default class File {
|
||||
}
|
||||
|
||||
set(key: mixed, val: mixed) {
|
||||
if (key === "helpersNamespace") {
|
||||
throw new Error(
|
||||
"Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility." +
|
||||
"If you are using @babel/plugin-external-helpers you will need to use a newer " +
|
||||
"version than the one you currently have installed. " +
|
||||
"If you have your own implementation, you'll want to explore using 'helperGenerator' " +
|
||||
"alongside 'file.availableHelper()'.",
|
||||
);
|
||||
}
|
||||
|
||||
this._map.set(key, val);
|
||||
}
|
||||
|
||||
@@ -136,17 +147,38 @@ export default class File {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given helper is available in @babel/core's helper list.
|
||||
*
|
||||
* This _also_ allows you to pass a Babel version specifically. If the
|
||||
* helper exists, but was not available for the full given range, it will be
|
||||
* considered unavailable.
|
||||
*/
|
||||
availableHelper(name: string, versionRange: ?string) {
|
||||
let minVersion;
|
||||
try {
|
||||
minVersion = helpers.minVersion(name);
|
||||
} catch (err) {
|
||||
if (err.code !== "BABEL_HELPER_UNKNOWN") throw err;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return (
|
||||
typeof versionRange !== "string" ||
|
||||
(!semver.intersects(`<${minVersion}`, versionRange) &&
|
||||
!semver.intersects(`>=8.0.0`, versionRange))
|
||||
);
|
||||
}
|
||||
|
||||
addHelper(name: string): Object {
|
||||
const declar = this.declarations[name];
|
||||
if (declar) return t.cloneNode(declar);
|
||||
|
||||
const generator = this.get("helperGenerator");
|
||||
const runtime = this.get("helpersNamespace");
|
||||
if (generator) {
|
||||
const res = generator(name);
|
||||
if (res) return res;
|
||||
} else if (runtime) {
|
||||
return t.memberExpression(t.cloneNode(runtime), t.identifier(name));
|
||||
}
|
||||
|
||||
const uid = (this.declarations[name] = this.scope.generateUidIdentifier(
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import path from "path";
|
||||
import buildDebug from "debug";
|
||||
import cloneDeep from "lodash/cloneDeep";
|
||||
import * as t from "@babel/types";
|
||||
import type { PluginPasses } from "../config";
|
||||
import convertSourceMap, { typeof Converter } from "convert-source-map";
|
||||
@@ -75,6 +76,7 @@ export default function normalizeFile(
|
||||
} else if (ast.type !== "File") {
|
||||
throw new Error("AST root must be a Program or File node");
|
||||
}
|
||||
ast = cloneDeep(ast);
|
||||
} else {
|
||||
// The parser's AST types aren't fully compatible with the types generated
|
||||
// by the logic in babel-types.
|
||||
|
||||
@@ -31,6 +31,10 @@ export default class PluginPass {
|
||||
return this._map.get(key);
|
||||
}
|
||||
|
||||
availableHelper(name: string, versionRange: ?string) {
|
||||
return this.file.availableHelper(name, versionRange);
|
||||
}
|
||||
|
||||
addHelper(name: string) {
|
||||
return this.file.addHelper(name);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,13 @@ function assertNotIgnored(result) {
|
||||
expect(result).not.toBeNull();
|
||||
}
|
||||
|
||||
function parse(code, opts) {
|
||||
return babel.parse(code, {
|
||||
cwd: __dirname,
|
||||
...opts,
|
||||
});
|
||||
}
|
||||
|
||||
function transform(code, opts) {
|
||||
return babel.transform(code, {
|
||||
cwd: __dirname,
|
||||
@@ -43,6 +50,13 @@ function transformAsync(code, opts) {
|
||||
});
|
||||
}
|
||||
|
||||
function transformFromAst(ast, code, opts) {
|
||||
return babel.transformFromAst(ast, code, {
|
||||
cwd: __dirname,
|
||||
...opts,
|
||||
});
|
||||
}
|
||||
|
||||
describe("parser and generator options", function() {
|
||||
const recast = {
|
||||
parse: function(code, opts) {
|
||||
@@ -168,6 +182,30 @@ describe("api", function() {
|
||||
expect(options).toEqual({ babelrc: false });
|
||||
});
|
||||
|
||||
it("transformFromAst should not mutate the AST", function() {
|
||||
const program = "const identifier = 1";
|
||||
const node = parse(program);
|
||||
const { code } = transformFromAst(node, program, {
|
||||
plugins: [
|
||||
function() {
|
||||
return {
|
||||
visitor: {
|
||||
Identifier: function(path) {
|
||||
path.node.name = "replaced";
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(code).toBe("const replaced = 1;");
|
||||
expect(node.program.body[0].declarations[0].id.name).toBe(
|
||||
"identifier",
|
||||
"original ast should not have been mutated",
|
||||
);
|
||||
});
|
||||
|
||||
it("options throw on falsy true", function() {
|
||||
return expect(function() {
|
||||
transform("", {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
["@babel/syntax-decorators", { "legacy": true }]
|
||||
]
|
||||
"parserOpts": {
|
||||
"plugins": ["decorators-legacy"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
{
|
||||
"compact": false,
|
||||
"presets": [
|
||||
"env",
|
||||
["stage-2", { "decoratorsLegacy": true }]
|
||||
"env"
|
||||
],
|
||||
"plugins": [
|
||||
"external-helpers",
|
||||
"proposal-object-rest-spread"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[{
|
||||
"original": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
"column": 14
|
||||
},
|
||||
"generated": {
|
||||
"line": 2,
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
"map",
|
||||
"x"
|
||||
],
|
||||
"mappings": "AAAAA,IAAIC,GAAJ,CAAQ;AAAA,SAAKC,IAAIA,CAAT;AAAA,CAAR",
|
||||
"mappings": "AAAAA,GAAG,CAACC,GAAJ,CAAQ,UAAAC,CAAC;AAAA,SAAIA,CAAC,GAAGA,CAAR;AAAA,CAAT",
|
||||
"sourcesContent": ["arr.map(x => x * x);"]
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
arr.map(function (x) {
|
||||
return x * x;
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNvdXJjZS1tYXBzL2lubGluZS9pbnB1dC5qcyJdLCJuYW1lcyI6WyJhcnIiLCJtYXAiLCJ4Il0sIm1hcHBpbmdzIjoiQUFBQUEsSUFBSUMsR0FBSixDQUFRO0FBQUEsU0FBS0MsSUFBSUEsQ0FBVDtBQUFBLENBQVIiLCJzb3VyY2VzQ29udGVudCI6WyJhcnIubWFwKHggPT4geCAqIHgpOyJdfQ==
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNvdXJjZS1tYXBzL2lubGluZS9pbnB1dC5qcyJdLCJuYW1lcyI6WyJhcnIiLCJtYXAiLCJ4Il0sIm1hcHBpbmdzIjoiQUFBQUEsR0FBRyxDQUFDQyxHQUFKLENBQVEsVUFBQUMsQ0FBQztBQUFBLFNBQUlBLENBQUMsR0FBR0EsQ0FBUjtBQUFBLENBQVQiLCJzb3VyY2VzQ29udGVudCI6WyJhcnIubWFwKHggPT4geCAqIHgpOyJdfQ==
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"HelloWorld.vue"
|
||||
],
|
||||
"names": [],
|
||||
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAsFA;AACA,QAAA,YADA;;AAEA,SAAA;AACA,WAAA;AACA,WAAA;AADA,KAAA;AAGA;;AANA,C",
|
||||
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAsFA;AACA,EAAA,IAAA,EAAA,YADA;;AAEA,EAAA,IAAA,GAAA;AACA,WAAA;AACA,MAAA,GAAA,EAAA;AADA,KAAA;AAGA;;AANA,C",
|
||||
"sourceRoot": "src/components",
|
||||
"sourcesContent": [
|
||||
"<template>\n <div class=\"hello\">\n <h1>{{ msg }}</h1>\n <h2>Essential Links</h2>\n <ul>\n <li>\n <a\n href=\"https://vuejs.org\"\n target=\"_blank\"\n >\n Core Docs\n </a>\n </li>\n <li>\n <a\n href=\"https://forum.vuejs.org\"\n target=\"_blank\"\n >\n Forum\n </a>\n </li>\n <li>\n <a\n href=\"https://chat.vuejs.org\"\n target=\"_blank\"\n >\n Community Chat\n </a>\n </li>\n <li>\n <a\n href=\"https://twitter.com/vuejs\"\n target=\"_blank\"\n >\n Twitter\n </a>\n </li>\n <br>\n <li>\n <a\n href=\"http://vuejs-templates.github.io/webpack/\"\n target=\"_blank\"\n >\n Docs for This Template\n </a>\n </li>\n </ul>\n <h2>Ecosystem</h2>\n <ul>\n <li>\n <a\n href=\"http://router.vuejs.org/\"\n target=\"_blank\"\n >\n vue-router\n </a>\n </li>\n <li>\n <a\n href=\"http://vuex.vuejs.org/\"\n target=\"_blank\"\n >\n vuex\n </a>\n </li>\n <li>\n <a\n href=\"http://vue-loader.vuejs.org/\"\n target=\"_blank\"\n >\n vue-loader\n </a>\n </li>\n <li>\n <a\n href=\"https://github.com/vuejs/awesome-vue\"\n target=\"_blank\"\n >\n awesome-vue\n </a>\n </li>\n </ul>\n </div>\n</template>\n\n<script>\nexport default {\n name: 'HelloWorld',\n data () {\n return {\n msg: 'Welcome to Your Vue.js App'\n }\n }\n}\n</script>\n\n<!-- Add \"scoped\" attribute to limit CSS to this component only -->\n<style scoped>\nh1, h2 {\n font-weight: normal;\n}\nul {\n list-style-type: none;\n padding: 0;\n}\nli {\n display: inline-block;\n margin: 0 10px;\n}\na {\n color: #42b983;\n}\n</style>\n"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"mappings": "AAAA,IAAA,MAAU,Y;SAAM,C;AAAC,CAAjB",
|
||||
"mappings": "AAAA,IAAA,GAAA,GAAU,Y;SAAM,C;AAAC,CAAjB",
|
||||
"names": [],
|
||||
"sources": ["original.js"],
|
||||
"sourcesContent": ["var foo = () => 4;"],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"mappings": "AAAA;AAEAA,QAAQC,GAAR,CAAY,eAAZ",
|
||||
"mappings": "AAAA;AAEAA,OAAO,CAACC,GAAR,CAAY,eAAZ",
|
||||
"names": [
|
||||
"console",
|
||||
"log"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/generator",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Turns an AST into code.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -11,14 +11,14 @@
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.54",
|
||||
"@babel/types": "7.0.0-beta.56",
|
||||
"jsesc": "^2.5.1",
|
||||
"lodash": "^4.17.5",
|
||||
"lodash": "^4.17.10",
|
||||
"source-map": "^0.5.0",
|
||||
"trim-right": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-fixtures": "7.0.0-beta.54",
|
||||
"@babel/parser": "7.0.0-beta.54"
|
||||
"@babel/helper-fixtures": "7.0.0-beta.56",
|
||||
"@babel/parser": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ export default class Buffer {
|
||||
column: null,
|
||||
filename: null,
|
||||
};
|
||||
_disallowedPop: Object | null = null;
|
||||
|
||||
/**
|
||||
* Get the final string output from the buffer, along with the sourcemap if one exists.
|
||||
@@ -71,8 +72,14 @@ export default class Buffer {
|
||||
|
||||
append(str: string): void {
|
||||
this._flush();
|
||||
const { line, column, filename, identifierName } = this._sourcePosition;
|
||||
this._append(str, line, column, identifierName, filename);
|
||||
const {
|
||||
line,
|
||||
column,
|
||||
filename,
|
||||
identifierName,
|
||||
force,
|
||||
} = this._sourcePosition;
|
||||
this._append(str, line, column, identifierName, filename, force);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,8 +94,14 @@ export default class Buffer {
|
||||
}
|
||||
}
|
||||
|
||||
const { line, column, filename, identifierName } = this._sourcePosition;
|
||||
this._queue.unshift([str, line, column, identifierName, filename]);
|
||||
const {
|
||||
line,
|
||||
column,
|
||||
filename,
|
||||
identifierName,
|
||||
force,
|
||||
} = this._sourcePosition;
|
||||
this._queue.unshift([str, line, column, identifierName, filename, force]);
|
||||
}
|
||||
|
||||
_flush(): void {
|
||||
@@ -102,6 +115,7 @@ export default class Buffer {
|
||||
column: number,
|
||||
identifierName: ?string,
|
||||
filename: ?string,
|
||||
force?: boolean,
|
||||
): void {
|
||||
// If there the line is ending, adding a new mapping marker is redundant
|
||||
if (this._map && str[0] !== "\n") {
|
||||
@@ -112,6 +126,7 @@ export default class Buffer {
|
||||
column,
|
||||
identifierName,
|
||||
filename,
|
||||
force,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -169,20 +184,60 @@ export default class Buffer {
|
||||
return this._queue.length > 0 || !!this._last;
|
||||
}
|
||||
|
||||
/**
|
||||
* Certain sourcemap usecases expect mappings to be more accurate than
|
||||
* Babel's generic sourcemap handling allows. For now, we special-case
|
||||
* identifiers to allow for the primary cases to work.
|
||||
* The goal of this line is to ensure that the map output from Babel will
|
||||
* have an exact range on identifiers in the output code. Without this
|
||||
* line, Babel would potentially include some number of trailing tokens
|
||||
* that are printed after the identifier, but before another location has
|
||||
* been assigned.
|
||||
* This allows tooling like Rollup and Webpack to more accurately perform
|
||||
* their own transformations. Most importantly, this allows the import/export
|
||||
* transformations performed by those tools to loose less information when
|
||||
* applying their own transformations on top of the code and map results
|
||||
* generated by Babel itself.
|
||||
*
|
||||
* The primary example of this is the snippet:
|
||||
*
|
||||
* import mod from "mod";
|
||||
* mod();
|
||||
*
|
||||
* With this line, there will be one mapping range over "mod" and another
|
||||
* over "();", where previously it would have been a single mapping.
|
||||
*/
|
||||
exactSource(loc: Object, cb: () => void) {
|
||||
// In cases where parent expressions start at the same locations as the
|
||||
// identifier itself, the current active location could already be the
|
||||
// start of this range. We use 'force' here to explicitly start a new
|
||||
// mapping range for this new token.
|
||||
this.source("start", loc, true /* force */);
|
||||
|
||||
cb();
|
||||
|
||||
// In cases where tokens are printed after this item, we want to
|
||||
// ensure that they get the location of the _end_ of the identifier.
|
||||
// To accomplish this, we assign the location and explicitly disable
|
||||
// the standard Buffer withSource previous-position "reactivation"
|
||||
// logic. This means that if another item calls '.source()' to set
|
||||
// the location after the identifier, it is fine, but the position won't
|
||||
// be automatically replaced with the previous value.
|
||||
this.source("end", loc);
|
||||
this._disallowPop("start", loc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a given position as the current source location so generated code after this call
|
||||
* will be given this position in the sourcemap.
|
||||
*/
|
||||
|
||||
source(prop: string, loc: Location): void {
|
||||
source(prop: string, loc: Location, force?: boolean): void {
|
||||
if (prop && !loc) return;
|
||||
|
||||
const pos = loc ? loc[prop] : null;
|
||||
|
||||
this._sourcePosition.identifierName = (loc && loc.identifierName) || null;
|
||||
this._sourcePosition.line = pos ? pos.line : null;
|
||||
this._sourcePosition.column = pos ? pos.column : null;
|
||||
this._sourcePosition.filename = (loc && loc.filename) || null;
|
||||
// Since this is called extremly often, we re-use the same _sourcePosition
|
||||
// object for the whole lifetime of the buffer.
|
||||
this._normalizePosition(prop, loc, this._sourcePosition, force);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -192,7 +247,9 @@ export default class Buffer {
|
||||
withSource(prop: string, loc: Location, cb: () => void): void {
|
||||
if (!this._map) return cb();
|
||||
|
||||
// Use the call stack to manage a stack of "source location" data.
|
||||
// Use the call stack to manage a stack of "source location" data because
|
||||
// the _sourcePosition object is mutated over the course of code generation,
|
||||
// and constantly copying it would be slower.
|
||||
const originalLine = this._sourcePosition.line;
|
||||
const originalColumn = this._sourcePosition.column;
|
||||
const originalFilename = this._sourcePosition.filename;
|
||||
@@ -202,10 +259,79 @@ export default class Buffer {
|
||||
|
||||
cb();
|
||||
|
||||
this._sourcePosition.line = originalLine;
|
||||
this._sourcePosition.column = originalColumn;
|
||||
this._sourcePosition.filename = originalFilename;
|
||||
this._sourcePosition.identifierName = originalIdentifierName;
|
||||
if (
|
||||
// If the current active position is forced, we only want to reactivate
|
||||
// the old position if it is different from the newest position.
|
||||
(!this._sourcePosition.force ||
|
||||
this._sourcePosition.line !== originalLine ||
|
||||
this._sourcePosition.column !== originalColumn ||
|
||||
this._sourcePosition.filename !== originalFilename) &&
|
||||
// Verify if reactivating this specific position has been disallowed.
|
||||
(!this._disallowedPop ||
|
||||
this._disallowedPop.line !== originalLine ||
|
||||
this._disallowedPop.column !== originalColumn ||
|
||||
this._disallowedPop.filename !== originalFilename)
|
||||
) {
|
||||
this._sourcePosition.line = originalLine;
|
||||
this._sourcePosition.column = originalColumn;
|
||||
this._sourcePosition.filename = originalFilename;
|
||||
this._sourcePosition.identifierName = originalIdentifierName;
|
||||
this._sourcePosition.force = false;
|
||||
this._disallowedPop = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Allow printers to disable the default location-reset behavior of the
|
||||
* sourcemap output, so that certain printers can be sure that the
|
||||
* "end" location that they set is actually treated as the end position.
|
||||
*/
|
||||
_disallowPop(prop: string, loc: Location) {
|
||||
if (prop && !loc) return;
|
||||
|
||||
this._disallowedPop = this._normalizePosition(prop, loc);
|
||||
}
|
||||
|
||||
_normalizePosition(
|
||||
prop: string,
|
||||
loc: Object,
|
||||
targetObj: Object,
|
||||
force?: boolean,
|
||||
) {
|
||||
const pos = loc ? loc[prop] : null;
|
||||
|
||||
if (targetObj === undefined) {
|
||||
// Initialize with fields so that the object doesn't change shape.
|
||||
targetObj = {
|
||||
identifierName: null,
|
||||
line: null,
|
||||
column: null,
|
||||
filename: null,
|
||||
force: false,
|
||||
};
|
||||
}
|
||||
|
||||
const origLine = targetObj.line;
|
||||
const origColumn = targetObj.column;
|
||||
const origFilename = targetObj.filename;
|
||||
|
||||
targetObj.identifierName =
|
||||
(prop === "start" && loc && loc.identifierName) || null;
|
||||
targetObj.line = pos ? pos.line : null;
|
||||
targetObj.column = pos ? pos.column : null;
|
||||
targetObj.filename = (loc && loc.filename) || null;
|
||||
|
||||
// We want to skip reassigning `force` if we're re-setting the same position.
|
||||
if (
|
||||
force ||
|
||||
targetObj.line !== origLine ||
|
||||
targetObj.column !== origColumn ||
|
||||
targetObj.filename !== origFilename
|
||||
) {
|
||||
targetObj.force = force;
|
||||
}
|
||||
|
||||
return targetObj;
|
||||
}
|
||||
|
||||
getCurrentColumn(): number {
|
||||
|
||||
@@ -124,6 +124,7 @@ export function ClassPrivateProperty(node: Object) {
|
||||
this.space();
|
||||
}
|
||||
this.print(node.key, node);
|
||||
this.print(node.typeAnnotation, node);
|
||||
if (node.value) {
|
||||
this.space();
|
||||
this.token("=");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
export function TaggedTemplateExpression(node: Object) {
|
||||
this.print(node.tag, node);
|
||||
this.print(node.typeParameters, node); // TS
|
||||
this.print(node.quasi, node);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ import * as t from "@babel/types";
|
||||
import jsesc from "jsesc";
|
||||
|
||||
export function Identifier(node: Object) {
|
||||
this.word(node.name);
|
||||
this.exactSource(node.loc, () => {
|
||||
this.word(node.name);
|
||||
});
|
||||
}
|
||||
|
||||
export function RestElement(node: Object) {
|
||||
|
||||
@@ -200,6 +200,12 @@ export default class Printer {
|
||||
this._buf.removeTrailingNewline();
|
||||
}
|
||||
|
||||
exactSource(loc: Object, cb: () => void) {
|
||||
this._catchUp("start", loc);
|
||||
|
||||
this._buf.exactSource(loc, cb);
|
||||
}
|
||||
|
||||
source(prop: string, loc: Object): void {
|
||||
this._catchUp(prop, loc);
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ export default class SourceMap {
|
||||
column: number,
|
||||
identifierName: ?string,
|
||||
filename: ?string,
|
||||
force?: boolean,
|
||||
) {
|
||||
// Adding an empty mapping at the start of a generated line just clutters the map.
|
||||
if (this._lastGenLine !== generatedLine && line === null) return;
|
||||
@@ -60,6 +61,7 @@ export default class SourceMap {
|
||||
// If this mapping points to the same source location as the last one, we can ignore it since
|
||||
// the previous one covers it.
|
||||
if (
|
||||
!force &&
|
||||
this._lastGenLine === generatedLine &&
|
||||
this._lastSourceLine === line &&
|
||||
this._lastSourceColumn === column
|
||||
|
||||
@@ -72,6 +72,10 @@ class Foo {
|
||||
static prop1: string;
|
||||
prop2: number;
|
||||
}
|
||||
class Foo {
|
||||
#prop1: string;
|
||||
prop2: number;
|
||||
}
|
||||
var x: number | string = 4;
|
||||
class Array { concat(items:number | string) {}; }
|
||||
var x: () => number | () => string = fn;
|
||||
|
||||
1
packages/babel-generator/test/fixtures/flow/type-annotations/options.json
vendored
Normal file
1
packages/babel-generator/test/fixtures/flow/type-annotations/options.json
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{ "plugins": ["classPrivateProperties", "flow"] }
|
||||
@@ -168,6 +168,11 @@ class Foo {
|
||||
prop2: number;
|
||||
}
|
||||
|
||||
class Foo {
|
||||
#prop1: string;
|
||||
prop2: number;
|
||||
}
|
||||
|
||||
var x: number | string = 4;
|
||||
|
||||
class Array {
|
||||
|
||||
16
packages/babel-generator/test/fixtures/sourcemaps/call-identifiers/input.js
vendored
Normal file
16
packages/babel-generator/test/fixtures/sourcemaps/call-identifiers/input.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
foo;
|
||||
foo();
|
||||
foo().bar;
|
||||
obj.foo;
|
||||
obj.foo();
|
||||
obj.foo.bar;
|
||||
obj.foo().bar;
|
||||
{
|
||||
foo;
|
||||
foo();
|
||||
foo().bar;
|
||||
obj.foo;
|
||||
obj.foo();
|
||||
obj.foo.bar;
|
||||
obj.foo().bar;
|
||||
}
|
||||
16
packages/babel-generator/test/fixtures/sourcemaps/call-identifiers/output.js
vendored
Normal file
16
packages/babel-generator/test/fixtures/sourcemaps/call-identifiers/output.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
foo;
|
||||
foo();
|
||||
foo().bar;
|
||||
obj.foo;
|
||||
obj.foo();
|
||||
obj.foo.bar;
|
||||
obj.foo().bar;
|
||||
{
|
||||
foo;
|
||||
foo();
|
||||
foo().bar;
|
||||
obj.foo;
|
||||
obj.foo();
|
||||
obj.foo.bar;
|
||||
obj.foo().bar;
|
||||
}
|
||||
9
packages/babel-generator/test/fixtures/sourcemaps/call-identifiers/source-map.json
vendored
Normal file
9
packages/babel-generator/test/fixtures/sourcemaps/call-identifiers/source-map.json
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"mappings": "AAAAA,GAAG;AACHA,GAAG;AACHA,GAAG,GAAGC,GAAN;AACAC,GAAG,CAACF,GAAJ;AACAE,GAAG,CAACF,GAAJ;AACAE,GAAG,CAACF,GAAJ,CAAQC,GAAR;AACAC,GAAG,CAACF,GAAJ,GAAUC,GAAV;AACA;AACED,EAAAA,GAAG;AACHA,EAAAA,GAAG;AACHA,EAAAA,GAAG,GAAGC,GAAN;AACAC,EAAAA,GAAG,CAACF,GAAJ;AACAE,EAAAA,GAAG,CAACF,GAAJ;AACAE,EAAAA,GAAG,CAACF,GAAJ,CAAQC,GAAR;AACAC,EAAAA,GAAG,CAACF,GAAJ,GAAUC,GAAV;AACD",
|
||||
"names": ["foo", "bar", "obj"],
|
||||
"sources": ["fixtures/sourcemaps/call-identifiers/input.js"],
|
||||
"sourcesContent": [
|
||||
"foo;\nfoo();\nfoo().bar;\nobj.foo;\nobj.foo();\nobj.foo.bar;\nobj.foo().bar;\n{\n foo;\n foo();\n foo().bar;\n obj.foo;\n obj.foo();\n obj.foo.bar;\n obj.foo().bar;\n}"
|
||||
],
|
||||
"version": 3
|
||||
}
|
||||
1
packages/babel-generator/test/fixtures/typescript/type-arguments-tagged-template/input.js
vendored
Normal file
1
packages/babel-generator/test/fixtures/typescript/type-arguments-tagged-template/input.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
f<T>``;
|
||||
1
packages/babel-generator/test/fixtures/typescript/type-arguments-tagged-template/output.js
vendored
Normal file
1
packages/babel-generator/test/fixtures/typescript/type-arguments-tagged-template/output.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
f<T>``;
|
||||
@@ -49,7 +49,8 @@ describe("generation", function() {
|
||||
version: 3,
|
||||
sources: ["a.js", "b.js"],
|
||||
mappings:
|
||||
"AAAA,SAASA,EAAT,CAAaC,GAAb,EAAkB;AAAEC,UAAQC,GAAR,CAAYF,GAAZ;AAAmB;;ACAvCD,GAAG,OAAH",
|
||||
// eslint-disable-next-line max-len
|
||||
"AAAA,SAASA,EAAT,CAAaC,GAAb,EAAkB;AAAEC,EAAAA,OAAO,CAACC,GAAR,CAAYF,GAAZ;AAAmB;;ACAvCD,EAAE,CAAC,OAAD,CAAF",
|
||||
names: ["hi", "msg", "console", "log"],
|
||||
sourcesContent: [
|
||||
"function hi (msg) { console.log(msg); }\n",
|
||||
@@ -103,6 +104,18 @@ describe("generation", function() {
|
||||
source: "a.js",
|
||||
original: { line: 1, column: 20 },
|
||||
},
|
||||
{
|
||||
name: "console",
|
||||
generated: { line: 2, column: 2 },
|
||||
source: "a.js",
|
||||
original: { line: 1, column: 20 },
|
||||
},
|
||||
{
|
||||
name: undefined,
|
||||
generated: { line: 2, column: 9 },
|
||||
source: "a.js",
|
||||
original: { line: 1, column: 27 },
|
||||
},
|
||||
{
|
||||
name: "log",
|
||||
generated: { line: 2, column: 10 },
|
||||
@@ -139,6 +152,12 @@ describe("generation", function() {
|
||||
source: "b.js",
|
||||
original: { line: 1, column: 0 },
|
||||
},
|
||||
{
|
||||
name: undefined,
|
||||
generated: { line: 5, column: 2 },
|
||||
source: "b.js",
|
||||
original: { line: 1, column: 2 },
|
||||
},
|
||||
{
|
||||
name: undefined,
|
||||
generated: { line: 5, column: 3 },
|
||||
@@ -149,6 +168,12 @@ describe("generation", function() {
|
||||
name: undefined,
|
||||
generated: { line: 5, column: 10 },
|
||||
source: "b.js",
|
||||
original: { line: 1, column: 2 },
|
||||
},
|
||||
{
|
||||
name: undefined,
|
||||
generated: { line: 5, column: 11 },
|
||||
source: "b.js",
|
||||
original: { line: 1, column: 0 },
|
||||
},
|
||||
],
|
||||
@@ -189,7 +214,7 @@ describe("generation", function() {
|
||||
version: 3,
|
||||
sources: ["inline"],
|
||||
names: ["foo", "bar"],
|
||||
mappings: "AAAA,SAASA,IAAT,GAAe;AAAEC;AAAM",
|
||||
mappings: "AAAA,SAASA,IAAT,GAAe;AAAEC,EAAAA,IAAG;AAAG",
|
||||
sourcesContent: ["function foo() { bar; }\n"],
|
||||
},
|
||||
"sourcemap was incorrectly generated",
|
||||
@@ -227,6 +252,18 @@ describe("generation", function() {
|
||||
source: "inline",
|
||||
original: { line: 1, column: 17 },
|
||||
},
|
||||
{
|
||||
name: "bar",
|
||||
generated: { line: 2, column: 2 },
|
||||
source: "inline",
|
||||
original: { line: 1, column: 17 },
|
||||
},
|
||||
{
|
||||
name: undefined,
|
||||
generated: { line: 2, column: 6 },
|
||||
source: "inline",
|
||||
original: { line: 1, column: 20 },
|
||||
},
|
||||
{
|
||||
name: undefined,
|
||||
generated: { line: 3, column: 0 },
|
||||
@@ -362,36 +399,49 @@ const suites = fixtures(`${__dirname}/fixtures`);
|
||||
suites.forEach(function(testSuite) {
|
||||
describe("generation/" + testSuite.title, function() {
|
||||
testSuite.tests.forEach(function(task) {
|
||||
it(
|
||||
const testFn = task.disabled ? it.skip : it;
|
||||
|
||||
testFn(
|
||||
task.title,
|
||||
!task.disabled &&
|
||||
function() {
|
||||
const expected = task.expect;
|
||||
const actual = task.actual;
|
||||
const actualCode = actual.code;
|
||||
|
||||
if (actualCode) {
|
||||
const actualAst = parse(actualCode, {
|
||||
filename: actual.loc,
|
||||
plugins: task.options.plugins || [],
|
||||
strictMode: false,
|
||||
sourceType: "module",
|
||||
});
|
||||
const result = generate(actualAst, task.options, actualCode);
|
||||
function() {
|
||||
const expected = task.expect;
|
||||
const actual = task.actual;
|
||||
const actualCode = actual.code;
|
||||
|
||||
if (
|
||||
!expected.code &&
|
||||
result.code &&
|
||||
fs.statSync(path.dirname(expected.loc)).isDirectory() &&
|
||||
!process.env.CI
|
||||
) {
|
||||
console.log(`New test file created: ${expected.loc}`);
|
||||
fs.writeFileSync(expected.loc, result.code);
|
||||
} else {
|
||||
expect(result.code).toBe(expected.code);
|
||||
}
|
||||
if (actualCode) {
|
||||
const actualAst = parse(actualCode, {
|
||||
filename: actual.loc,
|
||||
plugins: task.options.plugins || [],
|
||||
strictMode: false,
|
||||
sourceType: "module",
|
||||
sourceMaps: !!task.sourceMap,
|
||||
});
|
||||
const options = {
|
||||
sourceFileName: path.relative(__dirname, actual.loc),
|
||||
...task.options,
|
||||
sourceMaps: task.sourceMap ? true : task.options.sourceMaps,
|
||||
};
|
||||
|
||||
const result = generate(actualAst, options, actualCode);
|
||||
|
||||
if (options.sourceMaps) {
|
||||
expect(result.map).toEqual(task.sourceMap);
|
||||
}
|
||||
},
|
||||
|
||||
if (
|
||||
!expected.code &&
|
||||
result.code &&
|
||||
fs.statSync(path.dirname(expected.loc)).isDirectory() &&
|
||||
!process.env.CI
|
||||
) {
|
||||
console.log(`New test file created: ${expected.loc}`);
|
||||
fs.writeFileSync(expected.loc, result.code);
|
||||
} else {
|
||||
expect(result.code).toBe(expected.code);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-annotate-as-pure",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54"
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@babel/helper-bindify-decorators",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54",
|
||||
"@babel/types": "7.0.0-beta.54"
|
||||
"@babel/traverse": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@babel/helper-builder-binary-assignment-operator-visitor",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54",
|
||||
"@babel/types": "7.0.0-beta.54"
|
||||
"@babel/helper-explode-assignable-expression": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@babel/helper-builder-react-jsx",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54",
|
||||
"@babel/types": "7.0.0-beta.56",
|
||||
"esutils": "^2.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@babel/helper-call-delegate",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54",
|
||||
"@babel/traverse": "7.0.0-beta.54",
|
||||
"@babel/types": "7.0.0-beta.54"
|
||||
"@babel/helper-hoist-variables": "7.0.0-beta.56",
|
||||
"@babel/traverse": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@babel/helper-define-map",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54",
|
||||
"@babel/types": "7.0.0-beta.54",
|
||||
"lodash": "^4.17.5"
|
||||
"@babel/helper-function-name": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56",
|
||||
"lodash": "^4.17.10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@babel/helper-explode-assignable-expression",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54",
|
||||
"@babel/types": "7.0.0-beta.54"
|
||||
"@babel/traverse": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@babel/helper-explode-class",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54",
|
||||
"@babel/traverse": "7.0.0-beta.54",
|
||||
"@babel/types": "7.0.0-beta.54"
|
||||
"@babel/helper-bindify-decorators": "7.0.0-beta.56",
|
||||
"@babel/traverse": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@babel/helper-fixtures",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Helper function to support fixtures",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"license": "MIT",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-fixtures",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.5",
|
||||
"lodash": "^4.17.10",
|
||||
"semver": "^5.3.0",
|
||||
"try-resolve": "^1.0.0"
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@babel/helper-function-name",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54",
|
||||
"@babel/template": "7.0.0-beta.54",
|
||||
"@babel/types": "7.0.0-beta.54"
|
||||
"@babel/helper-get-function-arity": "7.0.0-beta.56",
|
||||
"@babel/template": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-get-function-arity",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54"
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-hoist-variables",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54"
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@babel/helper-member-expression-to-functions",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Helper function to replace certain member expressions with function calls",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-member-expression-to-functions",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"author": "Justin Ridgewell <justin@ridgewell.name>",
|
||||
"dependencies": {
|
||||
"@babel/types": "7.0.0-beta.54"
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-module-imports",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Babel helper functions for inserting module loads",
|
||||
"author": "Logan Smyth <loganfsmyth@gmail.com>",
|
||||
"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.54",
|
||||
"lodash": "^4.17.5"
|
||||
"@babel/types": "7.0.0-beta.56",
|
||||
"lodash": "^4.17.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.54"
|
||||
"@babel/core": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,12 @@ function test(sourceType, opts, initializer, expectedCode) {
|
||||
function({ types: t }) {
|
||||
return {
|
||||
pre(file) {
|
||||
file.set("helpersNamespace", t.identifier("babelHelpers"));
|
||||
file.set("helperGenerator", name =>
|
||||
t.memberExpression(
|
||||
t.identifier("babelHelpers"),
|
||||
t.identifier(name),
|
||||
),
|
||||
);
|
||||
},
|
||||
visitor: {
|
||||
Program(path) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-module-transforms",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Babel helper functions for implementing ES6 module transformations",
|
||||
"author": "Logan Smyth <loganfsmyth@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -8,11 +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.54",
|
||||
"@babel/helper-simple-access": "7.0.0-beta.54",
|
||||
"@babel/helper-split-export-declaration": "7.0.0-beta.54",
|
||||
"@babel/template": "7.0.0-beta.54",
|
||||
"@babel/types": "7.0.0-beta.54",
|
||||
"lodash": "^4.17.5"
|
||||
"@babel/helper-module-imports": "7.0.0-beta.56",
|
||||
"@babel/helper-simple-access": "7.0.0-beta.56",
|
||||
"@babel/helper-split-export-declaration": "7.0.0-beta.56",
|
||||
"@babel/template": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56",
|
||||
"lodash": "^4.17.10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-optimise-call-expression",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54"
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-plugin-test-runner",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54"
|
||||
"@babel/helper-transform-fixture-test-runner": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-plugin-utils",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "General utilities for plugins to use",
|
||||
"author": "Logan Smyth <loganfsmyth@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-regex",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Helper function to check for literal RegEx",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-regex",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.5"
|
||||
"lodash": "^4.17.10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"name": "@babel/helper-remap-async-to-generator",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54",
|
||||
"@babel/helper-wrap-function": "7.0.0-beta.54",
|
||||
"@babel/template": "7.0.0-beta.54",
|
||||
"@babel/traverse": "7.0.0-beta.54",
|
||||
"@babel/types": "7.0.0-beta.54"
|
||||
"@babel/helper-annotate-as-pure": "7.0.0-beta.56",
|
||||
"@babel/helper-wrap-function": "7.0.0-beta.56",
|
||||
"@babel/template": "7.0.0-beta.56",
|
||||
"@babel/traverse": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"name": "@babel/helper-replace-supers",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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-member-expression-to-functions": "7.0.0-beta.54",
|
||||
"@babel/helper-optimise-call-expression": "7.0.0-beta.54",
|
||||
"@babel/traverse": "7.0.0-beta.54",
|
||||
"@babel/types": "7.0.0-beta.54"
|
||||
"@babel/helper-member-expression-to-functions": "7.0.0-beta.56",
|
||||
"@babel/helper-optimise-call-expression": "7.0.0-beta.56",
|
||||
"@babel/traverse": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-simple-access",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Babel helper for ensuring that access to a given value is performed through simple accesses",
|
||||
"author": "Logan Smyth <loganfsmyth@gmail.com>",
|
||||
"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.54",
|
||||
"@babel/types": "7.0.0-beta.54",
|
||||
"lodash": "^4.17.5"
|
||||
"@babel/template": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56",
|
||||
"lodash": "^4.17.10"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "@babel/helper-split-export-declaration",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54"
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-transform-fixture-test-runner",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Transform test runner for @babel/helper-fixtures module",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -8,13 +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.54",
|
||||
"@babel/core": "7.0.0-beta.54",
|
||||
"@babel/helper-fixtures": "7.0.0-beta.54",
|
||||
"@babel/polyfill": "7.0.0-beta.54",
|
||||
"@babel/code-frame": "7.0.0-beta.56",
|
||||
"@babel/core": "7.0.0-beta.56",
|
||||
"@babel/helper-fixtures": "7.0.0-beta.56",
|
||||
"@babel/polyfill": "7.0.0-beta.56",
|
||||
"jest": "^22.4.2",
|
||||
"jest-diff": "^22.4.0",
|
||||
"lodash": "^4.17.5",
|
||||
"lodash": "^4.17.10",
|
||||
"resolve": "^1.3.2",
|
||||
"source-map": "^0.5.0"
|
||||
}
|
||||
|
||||
@@ -345,44 +345,44 @@ export default function(
|
||||
continue;
|
||||
}
|
||||
|
||||
it(
|
||||
const testFn = task.disabled ? it.skip : it;
|
||||
|
||||
testFn(
|
||||
task.title,
|
||||
!task.disabled &&
|
||||
function() {
|
||||
function runTask() {
|
||||
run(task);
|
||||
}
|
||||
|
||||
defaults(task.options, {
|
||||
sourceMap: !!(task.sourceMappings || task.sourceMap),
|
||||
function() {
|
||||
function runTask() {
|
||||
run(task);
|
||||
}
|
||||
|
||||
defaults(task.options, {
|
||||
sourceMap: !!(task.sourceMappings || task.sourceMap),
|
||||
});
|
||||
|
||||
extend(task.options, taskOpts);
|
||||
|
||||
if (dynamicOpts) dynamicOpts(task.options, task);
|
||||
|
||||
const throwMsg = task.options.throws;
|
||||
if (throwMsg) {
|
||||
// internal api doesn't have this option but it's best not to pollute
|
||||
// the options object with useless options
|
||||
delete task.options.throws;
|
||||
|
||||
assert.throws(runTask, function(err) {
|
||||
return throwMsg === true || err.message.indexOf(throwMsg) >= 0;
|
||||
});
|
||||
|
||||
extend(task.options, taskOpts);
|
||||
|
||||
if (dynamicOpts) dynamicOpts(task.options, task);
|
||||
|
||||
const throwMsg = task.options.throws;
|
||||
if (throwMsg) {
|
||||
// internal api doesn't have this option but it's best not to pollute
|
||||
// the options object with useless options
|
||||
delete task.options.throws;
|
||||
|
||||
assert.throws(runTask, function(err) {
|
||||
return (
|
||||
throwMsg === true || err.message.indexOf(throwMsg) >= 0
|
||||
);
|
||||
});
|
||||
} else {
|
||||
if (task.exec.code) {
|
||||
const result = run(task);
|
||||
if (result && typeof result.then === "function") {
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
runTask();
|
||||
} else {
|
||||
if (task.exec.code) {
|
||||
const result = run(task);
|
||||
if (result && typeof result.then === "function") {
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
runTask();
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
{
|
||||
"name": "@babel/helper-wrap-function",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"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.54",
|
||||
"@babel/template": "7.0.0-beta.54",
|
||||
"@babel/traverse": "7.0.0-beta.54",
|
||||
"@babel/types": "7.0.0-beta.54"
|
||||
"@babel/helper-function-name": "7.0.0-beta.56",
|
||||
"@babel/template": "7.0.0-beta.56",
|
||||
"@babel/traverse": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helpers",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Collection of helper functions used by Babel transforms.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"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.54",
|
||||
"@babel/traverse": "7.0.0-beta.54",
|
||||
"@babel/types": "7.0.0-beta.54"
|
||||
"@babel/template": "7.0.0-beta.56",
|
||||
"@babel/traverse": "7.0.0-beta.56",
|
||||
"@babel/types": "7.0.0-beta.56"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.54"
|
||||
"@babel/helper-plugin-test-runner": "7.0.0-beta.56"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
// @flow
|
||||
|
||||
import template from "@babel/template";
|
||||
|
||||
const helpers = {};
|
||||
const helpers = Object.create(null);
|
||||
export default helpers;
|
||||
|
||||
helpers.typeof = () => template.program.ast`
|
||||
const helper = (minVersion: string) => tpl => ({
|
||||
minVersion,
|
||||
ast: () => template.program.ast(tpl),
|
||||
});
|
||||
|
||||
helpers.typeof = helper("7.0.0-beta.0")`
|
||||
export default function _typeof(obj) {
|
||||
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
||||
_typeof = function (obj) { return typeof obj; };
|
||||
@@ -19,7 +26,7 @@ helpers.typeof = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.jsx = () => template.program.ast`
|
||||
helpers.jsx = helper("7.0.0-beta.0")`
|
||||
var REACT_ELEMENT_TYPE;
|
||||
|
||||
export default function _createRawReactElement(type, props, key, children) {
|
||||
@@ -70,7 +77,7 @@ helpers.jsx = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.asyncIterator = () => template.program.ast`
|
||||
helpers.asyncIterator = helper("7.0.0-beta.0")`
|
||||
export default function _asyncIterator(iterable) {
|
||||
var method
|
||||
if (typeof Symbol === "function") {
|
||||
@@ -87,13 +94,13 @@ helpers.asyncIterator = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.AwaitValue = () => template.program.ast`
|
||||
helpers.AwaitValue = helper("7.0.0-beta.0")`
|
||||
export default function _AwaitValue(value) {
|
||||
this.wrapped = value;
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.AsyncGenerator = () => template.program.ast`
|
||||
helpers.AsyncGenerator = helper("7.0.0-beta.0")`
|
||||
import AwaitValue from "AwaitValue";
|
||||
|
||||
export default function AsyncGenerator(gen) {
|
||||
@@ -177,7 +184,7 @@ helpers.AsyncGenerator = () => template.program.ast`
|
||||
AsyncGenerator.prototype.return = function (arg) { return this._invoke("return", arg); };
|
||||
`;
|
||||
|
||||
helpers.wrapAsyncGenerator = () => template.program.ast`
|
||||
helpers.wrapAsyncGenerator = helper("7.0.0-beta.0")`
|
||||
import AsyncGenerator from "AsyncGenerator";
|
||||
|
||||
export default function _wrapAsyncGenerator(fn) {
|
||||
@@ -187,7 +194,7 @@ helpers.wrapAsyncGenerator = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.awaitAsyncGenerator = () => template.program.ast`
|
||||
helpers.awaitAsyncGenerator = helper("7.0.0-beta.0")`
|
||||
import AwaitValue from "AwaitValue";
|
||||
|
||||
export default function _awaitAsyncGenerator(value) {
|
||||
@@ -195,7 +202,7 @@ helpers.awaitAsyncGenerator = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.asyncGeneratorDelegate = () => template.program.ast`
|
||||
helpers.asyncGeneratorDelegate = helper("7.0.0-beta.0")`
|
||||
export default function _asyncGeneratorDelegate(inner, awaitWrap) {
|
||||
var iter = {}, waiting = false;
|
||||
|
||||
@@ -237,7 +244,7 @@ helpers.asyncGeneratorDelegate = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.asyncToGenerator = () => template.program.ast`
|
||||
helpers.asyncToGenerator = helper("7.0.0-beta.0")`
|
||||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||||
try {
|
||||
var info = gen[key](arg);
|
||||
@@ -272,7 +279,7 @@ helpers.asyncToGenerator = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.classCallCheck = () => template.program.ast`
|
||||
helpers.classCallCheck = helper("7.0.0-beta.0")`
|
||||
export default function _classCallCheck(instance, Constructor) {
|
||||
if (!(instance instanceof Constructor)) {
|
||||
throw new TypeError("Cannot call a class as a function");
|
||||
@@ -280,7 +287,7 @@ helpers.classCallCheck = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.createClass = () => template.program.ast`
|
||||
helpers.createClass = helper("7.0.0-beta.0")`
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i ++) {
|
||||
var descriptor = props[i];
|
||||
@@ -298,7 +305,7 @@ helpers.createClass = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.defineEnumerableProperties = () => template.program.ast`
|
||||
helpers.defineEnumerableProperties = helper("7.0.0-beta.0")`
|
||||
export default function _defineEnumerableProperties(obj, descs) {
|
||||
for (var key in descs) {
|
||||
var desc = descs[key];
|
||||
@@ -324,7 +331,7 @@ helpers.defineEnumerableProperties = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.defaults = () => template.program.ast`
|
||||
helpers.defaults = helper("7.0.0-beta.0")`
|
||||
export default function _defaults(obj, defaults) {
|
||||
var keys = Object.getOwnPropertyNames(defaults);
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
@@ -338,7 +345,7 @@ helpers.defaults = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.defineProperty = () => template.program.ast`
|
||||
helpers.defineProperty = helper("7.0.0-beta.0")`
|
||||
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
|
||||
@@ -359,7 +366,7 @@ helpers.defineProperty = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.extends = () => template.program.ast`
|
||||
helpers.extends = helper("7.0.0-beta.0")`
|
||||
export default function _extends() {
|
||||
_extends = Object.assign || function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
@@ -377,7 +384,7 @@ helpers.extends = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.objectSpread = () => template.program.ast`
|
||||
helpers.objectSpread = helper("7.0.0-beta.0")`
|
||||
import defineProperty from "defineProperty";
|
||||
|
||||
export default function _objectSpread(target) {
|
||||
@@ -397,7 +404,7 @@ helpers.objectSpread = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.inherits = () => template.program.ast`
|
||||
helpers.inherits = helper("7.0.0-beta.0")`
|
||||
import setPrototypeOf from "setPrototypeOf";
|
||||
|
||||
export default function _inherits(subClass, superClass) {
|
||||
@@ -415,7 +422,7 @@ helpers.inherits = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.inheritsLoose = () => template.program.ast`
|
||||
helpers.inheritsLoose = helper("7.0.0-beta.0")`
|
||||
export default function _inheritsLoose(subClass, superClass) {
|
||||
subClass.prototype = Object.create(superClass.prototype);
|
||||
subClass.prototype.constructor = subClass;
|
||||
@@ -423,7 +430,7 @@ helpers.inheritsLoose = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.getPrototypeOf = () => template.program.ast`
|
||||
helpers.getPrototypeOf = helper("7.0.0-beta.0")`
|
||||
export default function _getPrototypeOf(o) {
|
||||
_getPrototypeOf = Object.setPrototypeOf
|
||||
? Object.getPrototypeOf
|
||||
@@ -434,7 +441,7 @@ helpers.getPrototypeOf = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.setPrototypeOf = () => template.program.ast`
|
||||
helpers.setPrototypeOf = helper("7.0.0-beta.0")`
|
||||
export default function _setPrototypeOf(o, p) {
|
||||
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
||||
o.__proto__ = p;
|
||||
@@ -444,7 +451,7 @@ helpers.setPrototypeOf = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.construct = () => template.program.ast`
|
||||
helpers.construct = helper("7.0.0-beta.0")`
|
||||
import setPrototypeOf from "setPrototypeOf";
|
||||
|
||||
function isNativeReflectConstruct() {
|
||||
@@ -492,7 +499,7 @@ helpers.construct = () => template.program.ast`
|
||||
`;
|
||||
|
||||
// Based on https://github.com/WebReflection/babel-plugin-transform-builtin-classes
|
||||
helpers.wrapNativeSuper = () => template.program.ast`
|
||||
helpers.wrapNativeSuper = helper("7.0.0-beta.0")`
|
||||
import getPrototypeOf from "getPrototypeOf";
|
||||
import setPrototypeOf from "setPrototypeOf";
|
||||
import construct from "construct";
|
||||
@@ -528,7 +535,7 @@ helpers.wrapNativeSuper = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.instanceof = () => template.program.ast`
|
||||
helpers.instanceof = helper("7.0.0-beta.0")`
|
||||
export default function _instanceof(left, right) {
|
||||
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
||||
return right[Symbol.hasInstance](left);
|
||||
@@ -538,13 +545,13 @@ helpers.instanceof = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.interopRequireDefault = () => template.program.ast`
|
||||
helpers.interopRequireDefault = helper("7.0.0-beta.0")`
|
||||
export default function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : { default: obj };
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.interopRequireWildcard = () => template.program.ast`
|
||||
helpers.interopRequireWildcard = helper("7.0.0-beta.0")`
|
||||
export default function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
@@ -570,7 +577,7 @@ helpers.interopRequireWildcard = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.newArrowCheck = () => template.program.ast`
|
||||
helpers.newArrowCheck = helper("7.0.0-beta.0")`
|
||||
export default function _newArrowCheck(innerThis, boundThis) {
|
||||
if (innerThis !== boundThis) {
|
||||
throw new TypeError("Cannot instantiate an arrow function");
|
||||
@@ -578,13 +585,13 @@ helpers.newArrowCheck = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.objectDestructuringEmpty = () => template.program.ast`
|
||||
helpers.objectDestructuringEmpty = helper("7.0.0-beta.0")`
|
||||
export default function _objectDestructuringEmpty(obj) {
|
||||
if (obj == null) throw new TypeError("Cannot destructure undefined");
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.objectWithoutPropertiesLoose = () => template.program.ast`
|
||||
helpers.objectWithoutPropertiesLoose = helper("7.0.0-beta.0")`
|
||||
export default function _objectWithoutPropertiesLoose(source, excluded) {
|
||||
if (source == null) return {};
|
||||
|
||||
@@ -602,7 +609,7 @@ helpers.objectWithoutPropertiesLoose = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.objectWithoutProperties = () => template.program.ast`
|
||||
helpers.objectWithoutProperties = helper("7.0.0-beta.0")`
|
||||
import objectWithoutPropertiesLoose from "objectWithoutPropertiesLoose";
|
||||
|
||||
export default function _objectWithoutProperties(source, excluded) {
|
||||
@@ -625,7 +632,7 @@ helpers.objectWithoutProperties = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.assertThisInitialized = () => template.program.ast`
|
||||
helpers.assertThisInitialized = helper("7.0.0-beta.0")`
|
||||
export default function _assertThisInitialized(self) {
|
||||
if (self === void 0) {
|
||||
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||||
@@ -634,7 +641,7 @@ helpers.assertThisInitialized = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.possibleConstructorReturn = () => template.program.ast`
|
||||
helpers.possibleConstructorReturn = helper("7.0.0-beta.0")`
|
||||
import assertThisInitialized from "assertThisInitialized";
|
||||
|
||||
export default function _possibleConstructorReturn(self, call) {
|
||||
@@ -645,7 +652,7 @@ helpers.possibleConstructorReturn = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.superPropBase = () => template.program.ast`
|
||||
helpers.superPropBase = helper("7.0.0-beta.0")`
|
||||
import getPrototypeOf from "getPrototypeOf";
|
||||
|
||||
export default function _superPropBase(object, property) {
|
||||
@@ -658,7 +665,7 @@ helpers.superPropBase = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.get = () => template.program.ast`
|
||||
helpers.get = helper("7.0.0-beta.0")`
|
||||
import getPrototypeOf from "getPrototypeOf";
|
||||
import superPropBase from "superPropBase";
|
||||
|
||||
@@ -683,7 +690,7 @@ helpers.get = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.set = () => template.program.ast`
|
||||
helpers.set = helper("7.0.0-beta.0")`
|
||||
import getPrototypeOf from "getPrototypeOf";
|
||||
import superPropBase from "superPropBase";
|
||||
import defineProperty from "defineProperty";
|
||||
@@ -741,7 +748,7 @@ helpers.set = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.taggedTemplateLiteral = () => template.program.ast`
|
||||
helpers.taggedTemplateLiteral = helper("7.0.0-beta.0")`
|
||||
export default function _taggedTemplateLiteral(strings, raw) {
|
||||
if (!raw) { raw = strings.slice(0); }
|
||||
return Object.freeze(Object.defineProperties(strings, {
|
||||
@@ -750,7 +757,7 @@ helpers.taggedTemplateLiteral = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.taggedTemplateLiteralLoose = () => template.program.ast`
|
||||
helpers.taggedTemplateLiteralLoose = helper("7.0.0-beta.0")`
|
||||
export default function _taggedTemplateLiteralLoose(strings, raw) {
|
||||
if (!raw) { raw = strings.slice(0); }
|
||||
strings.raw = raw;
|
||||
@@ -758,7 +765,7 @@ helpers.taggedTemplateLiteralLoose = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.temporalRef = () => template.program.ast`
|
||||
helpers.temporalRef = helper("7.0.0-beta.0")`
|
||||
import undef from "temporalUndefined";
|
||||
|
||||
export default function _temporalRef(val, name) {
|
||||
@@ -770,23 +777,23 @@ helpers.temporalRef = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.readOnlyError = () => template.program.ast`
|
||||
helpers.readOnlyError = helper("7.0.0-beta.0")`
|
||||
export default function _readOnlyError(name) {
|
||||
throw new Error("\\"" + name + "\\" is read-only");
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.classNameTDZError = () => template.program.ast`
|
||||
helpers.classNameTDZError = helper("7.0.0-beta.0")`
|
||||
export default function _classNameTDZError(name) {
|
||||
throw new Error("Class \\"" + name + "\\" cannot be referenced in computed property keys.");
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.temporalUndefined = () => template.program.ast`
|
||||
helpers.temporalUndefined = helper("7.0.0-beta.0")`
|
||||
export default {};
|
||||
`;
|
||||
|
||||
helpers.slicedToArray = () => template.program.ast`
|
||||
helpers.slicedToArray = helper("7.0.0-beta.0")`
|
||||
import arrayWithHoles from "arrayWithHoles";
|
||||
import iterableToArrayLimit from "iterableToArrayLimit";
|
||||
import nonIterableRest from "nonIterableRest";
|
||||
@@ -796,7 +803,7 @@ helpers.slicedToArray = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.slicedToArrayLoose = () => template.program.ast`
|
||||
helpers.slicedToArrayLoose = helper("7.0.0-beta.0")`
|
||||
import arrayWithHoles from "arrayWithHoles";
|
||||
import iterableToArrayLimitLoose from "iterableToArrayLimitLoose";
|
||||
import nonIterableRest from "nonIterableRest";
|
||||
@@ -806,7 +813,7 @@ helpers.slicedToArrayLoose = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.toArray = () => template.program.ast`
|
||||
helpers.toArray = helper("7.0.0-beta.0")`
|
||||
import arrayWithHoles from "arrayWithHoles";
|
||||
import iterableToArray from "iterableToArray";
|
||||
import nonIterableRest from "nonIterableRest";
|
||||
@@ -816,7 +823,7 @@ helpers.toArray = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.toConsumableArray = () => template.program.ast`
|
||||
helpers.toConsumableArray = helper("7.0.0-beta.0")`
|
||||
import arrayWithoutHoles from "arrayWithoutHoles";
|
||||
import iterableToArray from "iterableToArray";
|
||||
import nonIterableSpread from "nonIterableSpread";
|
||||
@@ -826,7 +833,7 @@ helpers.toConsumableArray = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.arrayWithoutHoles = () => template.program.ast`
|
||||
helpers.arrayWithoutHoles = helper("7.0.0-beta.0")`
|
||||
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];
|
||||
@@ -835,13 +842,13 @@ helpers.arrayWithoutHoles = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.arrayWithHoles = () => template.program.ast`
|
||||
helpers.arrayWithHoles = helper("7.0.0-beta.0")`
|
||||
export default function _arrayWithHoles(arr) {
|
||||
if (Array.isArray(arr)) return arr;
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.iterableToArray = () => template.program.ast`
|
||||
helpers.iterableToArray = helper("7.0.0-beta.0")`
|
||||
export default function _iterableToArray(iter) {
|
||||
if (
|
||||
Symbol.iterator in Object(iter) ||
|
||||
@@ -850,7 +857,7 @@ helpers.iterableToArray = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.iterableToArrayLimit = () => template.program.ast`
|
||||
helpers.iterableToArrayLimit = helper("7.0.0-beta.0")`
|
||||
export default function _iterableToArrayLimit(arr, i) {
|
||||
// this is an expanded form of \`for...of\` that properly supports abrupt completions of
|
||||
// iterators etc. variable names have been minimised to reduce the size of this massive
|
||||
@@ -885,7 +892,7 @@ helpers.iterableToArrayLimit = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.iterableToArrayLimitLoose = () => template.program.ast`
|
||||
helpers.iterableToArrayLimitLoose = helper("7.0.0-beta.0")`
|
||||
export default function _iterableToArrayLimitLoose(arr, i) {
|
||||
var _arr = [];
|
||||
for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
|
||||
@@ -896,19 +903,19 @@ helpers.iterableToArrayLimitLoose = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.nonIterableSpread = () => template.program.ast`
|
||||
helpers.nonIterableSpread = helper("7.0.0-beta.0")`
|
||||
export default function _nonIterableSpread() {
|
||||
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.nonIterableRest = () => template.program.ast`
|
||||
helpers.nonIterableRest = helper("7.0.0-beta.0")`
|
||||
export default function _nonIterableRest() {
|
||||
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.skipFirstGeneratorNext = () => template.program.ast`
|
||||
helpers.skipFirstGeneratorNext = helper("7.0.0-beta.0")`
|
||||
export default function _skipFirstGeneratorNext(fn) {
|
||||
return function () {
|
||||
var it = fn.apply(this, arguments);
|
||||
@@ -918,7 +925,7 @@ helpers.skipFirstGeneratorNext = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.toPropertyKey = () => template.program.ast`
|
||||
helpers.toPropertyKey = helper("7.0.0-beta.0")`
|
||||
export default function _toPropertyKey(key) {
|
||||
if (typeof key === "symbol") {
|
||||
return key;
|
||||
@@ -932,7 +939,7 @@ helpers.toPropertyKey = () => template.program.ast`
|
||||
* 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 = () => template.program.ast`
|
||||
helpers.initializerWarningHelper = helper("7.0.0-beta.0")`
|
||||
export default function _initializerWarningHelper(descriptor, context){
|
||||
throw new Error(
|
||||
'Decorating class property failed. Please ensure that ' +
|
||||
@@ -946,7 +953,7 @@ helpers.initializerWarningHelper = () => template.program.ast`
|
||||
/**
|
||||
* Add a helper to call as a replacement for class property definition.
|
||||
*/
|
||||
helpers.initializerDefineProperty = () => template.program.ast`
|
||||
helpers.initializerDefineProperty = helper("7.0.0-beta.0")`
|
||||
export default function _initializerDefineProperty(target, property, descriptor, context){
|
||||
if (!descriptor) return;
|
||||
|
||||
@@ -963,7 +970,7 @@ helpers.initializerDefineProperty = () => template.program.ast`
|
||||
* Add a helper to take an initial descriptor, apply some decorators to it, and optionally
|
||||
* define the property.
|
||||
*/
|
||||
helpers.applyDecoratedDescriptor = () => template.program.ast`
|
||||
helpers.applyDecoratedDescriptor = helper("7.0.0-beta.0")`
|
||||
export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context){
|
||||
var desc = {};
|
||||
Object['ke' + 'ys'](descriptor).forEach(function(key){
|
||||
@@ -995,14 +1002,14 @@ helpers.applyDecoratedDescriptor = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.classPrivateFieldLooseKey = () => template.program.ast`
|
||||
helpers.classPrivateFieldLooseKey = helper("7.0.0-beta.0")`
|
||||
var id = 0;
|
||||
export default function _classPrivateFieldKey(name) {
|
||||
return "__private_" + (id++) + "_" + name;
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.classPrivateFieldLooseBase = () => template.program.ast`
|
||||
helpers.classPrivateFieldLooseBase = helper("7.0.0-beta.0")`
|
||||
export default function _classPrivateFieldBase(receiver, privateKey) {
|
||||
if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
|
||||
throw new TypeError("attempted to use private field on non-instance");
|
||||
@@ -1011,21 +1018,28 @@ helpers.classPrivateFieldLooseBase = () => template.program.ast`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.classPrivateFieldGet = () => template.program.ast`
|
||||
helpers.classPrivateFieldGet = helper("7.0.0-beta.0")`
|
||||
export default function _classPrivateFieldGet(receiver, privateMap) {
|
||||
if (!privateMap.has(receiver)) {
|
||||
throw new TypeError("attempted to get private field on non-instance");
|
||||
}
|
||||
return privateMap.get(receiver);
|
||||
return privateMap.get(receiver).value;
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.classPrivateFieldSet = () => template.program.ast`
|
||||
helpers.classPrivateFieldSet = helper("7.0.0-beta.0")`
|
||||
export default function _classPrivateFieldSet(receiver, privateMap, value) {
|
||||
if (!privateMap.has(receiver)) {
|
||||
throw new TypeError("attempted to set private field on non-instance");
|
||||
}
|
||||
privateMap.set(receiver, value);
|
||||
var descriptor = privateMap.get(receiver);
|
||||
if (!descriptor.writable) {
|
||||
// This should only throw in strict mode, but class bodies are
|
||||
// always strict and private fields can only be used inside
|
||||
// class bodies.
|
||||
throw new TypeError("attempted to set read only private field");
|
||||
}
|
||||
descriptor.value = value;
|
||||
return value;
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -226,13 +226,19 @@ function permuteHelperAST(file, metadata, id, localBindings, getDependency) {
|
||||
});
|
||||
}
|
||||
|
||||
const helperData = {};
|
||||
const helperData = Object.create(null);
|
||||
function loadHelper(name) {
|
||||
if (!helperData[name]) {
|
||||
if (!helpers[name]) throw new ReferenceError(`Unknown helper ${name}`);
|
||||
const helper = helpers[name];
|
||||
if (!helper) {
|
||||
throw Object.assign(new ReferenceError(`Unknown helper ${name}`), {
|
||||
code: "BABEL_HELPER_UNKNOWN",
|
||||
helper: name,
|
||||
});
|
||||
}
|
||||
|
||||
const fn = () => {
|
||||
return t.file(helpers[name]());
|
||||
return t.file(helper.ast());
|
||||
};
|
||||
|
||||
const metadata = getHelperMetadata(fn());
|
||||
@@ -247,6 +253,9 @@ function loadHelper(name) {
|
||||
globals: metadata.globals,
|
||||
};
|
||||
},
|
||||
minVersion() {
|
||||
return helper.minVersion;
|
||||
},
|
||||
dependencies: metadata.dependencies,
|
||||
};
|
||||
}
|
||||
@@ -263,6 +272,10 @@ export function get(
|
||||
return loadHelper(name).build(getDependency, id, localBindings);
|
||||
}
|
||||
|
||||
export function minVersion(name: string) {
|
||||
return loadHelper(name).minVersion();
|
||||
}
|
||||
|
||||
export function getDependencies(name: string): $ReadOnlyArray<string> {
|
||||
return Array.from(loadHelper(name).dependencies.values());
|
||||
}
|
||||
|
||||
@@ -17,7 +17,10 @@ export default function defineHelper(
|
||||
throw new Error(`The ${id} helper is already defined.`);
|
||||
}
|
||||
Object.defineProperty(helpers, id, {
|
||||
value: template.program(code),
|
||||
value: {
|
||||
minVersion: "7.0.0-beta.0",
|
||||
ast: template.program(code),
|
||||
},
|
||||
});
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/highlight",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Syntax highlight JavaScript strings for output in terminals.",
|
||||
"author": "suchipi <me@suchipi.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/node",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "Babel command line",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -16,11 +16,11 @@
|
||||
"compiler"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/polyfill": "7.0.0-beta.54",
|
||||
"@babel/register": "7.0.0-beta.54",
|
||||
"@babel/polyfill": "7.0.0-beta.56",
|
||||
"@babel/register": "7.0.0-beta.56",
|
||||
"commander": "^2.8.1",
|
||||
"fs-readdir-recursive": "^1.0.0",
|
||||
"lodash": "^4.17.5",
|
||||
"lodash": "^4.17.10",
|
||||
"output-file-sync": "^2.0.0",
|
||||
"v8flags": "^3.1.1"
|
||||
},
|
||||
@@ -28,8 +28,8 @@
|
||||
"@babel/core": ">=7.0.0-beta.50 <7.0.0-rc.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.0.0-beta.54",
|
||||
"@babel/helper-fixtures": "7.0.0-beta.54"
|
||||
"@babel/core": "7.0.0-beta.56",
|
||||
"@babel/helper-fixtures": "7.0.0-beta.56"
|
||||
},
|
||||
"bin": {
|
||||
"babel-node": "./bin/babel-node.js"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/parser",
|
||||
"version": "7.0.0-beta.54",
|
||||
"version": "7.0.0-beta.56",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -23,7 +23,7 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-fixtures": "7.0.0-beta.54",
|
||||
"@babel/helper-fixtures": "7.0.0-beta.56",
|
||||
"charcodes": "0.1.0",
|
||||
"unicode-11.0.0": "^0.7.7"
|
||||
},
|
||||
|
||||
@@ -563,22 +563,41 @@ export default class ExpressionParser extends LValParser {
|
||||
}
|
||||
return node;
|
||||
} else if (this.match(tt.backQuote)) {
|
||||
const node = this.startNodeAt(startPos, startLoc);
|
||||
node.tag = base;
|
||||
node.quasi = this.parseTemplate(true);
|
||||
if (state.optionalChainMember) {
|
||||
this.raise(
|
||||
startPos,
|
||||
"Tagged Template Literals are not allowed in optionalChain",
|
||||
);
|
||||
}
|
||||
return this.finishNode(node, "TaggedTemplateExpression");
|
||||
return this.parseTaggedTemplateExpression(
|
||||
startPos,
|
||||
startLoc,
|
||||
base,
|
||||
state,
|
||||
);
|
||||
} else {
|
||||
state.stop = true;
|
||||
return base;
|
||||
}
|
||||
}
|
||||
|
||||
parseTaggedTemplateExpression(
|
||||
startPos: number,
|
||||
startLoc: Position,
|
||||
base: N.Expression,
|
||||
state: N.ParseSubscriptState,
|
||||
typeArguments?: ?N.TsTypeParameterInstantiation,
|
||||
): N.TaggedTemplateExpression {
|
||||
const node: N.TaggedTemplateExpression = this.startNodeAt(
|
||||
startPos,
|
||||
startLoc,
|
||||
);
|
||||
node.tag = base;
|
||||
node.quasi = this.parseTemplate(true);
|
||||
if (typeArguments) node.typeParameters = typeArguments;
|
||||
if (state.optionalChainMember) {
|
||||
this.raise(
|
||||
startPos,
|
||||
"Tagged Template Literals are not allowed in optionalChain",
|
||||
);
|
||||
}
|
||||
return this.finishNode(node, "TaggedTemplateExpression");
|
||||
}
|
||||
|
||||
atPossibleAsync(base: N.Expression): boolean {
|
||||
return (
|
||||
!this.state.containsEsc &&
|
||||
@@ -964,7 +983,7 @@ export default class ExpressionParser extends LValParser {
|
||||
} else if (!this.hasPlugin("importMeta")) {
|
||||
this.raise(
|
||||
id.start,
|
||||
`Dynamic imports require a parameter: import('a.js').then`,
|
||||
`Dynamic imports require a parameter: import('a.js')`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -463,7 +463,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
} while (this.eat(tt.comma));
|
||||
}
|
||||
|
||||
node.body = this.flowParseObjectType(true, false, false, isClass);
|
||||
node.body = this.flowParseObjectType(isClass, false, false, isClass);
|
||||
}
|
||||
|
||||
flowParseInterfaceExtends(): N.FlowInterfaceExtends {
|
||||
@@ -656,7 +656,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
} while (this.eat(tt.comma));
|
||||
}
|
||||
|
||||
node.body = this.flowParseObjectType(true, false, false, false);
|
||||
node.body = this.flowParseObjectType(false, false, false, false);
|
||||
|
||||
return this.finishNode(node, "InterfaceTypeAnnotation");
|
||||
}
|
||||
@@ -1917,6 +1917,15 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
return super.parseClassProperty(node);
|
||||
}
|
||||
|
||||
parseClassPrivateProperty(
|
||||
node: N.ClassPrivateProperty,
|
||||
): N.ClassPrivateProperty {
|
||||
if (this.match(tt.colon)) {
|
||||
node.typeAnnotation = this.flowParseTypeAnnotation();
|
||||
}
|
||||
return super.parseClassPrivateProperty(node);
|
||||
}
|
||||
|
||||
// determine whether or not we're currently in the position where a class method would appear
|
||||
isClassMethod(): boolean {
|
||||
return this.isRelational("<") || super.isClassMethod();
|
||||
|
||||
@@ -836,16 +836,6 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
return this.finishNode(node, "TSTypeAssertion");
|
||||
}
|
||||
|
||||
tsTryParseTypeArgumentsInExpression(
|
||||
eatNextToken: boolean,
|
||||
): ?N.TsTypeParameterInstantiation {
|
||||
return this.tsTryParseAndCatch(() => {
|
||||
const res = this.tsParseTypeArguments();
|
||||
if (eatNextToken) this.expect(tt.parenL);
|
||||
return res;
|
||||
});
|
||||
}
|
||||
|
||||
tsParseHeritageClause(): $ReadOnlyArray<N.TsExpressionWithTypeArguments> {
|
||||
return this.tsParseDelimitedList(
|
||||
"HeritageClauseElement",
|
||||
@@ -1376,38 +1366,53 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
return this.finishNode(nonNullExpression, "TSNonNullExpression");
|
||||
}
|
||||
|
||||
if (!noCalls && this.isRelational("<")) {
|
||||
if (this.atPossibleAsync(base)) {
|
||||
// Almost certainly this is a generic async function `async <T>() => ...
|
||||
// But it might be a call with a type argument `async<T>();`
|
||||
const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(
|
||||
startPos,
|
||||
startLoc,
|
||||
);
|
||||
if (asyncArrowFn) {
|
||||
return asyncArrowFn;
|
||||
// There are number of things we are going to "maybe" parse, like type arguments on
|
||||
// tagged template expressions. If any of them fail, walk it back and continue.
|
||||
const result = this.tsTryParseAndCatch(() => {
|
||||
if (this.isRelational("<")) {
|
||||
if (!noCalls && this.atPossibleAsync(base)) {
|
||||
// Almost certainly this is a generic async function `async <T>() => ...
|
||||
// But it might be a call with a type argument `async<T>();`
|
||||
const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(
|
||||
startPos,
|
||||
startLoc,
|
||||
);
|
||||
if (asyncArrowFn) {
|
||||
return asyncArrowFn;
|
||||
}
|
||||
}
|
||||
|
||||
const node: N.CallExpression = this.startNodeAt(startPos, startLoc);
|
||||
node.callee = base;
|
||||
|
||||
const typeArguments = this.tsParseTypeArguments();
|
||||
|
||||
if (typeArguments) {
|
||||
if (!noCalls && this.eat(tt.parenL)) {
|
||||
// possibleAsync always false here, because we would have handled it above.
|
||||
// $FlowIgnore (won't be any undefined arguments)
|
||||
node.arguments = this.parseCallExpressionArguments(
|
||||
tt.parenR,
|
||||
/* possibleAsync */ false,
|
||||
);
|
||||
node.typeParameters = typeArguments;
|
||||
return this.finishCallExpression(node);
|
||||
} else if (this.match(tt.backQuote)) {
|
||||
return this.parseTaggedTemplateExpression(
|
||||
startPos,
|
||||
startLoc,
|
||||
base,
|
||||
state,
|
||||
typeArguments,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const node: N.CallExpression = this.startNodeAt(startPos, startLoc);
|
||||
node.callee = base;
|
||||
this.unexpected();
|
||||
});
|
||||
|
||||
// May be passing type arguments. But may just be the `<` operator.
|
||||
// Note: With `/*eatNextToken*/ true` this also eats the `(` following the type arguments
|
||||
const typeArguments = this.tsTryParseTypeArgumentsInExpression(
|
||||
/*eatNextToken*/ true,
|
||||
);
|
||||
if (typeArguments) {
|
||||
// possibleAsync always false here, because we would have handled it above.
|
||||
// $FlowIgnore (won't be any undefined arguments)
|
||||
node.arguments = this.parseCallExpressionArguments(
|
||||
tt.parenR,
|
||||
/* possibleAsync */ false,
|
||||
);
|
||||
node.typeParameters = typeArguments;
|
||||
return this.finishCallExpression(node);
|
||||
}
|
||||
}
|
||||
if (result) return result;
|
||||
|
||||
return super.parseSubscript(base, startPos, startLoc, noCalls, state);
|
||||
}
|
||||
@@ -1530,6 +1535,17 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
cls.abstract = true;
|
||||
return cls;
|
||||
}
|
||||
|
||||
// export default interface allowed in:
|
||||
// https://github.com/Microsoft/TypeScript/pull/16040
|
||||
if (this.state.value === "interface") {
|
||||
return this.tsParseDeclaration(
|
||||
this.startNode(),
|
||||
this.state.value,
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
return super.parseExportDefaultExpression();
|
||||
}
|
||||
|
||||
@@ -2127,8 +2143,8 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
jsxParseOpeningElementAfterName(
|
||||
node: N.JSXOpeningElement,
|
||||
): N.JSXOpeningElement {
|
||||
const typeArguments = this.tsTryParseTypeArgumentsInExpression(
|
||||
/*eatNextToken*/ false,
|
||||
const typeArguments = this.tsTryParseAndCatch(() =>
|
||||
this.tsParseTypeArguments(),
|
||||
);
|
||||
if (typeArguments) node.typeParameters = typeArguments;
|
||||
return super.jsxParseOpeningElementAfterName(node);
|
||||
|
||||
@@ -577,6 +577,7 @@ export type TaggedTemplateExpression = NodeBase & {
|
||||
type: "TaggedTemplateExpression",
|
||||
tag: Expression,
|
||||
quasi: TemplateLiteral,
|
||||
typeParameters?: ?TypeParameterInstantiationBase, // TODO: Not in spec
|
||||
};
|
||||
|
||||
export type TemplateElement = NodeBase & {
|
||||
@@ -716,6 +717,7 @@ export type ClassPrivateProperty = NodeBase & {
|
||||
value: ?Expression, // TODO: Not in spec that this is nullable.
|
||||
static: boolean,
|
||||
computed: false,
|
||||
typeAnnotation?: ?TypeAnnotation, // TODO: Not in spec
|
||||
};
|
||||
|
||||
export type OptClassDeclaration = ClassBase &
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Dynamic imports require a parameter: import('a.js').then (2:9)"
|
||||
"throws": "Dynamic imports require a parameter: import('a.js') (2:9)"
|
||||
}
|
||||
|
||||
4
packages/babel-parser/test/fixtures/flow/class-private-property/1/input.js
vendored
Normal file
4
packages/babel-parser/test/fixtures/flow/class-private-property/1/input.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
class A {
|
||||
#prop1: string;
|
||||
#prop2: number = value;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user