diff --git a/lib/third-party-libs.js.flow b/lib/third-party-libs.js.flow index 85f14d259c58..9ce36c6dc427 100644 --- a/lib/third-party-libs.js.flow +++ b/lib/third-party-libs.js.flow @@ -187,7 +187,7 @@ declare module "convert-source-map" { } declare module "core-js-compat/data" { - declare type Target = "node" | "chrome" | "opera" | "edge" | "firefox" | "safari" | "ie" | "ios" | "android" | "electron" | "samsung"; + declare type Target = "node" | "chrome" | "opera" | "edge" | "firefox" | "safari" | "ie" | "ios" | "android" | "electron" | "samsung" | "rhino"; declare module.exports: { [key: string]: { diff --git a/packages/babel-compat-data/data/corejs2-built-ins.json b/packages/babel-compat-data/data/corejs2-built-ins.json index 9739da06e2ad..72c5f3ad7cf6 100644 --- a/packages/babel-compat-data/data/corejs2-built-ins.json +++ b/packages/babel-compat-data/data/corejs2-built-ins.json @@ -8,6 +8,7 @@ "node": "4", "ios": "9", "samsung": "5", + "rhino": "1.7.13", "electron": "0.31" }, "es6.array.every": { @@ -22,6 +23,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.array.fill": { @@ -33,6 +35,7 @@ "node": "4", "ios": "8", "samsung": "5", + "rhino": "1.7.13", "electron": "0.31" }, "es6.array.filter": { @@ -55,6 +58,7 @@ "node": "4", "ios": "8", "samsung": "5", + "rhino": "1.7.13", "electron": "0.31" }, "es6.array.find-index": { @@ -66,6 +70,7 @@ "node": "4", "ios": "8", "samsung": "5", + "rhino": "1.7.13", "electron": "0.31" }, "es7.array.flat-map": { @@ -91,6 +96,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.array.from": { @@ -127,6 +133,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.array.is-array": { @@ -141,6 +148,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.array.iterator": { @@ -152,6 +160,7 @@ "node": "10", "ios": "9", "samsung": "9", + "rhino": "1.7.13", "electron": "3.0" }, "es6.array.last-index-of": { @@ -166,6 +175,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.array.map": { @@ -188,6 +198,7 @@ "node": "4", "ios": "9", "samsung": "5", + "rhino": "1.7.13", "electron": "0.31" }, "es6.array.reduce": { @@ -202,6 +213,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.array.reduce-right": { @@ -216,6 +228,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.array.slice": { @@ -241,6 +254,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.array.sort": { @@ -253,6 +267,7 @@ "ie": "9", "ios": "12", "samsung": "8", + "rhino": "1.7.13", "electron": "3.0" }, "es6.array.species": { @@ -278,6 +293,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.date.to-iso-string": { @@ -292,6 +308,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.date.to-json": { @@ -305,6 +322,7 @@ "android": "4", "ios": "10", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.date.to-primitive": { @@ -330,6 +348,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.function.bind": { @@ -344,6 +363,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.function.has-instance": { @@ -368,6 +388,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.map": { @@ -390,6 +411,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.asinh": { @@ -401,6 +423,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.atanh": { @@ -412,6 +435,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.cbrt": { @@ -423,6 +447,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.clz32": { @@ -434,6 +459,7 @@ "node": "0.12", "ios": "9", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.cosh": { @@ -445,6 +471,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.expm1": { @@ -456,6 +483,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.fround": { @@ -467,6 +495,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.hypot": { @@ -478,6 +507,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.imul": { @@ -490,6 +520,7 @@ "android": "4.4", "ios": "7", "samsung": "2", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.log1p": { @@ -501,6 +532,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.log10": { @@ -512,6 +544,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.log2": { @@ -523,6 +556,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.sign": { @@ -534,6 +568,7 @@ "node": "0.12", "ios": "9", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.sinh": { @@ -545,6 +580,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.tanh": { @@ -556,6 +592,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.math.trunc": { @@ -567,6 +604,7 @@ "node": "0.12", "ios": "8", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.number.constructor": { @@ -578,6 +616,7 @@ "node": "4", "ios": "9", "samsung": "3.4", + "rhino": "1.7.13", "electron": "0.21" }, "es6.number.epsilon": { @@ -601,6 +640,7 @@ "android": "4.1", "ios": "9", "samsung": "1.5", + "rhino": "1.7.13", "electron": "0.20" }, "es6.number.is-integer": { @@ -612,6 +652,7 @@ "node": "0.12", "ios": "9", "samsung": "2", + "rhino": "1.7.13", "electron": "0.20" }, "es6.number.is-nan": { @@ -624,6 +665,7 @@ "android": "4.1", "ios": "9", "samsung": "1.5", + "rhino": "1.7.13", "electron": "0.20" }, "es6.number.is-safe-integer": { @@ -635,6 +677,7 @@ "node": "0.12", "ios": "9", "samsung": "2", + "rhino": "1.7.13", "electron": "0.20" }, "es6.number.max-safe-integer": { @@ -646,6 +689,7 @@ "node": "0.12", "ios": "9", "samsung": "2", + "rhino": "1.7.13", "electron": "0.20" }, "es6.number.min-safe-integer": { @@ -657,6 +701,7 @@ "node": "0.12", "ios": "9", "samsung": "2", + "rhino": "1.7.13", "electron": "0.20" }, "es6.number.parse-float": { @@ -704,6 +749,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es7.object.define-getter": { @@ -740,6 +786,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.object.define-properties": { @@ -754,6 +801,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es7.object.entries": { @@ -776,6 +824,7 @@ "node": "4", "ios": "9", "samsung": "4", + "rhino": "1.7.13", "electron": "0.30" }, "es6.object.get-own-property-descriptor": { @@ -787,6 +836,7 @@ "node": "4", "ios": "9", "samsung": "4", + "rhino": "1.7.13", "electron": "0.30" }, "es7.object.get-own-property-descriptors": { @@ -809,6 +859,7 @@ "node": "4", "ios": "9", "samsung": "3.4", + "rhino": "1.7.13", "electron": "0.21" }, "es6.object.get-prototype-of": { @@ -820,6 +871,7 @@ "node": "4", "ios": "9", "samsung": "4", + "rhino": "1.7.13", "electron": "0.30" }, "es7.object.lookup-getter": { @@ -853,6 +905,7 @@ "node": "4", "ios": "9", "samsung": "4", + "rhino": "1.7.13", "electron": "0.30" }, "es6.object.to-string": { @@ -876,6 +929,7 @@ "android": "4.1", "ios": "9", "samsung": "1.5", + "rhino": "1.7.13", "electron": "0.20" }, "es6.object.is-frozen": { @@ -887,6 +941,7 @@ "node": "4", "ios": "9", "samsung": "4", + "rhino": "1.7.13", "electron": "0.30" }, "es6.object.is-sealed": { @@ -898,6 +953,7 @@ "node": "4", "ios": "9", "samsung": "4", + "rhino": "1.7.13", "electron": "0.30" }, "es6.object.is-extensible": { @@ -909,6 +965,7 @@ "node": "4", "ios": "9", "samsung": "4", + "rhino": "1.7.13", "electron": "0.30" }, "es6.object.keys": { @@ -920,6 +977,7 @@ "node": "4", "ios": "9", "samsung": "3.4", + "rhino": "1.7.13", "electron": "0.21" }, "es6.object.seal": { @@ -931,6 +989,7 @@ "node": "4", "ios": "9", "samsung": "4", + "rhino": "1.7.13", "electron": "0.30" }, "es6.object.set-prototype-of": { @@ -943,6 +1002,7 @@ "ie": "11", "ios": "9", "samsung": "2", + "rhino": "1.7.13", "electron": "0.20" }, "es7.object.values": { @@ -1152,6 +1212,7 @@ "node": "6", "ios": "10", "samsung": "5", + "rhino": "1.7.13", "electron": "1.1" }, "es6.regexp.replace": { @@ -1185,6 +1246,7 @@ "node": "6", "ios": "10", "samsung": "5", + "rhino": "1.7.13", "electron": "1.1" }, "es6.regexp.to-string": { @@ -1292,6 +1354,7 @@ "node": "4", "ios": "9", "samsung": "3.4", + "rhino": "1.7.13", "electron": "0.21" }, "es6.string.ends-with": { @@ -1303,6 +1366,7 @@ "node": "4", "ios": "9", "samsung": "3.4", + "rhino": "1.7.13", "electron": "0.21" }, "es6.string.fixed": { @@ -1353,6 +1417,7 @@ "node": "4", "ios": "9", "samsung": "3.4", + "rhino": "1.7.13", "electron": "0.21" }, "es6.string.includes": { @@ -1364,6 +1429,7 @@ "node": "4", "ios": "9", "samsung": "3.4", + "rhino": "1.7.13", "electron": "0.21" }, "es6.string.italics": { @@ -1388,6 +1454,7 @@ "node": "0.12", "ios": "9", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "es6.string.link": { @@ -1412,6 +1479,7 @@ "node": "8", "ios": "10", "samsung": "7", + "rhino": "1.7.13", "electron": "1.7" }, "es7.string.pad-end": { @@ -1423,6 +1491,7 @@ "node": "8", "ios": "10", "samsung": "7", + "rhino": "1.7.13", "electron": "1.7" }, "es6.string.raw": { @@ -1445,6 +1514,7 @@ "node": "4", "ios": "9", "samsung": "3.4", + "rhino": "1.7.13", "electron": "0.21" }, "es6.string.small": { @@ -1469,6 +1539,7 @@ "node": "4", "ios": "9", "samsung": "3.4", + "rhino": "1.7.13", "electron": "0.21" }, "es6.string.strike": { @@ -1522,6 +1593,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es7.string.trim-left": { @@ -1533,6 +1605,7 @@ "node": "10", "ios": "12", "samsung": "9", + "rhino": "1.7.13", "electron": "3.0" }, "es7.string.trim-right": { @@ -1544,6 +1617,7 @@ "node": "10", "ios": "12", "samsung": "9", + "rhino": "1.7.13", "electron": "3.0" }, "es6.typed.array-buffer": { @@ -1569,6 +1643,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "es6.typed.int8-array": { diff --git a/packages/babel-compat-data/data/plugin-bugfixes.json b/packages/babel-compat-data/data/plugin-bugfixes.json index b1521be394f5..6e6d3498df56 100644 --- a/packages/babel-compat-data/data/plugin-bugfixes.json +++ b/packages/babel-compat-data/data/plugin-bugfixes.json @@ -98,6 +98,7 @@ "ie": "11", "ios": "11", "samsung": "5", + "rhino": "1.7.13", "electron": "0.37" }, "transform-template-literals": { diff --git a/packages/babel-compat-data/data/plugins.json b/packages/babel-compat-data/data/plugins.json index 6a8b47033cfe..13b40a3abf67 100644 --- a/packages/babel-compat-data/data/plugins.json +++ b/packages/babel-compat-data/data/plugins.json @@ -211,11 +211,12 @@ "chrome": "47", "opera": "34", "edge": "13", - "firefox": "45", + "firefox": "43", "safari": "10", "node": "6", "ios": "10", "samsung": "5", + "rhino": "1.7.13", "electron": "0.36" }, "transform-block-scoped-functions": { @@ -371,13 +372,14 @@ "node": "0.12", "ios": "9", "samsung": "3", + "rhino": "1.7.13", "electron": "0.20" }, "transform-new-target": { "chrome": "46", "opera": "33", "edge": "14", - "firefox": "41", + "firefox": "45", "safari": "10", "node": "5", "ios": "10", @@ -407,6 +409,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "transform-property-literals": { @@ -421,6 +424,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "transform-reserved-words": { @@ -435,6 +439,7 @@ "ios": "6", "phantom": "2", "samsung": "1", + "rhino": "1.7.13", "electron": "0.20" }, "proposal-export-namespace-from": { diff --git a/packages/babel-compat-data/scripts/data/plugin-features.js b/packages/babel-compat-data/scripts/data/plugin-features.js index 0717131bfc3e..bc1589fa9514 100644 --- a/packages/babel-compat-data/scripts/data/plugin-features.js +++ b/packages/babel-compat-data/scripts/data/plugin-features.js @@ -33,13 +33,29 @@ const es2015 = { features: ['function "name" property'], }, "transform-arrow-functions": { - features: ["arrow functions"], + features: [ + "arrow functions / 0 parameters", + "arrow functions / 1 parameter, no brackets", + "arrow functions / multiple parameters", + 'arrow functions / lexical "this" binding', + 'arrow functions / "this" unchanged by call or apply', + "arrow functions / can't be bound, can be curried", + 'arrow functions / lexical "arguments" binding', + "arrow functions / no line break between params and =>", + "arrow functions / correct precedence", + 'arrow functions / no "prototype" property', + ], }, "transform-block-scoped-functions": { features: ["block-level function declaration"], }, "transform-classes": { - features: ["class", "super"], + features: [ + "class", + "super", + 'arrow functions / lexical "super" binding in constructors', + 'arrow functions / lexical "super" binding in methods', + ], }, "transform-object-super": { features: ["super"], @@ -91,7 +107,7 @@ const es2015 = { features: ["Symbol / typeof support"], }, "transform-new-target": { - features: ["new.target"], + features: ["new.target", 'arrow functions / lexical "new.target" binding'], }, "transform-regenerator": { features: ["generators"], diff --git a/packages/babel-compat-data/scripts/download-compat-table.sh b/packages/babel-compat-data/scripts/download-compat-table.sh index a0a5f1bbeb8f..4d4f59f9f4c8 100755 --- a/packages/babel-compat-data/scripts/download-compat-table.sh +++ b/packages/babel-compat-data/scripts/download-compat-table.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -COMPAT_TABLE_COMMIT=e0380f77d240796b06a2a8ab33a99363b6ec7f67 +COMPAT_TABLE_COMMIT=63abfe227f4b9c6ef019efbbf059025b537b8511 GIT_HEAD=build/compat-table/.git/HEAD if [ -d "build/compat-table" ]; then diff --git a/packages/babel-compat-data/scripts/utils-build-data.js b/packages/babel-compat-data/scripts/utils-build-data.js index 33e7dca92986..be50cd565441 100644 --- a/packages/babel-compat-data/scripts/utils-build-data.js +++ b/packages/babel-compat-data/scripts/utils-build-data.js @@ -30,6 +30,7 @@ exports.environments = [ "ios", "phantom", "samsung", + "rhino", ]; const compatibilityTests = compatSources.flatMap(data => diff --git a/packages/babel-helper-compilation-targets/src/options.ts b/packages/babel-helper-compilation-targets/src/options.ts index 77f8b8294b21..ef3726849693 100644 --- a/packages/babel-helper-compilation-targets/src/options.ts +++ b/packages/babel-helper-compilation-targets/src/options.ts @@ -10,4 +10,5 @@ export const TargetNames = { android: "android", electron: "electron", samsung: "samsung", + rhino: "rhino", }; diff --git a/packages/babel-preset-env/test/fixtures/preset-options-babel-7/rhino-1_7_13/input.mjs b/packages/babel-preset-env/test/fixtures/preset-options-babel-7/rhino-1_7_13/input.mjs new file mode 100644 index 000000000000..f93701ad12b9 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-babel-7/rhino-1_7_13/input.mjs @@ -0,0 +1,2 @@ +const a = () => `1 + 1 = ${1 + 1}`; + diff --git a/packages/babel-preset-env/test/fixtures/preset-options-babel-7/rhino-1_7_13/options.json b/packages/babel-preset-env/test/fixtures/preset-options-babel-7/rhino-1_7_13/options.json new file mode 100644 index 000000000000..6f8e26c63cfe --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-babel-7/rhino-1_7_13/options.json @@ -0,0 +1,13 @@ +{ + "presets": [ + [ + "../../../../lib", + { + "targets": { + "rhino": "1.7.13" + }, + "modules": false + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/preset-options-babel-7/rhino-1_7_13/output.mjs b/packages/babel-preset-env/test/fixtures/preset-options-babel-7/rhino-1_7_13/output.mjs new file mode 100644 index 000000000000..d1cef0062201 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options-babel-7/rhino-1_7_13/output.mjs @@ -0,0 +1 @@ +var a = () => "1 + 1 = ".concat(1 + 1); diff --git a/packages/babel-preset-env/test/fixtures/preset-options/rhino-1_7_13/input.mjs b/packages/babel-preset-env/test/fixtures/preset-options/rhino-1_7_13/input.mjs new file mode 100644 index 000000000000..09f50d27486e --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options/rhino-1_7_13/input.mjs @@ -0,0 +1,2 @@ +const a = () => `1 + 1 = ${1+1}`; + diff --git a/packages/babel-preset-env/test/fixtures/preset-options/rhino-1_7_13/options.json b/packages/babel-preset-env/test/fixtures/preset-options/rhino-1_7_13/options.json new file mode 100644 index 000000000000..6f8e26c63cfe --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options/rhino-1_7_13/options.json @@ -0,0 +1,13 @@ +{ + "presets": [ + [ + "../../../../lib", + { + "targets": { + "rhino": "1.7.13" + }, + "modules": false + } + ] + ] +} diff --git a/packages/babel-preset-env/test/fixtures/preset-options/rhino-1_7_13/output.mjs b/packages/babel-preset-env/test/fixtures/preset-options/rhino-1_7_13/output.mjs new file mode 100644 index 000000000000..d1cef0062201 --- /dev/null +++ b/packages/babel-preset-env/test/fixtures/preset-options/rhino-1_7_13/output.mjs @@ -0,0 +1 @@ +var a = () => "1 + 1 = ".concat(1 + 1);