* fix: evaluate initializer when a private method is set as a field * make legacy node happy * add accessor test cases * fix: evaluate object before RHS * fix: evaluate object before throwing writeOnlyError
18 lines
384 B
JavaScript
18 lines
384 B
JavaScript
var counter = 0;
|
|
|
|
var _privateMethod = babelHelpers.classPrivateFieldLooseKey("privateMethod");
|
|
|
|
class Foo {
|
|
constructor() {
|
|
Object.defineProperty(this, _privateMethod, {
|
|
value: _privateMethod2
|
|
});
|
|
babelHelpers.classPrivateFieldLooseBase(this, _privateMethod)[_privateMethod] = ++counter;
|
|
}
|
|
|
|
}
|
|
|
|
var _privateMethod2 = function _privateMethod2() {
|
|
return 42;
|
|
};
|