Compare commits

...

9 Commits

Author SHA1 Message Date
Nicolò Ribaudo
35f4d12763 v7.7.2 2019-11-07 02:20:52 +03:00
Nicolò Ribaudo
9082e68d6f Parse arrows with params annotations in conditional expressions (#10669) 2019-11-07 02:18:36 +03:00
Vojtech Miksu
bdb4318f47 chore: update convert-source-map dep (#10667) 2019-11-06 14:30:32 -06:00
Maksim Ryzhikov
3ab035bab6 fix: Use the recommended property to specify repository URL (#10665) [ci-skip]
Use recommended by npm property to specify repository URL
https://docs.npmjs.com/files/package.json#repository

Otherwise, it breaks some tools which relay on this convention for example "nlf" package
https://github.com/iandotkelly/nlf/blob/master/lib/nlf.js#L284-L285
2019-11-06 07:34:09 -05:00
Leonid Shevtsov
2cd5ad0c80 fix typo: identifer -> identifier (#10647) 2019-11-06 09:13:08 +01:00
Huáng Jùnliàng
2640e5a27c fix: remove accessibility of constructor (#10658) 2019-11-05 13:52:57 -06:00
Huáng Jùnliàng
0f949990c3 fix: add inList setter for compatibility with babel-minify (#10656) 2019-11-05 12:28:16 -05:00
njlr
f544753bb8 code style: consistent spacing (#10643) [ci-skip]
Makes spacing consistent
2019-11-05 09:40:57 -05:00
Babel Bot
d3db02da30 Add v7.7.1 to CHANGELOG.md [skip ci] 2019-11-05 13:50:36 +00:00
28 changed files with 533 additions and 38 deletions

View File

@@ -17,6 +17,13 @@ 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.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)

View File

@@ -1,5 +1,5 @@
{
"version": "7.7.1",
"version": "7.7.2",
"changelog": {
"repo": "babel/babel",
"cacheDir": ".changelog",

View File

@@ -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",

View File

@@ -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"
}
}

View File

@@ -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,

View File

@@ -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"
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/parser",
"version": "7.7.0",
"version": "7.7.2",
"description": "A JavaScript parser",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",

View File

@@ -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
*/

View File

@@ -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":

View File

@@ -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": []
}
}

View File

@@ -0,0 +1,3 @@
test
? (x: T): U => y
: z

View File

@@ -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": []
}
}

View File

@@ -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"
}
}

View File

@@ -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
//

View File

@@ -1,4 +1,5 @@
class C {
m(): void;
public m(x?: number, ...y: number[]): void {}
public constructor() {}
}

View File

@@ -1,4 +1,6 @@
class C {
m(x, ...y) {}
constructor() {}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/preset-env-standalone",
"version": "7.7.1",
"version": "7.7.2",
"description": "Standalone build of babel-prest-env for use in non-Node.js environments.",
"main": "babel-preset-env.js",
"files": [
@@ -17,7 +17,7 @@
"@babel/plugin-transform-named-capturing-groups-regex": "^7.7.0",
"@babel/plugin-transform-new-target": "^7.4.4",
"@babel/preset-env": "^7.7.1",
"@babel/standalone": "^7.7.1"
"@babel/standalone": "^7.7.2"
},
"keywords": [
"babel",

View File

@@ -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"
}
}

View File

@@ -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");
}

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/runtime-corejs2",
"version": "7.7.1",
"version": "7.7.2",
"description": "babel's modular runtime helpers with core-js@2 polyfilling",
"license": "MIT",
"publishConfig": {

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/runtime-corejs3",
"version": "7.7.1",
"version": "7.7.2",
"description": "babel's modular runtime helpers with core-js@3 polyfilling",
"license": "MIT",
"publishConfig": {

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/runtime",
"version": "7.7.1",
"version": "7.7.2",
"description": "babel's modular runtime helpers",
"license": "MIT",
"publishConfig": {

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/standalone",
"version": "7.7.1",
"version": "7.7.2",
"description": "Standalone build of Babel for use in non-Node.js environments.",
"main": "babel.js",
"files": [
@@ -12,7 +12,7 @@
"prepublishOnly": "cd ../.. && make prepublish-build-standalone"
},
"devDependencies": {
"@babel/core": "^7.7.0",
"@babel/core": "^7.7.2",
"@babel/helper-plugin-utils": "^7.0.0",
"@babel/plugin-external-helpers": "^7.2.0",
"@babel/plugin-proposal-async-generator-functions": "^7.7.0",
@@ -96,11 +96,11 @@
"@babel/plugin-transform-strict-mode": "^7.2.0",
"@babel/plugin-transform-template-literals": "^7.4.4",
"@babel/plugin-transform-typeof-symbol": "^7.2.0",
"@babel/plugin-transform-typescript": "^7.7.0",
"@babel/plugin-transform-typescript": "^7.7.2",
"@babel/plugin-transform-unicode-regex": "^7.7.0",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.7.0",
"@babel/preset-typescript": "^7.7.0"
"@babel/preset-typescript": "^7.7.2"
},
"keywords": [
"babel",

View File

@@ -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"

View File

@@ -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;
}

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/types",
"version": "7.7.1",
"version": "7.7.2",
"description": "Babel Types is a Lodash-esque utility library for AST nodes",
"author": "Sebastian McKenzie <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"
}
}

View File

@@ -407,7 +407,7 @@ defineType("Identifier", {
name: {
validate: chain(function(node, key, val) {
if (!isValidIdentifier(val)) {
// throw new TypeError(`"${val}" is not a valid identifer name`);
// throw new TypeError(`"${val}" is not a valid identifier name`);
}
}, assertValueType("string")),
},