Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e5f2dc929 | ||
|
|
2b082601a7 | ||
|
|
70c0ed512a | ||
|
|
8c2ed89aaa | ||
|
|
e315d65a7a | ||
|
|
0287c0f02f | ||
|
|
c2bace4b73 | ||
|
|
35f4d12763 | ||
|
|
9082e68d6f | ||
|
|
bdb4318f47 | ||
|
|
3ab035bab6 | ||
|
|
2cd5ad0c80 | ||
|
|
2640e5a27c | ||
|
|
0f949990c3 | ||
|
|
f544753bb8 | ||
|
|
d3db02da30 | ||
|
|
42c8e0fb2f | ||
|
|
bf48fca6a0 | ||
|
|
f8eb290da1 | ||
|
|
5f2240e7ab |
123
CHANGELOG.md
123
CHANGELOG.md
@@ -17,6 +17,129 @@ See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0
|
||||
|
||||
<!-- DO NOT CHANGE THESE COMMENTS - See .github/actions/trigger-github-release/update-changelog.js -->
|
||||
<!-- insert-new-changelog-here -->
|
||||
## v7.7.3 (2019-11-08)
|
||||
|
||||
#### :bug: Bug Fix
|
||||
* `babel-parser`
|
||||
* [#10682](https://github.com/babel/babel/pull/10682) Don't recover from "adjacent jsx elements" parser error ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
## v7.7.2 (2019-11-07)
|
||||
|
||||
#### :bug: Bug Fix
|
||||
* `babel-parser`
|
||||
* [#10669](https://github.com/babel/babel/pull/10669) Parse arrows with params annotations in conditional expressions ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* `babel-plugin-transform-typescript`
|
||||
* [#10658](https://github.com/babel/babel/pull/10658) fix: remove accessibility of constructor ([@JLHwung](https://github.com/JLHwung))
|
||||
* `babel-traverse`
|
||||
* [#10656](https://github.com/babel/babel/pull/10656) fix: add inList setter for compatibility with babel-minify ([@JLHwung](https://github.com/JLHwung))
|
||||
## v7.7.1 (2019-11-05)
|
||||
|
||||
#### :bug: Bug Fix
|
||||
* `babel-types`
|
||||
* [#10650](https://github.com/babel/babel/pull/10650) Revert "throw a TypeError if identifier validation fails (#10621)" ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* `babel-preset-env`
|
||||
* [#10649](https://github.com/babel/babel/pull/10649) Fix(babel-preset-env): check api.caller is a function to avoid to thr… ([@love2me](https://github.com/love2me))
|
||||
|
||||
## v7.7.0 (2019-11-05)
|
||||
|
||||
#### :eyeglasses: Spec Compliance
|
||||
* `babel-types`
|
||||
* [#10621](https://github.com/babel/babel/pull/10621) throw a TypeError if identifier validation fails. ([@dentrado](https://github.com/dentrado))
|
||||
* `babel-parser`
|
||||
* [#10559](https://github.com/babel/babel/pull/10559) fix: Exclude catch clause from let identifier error. ([@gonzarodriguezt](https://github.com/gonzarodriguezt))
|
||||
* [#10567](https://github.com/babel/babel/pull/10567) [parser] Exception to 8 and 9 in tagged template. ([@pnowak](https://github.com/pnowak))
|
||||
* [#10532](https://github.com/babel/babel/pull/10532) Allow duplicate __proto__ keys in patterns, simple case (#6705). ([@alejo90](https://github.com/alejo90))
|
||||
|
||||
#### :rocket: New Feature
|
||||
* `babel-generator`, `babel-helper-create-class-features-plugin`, `babel-parser`, `babel-plugin-transform-typescript`, `babel-preset-typescript`, `babel-types`
|
||||
* [#10545](https://github.com/babel/babel/pull/10545) Add support for TS declare modifier on fields. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* `babel-core`, `babel-parser`, `babel-preset-typescript`
|
||||
* [#10363](https://github.com/babel/babel/pull/10363) @babel/parser error recovery. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* `babel-core`
|
||||
* [#10599](https://github.com/babel/babel/pull/10599) Add support for .cjs config files. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* [#10501](https://github.com/babel/babel/pull/10501) Add support for babel.config.json. ([@devongovett](https://github.com/devongovett))
|
||||
* [#10361](https://github.com/babel/babel/pull/10361) feat: if code frame error is on a single line, highlight the whole path. ([@SimenB](https://github.com/SimenB))
|
||||
* `babel-plugin-syntax-top-level-await`, `babel-preset-env`
|
||||
* [#10573](https://github.com/babel/babel/pull/10573) Create @babel/plugin-syntax-top-level-await. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* `babel-helper-builder-react-jsx`, `babel-plugin-transform-react-jsx`, `babel-preset-react`
|
||||
* [#10572](https://github.com/babel/babel/pull/10572) [transform-react-jsx] Add useSpread option to transform JSX. ([@ivandevp](https://github.com/ivandevp))
|
||||
* `babel-generator`, `babel-parser`, `babel-plugin-proposal-decorators`, `babel-plugin-syntax-flow`, `babel-types`
|
||||
* [#10344](https://github.com/babel/babel/pull/10344) Flow enums parsing. ([@gkz](https://github.com/gkz))
|
||||
* `babel-plugin-transform-function-name`, `babel-plugin-transform-modules-umd`, `babel-preset-env`
|
||||
* [#10477](https://github.com/babel/babel/pull/10477) Changes UMD callsite to be more likely to pass in the intended object.. ([@MicahZoltu](https://github.com/MicahZoltu))
|
||||
* `babel-parser`
|
||||
* [#10449](https://github.com/babel/babel/pull/10449) Create parser plugin "topLevelAwait". ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* [#10521](https://github.com/babel/babel/pull/10521) [parser] Enable "exportNamespaceFrom" by default. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* [#10483](https://github.com/babel/babel/pull/10483) [parser] Add support for private fields in TypeScript. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* `babel-generator`, `babel-parser`, `babel-types`
|
||||
* [#10543](https://github.com/babel/babel/pull/10543) add assertions signature for TypeScript. ([@tanhauhau](https://github.com/tanhauhau))
|
||||
* `babel-cli`, `babel-register`
|
||||
* [#8622](https://github.com/babel/babel/pull/8622) Make dir for babel --out-file. ([@TrySound](https://github.com/TrySound))
|
||||
* `babel-cli`
|
||||
* [#10399](https://github.com/babel/babel/pull/10399) Closes [#8326](https://github.com/babel/babel/issues/8326), add back --quiet option.. ([@chris-peng-1244](https://github.com/chris-peng-1244))
|
||||
|
||||
#### :bug: Bug Fix
|
||||
* `babel-helpers`, `babel-plugin-proposal-async-generator-functions`, `babel-plugin-proposal-function-sent`, `babel-preset-env`
|
||||
* [#10422](https://github.com/babel/babel/pull/10422) Correctly delegate .return() in async generator. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* `babel-helper-module-transforms`, `babel-plugin-transform-modules-commonjs`
|
||||
* [#10628](https://github.com/babel/babel/pull/10628) Don't throw when destructuring into a var named as an import. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* `babel-plugin-transform-modules-systemjs`
|
||||
* [#10638](https://github.com/babel/babel/pull/10638) fix: remove ExportNamedDeclaration when the specifier is empty. ([@JLHwung](https://github.com/JLHwung))
|
||||
* `babel-parser`
|
||||
* [#10631](https://github.com/babel/babel/pull/10631) [TS] Parse calls with type args in optional chains. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* [#10607](https://github.com/babel/babel/pull/10607) fixed missing errors on assignment pattern in object expression. ([@vivek12345](https://github.com/vivek12345))
|
||||
* [#10594](https://github.com/babel/babel/pull/10594) [parser] Parse only modifiers of actual methods. ([@gonzarodriguezt](https://github.com/gonzarodriguezt))
|
||||
* `babel-plugin-transform-typescript`
|
||||
* [#10555](https://github.com/babel/babel/pull/10555) [TS] Correctly transform computed strings and templates in enums. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* `babel-core`
|
||||
* [#10623](https://github.com/babel/babel/pull/10623) Fix: inputSourceMap should work when it is an external file. ([@JLHwung](https://github.com/JLHwung))
|
||||
* [#10539](https://github.com/babel/babel/pull/10539) fix: remove filename annotation in buildCodeFrameError. ([@JLHwung](https://github.com/JLHwung))
|
||||
* `babel-plugin-proposal-decorators`
|
||||
* [#10578](https://github.com/babel/babel/pull/10578) [decorators] fix: support string literal properties. ([@mwhitworth](https://github.com/mwhitworth))
|
||||
* `babel-helpers`, `babel-plugin-proposal-dynamic-import`, `babel-plugin-transform-modules-commonjs`, `babel-preset-env`
|
||||
* [#10574](https://github.com/babel/babel/pull/10574) fix: _interopRequireWildcard should only cache objects. ([@samMeow](https://github.com/samMeow))
|
||||
* `babel-traverse`
|
||||
* [#9777](https://github.com/babel/babel/pull/9777) [traverse] Allow skipping nodes inserted with .replaceWith(). ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* `babel-preset-env`
|
||||
* [#10146](https://github.com/babel/babel/pull/10146) Inject core-js@3 imports in Program:exit instead of on post(). ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* `babel-generator`
|
||||
* [#10519](https://github.com/babel/babel/pull/10519) Fix generator missing parens around an arrow returning function type. ([@existentialism](https://github.com/existentialism))
|
||||
* `babel-plugin-transform-async-to-generator`, `babel-preset-env`, `babel-traverse`
|
||||
* [#9939](https://github.com/babel/babel/pull/9939) Don't use args rest/spread to hoist super method calls. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
|
||||
#### :nail_care: Polish
|
||||
* `babel-plugin-transform-classes`, `babel-plugin-transform-regenerator`, `babel-preset-env`
|
||||
* [#9481](https://github.com/babel/babel/pull/9481) [preset-env] Don't use async-to-generator when already using regenerator. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
* `babel-helpers`, `babel-plugin-transform-modules-commonjs`, `babel-preset-env`
|
||||
* [#10585](https://github.com/babel/babel/pull/10585) fix(babel‑helpers/interopRequireWildcard): Avoid double nullish check. ([@ExE-Boss](https://github.com/ExE-Boss))
|
||||
* `babel-register`
|
||||
* [#10557](https://github.com/babel/babel/pull/10557) fix: disable caching when babel could not read/write cache. ([@JLHwung](https://github.com/JLHwung))
|
||||
|
||||
#### :house: Internal
|
||||
* `babel-cli`, `babel-node`
|
||||
* [#10619](https://github.com/babel/babel/pull/10619) chore: remove output-file-sync dependency. ([@JLHwung](https://github.com/JLHwung))
|
||||
* `babel-register`
|
||||
* [#10614](https://github.com/babel/babel/pull/10614) chore: bump source-map-support to 0.5.14. ([@JLHwung](https://github.com/JLHwung))
|
||||
* `babel-helper-create-regexp-features-plugin`, `babel-plugin-proposal-unicode-property-regex`, `babel-plugin-transform-dotall-regex`, `babel-plugin-transform-named-capturing-groups-regex`, `babel-plugin-transform-unicode-regex`, `babel-preset-env`
|
||||
* [#10447](https://github.com/babel/babel/pull/10447) Merge multiple regex transform plugin. ([@JLHwung](https://github.com/JLHwung))
|
||||
* `babel-preset-env`
|
||||
* [#10612](https://github.com/babel/babel/pull/10612) chore: update web.immediate support fixtures. ([@JLHwung](https://github.com/JLHwung))
|
||||
* `babel-helper-module-imports`
|
||||
* [#10608](https://github.com/babel/babel/pull/10608) Use .find instead of .filter to get targetPath in ImportInjector. ([@Andarist](https://github.com/Andarist))
|
||||
* Other
|
||||
* [#10600](https://github.com/babel/babel/pull/10600) Test node@13 on circle. ([@existentialism](https://github.com/existentialism))
|
||||
* [#10593](https://github.com/babel/babel/pull/10593) chore: replace outdated travis-ci.org badges [ci skip]. ([@JLHwung](https://github.com/JLHwung))
|
||||
* [#10591](https://github.com/babel/babel/pull/10591) chore: test against Node.js 13. ([@JLHwung](https://github.com/JLHwung))
|
||||
* [#10556](https://github.com/babel/babel/pull/10556) Add master branch workflow for test262 tests. ([@jbhoosreddy](https://github.com/jbhoosreddy))
|
||||
* [#10553](https://github.com/babel/babel/pull/10553) chore: introduce envinfo into environment section. ([@JLHwung](https://github.com/JLHwung))
|
||||
* `babel-runtime`
|
||||
* [#10418](https://github.com/babel/babel/pull/10418) docs: add homepage link. ([@DanArthurGallagher](https://github.com/DanArthurGallagher))
|
||||
* `babel-helper-annotate-as-pure`, `babel-helper-bindify-decorators`, `babel-helper-builder-binary-assignment-operator-visitor`, `babel-helper-builder-react-jsx`, `babel-helper-call-delegate`, `babel-helper-define-map`, `babel-helper-explode-assignable-expression`, `babel-helper-explode-class`, `babel-helper-function-name`, `babel-helper-get-function-arity`, `babel-helper-hoist-variables`, `babel-helper-member-expression-to-functions`, `babel-helper-module-imports`, `babel-helper-module-transforms`, `babel-helper-optimise-call-expression`, `babel-helper-remap-async-to-generator`, `babel-helper-replace-supers`, `babel-helper-simple-access`, `babel-helper-split-export-declaration`, `babel-helper-wrap-function`, `babel-helpers`, `babel-template`
|
||||
* [#10568](https://github.com/babel/babel/pull/10568) Bump babel-types to ^7.6.3. ([@JLHwung](https://github.com/JLHwung))
|
||||
|
||||
#### :running_woman: Performance
|
||||
* `babel-traverse`
|
||||
* [#10480](https://github.com/babel/babel/pull/10480) Traverse performance. ([@JLHwung](https://github.com/JLHwung))
|
||||
|
||||
## v7.6.4 (2019-10-10)
|
||||
|
||||
#### :eyeglasses: Spec Compliance
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.3",
|
||||
"changelog": {
|
||||
"repo": "babel/babel",
|
||||
"cacheDir": ".changelog",
|
||||
|
||||
@@ -73,7 +73,10 @@ commander.option(
|
||||
"Do not include superfluous whitespace characters and line terminators.",
|
||||
booleanify,
|
||||
);
|
||||
commander.option("--minified", "save as much bytes when printing [true|false]");
|
||||
commander.option(
|
||||
"--minified [true|false]",
|
||||
"Save as many bytes when printing.",
|
||||
);
|
||||
commander.option(
|
||||
"--auxiliary-comment-before [string]",
|
||||
"Print a comment before any injected non-user code.",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/core",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.2",
|
||||
"description": "Babel compiler core.",
|
||||
"main": "lib/index.js",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
@@ -34,13 +34,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.5.5",
|
||||
"@babel/generator": "^7.7.0",
|
||||
"@babel/generator": "^7.7.2",
|
||||
"@babel/helpers": "^7.7.0",
|
||||
"@babel/parser": "^7.7.0",
|
||||
"@babel/parser": "^7.7.2",
|
||||
"@babel/template": "^7.7.0",
|
||||
"@babel/traverse": "^7.7.0",
|
||||
"@babel/types": "^7.7.0",
|
||||
"convert-source-map": "^1.1.0",
|
||||
"@babel/traverse": "^7.7.2",
|
||||
"@babel/types": "^7.7.2",
|
||||
"convert-source-map": "^1.7.0",
|
||||
"debug": "^4.1.0",
|
||||
"json5": "^2.1.0",
|
||||
"lodash": "^4.17.13",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/generator",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.2",
|
||||
"description": "Turns an AST into code.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -14,13 +14,13 @@
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.7.0",
|
||||
"@babel/types": "^7.7.2",
|
||||
"jsesc": "^2.5.1",
|
||||
"lodash": "^4.17.13",
|
||||
"source-map": "^0.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-fixtures": "^7.6.3",
|
||||
"@babel/parser": "^7.7.0"
|
||||
"@babel/parser": "^7.7.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ describe("generation", function() {
|
||||
|
||||
const id2 = fn.body.body[0].expression;
|
||||
id2.name += "2";
|
||||
id2.loc.identiferName = "bar";
|
||||
id2.loc.identifierName = "bar";
|
||||
|
||||
const generated = generate(
|
||||
ast,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@babel/helper-create-regexp-features-plugin",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.2",
|
||||
"author": "The Babel Team (https://babeljs.io/team)",
|
||||
"license": "MIT",
|
||||
"description": "Compile ESNext Regular Expressions to ES5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"repository": "https://github.com/babel/babel",
|
||||
"url": "https://github.com/babel/babel",
|
||||
"directory": "packages/babel-helper-create-regexp-features-plugin"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
@@ -25,7 +25,7 @@
|
||||
"@babel/core": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.7.0",
|
||||
"@babel/core": "^7.7.2",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,7 +397,7 @@ helpers.objectSpread = helper("7.0.0-beta.0")`
|
||||
export default function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = (arguments[i] != null) ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
var ownKeys = Object.keys(Object(source));
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
@@ -434,13 +434,13 @@ helpers.objectSpread2 = helper("7.5.0")`
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = (arguments[i] != null) ? arguments[i] : {};
|
||||
if (i % 2) {
|
||||
ownKeys(source, true).forEach(function (key) {
|
||||
ownKeys(Object(source), true).forEach(function (key) {
|
||||
defineProperty(target, key, source[key]);
|
||||
});
|
||||
} else if (Object.getOwnPropertyDescriptors) {
|
||||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
||||
} else {
|
||||
ownKeys(source).forEach(function (key) {
|
||||
ownKeys(Object(source)).forEach(function (key) {
|
||||
Object.defineProperty(
|
||||
target,
|
||||
key,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/parser",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.3",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
|
||||
@@ -384,7 +384,7 @@ export default class ExpressionParser extends LValParser {
|
||||
* so for ?? operator we need to check in this case the right expression to have parenthesis
|
||||
* second case a && b ?? c
|
||||
* here a && b => This is considered as a logical expression in the ast tree
|
||||
* c => identifer
|
||||
* c => identifier
|
||||
* so now here for ?? operator we need to check the left expression to have parenthesis
|
||||
* if the parenthesis is missing we raise an error and throw it
|
||||
*/
|
||||
|
||||
@@ -2061,6 +2061,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
return node.operator === "=";
|
||||
|
||||
case "ParenthesizedExpression":
|
||||
case "TypeCastExpression":
|
||||
return this.isAssignable(node.expression);
|
||||
|
||||
case "MemberExpression":
|
||||
|
||||
@@ -484,18 +484,12 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
node.closingElement = closingElement;
|
||||
}
|
||||
node.children = children;
|
||||
while (this.isRelational("<")) {
|
||||
// In case we encounter an lt token here it will always be the start of
|
||||
// jsx as the lt sign is not allowed in places that expect an expression
|
||||
this.finishToken(tt.jsxTagStart);
|
||||
|
||||
this.raise(
|
||||
if (this.isRelational("<")) {
|
||||
throw this.raise(
|
||||
this.state.start,
|
||||
"Adjacent JSX elements must be wrapped in an enclosing tag. " +
|
||||
"Did you want a JSX fragment <>...</>?",
|
||||
);
|
||||
|
||||
this.jsxParseElement();
|
||||
}
|
||||
|
||||
return isFragment(openingElement)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
test
|
||||
? (x: T): U => y
|
||||
@@ -0,0 +1,220 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "ConditionalExpression",
|
||||
"start": 0,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Identifier",
|
||||
"start": 0,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"identifierName": "test"
|
||||
},
|
||||
"name": "test"
|
||||
},
|
||||
"consequent": {
|
||||
"type": "TypeCastExpression",
|
||||
"start": 10,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start": 10,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"typeAnnotation": {
|
||||
"type": "TypeAnnotation",
|
||||
"start": 11,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"typeAnnotation": {
|
||||
"type": "GenericTypeAnnotation",
|
||||
"start": 13,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"typeParameters": null,
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
},
|
||||
"identifierName": "T"
|
||||
},
|
||||
"name": "T"
|
||||
}
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"parenthesized": true,
|
||||
"parenStart": 9
|
||||
}
|
||||
},
|
||||
"alternate": {
|
||||
"type": "ArrowFunctionExpression",
|
||||
"start": 17,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"async": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 17,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
},
|
||||
"identifierName": "U"
|
||||
},
|
||||
"name": "U"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "Identifier",
|
||||
"start": 22,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
},
|
||||
"identifierName": "y"
|
||||
},
|
||||
"name": "y"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
test
|
||||
? (x: T): U => y
|
||||
: z
|
||||
@@ -0,0 +1,250 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 0,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "ConditionalExpression",
|
||||
"start": 0,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "Identifier",
|
||||
"start": 0,
|
||||
"end": 4,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"identifierName": "test"
|
||||
},
|
||||
"name": "test"
|
||||
},
|
||||
"consequent": {
|
||||
"type": "ArrowFunctionExpression",
|
||||
"start": 9,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"predicate": null,
|
||||
"returnType": {
|
||||
"type": "TypeAnnotation",
|
||||
"start": 15,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"typeAnnotation": {
|
||||
"type": "GenericTypeAnnotation",
|
||||
"start": 17,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"typeParameters": null,
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 17,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
},
|
||||
"identifierName": "U"
|
||||
},
|
||||
"name": "U"
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"async": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 10,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x",
|
||||
"typeAnnotation": {
|
||||
"type": "TypeAnnotation",
|
||||
"start": 11,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"typeAnnotation": {
|
||||
"type": "GenericTypeAnnotation",
|
||||
"start": 13,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"typeParameters": null,
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 13,
|
||||
"end": 14,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
},
|
||||
"identifierName": "T"
|
||||
},
|
||||
"name": "T"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "Identifier",
|
||||
"start": 22,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
},
|
||||
"identifierName": "y"
|
||||
},
|
||||
"name": "y"
|
||||
}
|
||||
},
|
||||
"alternate": {
|
||||
"type": "Identifier",
|
||||
"start": 28,
|
||||
"end": 29,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 5
|
||||
},
|
||||
"identifierName": "z"
|
||||
},
|
||||
"name": "z"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
3
packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json
vendored
Normal file
3
packages/babel-parser/test/fixtures/jsx/errors/adjacent-tags/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>? (1:22)"
|
||||
}
|
||||
@@ -1,189 +0,0 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 37
|
||||
}
|
||||
},
|
||||
"errors": [
|
||||
"SyntaxError: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>? (1:22)"
|
||||
],
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 37
|
||||
}
|
||||
},
|
||||
"sourceType": "script",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 37
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 4,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 4,
|
||||
"end": 5,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 5
|
||||
},
|
||||
"identifierName": "x"
|
||||
},
|
||||
"name": "x"
|
||||
},
|
||||
"init": {
|
||||
"type": "JSXElement",
|
||||
"start": 8,
|
||||
"end": 36,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 36
|
||||
}
|
||||
},
|
||||
"openingElement": {
|
||||
"type": "JSXOpeningElement",
|
||||
"start": 8,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 8
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 9,
|
||||
"end": 12,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"name": "div"
|
||||
},
|
||||
"attributes": [],
|
||||
"selfClosing": false
|
||||
},
|
||||
"closingElement": {
|
||||
"type": "JSXClosingElement",
|
||||
"start": 16,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 22
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "JSXIdentifier",
|
||||
"start": 18,
|
||||
"end": 21,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"name": "div"
|
||||
}
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"type": "JSXText",
|
||||
"start": 13,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 16
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": "one",
|
||||
"raw": "one"
|
||||
},
|
||||
"value": "one"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "var"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-typescript",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.2",
|
||||
"description": "Transform TypeScript into ES.next",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript",
|
||||
"license": "MIT",
|
||||
@@ -21,7 +21,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.7.0",
|
||||
"@babel/core": "^7.7.2",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ export default declare(
|
||||
// Rest handled by Function visitor
|
||||
},
|
||||
constructor(path, classPath) {
|
||||
if (path.node.accessibility) path.node.accessibility = null;
|
||||
// Collects parameter properties so that we can add an assignment
|
||||
// for each of them in the constructor body
|
||||
//
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class C {
|
||||
m(): void;
|
||||
public m(x?: number, ...y: number[]): void {}
|
||||
public constructor() {}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class C {
|
||||
m(x, ...y) {}
|
||||
|
||||
constructor() {}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/preset-env-standalone",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.3",
|
||||
"description": "Standalone build of babel-prest-env for use in non-Node.js environments.",
|
||||
"main": "babel-preset-env.js",
|
||||
"files": [
|
||||
@@ -16,8 +16,8 @@
|
||||
"@babel/plugin-proposal-json-strings": "^7.0.0",
|
||||
"@babel/plugin-transform-named-capturing-groups-regex": "^7.7.0",
|
||||
"@babel/plugin-transform-new-target": "^7.4.4",
|
||||
"@babel/preset-env": "^7.7.0",
|
||||
"@babel/standalone": "^7.7.0"
|
||||
"@babel/preset-env": "^7.7.1",
|
||||
"@babel/standalone": "^7.7.3"
|
||||
},
|
||||
"keywords": [
|
||||
"babel",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/preset-env",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.1",
|
||||
"description": "A Babel preset for each environment.",
|
||||
"author": "Henry Zhu <hi@henryzoo.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -59,7 +59,7 @@
|
||||
"@babel/plugin-transform-template-literals": "^7.4.4",
|
||||
"@babel/plugin-transform-typeof-symbol": "^7.2.0",
|
||||
"@babel/plugin-transform-unicode-regex": "^7.7.0",
|
||||
"@babel/types": "^7.7.0",
|
||||
"@babel/types": "^7.7.1",
|
||||
"browserslist": "^4.6.0",
|
||||
"core-js-compat": "^3.1.1",
|
||||
"invariant": "^2.2.2",
|
||||
|
||||
@@ -237,7 +237,7 @@ export default declare((api, opts) => {
|
||||
modules !== "auto" || !api.caller || !api.caller(supportsStaticESM),
|
||||
shouldTransformDynamicImport:
|
||||
modules !== "auto" || !api.caller || !api.caller(supportsDynamicImport),
|
||||
shouldParseTopLevelAwait: api.caller(supportsTopLevelAwait),
|
||||
shouldParseTopLevelAwait: !api.caller || api.caller(supportsTopLevelAwait),
|
||||
});
|
||||
|
||||
const pluginNames = filterItems(
|
||||
|
||||
@@ -298,7 +298,7 @@ require("regenerator-runtime/runtime");
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ require("core-js/modules/es6.object.to-string");
|
||||
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
||||
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/preset-typescript",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.2",
|
||||
"description": "Babel preset for TypeScript.",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-typescript",
|
||||
"license": "MIT",
|
||||
@@ -14,13 +14,13 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/plugin-transform-typescript": "^7.7.0"
|
||||
"@babel/plugin-transform-typescript": "^7.7.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.7.0",
|
||||
"@babel/core": "^7.7.2",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ export default declare(
|
||||
if (typeof allExtensions !== "boolean") {
|
||||
throw new Error(".allExtensions must be a boolean, or undefined");
|
||||
}
|
||||
|
||||
if (typeof isTSX !== "boolean") {
|
||||
throw new Error(".isTSX must be a boolean, or undefined");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/runtime-corejs2",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.2",
|
||||
"description": "babel's modular runtime helpers with core-js@2 polyfilling",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/runtime-corejs3",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.2",
|
||||
"description": "babel's modular runtime helpers with core-js@3 polyfilling",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/runtime",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.2",
|
||||
"description": "babel's modular runtime helpers",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/standalone",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.3",
|
||||
"description": "Standalone build of Babel for use in non-Node.js environments.",
|
||||
"main": "babel.js",
|
||||
"files": [
|
||||
@@ -12,7 +12,7 @@
|
||||
"prepublishOnly": "cd ../.. && make prepublish-build-standalone"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.7.0",
|
||||
"@babel/core": "^7.7.2",
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/plugin-external-helpers": "^7.2.0",
|
||||
"@babel/plugin-proposal-async-generator-functions": "^7.7.0",
|
||||
@@ -96,11 +96,11 @@
|
||||
"@babel/plugin-transform-strict-mode": "^7.2.0",
|
||||
"@babel/plugin-transform-template-literals": "^7.4.4",
|
||||
"@babel/plugin-transform-typeof-symbol": "^7.2.0",
|
||||
"@babel/plugin-transform-typescript": "^7.7.0",
|
||||
"@babel/plugin-transform-typescript": "^7.7.2",
|
||||
"@babel/plugin-transform-unicode-regex": "^7.7.0",
|
||||
"@babel/preset-flow": "^7.0.0",
|
||||
"@babel/preset-react": "^7.7.0",
|
||||
"@babel/preset-typescript": "^7.7.0"
|
||||
"@babel/preset-typescript": "^7.7.2"
|
||||
},
|
||||
"keywords": [
|
||||
"babel",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/traverse",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.2",
|
||||
"description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -12,11 +12,11 @@
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.5.5",
|
||||
"@babel/generator": "^7.7.0",
|
||||
"@babel/generator": "^7.7.2",
|
||||
"@babel/helper-function-name": "^7.7.0",
|
||||
"@babel/helper-split-export-declaration": "^7.7.0",
|
||||
"@babel/parser": "^7.7.0",
|
||||
"@babel/types": "^7.7.0",
|
||||
"@babel/parser": "^7.7.2",
|
||||
"@babel/types": "^7.7.2",
|
||||
"debug": "^4.1.0",
|
||||
"globals": "^11.1.0",
|
||||
"lodash": "^4.17.13"
|
||||
|
||||
@@ -161,6 +161,13 @@ export default class NodePath {
|
||||
return !!this.listKey;
|
||||
}
|
||||
|
||||
set inList(inList) {
|
||||
if (!inList) {
|
||||
this.listKey = null;
|
||||
}
|
||||
// ignore inList = true as it should depend on `listKey`
|
||||
}
|
||||
|
||||
get parentKey() {
|
||||
return this.listKey || this.key;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,9 @@ export function insertAfter(nodes) {
|
||||
}),
|
||||
);
|
||||
} else if (
|
||||
(this.isNodeType("Expression") && !this.isJSXElement()) ||
|
||||
(this.isNodeType("Expression") &&
|
||||
!this.isJSXElement() &&
|
||||
!parentPath.isJSXElement()) ||
|
||||
(parentPath.isForStatement() && this.key === "init")
|
||||
) {
|
||||
if (this.node) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import traverse from "../lib";
|
||||
import { parse } from "@babel/parser";
|
||||
import generate from "@babel/generator";
|
||||
import * as t from "@babel/types";
|
||||
|
||||
describe("path/replacement", function() {
|
||||
@@ -97,4 +98,19 @@ describe("path/replacement", function() {
|
||||
);
|
||||
});
|
||||
});
|
||||
describe("replaceWithMultiple", () => {
|
||||
it("does not add extra parentheses for a JSXElement with a JSXElement parent", () => {
|
||||
const ast = parse(`<div><span><p></p><h></h></span></div>`, {
|
||||
plugins: ["jsx"],
|
||||
});
|
||||
traverse(ast, {
|
||||
JSXElement: path => {
|
||||
if (path.node.openingElement.name.name === "span") {
|
||||
path.replaceWithMultiple(path.node.children.filter(t.isJSXElement));
|
||||
}
|
||||
},
|
||||
});
|
||||
expect(generate(ast).code).toBe("<div><p></p><h></h></div>;");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/types",
|
||||
"version": "7.7.0",
|
||||
"version": "7.7.2",
|
||||
"description": "Babel Types is a Lodash-esque utility library for AST nodes",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -17,7 +17,7 @@
|
||||
"to-fast-properties": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/generator": "^7.7.0",
|
||||
"@babel/parser": "^7.7.0"
|
||||
"@babel/generator": "^7.7.2",
|
||||
"@babel/parser": "^7.7.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// @flow
|
||||
import isIdentifierName from "../validators/isIdentifierName";
|
||||
import isValidIdentifier from "../validators/isValidIdentifier";
|
||||
|
||||
import {
|
||||
BINARY_OPERATORS,
|
||||
@@ -406,8 +406,8 @@ defineType("Identifier", {
|
||||
...patternLikeCommon,
|
||||
name: {
|
||||
validate: chain(function(node, key, val) {
|
||||
if (!isIdentifierName(val)) {
|
||||
throw new TypeError(`"${val}" is not a valid identifer name`);
|
||||
if (!isValidIdentifier(val)) {
|
||||
// throw new TypeError(`"${val}" is not a valid identifier name`);
|
||||
}
|
||||
}, assertValueType("string")),
|
||||
},
|
||||
|
||||
@@ -109,7 +109,6 @@ export {
|
||||
default as isValidES3Identifier,
|
||||
} from "./validators/isValidES3Identifier";
|
||||
export { default as isValidIdentifier } from "./validators/isValidIdentifier";
|
||||
export { default as isIdentifierName } from "./validators/isIdentifierName";
|
||||
export { default as isVar } from "./validators/isVar";
|
||||
export { default as matchesPattern } from "./validators/matchesPattern";
|
||||
export { default as validate } from "./validators/validate";
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
// @flow
|
||||
import esutils from "esutils";
|
||||
|
||||
/**
|
||||
* Check if the input `name` is a valid identifier name.
|
||||
*/
|
||||
export default function isIdentifierName(name: string): boolean {
|
||||
return esutils.keyword.isIdentifierNameES6(name);
|
||||
}
|
||||
Reference in New Issue
Block a user