* 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>
36 lines
848 B
JavaScript
36 lines
848 B
JavaScript
"use strict";
|
|
|
|
let Base = /*#__PURE__*/babelHelpers.createClass(function Base() {
|
|
babelHelpers.classCallCheck(this, Base);
|
|
});
|
|
|
|
let Obj = /*#__PURE__*/function (_Base) {
|
|
babelHelpers.inherits(Obj, _Base);
|
|
|
|
var _super = babelHelpers.createSuper(Obj);
|
|
|
|
function Obj() {
|
|
babelHelpers.classCallCheck(this, Obj);
|
|
return _super.apply(this, arguments);
|
|
}
|
|
|
|
babelHelpers.createClass(Obj, [{
|
|
key: "call",
|
|
value: function call() {
|
|
return babelHelpers.get(babelHelpers.getPrototypeOf(Obj.prototype), "test", this).call(this);
|
|
}
|
|
}, {
|
|
key: "test",
|
|
value: function test() {
|
|
throw new Error("gobbledygook");
|
|
}
|
|
}]);
|
|
return Obj;
|
|
}(Base);
|
|
|
|
const obj = new Obj();
|
|
expect(() => {
|
|
obj.call(); // Assert that this throws, but that it's not
|
|
// Obj.p.test's error that is thrown
|
|
}).toThrowError(TypeError);
|