Files
Huáng JùnliàngandGitHub 980dcb8b01 Memoize class binding when compiling private methods and static elements (#15701)
* add test cases

* fix: memoise class binding when lowering static elements and private methods

* update test fixtures

* update test fixtures
2023-07-19 17:59:21 -04:00

24 lines
571 B
JavaScript

var _class;
class Base {
superMethod() {
return 'good';
}
}
var _privateMethod = /*#__PURE__*/new WeakSet();
class Sub extends Base {
constructor(...args) {
super(...args);
babelHelpers.classPrivateMethodInitSpec(this, _privateMethod);
}
superMethod() {
return 'bad';
}
publicMethod() {
return babelHelpers.classPrivateMethodGet(this, _privateMethod, _privateMethod2).call(this);
}
}
_class = Sub;
function _privateMethod2() {
return babelHelpers.get(babelHelpers.getPrototypeOf(_class.prototype), "superMethod", this).call(this);
}