* Save full descriptor instead of only value for private fields. Decorators can make private fields non-writable, so we need to store this information somewhere. The descriptor can also be used to implement private accessors.
30 lines
707 B
JavaScript
30 lines
707 B
JavaScript
var Foo =
|
|
/*#__PURE__*/
|
|
function () {
|
|
"use strict";
|
|
|
|
function Foo() {
|
|
babelHelpers.classCallCheck(this, Foo);
|
|
|
|
_foo.set(this, {
|
|
writable: true,
|
|
value: 0
|
|
});
|
|
}
|
|
|
|
babelHelpers.createClass(Foo, [{
|
|
key: "test",
|
|
value: function test(other) {
|
|
var _other$obj;
|
|
|
|
babelHelpers.classPrivateFieldSet(this, _foo, babelHelpers.classPrivateFieldGet(this, _foo) + 1);
|
|
babelHelpers.classPrivateFieldSet(this, _foo, 2);
|
|
babelHelpers.classPrivateFieldSet(_other$obj = other.obj, _foo, babelHelpers.classPrivateFieldGet(_other$obj, _foo) + 1);
|
|
babelHelpers.classPrivateFieldSet(other.obj, _foo, 2);
|
|
}
|
|
}]);
|
|
return Foo;
|
|
}();
|
|
|
|
var _foo = new WeakMap();
|