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

36 lines
827 B
JavaScript

var _prop = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("prop");
var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() {
"use strict";
babelHelpers.classCallCheck(this, Foo);
Object.defineProperty(this, _prop, {
writable: true,
value: "foo"
});
});
var _prop2 = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("prop");
var Bar = /*#__PURE__*/function (_Foo) {
"use strict";
babelHelpers.inherits(Bar, _Foo);
var _super = babelHelpers.createSuper(Bar);
function Bar(...args) {
var _this;
babelHelpers.classCallCheck(this, Bar);
_this = _super.call(this, ...args);
Object.defineProperty(babelHelpers.assertThisInitialized(_this), _prop2, {
writable: true,
value: "bar"
});
return _this;
}
return babelHelpers.createClass(Bar);
}(Foo);