Ensure that @babel/runtime-corejs3 imports are injected (#12869)
* Add failing test for #12863 * Minimal * Ensure that `@babel/runtime-corejs2` imports are injected
This commit is contained in:
3
packages/babel-plugin-transform-runtime/test/fixtures/regression/12863/input.mjs
vendored
Normal file
3
packages/babel-plugin-transform-runtime/test/fixtures/regression/12863/input.mjs
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
class B extends A {
|
||||
b = 8;
|
||||
}
|
||||
8
packages/babel-plugin-transform-runtime/test/fixtures/regression/12863/options.json
vendored
Normal file
8
packages/babel-plugin-transform-runtime/test/fixtures/regression/12863/options.json
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"plugins": [
|
||||
"proposal-class-properties",
|
||||
["transform-runtime", { "corejs": 3 }],
|
||||
"transform-classes",
|
||||
"transform-spread"
|
||||
]
|
||||
}
|
||||
34
packages/babel-plugin-transform-runtime/test/fixtures/regression/12863/output.mjs
vendored
Normal file
34
packages/babel-plugin-transform-runtime/test/fixtures/regression/12863/output.mjs
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
||||
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
||||
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
||||
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
||||
import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
|
||||
import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
|
||||
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
|
||||
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
||||
|
||||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
||||
|
||||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
||||
|
||||
let B = /*#__PURE__*/function (_A) {
|
||||
_inherits(B, _A);
|
||||
|
||||
var _super = _createSuper(B);
|
||||
|
||||
function B(...args) {
|
||||
var _context;
|
||||
|
||||
var _this;
|
||||
|
||||
_classCallCheck(this, B);
|
||||
|
||||
_this = _super.call.apply(_super, _concatInstanceProperty(_context = [this]).call(_context, args));
|
||||
|
||||
_defineProperty(_assertThisInitialized(_this), "b", 8);
|
||||
|
||||
return _this;
|
||||
}
|
||||
|
||||
return B;
|
||||
}(A);
|
||||
Reference in New Issue
Block a user