Add a check for privateMap's existence (#11571)
Co-authored-by: Ajay Poshak <ajay.poshak@bookmyshow.com>
This commit is contained in:
@@ -182,8 +182,8 @@ export function createClassFeaturePlugin({
|
||||
}
|
||||
|
||||
path = wrapClass(path);
|
||||
path.insertBefore(keysNodes);
|
||||
path.insertAfter([...privateNamesNodes, ...staticNodes]);
|
||||
path.insertBefore([...privateNamesNodes, ...keysNodes]);
|
||||
path.insertAfter(staticNodes);
|
||||
},
|
||||
|
||||
PrivateName(path) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
var _privateMethod = new WeakSet();
|
||||
|
||||
class X {
|
||||
constructor() {
|
||||
_privateMethod.add(this);
|
||||
@@ -5,8 +7,6 @@ class X {
|
||||
|
||||
}
|
||||
|
||||
var _privateMethod = new WeakSet();
|
||||
|
||||
var _privateMethod2 = function _privateMethod2() {
|
||||
return 42;
|
||||
};
|
||||
|
||||
@@ -2,6 +2,8 @@ var id = 0;
|
||||
|
||||
function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + name; }
|
||||
|
||||
var _privateMethod = _classPrivateFieldLooseKey("privateMethod");
|
||||
|
||||
class X {
|
||||
constructor() {
|
||||
Object.defineProperty(this, _privateMethod, {
|
||||
@@ -11,8 +13,6 @@ class X {
|
||||
|
||||
}
|
||||
|
||||
var _privateMethod = _classPrivateFieldLooseKey("privateMethod");
|
||||
|
||||
var _privateMethod2 = function _privateMethod2() {
|
||||
return 42;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user