wentout c59870c526
Mark class prototype as read-only (#12115)
* initial code 2 fix the issue #2025

* Mark class prototype as read-only

* Update fixtures

* Fix failure

* Update Babel 8 fixtures

* Disable in loose mode

* Update fixtures

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-12-10 21:44:48 +01:00

51 lines
1.3 KiB
JavaScript

var _foo = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("foo");
var Foo = /*#__PURE__*/function () {
"use strict";
function Foo() {
babelHelpers.classCallCheck(this, Foo);
Object.defineProperty(this, _foo, {
writable: true,
value: 1
});
}
babelHelpers.createClass(Foo, [{
key: "test",
value: function test() {
var _babelHelpers$classPr;
var _foo2 = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("foo");
var Nested = /*#__PURE__*/function (_ref) {
babelHelpers.inherits(Nested, _ref);
var _super = babelHelpers.createSuper(Nested);
function Nested(...args) {
var _this;
babelHelpers.classCallCheck(this, Nested);
_this = _super.call(this, ...args);
Object.defineProperty(babelHelpers.assertThisInitialized(_this), _foo2, {
writable: true,
value: 3
});
return _this;
}
return babelHelpers.createClass(Nested);
}((_babelHelpers$classPr = babelHelpers.classPrivateFieldLooseBase(this, _foo)[_foo], /*#__PURE__*/function () {
function _class2() {
babelHelpers.classCallCheck(this, _class2);
this[_babelHelpers$classPr] = 2;
}
return babelHelpers.createClass(_class2);
}()));
}
}]);
return Foo;
}();