Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d1fe2d05f4 | ||
|
|
b9a3806f9e | ||
|
|
b25fea49fe | ||
|
|
83cbc11d46 | ||
|
|
0f685d9b42 | ||
|
|
d86b831364 | ||
|
|
0050266a50 | ||
|
|
b6300a0869 | ||
|
|
4ba998c5db | ||
|
|
2fb1f9aed3 | ||
|
|
85ea5b0b50 | ||
|
|
d349b74a4f | ||
|
|
3a9743fce4 | ||
|
|
2817844e89 | ||
|
|
7943a48cc3 | ||
|
|
953182d44a | ||
|
|
045d019149 | ||
|
|
d1514f57bd | ||
|
|
fdb65ab8b1 | ||
|
|
81123fb972 | ||
|
|
738060ebfa | ||
|
|
07b0f22a3f | ||
|
|
e03e5ba01d |
16
.github/actions/filter-commit-message/Dockerfile
vendored
Normal file
16
.github/actions/filter-commit-message/Dockerfile
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
FROM debian:stable-slim
|
||||
|
||||
LABEL "name"="filter"
|
||||
LABEL "version"="1.1.0"
|
||||
|
||||
LABEL "com.github.actions.name"="Filter commit message"
|
||||
LABEL "com.github.actions.description"="Stop a workflow if the message of the current commit doesn't match the pattern"
|
||||
LABEL "com.github.actions.icon"="filter"
|
||||
LABEL "com.github.actions.color"="gray-dark"
|
||||
|
||||
ADD entrypoint.sh /action/entrypoint.sh
|
||||
|
||||
RUN chmod +x /action/entrypoint.sh
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends git
|
||||
|
||||
ENTRYPOINT ["/action/entrypoint.sh"]
|
||||
15
.github/actions/filter-commit-message/entrypoint.sh
vendored
Normal file
15
.github/actions/filter-commit-message/entrypoint.sh
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
pattern=$1
|
||||
message=$(git log --oneline --format=%B -1 $GITHUB_SHA)
|
||||
|
||||
if echo "$message" | grep -Pq "$pattern"; then
|
||||
echo "INFO: $message matches $pattern"
|
||||
exit 0
|
||||
else
|
||||
echo "INFO: $message does not match $pattern"
|
||||
# 78 is the "neutral" exit status
|
||||
exit 78
|
||||
fi
|
||||
@@ -5,11 +5,20 @@ set -e
|
||||
echo "INFO: Installing action dependencies..."
|
||||
(cd /action; npm ci)
|
||||
|
||||
echo "INFO: Checking out current tag..."
|
||||
git -c advice.detachedHead=false checkout $GITHUB_REF
|
||||
echo "INFO: Checking out current commit..."
|
||||
git -c advice.detachedHead=false checkout $GITHUB_SHA
|
||||
|
||||
# GitHub doesn't support running actions on new tags yet: we need to run it on the commit.
|
||||
# For this reason, we can't be sure that the tag already exists. We can use the commit
|
||||
# message to create the tag. If the tag already exists locally, they won't conflict because
|
||||
# they have the same name and are on the same commit.
|
||||
echo "INFO: Getting release version..."
|
||||
# current_tag=$(git describe --abbrev=0 --tags HEAD)
|
||||
current_tag=$(git log --oneline --format=%B -1 HEAD)
|
||||
|
||||
echo "INFO: Creating new tag..."
|
||||
(git tag $current_tag $GITHUB_SHA) || echo "INFO: Tag already exists"
|
||||
|
||||
echo "INFO: Getting tag info..."
|
||||
current_tag=$(git describe --abbrev=0 --tags)
|
||||
last_tag=$(git describe --abbrev=0 --tags HEAD^)
|
||||
echo "INFO: New version is $current_tag; last version is $last_tag."
|
||||
|
||||
|
||||
10
.github/main.workflow
vendored
10
.github/main.workflow
vendored
@@ -10,14 +10,16 @@ action "Trigger GitHub release" {
|
||||
# When GitHub Actions will support the "release" event for public
|
||||
# repositories, we won't need these checks anymore.
|
||||
needs = [
|
||||
"Is version tag",
|
||||
"Is version commit",
|
||||
"On master branch",
|
||||
]
|
||||
}
|
||||
|
||||
action "Is version tag" {
|
||||
uses = "actions/bin/filter@master"
|
||||
args = "tag v*"
|
||||
action "Is version commit" {
|
||||
uses = "./.github/actions/filter-commit-message"
|
||||
# This regex is run using "grep -P".
|
||||
# The (-\\S+) part is for 7.0.0-beta.1 releases.
|
||||
args = "^v(\\d+\\.){2}\\d+(-\\S+)?$"
|
||||
}
|
||||
|
||||
action "On master branch" {
|
||||
|
||||
@@ -17,8 +17,7 @@ const source = require("vinyl-source-stream");
|
||||
const buffer = require("vinyl-buffer");
|
||||
const rollupBabel = require("rollup-plugin-babel");
|
||||
const rollupNodeResolve = require("rollup-plugin-node-resolve");
|
||||
const registerStandalonePackageTask = require("./scripts/gulp-tasks")
|
||||
.registerStandalonePackageTask;
|
||||
const { registerStandalonePackageTask } = require("./scripts/gulp-tasks");
|
||||
|
||||
const sources = ["codemods", "packages"];
|
||||
|
||||
@@ -138,7 +137,7 @@ registerStandalonePackageTask(
|
||||
"babel",
|
||||
"Babel",
|
||||
path.join(__dirname, "packages"),
|
||||
require("./packages/babel-core/package.json").version
|
||||
require("./packages/babel-standalone/package.json").version
|
||||
);
|
||||
|
||||
const presetEnvWebpackPlugins = [
|
||||
@@ -167,6 +166,6 @@ registerStandalonePackageTask(
|
||||
"babel-preset-env",
|
||||
"babelPresetEnv",
|
||||
path.join(__dirname, "packages"),
|
||||
require("./packages/babel-preset-env/package.json").version,
|
||||
require("./packages/babel-preset-env-standalone/package.json").version,
|
||||
presetEnvWebpackPlugins
|
||||
);
|
||||
|
||||
6
Makefile
6
Makefile
@@ -130,8 +130,12 @@ prepublish:
|
||||
make prepublish-build
|
||||
make test
|
||||
|
||||
new-version:
|
||||
./node_modules/.bin/lerna version --force-publish="@babel/runtime,@babel/runtime-corejs2,@babel/standalone,@babel/preset-env-standalone"
|
||||
|
||||
# NOTE: Run make new-version first
|
||||
publish: prepublish
|
||||
./node_modules/.bin/lerna publish --force-publish="@babel/runtime,@babel/runtime-corejs2,@babel/standalone,@babel/preset-env-standalone" --require-scripts
|
||||
./node_modules/.bin/lerna publish from-git --require-scripts
|
||||
make clean
|
||||
|
||||
bootstrap: clean-all
|
||||
|
||||
@@ -8,3 +8,5 @@ coverage:
|
||||
target: "80%"
|
||||
patch:
|
||||
enabled: false
|
||||
ignore:
|
||||
- packages/babel-types/src/*/generated/index.js
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "7.3.2",
|
||||
"version": "7.3.3",
|
||||
"changelog": {
|
||||
"repo": "babel/babel",
|
||||
"cacheDir": ".changelog",
|
||||
|
||||
@@ -30,13 +30,14 @@
|
||||
"chalk": "^2.3.2",
|
||||
"charcodes": "^0.2.0",
|
||||
"derequire": "^2.0.2",
|
||||
"duplicate-package-checker-webpack-plugin": "^2.1.0",
|
||||
"enhanced-resolve": "^3.0.0",
|
||||
"eslint": "^5.12.1",
|
||||
"eslint-config-babel": "^8.0.2",
|
||||
"eslint-plugin-flowtype": "^3.2.1",
|
||||
"eslint-plugin-prettier": "^3.0.1",
|
||||
"fancy-log": "^1.3.3",
|
||||
"flow-bin": "^0.87.0",
|
||||
"flow-bin": "^0.92.1",
|
||||
"graceful-fs": "^4.1.15",
|
||||
"gulp": "^4.0.0",
|
||||
"gulp-babel": "^8.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/core",
|
||||
"version": "7.2.2",
|
||||
"version": "7.3.3",
|
||||
"description": "Babel compiler core.",
|
||||
"main": "lib/index.js",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
@@ -34,16 +34,16 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"@babel/generator": "^7.2.2",
|
||||
"@babel/generator": "^7.3.3",
|
||||
"@babel/helpers": "^7.2.0",
|
||||
"@babel/parser": "^7.2.2",
|
||||
"@babel/parser": "^7.3.3",
|
||||
"@babel/template": "^7.2.2",
|
||||
"@babel/traverse": "^7.2.2",
|
||||
"@babel/types": "^7.2.2",
|
||||
"@babel/types": "^7.3.3",
|
||||
"convert-source-map": "^1.1.0",
|
||||
"debug": "^4.1.0",
|
||||
"json5": "^2.1.0",
|
||||
"lodash": "^4.17.10",
|
||||
"lodash": "^4.17.11",
|
||||
"resolve": "^1.3.2",
|
||||
"semver": "^5.4.1",
|
||||
"source-map": "^0.5.0"
|
||||
|
||||
@@ -43,7 +43,6 @@ export function makeWeakCache<
|
||||
>(
|
||||
handler: (ArgT, CacheConfigurator<SideChannel>) => ResultT,
|
||||
): (ArgT, SideChannel) => ResultT {
|
||||
// $FlowIssue https://github.com/facebook/flow/issues/4528
|
||||
return makeCachedFunction(new WeakMap(), handler);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
makeWeakCache,
|
||||
type CacheConfigurator,
|
||||
} from "../caching";
|
||||
import makeAPI from "../helpers/config-api";
|
||||
import makeAPI, { type PluginAPI } from "../helpers/config-api";
|
||||
import { makeStaticFileCache } from "./utils";
|
||||
import pathPatternToRegex from "../pattern-to-regex";
|
||||
import type { FilePackageData, RelativeConfig, ConfigFile } from "./types";
|
||||
@@ -150,7 +150,7 @@ const LOADING_CONFIGS = new Set();
|
||||
|
||||
const readConfigJS = makeStrongCache(
|
||||
(
|
||||
filepath,
|
||||
filepath: string,
|
||||
cache: CacheConfigurator<{
|
||||
envName: string,
|
||||
caller: CallerMetadata | void,
|
||||
@@ -193,7 +193,7 @@ const readConfigJS = makeStrongCache(
|
||||
}
|
||||
|
||||
if (typeof options === "function") {
|
||||
options = options(makeAPI(cache));
|
||||
options = ((options: any): (api: PluginAPI) => {})(makeAPI(cache));
|
||||
|
||||
if (!cache.configured()) throwConfigError();
|
||||
}
|
||||
|
||||
@@ -131,6 +131,7 @@ function isThenable(val: mixed): boolean {
|
||||
return (
|
||||
!!val &&
|
||||
(typeof val === "object" || typeof val === "function") &&
|
||||
!!val.then &&
|
||||
typeof val.then === "function"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/generator",
|
||||
"version": "7.3.2",
|
||||
"version": "7.3.3",
|
||||
"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.3.2",
|
||||
"@babel/types": "^7.3.3",
|
||||
"jsesc": "^2.5.1",
|
||||
"lodash": "^4.17.10",
|
||||
"lodash": "^4.17.11",
|
||||
"source-map": "^0.5.0",
|
||||
"trim-right": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-fixtures": "^7.2.0",
|
||||
"@babel/parser": "^7.3.2"
|
||||
"@babel/parser": "^7.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,8 +50,35 @@ export function Directive(node: Object) {
|
||||
this.semicolon();
|
||||
}
|
||||
|
||||
// These regexes match an even number of \ followed by a quote
|
||||
const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
|
||||
const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
|
||||
|
||||
export function DirectiveLiteral(node: Object) {
|
||||
const raw = this.getPossibleRaw(node);
|
||||
if (raw != null) {
|
||||
this.token(raw);
|
||||
return;
|
||||
}
|
||||
|
||||
const { value } = node;
|
||||
|
||||
// NOTE: In directives we can't change escapings,
|
||||
// because they change the behavior.
|
||||
// e.g. "us\x65 string" (\x65 is e) is not a "use strict" directive.
|
||||
|
||||
if (!unescapedDoubleQuoteRE.test(value)) {
|
||||
this.token(`"${value}"`);
|
||||
} else if (!unescapedSingleQuoteRE.test(value)) {
|
||||
this.token(`'${value}'`);
|
||||
} else {
|
||||
throw new Error(
|
||||
"Malformed AST: it is not possible to print a directive containing" +
|
||||
" both unescaped single and double quotes.",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export function InterpreterDirective(node: Object) {
|
||||
this.token(`#!${node.value}\n`);
|
||||
}
|
||||
|
||||
export { StringLiteral as DirectiveLiteral } from "./types";
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
0; // Not a directive
|
||||
"©";
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
0;// Not a directive
|
||||
"\u00A9";
|
||||
@@ -384,6 +384,48 @@ describe("programmatic generation", function() {
|
||||
[key: any]: number
|
||||
}`);
|
||||
});
|
||||
|
||||
describe("directives", function() {
|
||||
it("preserves escapes", function() {
|
||||
const directive = t.directive(
|
||||
t.directiveLiteral(String.raw`us\x65 strict`),
|
||||
);
|
||||
const output = generate(directive).code;
|
||||
|
||||
expect(output).toBe(String.raw`"us\x65 strict";`);
|
||||
});
|
||||
|
||||
it("preserves escapes in minified output", function() {
|
||||
// https://github.com/babel/babel/issues/4767
|
||||
|
||||
const directive = t.directive(t.directiveLiteral(String.raw`foo\n\t\r`));
|
||||
const output = generate(directive, { minified: true }).code;
|
||||
|
||||
expect(output).toBe(String.raw`"foo\n\t\r";`);
|
||||
});
|
||||
|
||||
it("unescaped single quote", function() {
|
||||
const directive = t.directive(t.directiveLiteral(String.raw`'\'\"`));
|
||||
const output = generate(directive).code;
|
||||
|
||||
expect(output).toBe(String.raw`"'\'\"";`);
|
||||
});
|
||||
|
||||
it("unescaped double quote", function() {
|
||||
const directive = t.directive(t.directiveLiteral(String.raw`"\'\"`));
|
||||
const output = generate(directive).code;
|
||||
|
||||
expect(output).toBe(String.raw`'"\'\"';`);
|
||||
});
|
||||
|
||||
it("unescaped single and double quotes together throw", function() {
|
||||
const directive = t.directive(t.directiveLiteral(String.raw`'"`));
|
||||
|
||||
expect(() => {
|
||||
generate(directive);
|
||||
}).toThrow();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("CodeGenerator", function() {
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
"@babel/helper-member-expression-to-functions": "^7.0.0",
|
||||
"@babel/helper-optimise-call-expression": "^7.0.0",
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/helper-replace-supers": "^7.2.3"
|
||||
"@babel/helper-replace-supers": "^7.2.3",
|
||||
"@babel/helper-split-export-declaration": "^7.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0"
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
"dependencies": {
|
||||
"@babel/helper-function-name": "^7.1.0",
|
||||
"@babel/types": "^7.0.0",
|
||||
"lodash": "^4.17.10"
|
||||
"lodash": "^4.17.11"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-helper-fixtures",
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.10",
|
||||
"lodash": "^4.17.11",
|
||||
"semver": "^5.3.0",
|
||||
"try-resolve": "^1.0.0"
|
||||
}
|
||||
|
||||
@@ -16,6 +16,6 @@
|
||||
"@babel/helper-split-export-declaration": "^7.0.0",
|
||||
"@babel/template": "^7.2.2",
|
||||
"@babel/types": "^7.2.2",
|
||||
"lodash": "^4.17.10"
|
||||
"lodash": "^4.17.11"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"lodash": "^4.17.10"
|
||||
"lodash": "^4.17.11"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"babel-check-duplicated-nodes": "^1.0.0",
|
||||
"jest": "^22.4.2",
|
||||
"jest-diff": "^22.4.0",
|
||||
"lodash": "^4.17.10",
|
||||
"lodash": "^4.17.11",
|
||||
"resolve": "^1.3.2",
|
||||
"source-map": "^0.5.0"
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"@babel/polyfill": "^7.0.0",
|
||||
"@babel/register": "^7.0.0",
|
||||
"commander": "^2.8.1",
|
||||
"lodash": "^4.17.10",
|
||||
"lodash": "^4.17.11",
|
||||
"v8flags": "^3.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
6
packages/babel-node/test/fixtures/babel-node/node_--inspect/options.json
vendored
Normal file
6
packages/babel-node/test/fixtures/babel-node/node_--inspect/options.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"args": ["--inspect", "--eval", "console.log('foo');"],
|
||||
"stderr": "Debugger listening on",
|
||||
"stderrContains": true,
|
||||
"stdout": "foo"
|
||||
}
|
||||
4
packages/babel-node/test/fixtures/babel-node/node_--no-lazy/options.json
vendored
Normal file
4
packages/babel-node/test/fixtures/babel-node/node_--no-lazy/options.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"args": ["--nolazy", "--eval", "console.log('foo')"],
|
||||
"stdout": "foo"
|
||||
}
|
||||
4
packages/babel-node/test/fixtures/babel-node/node_-gc_alias_--expose-gc/options.json
vendored
Normal file
4
packages/babel-node/test/fixtures/babel-node/node_-gc_alias_--expose-gc/options.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"args": ["-gc", "--eval", "console.log(typeof global.gc)"],
|
||||
"stdout": "function"
|
||||
}
|
||||
@@ -1149,6 +1149,7 @@ A specifier in an import or export declaration.
|
||||
```js
|
||||
interface ImportDeclaration <: ModuleDeclaration {
|
||||
type: "ImportDeclaration";
|
||||
importKind: null | "type" | "typeof" | "value";
|
||||
specifiers: [ ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier ];
|
||||
source: Literal;
|
||||
}
|
||||
@@ -1156,6 +1157,8 @@ interface ImportDeclaration <: ModuleDeclaration {
|
||||
|
||||
An import declaration, e.g., `import foo from "mod";`.
|
||||
|
||||
> importKind is only set when `flow` plugin enabled in babel-parser
|
||||
|
||||
### ImportSpecifier
|
||||
|
||||
```js
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/parser",
|
||||
"version": "7.3.2",
|
||||
"version": "7.3.3",
|
||||
"description": "A JavaScript parser",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -28,6 +28,7 @@
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/code-frame": "^7.0.0",
|
||||
"@babel/helper-fixtures": "^7.2.0",
|
||||
"charcodes": "0.1.0",
|
||||
"unicode-11.0.0": "^0.7.8"
|
||||
|
||||
@@ -76,7 +76,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
return this.finishNode(node, "InterpreterDirective");
|
||||
}
|
||||
|
||||
isLet(declaration?: boolean): boolean {
|
||||
isLet(context: ?string): boolean {
|
||||
if (!this.isContextual("let")) {
|
||||
return false;
|
||||
}
|
||||
@@ -85,20 +85,16 @@ export default class StatementParser extends ExpressionParser {
|
||||
// $FlowIgnore
|
||||
const next = this.state.pos + skip[0].length;
|
||||
const nextCh = this.state.input.charCodeAt(next);
|
||||
if (
|
||||
(nextCh === charCodes.leftCurlyBrace &&
|
||||
!lineBreak.test(this.state.input.slice(this.state.end, next))) ||
|
||||
nextCh === charCodes.leftSquareBracket
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
// For ambiguous cases, determine if a LexicalDeclaration (or only a
|
||||
// Statement) is allowed here. If context is not empty then only a Statement
|
||||
// is allowed. However, `let [` is an explicit negative lookahead for
|
||||
// ExpressionStatement, so special-case it first.
|
||||
if (nextCh === charCodes.leftSquareBracket) return true;
|
||||
if (context) return false;
|
||||
|
||||
if (nextCh === charCodes.leftCurlyBrace) return true;
|
||||
|
||||
if (isIdentifierStart(nextCh)) {
|
||||
if (
|
||||
!declaration &&
|
||||
lineBreak.test(this.state.input.slice(this.state.end, next))
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
let pos = next + 1;
|
||||
while (isIdentifierChar(this.state.input.charCodeAt(pos))) {
|
||||
++pos;
|
||||
@@ -116,19 +112,19 @@ export default class StatementParser extends ExpressionParser {
|
||||
// `if (foo) /blah/.exec(foo)`, where looking at the previous token
|
||||
// does not help.
|
||||
|
||||
parseStatement(declaration: boolean, topLevel?: boolean): N.Statement {
|
||||
parseStatement(context: ?string, topLevel?: boolean): N.Statement {
|
||||
if (this.match(tt.at)) {
|
||||
this.parseDecorators(true);
|
||||
}
|
||||
return this.parseStatementContent(declaration, topLevel);
|
||||
return this.parseStatementContent(context, topLevel);
|
||||
}
|
||||
|
||||
parseStatementContent(declaration: boolean, topLevel: ?boolean): N.Statement {
|
||||
parseStatementContent(context: ?string, topLevel: ?boolean): N.Statement {
|
||||
let starttype = this.state.type;
|
||||
const node = this.startNode();
|
||||
let kind;
|
||||
|
||||
if (this.isLet(declaration)) {
|
||||
if (this.isLet(context)) {
|
||||
starttype = tt._var;
|
||||
kind = "let";
|
||||
}
|
||||
@@ -148,18 +144,28 @@ export default class StatementParser extends ExpressionParser {
|
||||
return this.parseDoStatement(node);
|
||||
case tt._for:
|
||||
return this.parseForStatement(node);
|
||||
case tt._function:
|
||||
case tt._function: {
|
||||
if (this.lookahead().type === tt.dot) break;
|
||||
if (!declaration) {
|
||||
if (
|
||||
context &&
|
||||
(this.state.strict || (context !== "if" && context !== "label"))
|
||||
) {
|
||||
this.raise(
|
||||
this.state.start,
|
||||
"Function declaration not allowed in this context",
|
||||
);
|
||||
}
|
||||
return this.parseFunctionStatement(node);
|
||||
const result = this.parseFunctionStatement(node);
|
||||
|
||||
// TODO: Remove this once we have proper scope tracking in place.
|
||||
if (context && result.generator) {
|
||||
this.unexpected(node.start);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
case tt._class:
|
||||
if (!declaration) this.unexpected();
|
||||
if (context) this.unexpected();
|
||||
return this.parseClass(node, true);
|
||||
|
||||
case tt._if:
|
||||
@@ -176,7 +182,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
case tt._const:
|
||||
case tt._var:
|
||||
kind = kind || this.state.value;
|
||||
if (!declaration && kind !== "var") this.unexpected();
|
||||
if (context && kind !== "var") this.unexpected();
|
||||
return this.parseVarStatement(node, kind);
|
||||
|
||||
case tt._while:
|
||||
@@ -237,7 +243,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
const state = this.state.clone();
|
||||
this.next();
|
||||
if (this.match(tt._function) && !this.canInsertSemicolon()) {
|
||||
if (!declaration) {
|
||||
if (context) {
|
||||
this.raise(
|
||||
this.state.lastTokStart,
|
||||
"Function declaration not allowed in this context",
|
||||
@@ -264,7 +270,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
expr.type === "Identifier" &&
|
||||
this.eat(tt.colon)
|
||||
) {
|
||||
return this.parseLabeledStatement(node, maybeName, expr, declaration);
|
||||
return this.parseLabeledStatement(node, maybeName, expr, context);
|
||||
} else {
|
||||
return this.parseExpressionStatement(node, expr);
|
||||
}
|
||||
@@ -430,7 +436,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
// outside of the loop body.
|
||||
this.withTopicForbiddingContext(() =>
|
||||
// Parse the loop body's body.
|
||||
this.parseStatement(false),
|
||||
this.parseStatement("do"),
|
||||
);
|
||||
|
||||
this.state.labels.pop();
|
||||
@@ -526,8 +532,8 @@ export default class StatementParser extends ExpressionParser {
|
||||
parseIfStatement(node: N.IfStatement): N.IfStatement {
|
||||
this.next();
|
||||
node.test = this.parseParenExpression();
|
||||
node.consequent = this.parseStatement(false);
|
||||
node.alternate = this.eat(tt._else) ? this.parseStatement(false) : null;
|
||||
node.consequent = this.parseStatement("if");
|
||||
node.alternate = this.eat(tt._else) ? this.parseStatement("if") : null;
|
||||
return this.finishNode(node, "IfStatement");
|
||||
}
|
||||
|
||||
@@ -583,7 +589,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
this.expect(tt.colon);
|
||||
} else {
|
||||
if (cur) {
|
||||
cur.consequent.push(this.parseStatement(true));
|
||||
cur.consequent.push(this.parseStatement(null));
|
||||
} else {
|
||||
this.unexpected();
|
||||
}
|
||||
@@ -672,7 +678,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
// They are permitted in test expressions, outside of the loop body.
|
||||
this.withTopicForbiddingContext(() =>
|
||||
// Parse loop body.
|
||||
this.parseStatement(false),
|
||||
this.parseStatement("while"),
|
||||
);
|
||||
|
||||
this.state.labels.pop();
|
||||
@@ -694,7 +700,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
// part of the outer context, outside of the function body.
|
||||
this.withTopicForbiddingContext(() =>
|
||||
// Parse the statement body.
|
||||
this.parseStatement(false),
|
||||
this.parseStatement("with"),
|
||||
);
|
||||
|
||||
return this.finishNode(node, "WithStatement");
|
||||
@@ -709,7 +715,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
node: N.LabeledStatement,
|
||||
maybeName: string,
|
||||
expr: N.Identifier,
|
||||
declaration: boolean,
|
||||
context: ?string,
|
||||
): N.LabeledStatement {
|
||||
for (const label of this.state.labels) {
|
||||
if (label.name === maybeName) {
|
||||
@@ -737,16 +743,13 @@ export default class StatementParser extends ExpressionParser {
|
||||
kind: kind,
|
||||
statementStart: this.state.start,
|
||||
});
|
||||
node.body = this.parseStatement(declaration);
|
||||
|
||||
if (
|
||||
node.body.type === "ClassDeclaration" ||
|
||||
(node.body.type === "VariableDeclaration" && node.body.kind !== "var") ||
|
||||
(node.body.type === "FunctionDeclaration" &&
|
||||
(this.state.strict || node.body.generator || node.body.async))
|
||||
) {
|
||||
this.raise(node.body.start, "Invalid labeled declaration");
|
||||
}
|
||||
node.body = this.parseStatement(
|
||||
context
|
||||
? context.indexOf("label") === -1
|
||||
? context + "label"
|
||||
: context
|
||||
: "label",
|
||||
);
|
||||
|
||||
this.state.labels.pop();
|
||||
node.label = expr;
|
||||
@@ -813,7 +816,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
octalPosition = this.state.octalPosition;
|
||||
}
|
||||
|
||||
const stmt = this.parseStatement(true, topLevel);
|
||||
const stmt = this.parseStatement(null, topLevel);
|
||||
|
||||
if (directives && !parsedNonDirective && this.isValidDirective(stmt)) {
|
||||
const directive = this.stmtToDirective(stmt);
|
||||
@@ -861,7 +864,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
// outside of the loop body.
|
||||
this.withTopicForbiddingContext(() =>
|
||||
// Parse the loop body.
|
||||
this.parseStatement(false),
|
||||
this.parseStatement("for"),
|
||||
);
|
||||
|
||||
this.state.labels.pop();
|
||||
@@ -896,7 +899,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
// They are permitted in test expressions, outside of the loop body.
|
||||
this.withTopicForbiddingContext(() =>
|
||||
// Parse loop body.
|
||||
this.parseStatement(false),
|
||||
this.parseStatement("for"),
|
||||
);
|
||||
|
||||
this.state.labels.pop();
|
||||
@@ -1700,7 +1703,7 @@ export default class StatementParser extends ExpressionParser {
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
parseExportDeclaration(node: N.ExportNamedDeclaration): ?N.Declaration {
|
||||
return this.parseStatement(true);
|
||||
return this.parseStatement(null);
|
||||
}
|
||||
|
||||
isExportDefaultSpecifier(): boolean {
|
||||
|
||||
@@ -1566,7 +1566,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
}
|
||||
|
||||
// interfaces
|
||||
parseStatement(declaration: boolean, topLevel?: boolean): N.Statement {
|
||||
parseStatement(context: ?string, topLevel?: boolean): N.Statement {
|
||||
// strict mode handling of `interface` since it's a reserved word
|
||||
if (
|
||||
this.state.strict &&
|
||||
@@ -1577,7 +1577,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
this.next();
|
||||
return this.flowParseInterface(node);
|
||||
} else {
|
||||
const stmt = super.parseStatement(declaration, topLevel);
|
||||
const stmt = super.parseStatement(context, topLevel);
|
||||
// We will parse a flow pragma in any comment before the first statement.
|
||||
if (this.flowPragma === undefined && !this.isValidDirective(stmt)) {
|
||||
this.flowPragma = null;
|
||||
|
||||
@@ -342,17 +342,18 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
}
|
||||
|
||||
tsParseBindingListForSignature(): $ReadOnlyArray<
|
||||
N.Identifier | N.RestElement | N.ObjectPattern,
|
||||
N.Identifier | N.RestElement | N.ObjectPattern | N.ArrayPattern,
|
||||
> {
|
||||
return this.parseBindingList(tt.parenR).map(pattern => {
|
||||
if (
|
||||
pattern.type !== "Identifier" &&
|
||||
pattern.type !== "RestElement" &&
|
||||
pattern.type !== "ObjectPattern"
|
||||
pattern.type !== "ObjectPattern" &&
|
||||
pattern.type !== "ArrayPattern"
|
||||
) {
|
||||
throw this.unexpected(
|
||||
pattern.start,
|
||||
`Name in a signature must be an Identifier or ObjectPattern, instead got ${
|
||||
`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${
|
||||
pattern.type
|
||||
}`,
|
||||
);
|
||||
@@ -794,6 +795,21 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
return true;
|
||||
}
|
||||
|
||||
if (this.match(tt.bracketL)) {
|
||||
let braceStackCounter = 1;
|
||||
this.next();
|
||||
|
||||
while (braceStackCounter > 0) {
|
||||
if (this.match(tt.bracketL)) {
|
||||
++braceStackCounter;
|
||||
} else if (this.match(tt.bracketR)) {
|
||||
--braceStackCounter;
|
||||
}
|
||||
this.next();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1683,10 +1699,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
return super.parseExportDefaultExpression();
|
||||
}
|
||||
|
||||
parseStatementContent(
|
||||
declaration: boolean,
|
||||
topLevel: ?boolean,
|
||||
): N.Statement {
|
||||
parseStatementContent(context: ?string, topLevel: ?boolean): N.Statement {
|
||||
if (this.state.type === tt._const) {
|
||||
const ahead = this.lookahead();
|
||||
if (ahead.type === tt.name && ahead.value === "enum") {
|
||||
@@ -1696,7 +1709,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
return this.tsParseEnumDeclaration(node, /* isConst */ true);
|
||||
}
|
||||
}
|
||||
return super.parseStatementContent(declaration, topLevel);
|
||||
return super.parseStatementContent(context, topLevel);
|
||||
}
|
||||
|
||||
parseAccessModifier(): ?N.Accessibility {
|
||||
@@ -1849,7 +1862,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
||||
return this.finishNode(typeCastNode, "TSTypeCastExpression");
|
||||
}
|
||||
|
||||
return node;
|
||||
return this.finishNode(node, node.type);
|
||||
}
|
||||
|
||||
parseExportDeclaration(node: N.ExportNamedDeclaration): ?N.Declaration {
|
||||
|
||||
@@ -1076,7 +1076,9 @@ export type TsSignatureDeclaration =
|
||||
|
||||
export type TsSignatureDeclarationOrIndexSignatureBase = NodeBase & {
|
||||
// Not using TypeScript's "ParameterDeclaration" here, since it's inconsistent with regular functions.
|
||||
parameters: $ReadOnlyArray<Identifier | RestElement | ObjectPattern>,
|
||||
parameters: $ReadOnlyArray<
|
||||
Identifier | RestElement | ObjectPattern | ArrayPattern,
|
||||
>,
|
||||
typeAnnotation: ?TsTypeAnnotation,
|
||||
};
|
||||
|
||||
|
||||
4
packages/babel-parser/test/fixtures/es2015/let/let-block-with-newline/input.js
vendored
Normal file
4
packages/babel-parser/test/fixtures/es2015/let/let-block-with-newline/input.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
if (false) {
|
||||
L: let // ASI
|
||||
{}
|
||||
}
|
||||
220
packages/babel-parser/test/fixtures/es2015/let/let-block-with-newline/output.json
vendored
Normal file
220
packages/babel-parser/test/fixtures/es2015/let/let-block-with-newline/output.json
vendored
Normal file
@@ -0,0 +1,220 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 39,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 39,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"sourceType": "script",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "IfStatement",
|
||||
"start": 0,
|
||||
"end": 39,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"type": "BooleanLiteral",
|
||||
"start": 4,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"value": false
|
||||
},
|
||||
"consequent": {
|
||||
"type": "BlockStatement",
|
||||
"start": 11,
|
||||
"end": 39,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 4,
|
||||
"column": 1
|
||||
}
|
||||
},
|
||||
"body": [
|
||||
{
|
||||
"type": "LabeledStatement",
|
||||
"start": 17,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"body": {
|
||||
"type": "ExpressionStatement",
|
||||
"start": 20,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 10
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "Identifier",
|
||||
"start": 20,
|
||||
"end": 23,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 10
|
||||
},
|
||||
"identifierName": "let"
|
||||
},
|
||||
"name": "let"
|
||||
}
|
||||
},
|
||||
"label": {
|
||||
"type": "Identifier",
|
||||
"start": 17,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 5
|
||||
},
|
||||
"identifierName": "L"
|
||||
},
|
||||
"name": "L"
|
||||
},
|
||||
"trailingComments": [
|
||||
{
|
||||
"type": "CommentLine",
|
||||
"value": " ASI",
|
||||
"start": 24,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 17
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "BlockStatement",
|
||||
"start": 35,
|
||||
"end": 37,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"body": [],
|
||||
"directives": [],
|
||||
"leadingComments": [
|
||||
{
|
||||
"type": "CommentLine",
|
||||
"value": " ASI",
|
||||
"start": 24,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 17
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
},
|
||||
"alternate": null
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
},
|
||||
"comments": [
|
||||
{
|
||||
"type": "CommentLine",
|
||||
"value": " ASI",
|
||||
"start": 24,
|
||||
"end": 30,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 17
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
2
packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-arr-dstrk/input.js
vendored
Normal file
2
packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-arr-dstrk/input.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
let
|
||||
[a] = [1];
|
||||
139
packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-arr-dstrk/output.json
vendored
Normal file
139
packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-arr-dstrk/output.json
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"sourceType": "script",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 18,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 8,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "ArrayPattern",
|
||||
"start": 8,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 9,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
}
|
||||
]
|
||||
},
|
||||
"init": {
|
||||
"type": "ArrayExpression",
|
||||
"start": 14,
|
||||
"end": 17,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 10
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
}
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"type": "NumericLiteral",
|
||||
"start": 15,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 11
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 12
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": 1,
|
||||
"raw": "1"
|
||||
},
|
||||
"value": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "let"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
2
packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-obj-dstrk/input.js
vendored
Normal file
2
packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-obj-dstrk/input.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
let
|
||||
{ a } = { a: 1 };
|
||||
212
packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-obj-dstrk/output.json
vendored
Normal file
212
packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-obj-dstrk/output.json
vendored
Normal file
@@ -0,0 +1,212 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"sourceType": "script",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 25,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 21
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 8,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "ObjectPattern",
|
||||
"start": 8,
|
||||
"end": 13,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
}
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "ObjectProperty",
|
||||
"start": 10,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
}
|
||||
},
|
||||
"method": false,
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"start": 10,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"computed": false,
|
||||
"shorthand": true,
|
||||
"value": {
|
||||
"type": "Identifier",
|
||||
"start": 10,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 7
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"extra": {
|
||||
"shorthand": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"init": {
|
||||
"type": "ObjectExpression",
|
||||
"start": 16,
|
||||
"end": 24,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 12
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 20
|
||||
}
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"type": "ObjectProperty",
|
||||
"start": 18,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 14
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"method": false,
|
||||
"key": {
|
||||
"type": "Identifier",
|
||||
"start": 18,
|
||||
"end": 19,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 14
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 15
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"computed": false,
|
||||
"shorthand": false,
|
||||
"value": {
|
||||
"type": "NumericLiteral",
|
||||
"start": 21,
|
||||
"end": 22,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 17
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": 1,
|
||||
"raw": "1"
|
||||
},
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"kind": "let"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
2
packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak/input.js
vendored
Normal file
2
packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak/input.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
let
|
||||
a;
|
||||
86
packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak/output.json
vendored
Normal file
86
packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak/output.json
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"sourceType": "script",
|
||||
"interpreter": null,
|
||||
"body": [
|
||||
{
|
||||
"type": "VariableDeclaration",
|
||||
"start": 0,
|
||||
"end": 10,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 6
|
||||
}
|
||||
},
|
||||
"declarations": [
|
||||
{
|
||||
"type": "VariableDeclarator",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 5
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 8,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 5
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
},
|
||||
"init": null
|
||||
}
|
||||
],
|
||||
"kind": "let"
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Invalid labeled declaration (1:5)"
|
||||
"throws": "Unexpected token (1:5)"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Invalid labeled declaration (1:5)"
|
||||
"throws": "Unexpected token (1:5)"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Invalid labeled declaration (1:5)"
|
||||
"throws": "Function declaration not allowed in this context (1:5)"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Invalid labeled declaration (1:5)"
|
||||
"throws": "Unexpected token (1:5)"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Invalid labeled declaration (1:35)"
|
||||
"throws": "Function declaration not allowed in this context (1:35)"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Invalid labeled declaration (1:5)"
|
||||
"throws": "Unexpected token, expected \";\" (1:9)"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:7)"
|
||||
"throws": "Unexpected token, expected \";\" (1:11)"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Unexpected token (1:9)"
|
||||
"throws": "Unexpected token, expected \";\" (1:13)"
|
||||
}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
(x?: number): any => x;
|
||||
(x?: number): any => x;
|
||||
((k?) => k + 1)();
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 23,
|
||||
"end": 42,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
"line": 2,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 23,
|
||||
"end": 42,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 23
|
||||
"line": 2,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
@@ -158,6 +158,132 @@
|
||||
"name": "x"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ExpressionStatement",
|
||||
"start": 24,
|
||||
"end": 42,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 18
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "CallExpression",
|
||||
"start": 24,
|
||||
"end": 41,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 17
|
||||
}
|
||||
},
|
||||
"callee": {
|
||||
"type": "ArrowFunctionExpression",
|
||||
"start": 25,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 1
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"id": null,
|
||||
"generator": false,
|
||||
"async": false,
|
||||
"params": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 26,
|
||||
"end": 28,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 2
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 4
|
||||
},
|
||||
"identifierName": "k"
|
||||
},
|
||||
"name": "k",
|
||||
"optional": true
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BinaryExpression",
|
||||
"start": 33,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"left": {
|
||||
"type": "Identifier",
|
||||
"start": 33,
|
||||
"end": 34,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 9
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 10
|
||||
},
|
||||
"identifierName": "k"
|
||||
},
|
||||
"name": "k"
|
||||
},
|
||||
"operator": "+",
|
||||
"right": {
|
||||
"type": "NumericLiteral",
|
||||
"start": 37,
|
||||
"end": 38,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"column": 13
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"column": 14
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"rawValue": 1,
|
||||
"raw": "1"
|
||||
},
|
||||
"value": 1
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"parenthesized": true,
|
||||
"parenStart": 24
|
||||
}
|
||||
},
|
||||
"arguments": []
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
type MyType = ({ theme }: any) => any
|
||||
|
||||
type AnotherType = ([a]: any) => any
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
{
|
||||
"type": "File",
|
||||
"start": 0,
|
||||
"end": 37,
|
||||
"end": 75,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 37
|
||||
"line": 3,
|
||||
"column": 36
|
||||
}
|
||||
},
|
||||
"program": {
|
||||
"type": "Program",
|
||||
"start": 0,
|
||||
"end": 37,
|
||||
"end": 75,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 1,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 1,
|
||||
"column": 37
|
||||
"line": 3,
|
||||
"column": 36
|
||||
}
|
||||
},
|
||||
"sourceType": "module",
|
||||
@@ -209,6 +209,149 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "TSTypeAliasDeclaration",
|
||||
"start": 39,
|
||||
"end": 75,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 36
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "Identifier",
|
||||
"start": 44,
|
||||
"end": 55,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 5
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 16
|
||||
},
|
||||
"identifierName": "AnotherType"
|
||||
},
|
||||
"name": "AnotherType"
|
||||
},
|
||||
"typeAnnotation": {
|
||||
"type": "TSFunctionType",
|
||||
"start": 58,
|
||||
"end": 75,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 19
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 36
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"type": "ArrayPattern",
|
||||
"start": 59,
|
||||
"end": 67,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 20
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"type": "Identifier",
|
||||
"start": 60,
|
||||
"end": 61,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 21
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 22
|
||||
},
|
||||
"identifierName": "a"
|
||||
},
|
||||
"name": "a"
|
||||
}
|
||||
],
|
||||
"typeAnnotation": {
|
||||
"type": "TSTypeAnnotation",
|
||||
"start": 62,
|
||||
"end": 67,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 23
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 28
|
||||
}
|
||||
},
|
||||
"typeAnnotation": {
|
||||
"type": "TSAnyKeyword",
|
||||
"start": 64,
|
||||
"end": 67,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 25
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 28
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"typeAnnotation": {
|
||||
"type": "TSTypeAnnotation",
|
||||
"start": 69,
|
||||
"end": 75,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 30
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 36
|
||||
}
|
||||
},
|
||||
"typeAnnotation": {
|
||||
"type": "TSAnyKeyword",
|
||||
"start": 72,
|
||||
"end": 75,
|
||||
"loc": {
|
||||
"start": {
|
||||
"line": 3,
|
||||
"column": 33
|
||||
},
|
||||
"end": {
|
||||
"line": 3,
|
||||
"column": 36
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"directives": []
|
||||
|
||||
@@ -1,7 +1,46 @@
|
||||
import { multiple as getFixtures } from "@babel/helper-fixtures";
|
||||
import { codeFrameColumns } from "@babel/code-frame";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
const rootPath = path.join(__dirname, "../../../..");
|
||||
|
||||
class FixtureError extends Error {
|
||||
constructor(previousError, fixturePath, code) {
|
||||
super(previousError.message);
|
||||
const messageLines = (previousError.message.match(/\n/g) || []).length + 1;
|
||||
|
||||
let fixtureStackFrame = "";
|
||||
if (previousError.loc) {
|
||||
fixtureStackFrame =
|
||||
codeFrameColumns(
|
||||
code,
|
||||
{
|
||||
start: {
|
||||
line: previousError.loc.line,
|
||||
column: previousError.loc.column + 1,
|
||||
},
|
||||
},
|
||||
{ highlightCode: true },
|
||||
) +
|
||||
"\n" +
|
||||
`at fixture (${fixturePath}:${previousError.loc.line}:${previousError
|
||||
.loc.column + 1})\n`;
|
||||
}
|
||||
|
||||
this.stack =
|
||||
previousError.constructor.name +
|
||||
": " +
|
||||
previousError.message +
|
||||
"\n" +
|
||||
fixtureStackFrame +
|
||||
previousError.stack
|
||||
.split("\n")
|
||||
.slice(messageLines)
|
||||
.join("\n");
|
||||
}
|
||||
}
|
||||
|
||||
export function runFixtureTests(fixturesPath, parseFunction) {
|
||||
const fixtures = getFixtures(fixturesPath);
|
||||
|
||||
@@ -26,9 +65,11 @@ export function runFixtureTests(fixturesPath, parseFunction) {
|
||||
}
|
||||
}
|
||||
|
||||
err.message =
|
||||
name + "/" + task.actual.filename + ": " + err.message;
|
||||
throw err;
|
||||
const fixturePath = `${path.relative(
|
||||
rootPath,
|
||||
fixturesPath,
|
||||
)}/${name}/${task.actual.filename}`;
|
||||
throw new FixtureError(err, fixturePath, task.actual.code);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -53,9 +94,11 @@ export function runThrowTestsWithEstree(fixturesPath, parseFunction) {
|
||||
try {
|
||||
runTest(task, parseFunction);
|
||||
} catch (err) {
|
||||
err.message =
|
||||
name + "/" + task.actual.filename + ": " + err.message;
|
||||
throw err;
|
||||
const fixturePath = `${path.relative(
|
||||
rootPath,
|
||||
fixturesPath,
|
||||
)}/${name}/${task.actual.filename}`;
|
||||
throw new FixtureError(err, fixturePath, task.actual.code);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
20
packages/babel-parser/typings/babel-parser.d.ts
vendored
20
packages/babel-parser/typings/babel-parser.d.ts
vendored
@@ -106,4 +106,22 @@ export type ParserPlugin =
|
||||
'optionalCatchBinding' |
|
||||
'throwExpressions' |
|
||||
'pipelineOperator' |
|
||||
'nullishCoalescingOperator';
|
||||
'nullishCoalescingOperator' |
|
||||
ParserPluginWithOptions;
|
||||
|
||||
export type ParserPluginWithOptions =
|
||||
['decorators', DecoratorsPluginOptions] |
|
||||
['pipelineOperator', PipelineOperatorPluginOptions] |
|
||||
['flow', FlowPluginOptions];
|
||||
|
||||
export interface DecoratorsPluginOptions {
|
||||
decoratorsBeforeExport?: boolean;
|
||||
}
|
||||
|
||||
export interface PipelineOperatorPluginOptions {
|
||||
proposal: 'minimal' | 'smart';
|
||||
}
|
||||
|
||||
export interface FlowPluginOptions {
|
||||
all?: boolean;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-proposal-class-properties",
|
||||
"version": "7.3.0",
|
||||
"version": "7.3.3",
|
||||
"description": "This plugin transforms static class properties as well as properties declared with the property initializer syntax",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-properties",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/core": "^7.3.3",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,13 +12,13 @@ function (_Bar) {
|
||||
|
||||
if (condition) {
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))), _bar, {
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(_this), _bar, {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
});
|
||||
} else {
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))), _bar, {
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(_this), _bar, {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
});
|
||||
|
||||
@@ -22,7 +22,7 @@ function (_Foo) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Bar);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Bar).call(this, ...args));
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), _prop2, {
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(_this), _prop2, {
|
||||
writable: true,
|
||||
value: "bar"
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ function (_Parent) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Child);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Child).call(this));
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), _scopedFunctionWithThis, {
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(_this), _scopedFunctionWithThis, {
|
||||
writable: true,
|
||||
value: function value() {
|
||||
_this.name = {};
|
||||
|
||||
@@ -9,7 +9,7 @@ function (_Bar) {
|
||||
var _temp, _this;
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), Object.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), _bar, {
|
||||
foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), Object.defineProperty(babelHelpers.assertThisInitialized(_this), _bar, {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
}), _temp));
|
||||
|
||||
@@ -10,7 +10,7 @@ function (_Bar) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), _bar, {
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(_this), _bar, {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
});
|
||||
|
||||
@@ -13,14 +13,14 @@ function (_Bar) {
|
||||
if (condition) {
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
|
||||
_bar.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))), {
|
||||
_bar.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
});
|
||||
} else {
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
|
||||
_bar.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))), {
|
||||
_bar.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ function (_Foo) {
|
||||
babelHelpers.classCallCheck(this, Bar);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Bar).call(this, ...args));
|
||||
|
||||
_prop2.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), {
|
||||
_prop2.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: "bar"
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ function (_Parent) {
|
||||
babelHelpers.classCallCheck(this, Child);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Child).call(this));
|
||||
|
||||
_scopedFunctionWithThis.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), {
|
||||
_scopedFunctionWithThis.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: () => {
|
||||
_this.name = {};
|
||||
|
||||
@@ -29,7 +29,7 @@ function (_A) {
|
||||
babelHelpers.classCallCheck(this, B);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(B).call(this, ...args));
|
||||
|
||||
_foo.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), {
|
||||
_foo.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: babelHelpers.get(babelHelpers.getPrototypeOf(B.prototype), "foo", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this))
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@ function (_Bar) {
|
||||
var _temp, _this;
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), _bar.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), {
|
||||
foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), _bar.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
}), _temp));
|
||||
|
||||
@@ -11,7 +11,7 @@ function (_Bar) {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
|
||||
_bar.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), {
|
||||
_bar.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
});
|
||||
|
||||
@@ -12,10 +12,10 @@ function (_Bar) {
|
||||
|
||||
if (condition) {
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))), "bar", "foo");
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "bar", "foo");
|
||||
} else {
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))), "bar", "foo");
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "bar", "foo");
|
||||
}
|
||||
|
||||
return babelHelpers.possibleConstructorReturn(_this);
|
||||
|
||||
@@ -10,7 +10,7 @@ function (_Bar) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this, ...args));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "bar", "foo");
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "bar", "foo");
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ function (_Parent) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Child);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Child).call(this));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "scopedFunctionWithThis", function () {
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "scopedFunctionWithThis", function () {
|
||||
_this.name = {};
|
||||
});
|
||||
return _this;
|
||||
|
||||
@@ -28,7 +28,7 @@ function (_A) {
|
||||
|
||||
babelHelpers.classCallCheck(this, B);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(B).call(this, ...args));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "foo", babelHelpers.get(babelHelpers.getPrototypeOf(B.prototype), "foo", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "foo", babelHelpers.get(babelHelpers.getPrototypeOf(B.prototype), "foo", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)));
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ function (_Bar) {
|
||||
var _temp, _this;
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "bar", "foo"), _temp));
|
||||
foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "bar", "foo"), _temp));
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ function (_Bar) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "bar", "foo");
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "bar", "foo");
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
@@ -43,7 +43,7 @@ var Test = function Test() {
|
||||
|
||||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Other)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
||||
|
||||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "a", function () {
|
||||
_defineProperty(_assertThisInitialized(_this), "a", function () {
|
||||
return _get(_getPrototypeOf(Other.prototype), "test", _assertThisInitialized(_this));
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-syntax-typescript",
|
||||
"version": "7.2.0",
|
||||
"version": "7.3.3",
|
||||
"description": "Allow parsing of TypeScript syntax",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-typescript",
|
||||
"license": "MIT",
|
||||
@@ -19,6 +19,6 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0"
|
||||
"@babel/core": "^7.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ export default declare((api, { isTSX }) => {
|
||||
// takes priority.
|
||||
removePlugin(plugins, "flow");
|
||||
|
||||
// If the JSX syntax plugin already ran, remomove it because JSX handling
|
||||
// If the JSX syntax plugin already ran, remove it because JSX handling
|
||||
// in TS depends on the extensions, and is purely dependent on 'isTSX'.
|
||||
removePlugin(plugins, "jsx");
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"main": "lib/index.js",
|
||||
"dependencies": {
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"lodash": "^4.17.10"
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"keywords": [
|
||||
"babel-plugin"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-classes",
|
||||
"version": "7.2.2",
|
||||
"version": "7.3.3",
|
||||
"description": "Compile ES2015 classes to ES5",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-classes",
|
||||
"license": "MIT",
|
||||
@@ -25,7 +25,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.2",
|
||||
"@babel/core": "^7.3.3",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,25 +32,6 @@ const verifyConstructorVisitor = traverse.visitors.merge([
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
ThisExpression(path, state) {
|
||||
if (!state.isDerived) return;
|
||||
|
||||
const { node, parentPath } = path;
|
||||
if (parentPath.isMemberExpression({ object: node })) {
|
||||
// In cases like this.foo or this[foo], there is no need to add
|
||||
// assertThisInitialized, since they already throw if this is
|
||||
// undefined.
|
||||
return;
|
||||
}
|
||||
|
||||
const assertion = t.callExpression(
|
||||
state.file.addHelper("assertThisInitialized"),
|
||||
[node],
|
||||
);
|
||||
path.replaceWith(assertion);
|
||||
path.skip();
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
@@ -84,7 +65,6 @@ export default function transformClass(
|
||||
instancePropRefs: {},
|
||||
staticPropBody: [],
|
||||
body: [],
|
||||
bareSupers: new Set(),
|
||||
superThises: [],
|
||||
pushedConstructor: false,
|
||||
pushedInherits: false,
|
||||
@@ -217,34 +197,22 @@ export default function transformClass(
|
||||
|
||||
replaceSupers.replace();
|
||||
|
||||
// TODO this needs to be cleaned up. But, one step at a time.
|
||||
const state = {
|
||||
returns: [],
|
||||
bareSupers: new Set(),
|
||||
};
|
||||
const superReturns = [];
|
||||
path.traverse(
|
||||
traverse.visitors.merge([
|
||||
environmentVisitor,
|
||||
{
|
||||
ReturnStatement(path, state) {
|
||||
ReturnStatement(path) {
|
||||
if (!path.getFunctionParent().isArrowFunctionExpression()) {
|
||||
state.returns.push(path);
|
||||
}
|
||||
},
|
||||
|
||||
Super(path, state) {
|
||||
const { node, parentPath } = path;
|
||||
if (parentPath.isCallExpression({ callee: node })) {
|
||||
state.bareSupers.add(parentPath);
|
||||
superReturns.push(path);
|
||||
}
|
||||
},
|
||||
},
|
||||
]),
|
||||
state,
|
||||
);
|
||||
|
||||
if (isConstructor) {
|
||||
pushConstructor(state, node, path);
|
||||
pushConstructor(superReturns, node, path);
|
||||
} else {
|
||||
pushMethod(node, path);
|
||||
}
|
||||
@@ -378,15 +346,43 @@ export default function transformClass(
|
||||
|
||||
path.traverse(findThisesVisitor);
|
||||
|
||||
let guaranteedSuperBeforeFinish = !!classState.bareSupers.size;
|
||||
|
||||
let thisRef = function() {
|
||||
const ref = path.scope.generateDeclaredUidIdentifier("this");
|
||||
thisRef = () => t.cloneNode(ref);
|
||||
return ref;
|
||||
};
|
||||
|
||||
for (const bareSuper of classState.bareSupers) {
|
||||
for (const thisPath of classState.superThises) {
|
||||
const { node, parentPath } = thisPath;
|
||||
if (parentPath.isMemberExpression({ object: node })) {
|
||||
thisPath.replaceWith(thisRef());
|
||||
continue;
|
||||
}
|
||||
thisPath.replaceWith(
|
||||
t.callExpression(classState.file.addHelper("assertThisInitialized"), [
|
||||
thisRef(),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
const bareSupers = new Set();
|
||||
path.traverse(
|
||||
traverse.visitors.merge([
|
||||
environmentVisitor,
|
||||
{
|
||||
Super(path) {
|
||||
const { node, parentPath } = path;
|
||||
if (parentPath.isCallExpression({ callee: node })) {
|
||||
bareSupers.add(parentPath);
|
||||
}
|
||||
},
|
||||
},
|
||||
]),
|
||||
);
|
||||
|
||||
let guaranteedSuperBeforeFinish = !!bareSupers.size;
|
||||
|
||||
for (const bareSuper of bareSupers) {
|
||||
wrapSuperCall(bareSuper, classState.superName, thisRef, body);
|
||||
|
||||
if (guaranteedSuperBeforeFinish) {
|
||||
@@ -408,19 +404,6 @@ export default function transformClass(
|
||||
}
|
||||
}
|
||||
|
||||
for (const thisPath of classState.superThises) {
|
||||
const { node, parentPath } = thisPath;
|
||||
if (parentPath.isMemberExpression({ object: node })) {
|
||||
thisPath.replaceWith(thisRef());
|
||||
continue;
|
||||
}
|
||||
thisPath.replaceWith(
|
||||
t.callExpression(classState.file.addHelper("assertThisInitialized"), [
|
||||
thisRef(),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
let wrapReturn;
|
||||
|
||||
if (classState.isLoose) {
|
||||
@@ -535,7 +518,7 @@ export default function transformClass(
|
||||
* Replace the constructor body of our class.
|
||||
*/
|
||||
function pushConstructor(
|
||||
replaceSupers,
|
||||
superReturns,
|
||||
method: { type: "ClassMethod" },
|
||||
path: NodePath,
|
||||
) {
|
||||
@@ -548,8 +531,7 @@ export default function transformClass(
|
||||
userConstructorPath: path,
|
||||
userConstructor: method,
|
||||
hasConstructor: true,
|
||||
bareSupers: replaceSupers.bareSupers,
|
||||
superReturns: replaceSupers.returns,
|
||||
superReturns,
|
||||
});
|
||||
|
||||
const { construct } = classState;
|
||||
|
||||
@@ -21,7 +21,7 @@ function (_b) {
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(a1).call(this));
|
||||
|
||||
_this.x = function () {
|
||||
return babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this));
|
||||
return babelHelpers.assertThisInitialized(_this);
|
||||
};
|
||||
|
||||
return _this;
|
||||
@@ -42,7 +42,7 @@ function (_b2) {
|
||||
_this2 = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(a2).call(this));
|
||||
|
||||
_this2.x = function () {
|
||||
return babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this2));
|
||||
return babelHelpers.assertThisInitialized(_this2);
|
||||
};
|
||||
|
||||
return _this2;
|
||||
|
||||
@@ -9,7 +9,7 @@ function (_Bar) {
|
||||
var _this;
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
return _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this, babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))));
|
||||
return _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this, babelHelpers.assertThisInitialized(_this)));
|
||||
}
|
||||
|
||||
return Foo;
|
||||
|
||||
@@ -10,7 +10,7 @@ function (_Bar) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
|
||||
var fn = () => babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this));
|
||||
var fn = () => babelHelpers.assertThisInitialized(_this);
|
||||
|
||||
fn();
|
||||
return _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
|
||||
@@ -10,7 +10,7 @@ function (_Bar) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
|
||||
var fn = () => babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this));
|
||||
var fn = () => babelHelpers.assertThisInitialized(_this);
|
||||
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
fn();
|
||||
|
||||
@@ -9,7 +9,7 @@ function (_Bar) {
|
||||
var _this;
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
Foo[babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))];
|
||||
Foo[babelHelpers.assertThisInitialized(_this)];
|
||||
return babelHelpers.possibleConstructorReturn(_this);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/plugin-transform-parameters",
|
||||
"version": "7.2.0",
|
||||
"version": "7.3.3",
|
||||
"description": "Compile ES2015 default and rest parameters to ES5",
|
||||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-parameters",
|
||||
"license": "MIT",
|
||||
@@ -20,7 +20,7 @@
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/core": "^7.3.3",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,12 +21,12 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
||||
|
||||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
var App =
|
||||
@@ -47,7 +47,7 @@ function (_Component) {
|
||||
|
||||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(App)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
||||
|
||||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "exportType", '');
|
||||
_defineProperty(_assertThisInitialized(_this), "exportType", '');
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/preset-env-standalone",
|
||||
"version": "7.3.2",
|
||||
"version": "7.3.3",
|
||||
"description": "Standalone build of babel-prest-env for use in non-Node.js environments.",
|
||||
"main": "babel-preset-env.js",
|
||||
"files": [
|
||||
@@ -13,7 +13,7 @@
|
||||
"@babel/plugin-transform-named-capturing-groups-regex": "^7.3.0",
|
||||
"@babel/plugin-transform-new-target": "^7.0.0",
|
||||
"@babel/preset-env": "^7.3.1",
|
||||
"@babel/standalone": "^7.3.2"
|
||||
"@babel/standalone": "^7.3.3"
|
||||
},
|
||||
"keywords": [
|
||||
"babel",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/preset-typescript",
|
||||
"version": "7.1.0",
|
||||
"version": "7.3.3",
|
||||
"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.1.0"
|
||||
"@babel/plugin-transform-typescript": "^7.3.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/core": "^7.3.3",
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"core-js": "^2.5.7",
|
||||
"find-cache-dir": "^2.0.0",
|
||||
"home-or-tmp": "^3.0.0",
|
||||
"lodash": "^4.17.10",
|
||||
"lodash": "^4.17.11",
|
||||
"mkdirp": "^0.5.1",
|
||||
"pirates": "^4.0.0",
|
||||
"source-map-support": "^0.5.9"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/standalone",
|
||||
"version": "7.3.2",
|
||||
"version": "7.3.3",
|
||||
"description": "Standalone build of Babel for use in non-Node.js environments.",
|
||||
"main": "babel.js",
|
||||
"files": [
|
||||
@@ -9,11 +9,11 @@
|
||||
"src"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.2.2",
|
||||
"@babel/core": "^7.3.3",
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/plugin-external-helpers": "^7.2.0",
|
||||
"@babel/plugin-proposal-async-generator-functions": "^7.2.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.3.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.3.3",
|
||||
"@babel/plugin-proposal-decorators": "^7.3.0",
|
||||
"@babel/plugin-proposal-do-expressions": "^7.2.0",
|
||||
"@babel/plugin-proposal-export-default-from": "^7.2.0",
|
||||
@@ -23,6 +23,7 @@
|
||||
"@babel/plugin-proposal-json-strings": "^7.2.0",
|
||||
"@babel/plugin-proposal-logical-assignment-operators": "^7.2.0",
|
||||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.2.0",
|
||||
"@babel/plugin-proposal-numeric-separator": "^7.2.0",
|
||||
"@babel/plugin-proposal-object-rest-spread": "^7.3.2",
|
||||
"@babel/plugin-proposal-optional-catch-binding": "^7.2.0",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.2.0",
|
||||
@@ -45,12 +46,12 @@
|
||||
"@babel/plugin-syntax-object-rest-spread": "^7.2.0",
|
||||
"@babel/plugin-syntax-optional-catch-binding": "^7.2.0",
|
||||
"@babel/plugin-syntax-pipeline-operator": "^7.3.0",
|
||||
"@babel/plugin-syntax-typescript": "^7.2.0",
|
||||
"@babel/plugin-syntax-typescript": "^7.3.3",
|
||||
"@babel/plugin-transform-arrow-functions": "^7.2.0",
|
||||
"@babel/plugin-transform-async-to-generator": "^7.2.0",
|
||||
"@babel/plugin-transform-block-scoped-functions": "^7.2.0",
|
||||
"@babel/plugin-transform-block-scoping": "^7.2.0",
|
||||
"@babel/plugin-transform-classes": "^7.2.2",
|
||||
"@babel/plugin-transform-classes": "^7.3.3",
|
||||
"@babel/plugin-transform-computed-properties": "^7.2.0",
|
||||
"@babel/plugin-transform-destructuring": "^7.3.2",
|
||||
"@babel/plugin-transform-dotall-regex": "^7.2.0",
|
||||
@@ -72,7 +73,7 @@
|
||||
"@babel/plugin-transform-object-assign": "^7.2.0",
|
||||
"@babel/plugin-transform-object-set-prototype-of-to-assign": "^7.2.0",
|
||||
"@babel/plugin-transform-object-super": "^7.2.0",
|
||||
"@babel/plugin-transform-parameters": "^7.2.0",
|
||||
"@babel/plugin-transform-parameters": "^7.3.3",
|
||||
"@babel/plugin-transform-property-literals": "^7.2.0",
|
||||
"@babel/plugin-transform-property-mutators": "^7.2.0",
|
||||
"@babel/plugin-transform-proto-to-assign": "^7.2.0",
|
||||
@@ -95,7 +96,7 @@
|
||||
"@babel/plugin-transform-unicode-regex": "^7.2.0",
|
||||
"@babel/preset-flow": "^7.0.0",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"@babel/preset-typescript": "^7.0.0"
|
||||
"@babel/preset-typescript": "^7.3.3"
|
||||
},
|
||||
"keywords": [
|
||||
"babel",
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"@babel/types": "^7.2.2",
|
||||
"debug": "^4.1.0",
|
||||
"globals": "^11.1.0",
|
||||
"lodash": "^4.17.10"
|
||||
"lodash": "^4.17.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/helper-plugin-test-runner": "^7.0.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@babel/types",
|
||||
"version": "7.3.2",
|
||||
"version": "7.3.3",
|
||||
"description": "Babel Types is a Lodash-esque utility library for AST nodes",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
@@ -10,11 +10,11 @@
|
||||
"types": "lib/index.d.ts",
|
||||
"dependencies": {
|
||||
"esutils": "^2.0.2",
|
||||
"lodash": "^4.17.10",
|
||||
"lodash": "^4.17.11",
|
||||
"to-fast-properties": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/generator": "^7.3.2",
|
||||
"@babel/parser": "^7.3.2"
|
||||
"@babel/generator": "^7.3.3",
|
||||
"@babel/parser": "^7.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +288,14 @@ export const functionCommon = {
|
||||
params: {
|
||||
validate: chain(
|
||||
assertValueType("array"),
|
||||
assertEach(assertNodeType("LVal")),
|
||||
assertEach(
|
||||
assertNodeType(
|
||||
"Identifier",
|
||||
"Pattern",
|
||||
"RestElement",
|
||||
"TSParameterProperty",
|
||||
),
|
||||
),
|
||||
),
|
||||
},
|
||||
generator: {
|
||||
|
||||
@@ -322,6 +322,11 @@ defineType("ImportDeclaration", {
|
||||
source: {
|
||||
validate: assertNodeType("StringLiteral"),
|
||||
},
|
||||
importKind: {
|
||||
// Handle Flowtype's extension "import {typeof foo} from"
|
||||
validate: assertOneOf("type", "typeof", "value"),
|
||||
optional: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -357,7 +362,8 @@ defineType("ImportSpecifier", {
|
||||
},
|
||||
importKind: {
|
||||
// Handle Flowtype's extension "import {typeof foo} from"
|
||||
validate: assertOneOf(null, "type", "typeof"),
|
||||
validate: assertOneOf("type", "typeof"),
|
||||
optional: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -72,7 +72,7 @@ defineType("ClassImplements", {
|
||||
},
|
||||
});
|
||||
|
||||
defineInterfaceishType("DeclareClass", "TypeParameterInstantiation");
|
||||
defineInterfaceishType("DeclareClass");
|
||||
|
||||
defineType("DeclareFunction", {
|
||||
visitor: ["id"],
|
||||
|
||||
32
packages/babel-types/test/builders/flow/declareClass.js
Normal file
32
packages/babel-types/test/builders/flow/declareClass.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import * as t from "../../..";
|
||||
|
||||
describe("builders", function() {
|
||||
describe("flow", function() {
|
||||
describe("declareClass", function() {
|
||||
it("accept TypeParameterDeclaration as typeParameters", function() {
|
||||
const typeParameter = t.typeParameter(null, null, null);
|
||||
typeParameter.name = "T";
|
||||
const declaredClass = t.declareClass(
|
||||
t.identifier("A"),
|
||||
t.typeParameterDeclaration([typeParameter]),
|
||||
[],
|
||||
t.objectTypeAnnotation([], [], [], []),
|
||||
);
|
||||
expect(t.isDeclareClass(declaredClass)).toBe(true);
|
||||
});
|
||||
|
||||
it("not accept typeParameterInstantiation as typeParameters", function() {
|
||||
expect(() =>
|
||||
t.declareClass(
|
||||
t.identifier("A"),
|
||||
t.typeParameterInstantiation([
|
||||
t.genericTypeAnnotation(t.identifier("T")),
|
||||
]),
|
||||
[],
|
||||
t.objectTypeAnnotation([], [], [], []),
|
||||
),
|
||||
).toThrow(Error);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -17,9 +17,9 @@ const chalk = require("chalk");
|
||||
const through = require("through2");
|
||||
const fancyLog = require("fancy-log");
|
||||
const rename = require("gulp-rename");
|
||||
const RootMostResolvePlugin = require("webpack-dependency-suite")
|
||||
.RootMostResolvePlugin;
|
||||
const webpack = require("webpack");
|
||||
const { RootMostResolvePlugin } = require("webpack-dependency-suite");
|
||||
const DuplicatePackageCheckerPlugin = require("duplicate-package-checker-webpack-plugin");
|
||||
const webpackStream = require("webpack-stream");
|
||||
const uglify = require("gulp-uglify");
|
||||
|
||||
@@ -62,6 +62,11 @@ function webpackBuild(opts) {
|
||||
libraryTarget: "umd",
|
||||
},
|
||||
plugins: [
|
||||
new DuplicatePackageCheckerPlugin({
|
||||
exclude(instance) {
|
||||
return instance.name === "semver";
|
||||
},
|
||||
}),
|
||||
new webpack.DefinePlugin({
|
||||
"process.env.NODE_ENV": '"production"',
|
||||
"process.env": JSON.stringify({ NODE_ENV: "production" }),
|
||||
@@ -92,8 +97,11 @@ function webpackBuild(opts) {
|
||||
return webpackStream(config, webpack);
|
||||
// To write JSON for debugging:
|
||||
/*return webpackStream(config, webpack, (err, stats) => {
|
||||
require('fancy-log')(stats.toString({colors: true}));
|
||||
require('fs').writeFileSync('webpack-debug.json', JSON.stringify(stats.toJson()));
|
||||
require("fancy-log")(stats.toString({ colors: true }));
|
||||
require("fs").writeFileSync(
|
||||
"webpack-debug.json",
|
||||
JSON.stringify(stats.toJson())
|
||||
);
|
||||
});*/
|
||||
}
|
||||
|
||||
|
||||
@@ -1,183 +1,3 @@
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-block-scoping.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-existing-block-fn-no-init.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-existing-block-fn-update.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-existing-fn-no-init.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-existing-fn-update.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-existing-var-no-init.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-existing-var-update.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-init.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-no-skip-try.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-skip-dft-param.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-block.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for-in.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for-of.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-switch.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-try.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-skip-param.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-a-func-update.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-block-scoping.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-existing-block-fn-no-init.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-existing-block-fn-update.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-existing-fn-no-init.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-existing-fn-update.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-existing-var-no-init.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-existing-var-update.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-init.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-no-skip-try.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-skip-dft-param.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-block.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-for-in.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-for-of.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-for.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-switch.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-try.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-skip-param.js(default)
|
||||
annexB/language/function-code/if-decl-else-decl-b-func-update.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-block-scoping.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-existing-block-fn-no-init.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-existing-block-fn-update.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-existing-fn-no-init.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-existing-fn-update.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-existing-var-no-init.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-existing-var-update.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-init.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-no-skip-try.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-skip-dft-param.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-block.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-for-in.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-for-of.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-for.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-switch.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-try.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-skip-early-err.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-skip-param.js(default)
|
||||
annexB/language/function-code/if-decl-else-stmt-func-update.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-block-scoping.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-existing-block-fn-no-init.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-existing-block-fn-update.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-existing-fn-no-init.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-existing-fn-update.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-existing-var-no-init.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-existing-var-update.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-init.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-no-skip-try.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-skip-dft-param.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-skip-early-err-block.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-skip-early-err-for-in.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-skip-early-err-for-of.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-skip-early-err-for.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-skip-early-err-switch.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-skip-early-err-try.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-skip-early-err.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-skip-param.js(default)
|
||||
annexB/language/function-code/if-decl-no-else-func-update.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-block-scoping.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-existing-block-fn-no-init.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-existing-block-fn-update.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-existing-fn-no-init.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-existing-fn-update.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-existing-var-no-init.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-existing-var-update.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-init.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-no-skip-try.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-skip-dft-param.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-block.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-for-in.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-for-of.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-for.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-switch.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-try.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-skip-early-err.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-skip-param.js(default)
|
||||
annexB/language/function-code/if-stmt-else-decl-func-update.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-block-scoping.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-existing-block-fn-no-init.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-existing-block-fn-update.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-existing-fn-no-init.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-existing-fn-update.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-existing-var-no-init.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-existing-var-update.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-init.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-no-skip-try.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-block.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for-in.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for-of.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-switch.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-try.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-a-global-update.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-block-scoping.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-existing-block-fn-no-init.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-existing-block-fn-update.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-existing-fn-no-init.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-existing-fn-update.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-existing-var-no-init.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-existing-var-update.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-init.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-no-skip-try.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-block.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for-in.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for-of.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-switch.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-try.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err.js(default)
|
||||
annexB/language/global-code/if-decl-else-decl-b-global-update.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-block-scoping.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-existing-block-fn-no-init.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-existing-block-fn-update.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-existing-fn-no-init.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-existing-fn-update.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-existing-var-no-init.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-existing-var-update.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-init.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-no-skip-try.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-block.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for-in.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for-of.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-switch.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-try.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-skip-early-err.js(default)
|
||||
annexB/language/global-code/if-decl-else-stmt-global-update.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-block-scoping.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-existing-block-fn-no-init.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-existing-block-fn-update.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-existing-fn-no-init.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-existing-fn-update.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-existing-var-no-init.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-existing-var-update.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-init.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-no-skip-try.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-skip-early-err-block.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-skip-early-err-for-in.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-skip-early-err-for-of.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-skip-early-err-for.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-skip-early-err-switch.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-skip-early-err-try.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-skip-early-err.js(default)
|
||||
annexB/language/global-code/if-decl-no-else-global-update.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-block-scoping.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-existing-block-fn-no-init.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-existing-block-fn-update.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-existing-fn-no-init.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-existing-fn-update.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-existing-var-no-init.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-existing-var-update.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-init.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-no-skip-try.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-block.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for-in.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for-of.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-switch.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-try.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-skip-early-err.js(default)
|
||||
annexB/language/global-code/if-stmt-else-decl-global-update.js(default)
|
||||
annexB/language/statements/for-in/bare-initializer.js(default)
|
||||
annexB/language/statements/for-in/bare-initializer.js(strict mode)
|
||||
built-ins/RegExp/property-escapes/binary-property-with-value-ASCII_-_F-negated.js(default)
|
||||
@@ -1165,7 +985,6 @@ language/statements/for/head-let-bound-names-in-stmt.js(default)
|
||||
language/statements/for/head-let-bound-names-in-stmt.js(strict mode)
|
||||
language/statements/function/dflt-params-duplicates.js(default)
|
||||
language/statements/generators/dflt-params-duplicates.js(default)
|
||||
language/statements/labeled/let-identifier-with-newline.js(default)
|
||||
language/statements/let/redeclaration-error-from-within-strict-mode-function.js(default)
|
||||
language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-function.js(default)
|
||||
language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-function.js(strict mode)
|
||||
|
||||
31
yarn.lock
31
yarn.lock
@@ -2239,6 +2239,15 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.2:
|
||||
escape-string-regexp "^1.0.5"
|
||||
supports-color "^5.3.0"
|
||||
|
||||
chalk@^2.3.0:
|
||||
version "2.4.2"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
|
||||
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
|
||||
dependencies:
|
||||
ansi-styles "^3.2.1"
|
||||
escape-string-regexp "^1.0.5"
|
||||
supports-color "^5.3.0"
|
||||
|
||||
chalk@^2.3.1, chalk@^2.4.1:
|
||||
version "2.4.1"
|
||||
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e"
|
||||
@@ -3129,6 +3138,16 @@ duplexify@^3.4.2, duplexify@^3.6.0:
|
||||
readable-stream "^2.0.0"
|
||||
stream-shift "^1.0.0"
|
||||
|
||||
duplicate-package-checker-webpack-plugin@^2.1.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/duplicate-package-checker-webpack-plugin/-/duplicate-package-checker-webpack-plugin-2.1.0.tgz#6723ee32d89947997470778973c10788cb69e496"
|
||||
integrity sha512-Blok+Cb8zDavYQyeTtSkmNp/aiyRn5+JV/4EhDDH5VJChnyIzPhq+S5MyWnFpqpv8jNKmD3cXmXFEVU509pzXQ==
|
||||
dependencies:
|
||||
chalk "^2.3.0"
|
||||
find-root "^1.0.0"
|
||||
lodash "^4.17.4"
|
||||
semver "^5.4.1"
|
||||
|
||||
each-props@^1.3.0:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/each-props/-/each-props-1.3.1.tgz#fc138f51e3a2774286d4858e02d6e7de462de158"
|
||||
@@ -3749,6 +3768,11 @@ find-parent-dir@^0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54"
|
||||
|
||||
find-root@^1.0.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4"
|
||||
integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==
|
||||
|
||||
find-up@^1.0.0:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f"
|
||||
@@ -3806,9 +3830,10 @@ flat-cache@^1.2.1:
|
||||
graceful-fs "^4.1.2"
|
||||
write "^0.2.1"
|
||||
|
||||
flow-bin@^0.87.0:
|
||||
version "0.87.0"
|
||||
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.87.0.tgz#fab7f984d8cc767e93fa9eb01cf7d57ed744f19d"
|
||||
flow-bin@^0.92.1:
|
||||
version "0.92.1"
|
||||
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.92.1.tgz#32c136c07235f30c42dc0549a0790f370fad4070"
|
||||
integrity sha512-F5kC5oQOR2FXROAeybJHFqgZP+moKV9fa/53QK4Q4WayTQHdA0KSl48KD1gP0A9mioRLiKUegTva/7I15cX3Iw==
|
||||
|
||||
flush-write-stream@^1.0.0, flush-write-stream@^1.0.2:
|
||||
version "1.0.3"
|
||||
|
||||
Reference in New Issue
Block a user