Bump babel-parser (#4910)
parent
b6077e175e
commit
1597578b05
|
@ -15,7 +15,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/code-frame": "7.0.0-beta.46",
|
"@babel/code-frame": "7.0.0-beta.46",
|
||||||
"@babel/parser": "7.0.0-beta.49",
|
"@babel/parser": "7.0.0-beta.55",
|
||||||
"@glimmer/syntax": "0.30.3",
|
"@glimmer/syntax": "0.30.3",
|
||||||
"camelcase": "4.1.0",
|
"camelcase": "4.1.0",
|
||||||
"chalk": "2.1.0",
|
"chalk": "2.1.0",
|
||||||
|
@ -64,9 +64,9 @@
|
||||||
"yaml-unist-parser": "1.0.0-rc.3"
|
"yaml-unist-parser": "1.0.0-rc.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "7.0.0-beta.49",
|
"@babel/cli": "7.0.0-beta.55",
|
||||||
"@babel/core": "7.0.0-beta.49",
|
"@babel/core": "7.0.0-beta.55",
|
||||||
"@babel/preset-env": "7.0.0-beta.49",
|
"@babel/preset-env": "7.0.0-beta.55",
|
||||||
"babel-loader": "8.0.0-beta.3",
|
"babel-loader": "8.0.0-beta.3",
|
||||||
"benchmark": "2.1.4",
|
"benchmark": "2.1.4",
|
||||||
"builtin-modules": "2.0.0",
|
"builtin-modules": "2.0.0",
|
||||||
|
|
|
@ -3,9 +3,11 @@
|
||||||
//
|
//
|
||||||
// BEFORE:
|
// BEFORE:
|
||||||
// [__something__].includes(__something__)
|
// [__something__].includes(__something__)
|
||||||
|
// CONSTANT_CASE.includes(__something__)
|
||||||
//
|
//
|
||||||
// AFTER:
|
// AFTER:
|
||||||
// [__something__].indexOf(__something__) !== -1
|
// [__something__].indexOf(__something__) !== -1
|
||||||
|
// CONSTANT_CASE.indexOf(__something__) !== -1
|
||||||
//
|
//
|
||||||
|
|
||||||
module.exports = ({ types: t }) => ({
|
module.exports = ({ types: t }) => ({
|
||||||
|
@ -15,7 +17,9 @@ module.exports = ({ types: t }) => ({
|
||||||
const callee = node.callee;
|
const callee = node.callee;
|
||||||
if (
|
if (
|
||||||
t.isMemberExpression(callee, { computed: false }) &&
|
t.isMemberExpression(callee, { computed: false }) &&
|
||||||
t.isArrayExpression(callee.object) &&
|
(t.isArrayExpression(callee.object) ||
|
||||||
|
(t.isIdentifier(callee.object) &&
|
||||||
|
/^[A-Z_]+$/.test(callee.object.name))) &&
|
||||||
t.isIdentifier(callee.property, { name: "includes" })
|
t.isIdentifier(callee.property, { name: "includes" })
|
||||||
) {
|
) {
|
||||||
callee.property.name = "indexOf";
|
callee.property.name = "indexOf";
|
||||||
|
|
|
@ -98,7 +98,7 @@ async function run(params) {
|
||||||
await execa("rm", ["-rf", ".cache"]);
|
await execa("rm", ["-rf", ".cache"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bundleCache = new Cache(".cache/", "v4");
|
const bundleCache = new Cache(".cache/", "v5");
|
||||||
await bundleCache.load();
|
await bundleCache.load();
|
||||||
|
|
||||||
console.log(chalk.inverse(" Building packages "));
|
console.log(chalk.inverse(" Building packages "));
|
||||||
|
|
|
@ -24,7 +24,10 @@ const path = require("path");
|
||||||
const parsers = [
|
const parsers = [
|
||||||
{
|
{
|
||||||
input: "src/language-js/parser-babylon.js",
|
input: "src/language-js/parser-babylon.js",
|
||||||
target: "universal"
|
target: "universal",
|
||||||
|
babelPlugins: [
|
||||||
|
require.resolve("./babel-plugins/replace-array-includes-with-indexof")
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: "src/language-js/parser-flow.js",
|
input: "src/language-js/parser-flow.js",
|
||||||
|
|
|
@ -32,7 +32,7 @@ function parse(text, parsers, opts) {
|
||||||
"optionalCatchBinding",
|
"optionalCatchBinding",
|
||||||
"optionalChaining",
|
"optionalChaining",
|
||||||
"classPrivateProperties",
|
"classPrivateProperties",
|
||||||
"pipelineOperator",
|
["pipelineOperator", { proposal: "minimal" }],
|
||||||
"nullishCoalescingOperator",
|
"nullishCoalescingOperator",
|
||||||
"bigInt",
|
"bigInt",
|
||||||
"throwExpressions"
|
"throwExpressions"
|
||||||
|
|
|
@ -28,6 +28,10 @@ declare class X {
|
||||||
static deserialize(): mixed,
|
static deserialize(): mixed,
|
||||||
static deserialize: () => mixed,
|
static deserialize: () => mixed,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface I {
|
||||||
|
static(): number;
|
||||||
|
}
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
type T = { method: () => void };
|
type T = { method: () => void };
|
||||||
type T = { method(): void };
|
type T = { method(): void };
|
||||||
|
@ -40,4 +44,8 @@ declare class X {
|
||||||
static deserialize: () => mixed;
|
static deserialize: () => mixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface I {
|
||||||
|
static(): number;
|
||||||
|
}
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
run_spec(__dirname, ["flow"]);
|
run_spec(__dirname, ["flow", "babylon"]);
|
||||||
|
|
|
@ -8,3 +8,7 @@ declare class X {
|
||||||
static deserialize(): mixed,
|
static deserialize(): mixed,
|
||||||
static deserialize: () => mixed,
|
static deserialize: () => mixed,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface I {
|
||||||
|
static(): number;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue