-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
Spec: ClassesoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
class Base {
get test() {
}
}
class Obj extends Base {
// Redefining method here
test() { }
}This outputs:
var Base = function () {
function Base() {}
_createClass(Base, [{
key: "test",
get: function get() {}
}]);
return Base;
}();
var Obj = function (_Base) {
_inheritsLoose(Obj, _Base);
function Obj() {
return _Base.apply(this, arguments) || this;
}
var _proto = Obj.prototype;
// Redefining method here
_proto.test = function test() {};
return Obj;
}(Base);Notice we do _inheritsLoose(Obj, _Base) immediately, then do Obj.prototype.test = function() {}. This tries to set to a inherited property that's only a getter, so it throws in strict mode.
We could just do the _inheritsLoose after defining the prototype methods?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Spec: ClassesoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue