Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com> Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
25 lines
388 B
JavaScript
25 lines
388 B
JavaScript
class Base {
|
|
constructor(obj) {
|
|
return obj;
|
|
}
|
|
|
|
}
|
|
|
|
let counter = 0;
|
|
|
|
var _foo = /*#__PURE__*/new WeakMap();
|
|
|
|
class Derived extends Base {
|
|
constructor(...args) {
|
|
super(...args);
|
|
babelHelpers.classPrivateFieldInitSpec(this, _foo, {
|
|
writable: true,
|
|
value: ++counter
|
|
});
|
|
}
|
|
|
|
static get(obj) {
|
|
return babelHelpers.classPrivateFieldGet(obj, _foo);
|
|
}
|
|
|
|
} |