Add support for rhino as a compilation target (#13448)

* Add support for rhino as a compilation target

* Add tests for target: rhino

* Fix test failing due to whitespace

* Keep consistent names for rhino tests in babel 7 and 8

* Bump core-js-compat to 3.15.0

* Change references to rhino to include patch version

* Update compat table data import

* Split transpilation of arrow function features more finely

* Rename rhino fixtures to include the patch number and update to include syntax that is and isn't supported for better testing

* Only use the relevant features for transform-new-target and transform-classes
This commit is contained in:
Samuel Gaus
2021-08-03 22:03:16 +01:00
committed by GitHub
parent a254ea38a4
commit 830b99dc83
14 changed files with 138 additions and 7 deletions

View File

@@ -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 <code>=></code>",
"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"],

View File

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

View File

@@ -30,6 +30,7 @@ exports.environments = [
"ios",
"phantom",
"samsung",
"rhino",
];
const compatibilityTests = compatSources.flatMap(data =>