* Add private method syntax support * Add private method spec support * Add private method loose support * Throw error if static private method is used * Add more isStatic & isMethod checks * Remove `writable:false` from private method inits `writable` is false by default. * Add private method func obj equality check * Throw if private accessor is used * Add check for fields === private method loose mode * Throw buildCodeFrameErrors instead of Errors * Move obj destructuring inside for loop * Remove "computed" from ClassPrivateMethod type def
52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
var Foo =
|
|
/*#__PURE__*/
|
|
function () {
|
|
"use strict";
|
|
|
|
function Foo(status) {
|
|
babelHelpers.classCallCheck(this, Foo);
|
|
Object.defineProperty(this, _getStatus, {
|
|
value: _getStatus2
|
|
});
|
|
this.status = status;
|
|
}
|
|
|
|
babelHelpers.createClass(Foo, [{
|
|
key: "getCurrentStatus",
|
|
value: function getCurrentStatus() {
|
|
return babelHelpers.classPrivateFieldLooseBase(this, _getStatus)[_getStatus]();
|
|
}
|
|
}, {
|
|
key: "setCurrentStatus",
|
|
value: function setCurrentStatus(newStatus) {
|
|
this.status = newStatus;
|
|
}
|
|
}, {
|
|
key: "getFakeStatus",
|
|
value: function getFakeStatus(fakeStatus) {
|
|
var fakeGetStatus = babelHelpers.classPrivateFieldLooseBase(this, _getStatus)[_getStatus];
|
|
|
|
return function () {
|
|
return fakeGetStatus.call({
|
|
status: fakeStatus
|
|
});
|
|
};
|
|
}
|
|
}, {
|
|
key: "getFakeStatusFunc",
|
|
value: function getFakeStatusFunc() {
|
|
return {
|
|
status: 'fake-status',
|
|
getFakeStatus: babelHelpers.classPrivateFieldLooseBase(this, _getStatus)[_getStatus]
|
|
};
|
|
}
|
|
}]);
|
|
return Foo;
|
|
}();
|
|
|
|
var _getStatus = babelHelpers.classPrivateFieldLooseKey("getStatus");
|
|
|
|
var _getStatus2 = function _getStatus2() {
|
|
return this.status;
|
|
};
|