Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0407f034f0 | ||
|
|
d919ecd254 | ||
|
|
d8da63c929 | ||
|
|
eb3230f9db | ||
|
|
7dc5fdb390 | ||
|
|
ee68d6d1b0 | ||
|
|
d3fe22f0e1 | ||
|
|
7f47cb65d0 | ||
|
|
8b9af1be2f | ||
|
|
f5ca0587d1 | ||
|
|
a9660cf559 | ||
|
|
8107a6faa2 | ||
|
|
42000b9907 | ||
|
|
5d9a786b2f | ||
|
|
e88a569e83 | ||
|
|
4eab157502 |
@@ -6,7 +6,7 @@ charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
end_of_line = lf
|
||||
|
||||
[*.{js,json}]
|
||||
[*.{js,json,ts,tsx}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
|
||||
@@ -18,6 +18,12 @@ 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.5.4 (2019-07-09)
|
||||
|
||||
#### :bug: Bug Fix
|
||||
* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`, `babel-preset-env`
|
||||
* [#10188](https://github.com/babel/babel/pull/10188) Fix _objectSpread2 for real ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
|
||||
|
||||
## v7.5.3 (2019-07-09)
|
||||
|
||||
#### :bug: Bug Fix
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "7.5.4",
|
||||
"version": "7.5.5",
|
||||
"changelog": {
|
||||
"repo": "babel/babel",
|
||||
"cacheDir": ".changelog",
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
"lerna": "^3.14.2",
|
||||
"lerna-changelog": "^0.5.0",
|
||||
"lint-staged": "^8.1.7",
|
||||
"lodash": "^4.17.11",
|
||||
"lodash": "^4.17.13",
|
||||
"merge-stream": "^1.0.1",
|
||||
"output-file-sync": "^2.0.0",
|
||||
"prettier": "^1.17.1",
|
||||
@@ -71,7 +71,7 @@
|
||||
"webpack-stream": "^4.0.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"@lerna/**/@lerna/collect-updates": "https://github.com/nicolo-ribaudo/lerna.git#babel-collect-updates"
|
||||
"@lerna/**/@lerna/collect-updates": "https://github.com/babel/lerna.git#babel-collect-updates"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.9.0 < 13.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/cli",
|
||||
"version": "7.5.0",
|
||||
"version": "7.5.5",
|
||||
"description": "Babel command line.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -23,7 +23,7 @@
|
||||
"convert-source-map": "^1.1.0",
|
||||
"fs-readdir-recursive": "^1.1.0",
|
||||
"glob": "^7.0.0",
|
||||
"lodash": "^4.17.11",
|
||||
"lodash": "^4.17.13",
|
||||
"mkdirp": "^0.5.1",
|
||||
"output-file-sync": "^2.0.0",
|
||||
"slash": "^2.0.0",
|
||||
@@ -36,8 +36,8 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.5.0",
|
||||
"@babel/helper-fixtures": "^7.4.4"
|
||||
"@babel/core": "^7.5.5",
|
||||
"@babel/helper-fixtures": "^7.5.5"
|
||||
},
|
||||
"bin": {
|
||||
"babel": "./bin/babel.js",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/code-frame",
|
||||
"version": "7.0.0",
|
||||
"version": "7.5.5",
|
||||
"description": "Generate errors that contain a code frame that point to source locations.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
|
||||
@@ -76,7 +76,7 @@ function getMarkerLines(
|
||||
} else if (i === 0) {
|
||||
const sourceLength = source[lineNumber - 1].length;
|
||||
|
||||
markerLines[lineNumber] = [startColumn, sourceLength - startColumn];
|
||||
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
||||
} else if (i === lineDiff) {
|
||||
markerLines[lineNumber] = [0, endColumn];
|
||||
} else {
|
||||
@@ -112,15 +112,16 @@ export function codeFrameColumns(
|
||||
const maybeHighlight = (chalkFn, string) => {
|
||||
return highlighted ? chalkFn(string) : string;
|
||||
};
|
||||
if (highlighted) rawLines = highlight(rawLines, opts);
|
||||
|
||||
const lines = rawLines.split(NEWLINE);
|
||||
const { start, end, markerLines } = getMarkerLines(loc, lines, opts);
|
||||
const hasColumns = loc.start && typeof loc.start.column === "number";
|
||||
|
||||
const numberMaxWidth = String(end).length;
|
||||
|
||||
let frame = lines
|
||||
const highlightedLines = highlighted ? highlight(rawLines, opts) : rawLines;
|
||||
|
||||
let frame = highlightedLines
|
||||
.split(NEWLINE)
|
||||
.slice(start, end)
|
||||
.map((line, index) => {
|
||||
const number = start + 1 + index;
|
||||
|
||||
@@ -102,6 +102,45 @@ describe("@babel/code-frame", function() {
|
||||
);
|
||||
});
|
||||
|
||||
test("opts.highlightCode with multiple columns and lines", function() {
|
||||
// prettier-ignore
|
||||
const rawLines = [
|
||||
"function a(b, c) {",
|
||||
" return b + c;",
|
||||
"}"
|
||||
].join("\n");
|
||||
|
||||
const result = codeFrameColumns(
|
||||
rawLines,
|
||||
{
|
||||
start: {
|
||||
line: 1,
|
||||
column: 1,
|
||||
},
|
||||
end: {
|
||||
line: 3,
|
||||
column: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
highlightCode: true,
|
||||
message: "Message about things",
|
||||
},
|
||||
);
|
||||
const stripped = stripAnsi(result);
|
||||
expect(stripped).toEqual(
|
||||
// prettier-ignore
|
||||
[
|
||||
"> 1 | function a(b, c) {",
|
||||
" | ^^^^^^^^^^^^^^^^^^",
|
||||
"> 2 | return b + c;",
|
||||
" | ^^^^^^^^^^^^^^^",
|
||||
"> 3 | }",
|
||||
" | ^ Message about things",
|
||||
].join('\n'),
|
||||
);
|
||||
});
|
||||
|
||||
test("opts.linesAbove", function() {
|
||||
const rawLines = [
|
||||
"/**",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/core",
|
||||
"version": "7.5.4",
|
||||
"version": "7.5.5",
|
||||
"description": "Babel compiler core.",
|
||||
"main": "lib/index.js",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
@@ -33,23 +33,23 @@
|
||||
"./lib/transform-file.js": "./lib/transform-file-browser.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"@babel/generator": "^7.5.0",
|
||||
"@babel/helpers": "^7.5.4",
|
||||
"@babel/parser": "^7.5.0",
|
||||
"@babel/code-frame": "^7.5.5",
|
||||
"@babel/generator": "^7.5.5",
|
||||
"@babel/helpers": "^7.5.5",
|
||||
"@babel/parser": "^7.5.5",
|
||||
"@babel/template": "^7.4.4",
|
||||
"@babel/traverse": "^7.5.0",
|
||||
"@babel/types": "^7.5.0",
|
||||
"@babel/traverse": "^7.5.5",
|
||||
"@babel/types": "^7.5.5",
|
||||
"convert-source-map": "^1.1.0",
|
||||
"debug": "^4.1.0",
|
||||
"json5": "^2.1.0",
|
||||
"lodash": "^4.17.11",
|
||||
"lodash": "^4.17.13",
|
||||
"resolve": "^1.3.2",
|
||||
"semver": "^5.4.1",
|
||||
"source-map": "^0.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-transform-fixture-test-runner": "^7.5.0",
|
||||
"@babel/register": "^7.4.4"
|
||||
"@babel/helper-transform-fixture-test-runner": "^7.5.5",
|
||||
"@babel/register": "^7.5.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,6 +203,9 @@ export default class File {
|
||||
if (res) return res;
|
||||
}
|
||||
|
||||
// make sure that the helper exists
|
||||
helpers.ensure(name);
|
||||
|
||||
const uid = (this.declarations[name] = this.scope.generateUidIdentifier(
|
||||
name,
|
||||
));
|
||||
|
||||
@@ -788,4 +788,28 @@ describe("api", function() {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("missing helpers", function() {
|
||||
it("should always throw", function() {
|
||||
expect(() =>
|
||||
babel.transformSync(``, {
|
||||
configFile: false,
|
||||
plugins: [
|
||||
function() {
|
||||
return {
|
||||
visitor: {
|
||||
Program(path) {
|
||||
try {
|
||||
path.pushContainer("body", this.addHelper("fooBar"));
|
||||
} catch {}
|
||||
path.pushContainer("body", this.addHelper("fooBar"));
|
||||
},
|
||||
},
|
||||
};
|
||||
},
|
||||
],
|
||||
}),
|
||||
).toThrow();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/generator",
|
||||
"version": "7.5.0",
|
||||
"version": "7.5.5",
|
||||
"description": "Turns an AST into code.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -14,14 +14,14 @@
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.5.0",
|
||||
"@babel/types": "^7.5.5",
|
||||
"jsesc": "^2.5.1",
|
||||
"lodash": "^4.17.11",
|
||||
"lodash": "^4.17.13",
|
||||
"source-map": "^0.5.0",
|
||||
"trim-right": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-fixtures": "^7.4.4",
|
||||
"@babel/parser": "^7.5.0"
|
||||
"@babel/helper-fixtures": "^7.5.5",
|
||||
"@babel/parser": "^7.5.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-create-class-features-plugin",
|
||||
"version": "7.5.0",
|
||||
"version": "7.5.5",
|
||||
"author": "The Babel Team (https://babeljs.io/team)",
|
||||
"license": "MIT",
|
||||
"description": "Compile class public and private fields, private methods and decorators to ES6",
|
||||
@@ -15,17 +15,17 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/helper-function-name": "^7.1.0",
|
||||
"@babel/helper-member-expression-to-functions": "^7.0.0",
|
||||
"@babel/helper-member-expression-to-functions": "^7.5.5",
|
||||
"@babel/helper-optimise-call-expression": "^7.0.0",
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/helper-replace-supers": "^7.4.4",
|
||||
"@babel/helper-replace-supers": "^7.5.5",
|
||||
"@babel/helper-split-export-declaration": "^7.4.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.5.0",
|
||||
"@babel/core": "^7.5.5",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,6 +211,19 @@ const privateNameHandlerSpec = {
|
||||
]);
|
||||
},
|
||||
|
||||
destructureSet(member) {
|
||||
const { privateNamesMap, file } = this;
|
||||
const { name } = member.node.property.id;
|
||||
const { id } = privateNamesMap.get(name);
|
||||
return t.memberExpression(
|
||||
t.callExpression(file.addHelper("classPrivateFieldDestructureSet"), [
|
||||
this.receiver(member),
|
||||
t.cloneNode(id),
|
||||
]),
|
||||
t.identifier("value"),
|
||||
);
|
||||
},
|
||||
|
||||
call(member, args) {
|
||||
// The first access (the get) should do the memo assignment.
|
||||
this.memoise(member, 1);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-define-map",
|
||||
"version": "7.4.4",
|
||||
"version": "7.5.5",
|
||||
"description": "Helper function to define a map",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-define-map",
|
||||
"license": "MIT",
|
||||
@@ -10,7 +10,7 @@
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-function-name": "^7.1.0",
|
||||
"@babel/types": "^7.4.4",
|
||||
"lodash": "^4.17.11"
|
||||
"@babel/types": "^7.5.5",
|
||||
"lodash": "^4.17.13"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-fixtures",
|
||||
"version": "7.4.4",
|
||||
"version": "7.5.5",
|
||||
"description": "Helper function to support fixtures",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"license": "MIT",
|
||||
@@ -10,7 +10,7 @@
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-fixtures",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.11",
|
||||
"lodash": "^4.17.13",
|
||||
"semver": "^5.3.0",
|
||||
"try-resolve": "^1.0.0"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-member-expression-to-functions",
|
||||
"version": "7.0.0",
|
||||
"version": "7.5.5",
|
||||
"description": "Helper function to replace certain member expressions with function calls",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-member-expression-to-functions",
|
||||
"license": "MIT",
|
||||
@@ -10,6 +10,6 @@
|
||||
"main": "lib/index.js",
|
||||
"author": "Justin Ridgewell <justin@ridgewell.name>",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.0.0"
|
||||
"@babel/types": "^7.5.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,6 +100,34 @@ const handle = {
|
||||
return;
|
||||
}
|
||||
|
||||
// { KEY: MEMBER } = OBJ -> { KEY: _destructureSet(MEMBER) } = OBJ
|
||||
// { KEY: MEMBER = _VALUE } = OBJ -> { KEY: _destructureSet(MEMBER) = _VALUE } = OBJ
|
||||
// {...MEMBER} -> {..._destructureSet(MEMBER)}
|
||||
//
|
||||
// [MEMBER] = ARR -> [_destructureSet(MEMBER)] = ARR
|
||||
// [MEMBER = _VALUE] = ARR -> [_destructureSet(MEMBER) = _VALUE] = ARR
|
||||
// [...MEMBER] -> [..._destructureSet(MEMBER)]
|
||||
if (
|
||||
// { KEY: MEMBER } = OBJ
|
||||
(parentPath.isObjectProperty({ value: node }) &&
|
||||
parentPath.parentPath.isObjectPattern()) ||
|
||||
// { KEY: MEMBER = _VALUE } = OBJ
|
||||
(parentPath.isAssignmentPattern({ left: node }) &&
|
||||
parentPath.parentPath.isObjectProperty({ value: parent }) &&
|
||||
parentPath.parentPath.parentPath.isObjectPattern()) ||
|
||||
// [MEMBER] = ARR
|
||||
parentPath.isArrayPattern() ||
|
||||
// [MEMBER = _VALUE] = ARR
|
||||
(parentPath.isAssignmentPattern({ left: node }) &&
|
||||
parentPath.parentPath.isArrayPattern()) ||
|
||||
// {...MEMBER}
|
||||
// [...MEMBER]
|
||||
parentPath.isRestElement()
|
||||
) {
|
||||
member.replaceWith(this.destructureSet(member));
|
||||
return;
|
||||
}
|
||||
|
||||
// MEMBER -> _get(MEMBER)
|
||||
member.replaceWith(this.get(member));
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-module-transforms",
|
||||
"version": "7.4.4",
|
||||
"version": "7.5.5",
|
||||
"description": "Babel helper functions for implementing ES6 module transformations",
|
||||
"author": "Logan Smyth <loganfsmyth@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -15,7 +15,7 @@
|
||||
"@babel/helper-simple-access": "^7.1.0",
|
||||
"@babel/helper-split-export-declaration": "^7.4.4",
|
||||
"@babel/template": "^7.4.4",
|
||||
"@babel/types": "^7.4.4",
|
||||
"lodash": "^4.17.11"
|
||||
"@babel/types": "^7.5.5",
|
||||
"lodash": "^4.17.13"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-regex",
|
||||
"version": "7.4.4",
|
||||
"version": "7.5.5",
|
||||
"description": "Helper function to check for literal RegEx",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-regex",
|
||||
"license": "MIT",
|
||||
@@ -9,6 +9,6 @@
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.11"
|
||||
"lodash": "^4.17.13"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-replace-supers",
|
||||
"version": "7.4.4",
|
||||
"version": "7.5.5",
|
||||
"description": "Helper function to replace supers",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-replace-supers",
|
||||
"license": "MIT",
|
||||
@@ -9,9 +9,9 @@
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-member-expression-to-functions": "^7.0.0",
|
||||
"@babel/helper-member-expression-to-functions": "^7.5.5",
|
||||
"@babel/helper-optimise-call-expression": "^7.0.0",
|
||||
"@babel/traverse": "^7.4.4",
|
||||
"@babel/types": "^7.4.4"
|
||||
"@babel/traverse": "^7.5.5",
|
||||
"@babel/types": "^7.5.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,6 +125,12 @@ const specHandlers = {
|
||||
]);
|
||||
},
|
||||
|
||||
destructureSet(superMember) {
|
||||
throw superMember.buildCodeFrameError(
|
||||
`Destructuring to a super field is not supported yet.`,
|
||||
);
|
||||
},
|
||||
|
||||
call(superMember, args) {
|
||||
return optimiseCall(this.get(superMember), t.thisExpression(), args);
|
||||
},
|
||||
@@ -174,6 +180,13 @@ const looseHandlers = {
|
||||
value,
|
||||
);
|
||||
},
|
||||
|
||||
destructureSet(superMember) {
|
||||
const { computed } = superMember.node;
|
||||
const prop = this.prop(superMember);
|
||||
|
||||
return t.memberExpression(t.thisExpression(), prop, computed);
|
||||
},
|
||||
};
|
||||
|
||||
export default class ReplaceSupers {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helper-transform-fixture-test-runner",
|
||||
"version": "7.5.0",
|
||||
"version": "7.5.5",
|
||||
"description": "Transform test runner for @babel/helper-fixtures module",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -11,14 +11,14 @@
|
||||
"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",
|
||||
"@babel/core": "^7.5.0",
|
||||
"@babel/helper-fixtures": "^7.4.4",
|
||||
"@babel/code-frame": "^7.5.5",
|
||||
"@babel/core": "^7.5.5",
|
||||
"@babel/helper-fixtures": "^7.5.5",
|
||||
"@babel/polyfill": "^7.4.4",
|
||||
"babel-check-duplicated-nodes": "^1.0.0",
|
||||
"jest": "^24.8.0",
|
||||
"jest-diff": "^24.8.0",
|
||||
"lodash": "^4.17.11",
|
||||
"lodash": "^4.17.13",
|
||||
"resolve": "^1.3.2",
|
||||
"source-map": "^0.5.0"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/helpers",
|
||||
"version": "7.5.4",
|
||||
"version": "7.5.5",
|
||||
"description": "Collection of helper functions used by Babel transforms.",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -12,8 +12,8 @@
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/template": "^7.4.4",
|
||||
"@babel/traverse": "^7.5.0",
|
||||
"@babel/types": "^7.5.0"
|
||||
"@babel/traverse": "^7.5.5",
|
||||
"@babel/types": "^7.5.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
|
||||
@@ -409,14 +409,19 @@ helpers.objectSpread = helper("7.0.0-beta.0")`
|
||||
helpers.objectSpread2 = helper("7.5.0")`
|
||||
import defineProperty from "defineProperty";
|
||||
|
||||
// This function is different to "Reflect.ownKeys". The enumerableOnly
|
||||
// filters on symbol properties only. Returned string properties are always
|
||||
// enumerable. It is good to use in objectSpread.
|
||||
|
||||
function ownKeys(object, enumerableOnly) {
|
||||
var keys = Object.keys(object);
|
||||
if (Object.getOwnPropertySymbols) {
|
||||
keys.push.apply(keys, Object.getOwnPropertySymbols(object));
|
||||
var symbols = Object.getOwnPropertySymbols(object);
|
||||
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
keys.push.apply(keys, symbols);
|
||||
}
|
||||
if (enumerableOnly) keys = keys.filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
||||
});
|
||||
return keys;
|
||||
}
|
||||
|
||||
@@ -587,7 +592,7 @@ helpers.wrapNativeSuper = helper("7.0.0-beta.0")`
|
||||
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);
|
||||
return !!right[Symbol.hasInstance](left);
|
||||
} else {
|
||||
return left instanceof right;
|
||||
}
|
||||
@@ -715,7 +720,6 @@ helpers.superPropBase = helper("7.0.0-beta.0")`
|
||||
`;
|
||||
|
||||
helpers.get = helper("7.0.0-beta.0")`
|
||||
import getPrototypeOf from "getPrototypeOf";
|
||||
import superPropBase from "superPropBase";
|
||||
|
||||
export default function _get(target, property, receiver) {
|
||||
@@ -740,7 +744,6 @@ helpers.get = helper("7.0.0-beta.0")`
|
||||
`;
|
||||
|
||||
helpers.set = helper("7.0.0-beta.0")`
|
||||
import getPrototypeOf from "getPrototypeOf";
|
||||
import superPropBase from "superPropBase";
|
||||
import defineProperty from "defineProperty";
|
||||
|
||||
@@ -1118,6 +1121,34 @@ helpers.classPrivateFieldSet = helper("7.0.0-beta.0")`
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.classPrivateFieldDestructureSet = helper("7.4.4")`
|
||||
export default function _classPrivateFieldDestructureSet(receiver, privateMap) {
|
||||
if (!privateMap.has(receiver)) {
|
||||
throw new TypeError("attempted to set private field on non-instance");
|
||||
}
|
||||
var descriptor = privateMap.get(receiver);
|
||||
if (descriptor.set) {
|
||||
if (!("__destrObj" in descriptor)) {
|
||||
descriptor.__destrObj = {
|
||||
set value(v) {
|
||||
descriptor.set.call(receiver, v)
|
||||
},
|
||||
};
|
||||
}
|
||||
return descriptor.__destrObj;
|
||||
} else {
|
||||
if (!descriptor.writable) {
|
||||
// This should only throw in strict mode, but class bodies are
|
||||
// always strict and private fields can only be used inside
|
||||
// class bodies.
|
||||
throw new TypeError("attempted to set read only private field");
|
||||
}
|
||||
|
||||
return descriptor;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
helpers.classStaticPrivateFieldSpecGet = helper("7.0.2")`
|
||||
export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {
|
||||
if (receiver !== classConstructor) {
|
||||
|
||||
@@ -280,6 +280,10 @@ export function getDependencies(name: string): $ReadOnlyArray<string> {
|
||||
return Array.from(loadHelper(name).dependencies.values());
|
||||
}
|
||||
|
||||
export function ensure(name: string) {
|
||||
loadHelper(name);
|
||||
}
|
||||
|
||||
export const list = Object.keys(helpers)
|
||||
.map(name => name.replace(/^_/, ""))
|
||||
.filter(name => name !== "__esModule");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/node",
|
||||
"version": "7.5.0",
|
||||
"version": "7.5.5",
|
||||
"description": "Babel command line",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -20,9 +20,9 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/polyfill": "^7.0.0",
|
||||
"@babel/register": "^7.0.0",
|
||||
"@babel/register": "^7.5.5",
|
||||
"commander": "^2.8.1",
|
||||
"lodash": "^4.17.11",
|
||||
"lodash": "^4.17.13",
|
||||
"node-environment-flags": "^1.0.5",
|
||||
"v8flags": "^3.1.1"
|
||||
},
|
||||
@@ -30,8 +30,8 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.5.0",
|
||||
"@babel/helper-fixtures": "^7.2.0",
|
||||
"@babel/core": "^7.5.5",
|
||||
"@babel/helper-fixtures": "^7.5.5",
|
||||
"fs-readdir-recursive": "^1.0.0",
|
||||
"output-file-sync": "^2.0.0"
|
||||
},
|
||||
|
||||
@@ -898,6 +898,54 @@ interface BindExpression <: Expression {
|
||||
|
||||
If `object` is `null`, then `callee` should be a `MemberExpression`.
|
||||
|
||||
### Pipeline
|
||||
|
||||
These nodes are used by the Smart Pipeline to determine the type of the expression in a Pipeline Operator Expression. The F# Pipeline uses simple `BinaryExpression`s.
|
||||
|
||||
#### PipelineBody
|
||||
|
||||
```js
|
||||
interface PipelineBody <: NodeBase {
|
||||
type: "PipelineBody";
|
||||
}
|
||||
```
|
||||
|
||||
#### PipelineBareFunctionBody
|
||||
|
||||
```js
|
||||
interface PipelineBody <: NodeBase {
|
||||
type: "PipelineBareFunctionBody";
|
||||
callee: Expression;
|
||||
}
|
||||
```
|
||||
|
||||
#### PipelineBareConstructorBody
|
||||
|
||||
```js
|
||||
interface PipelineBareConstructorBody <: NodeBase {
|
||||
type: "PipelineBareConstructorBody";
|
||||
callee: Expression;
|
||||
}
|
||||
```
|
||||
|
||||
#### PipelineBareAwaitedFunctionBody
|
||||
|
||||
```js
|
||||
interface PipelineBareConstructorBody <: NodeBase {
|
||||
type: "PipelineTopicBody";
|
||||
expression: Expression;
|
||||
}
|
||||
```
|
||||
|
||||
#### PipelineTopicBody
|
||||
|
||||
```js
|
||||
interface PipelineBareConstructorBody <: NodeBase {
|
||||
type: "PipelineBareAwaitedFunctionBody";
|
||||
callee: Expression;
|
||||
}
|
||||
```
|
||||
|
||||
## ConditionalExpression
|
||||
|
||||
```js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/parser",
|
||||
"version": "7.5.0",
|
||||
"version": "7.5.5",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -28,8 +28,8 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"@babel/helper-fixtures": "^7.4.4",
|
||||
"@babel/code-frame": "^7.5.5",
|
||||
"@babel/helper-fixtures": "^7.5.5",
|
||||
"charcodes": "^0.2.0",
|
||||
"unicode-12.0.0": "^0.7.9"
|
||||
},
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user