Add a check for privateMap's existence (#11571)

Co-authored-by: Ajay Poshak <ajay.poshak@bookmyshow.com>
This commit is contained in:
Ajay Poshak
2020-05-31 02:08:15 +05:30
committed by GitHub
parent cd9c71c5b3
commit b1923fd140
117 changed files with 332 additions and 333 deletions

View File

@@ -1,3 +1,7 @@
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");
var _privateFieldValue = babelHelpers.classPrivateFieldLooseKey("privateFieldValue");
class Cl {
constructor() {
Object.defineProperty(this, _privateFieldValue, {
@@ -21,10 +25,6 @@ class Cl {
}
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");
var _privateFieldValue = babelHelpers.classPrivateFieldLooseKey("privateFieldValue");
var _get_privateFieldValue = function () {
return babelHelpers.classPrivateFieldLooseBase(this, _privateField)[_privateField];
};

View File

@@ -1,3 +1,7 @@
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");
var _privateFieldValue = babelHelpers.classPrivateFieldLooseKey("privateFieldValue");
class Cl {
constructor() {
Object.defineProperty(this, _privateFieldValue, {
@@ -13,10 +17,6 @@ class Cl {
}
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");
var _privateFieldValue = babelHelpers.classPrivateFieldLooseKey("privateFieldValue");
var _set_privateFieldValue = function (newValue) {
babelHelpers.classPrivateFieldLooseBase(this, _privateField)[_privateField] = newValue;
};

View File

@@ -1,3 +1,7 @@
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");
var _privateFieldValue = babelHelpers.classPrivateFieldLooseKey("privateFieldValue");
class Cl {
constructor() {
Object.defineProperty(this, _privateFieldValue, {
@@ -13,10 +17,6 @@ class Cl {
}
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");
var _privateFieldValue = babelHelpers.classPrivateFieldLooseKey("privateFieldValue");
var _get_privateFieldValue = function () {
return babelHelpers.classPrivateFieldLooseBase(this, _privateField)[_privateField];
};

View File

@@ -1,3 +1,7 @@
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");
var _privateFieldValue = babelHelpers.classPrivateFieldLooseKey("privateFieldValue");
class Cl {
constructor() {
Object.defineProperty(this, _privateFieldValue, {
@@ -42,10 +46,6 @@ class Cl {
}
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");
var _privateFieldValue = babelHelpers.classPrivateFieldLooseKey("privateFieldValue");
var _get_privateFieldValue = function () {
return babelHelpers.classPrivateFieldLooseBase(this, _privateField)[_privateField];
};

View File

@@ -1,3 +1,7 @@
var _privateField = new WeakMap();
var _privateFieldValue = new WeakMap();
class Cl {
constructor() {
_privateFieldValue.set(this, {
@@ -23,10 +27,6 @@ class Cl {
}
var _privateField = new WeakMap();
var _privateFieldValue = new WeakMap();
var _get_privateFieldValue = function () {
return babelHelpers.classPrivateFieldGet(this, _privateField);
};

View File

@@ -1,3 +1,7 @@
var _privateField = new WeakMap();
var _privateFieldValue = new WeakMap();
class Cl {
constructor() {
_privateFieldValue.set(this, {
@@ -15,10 +19,6 @@ class Cl {
}
var _privateField = new WeakMap();
var _privateFieldValue = new WeakMap();
var _set_privateFieldValue = function (newValue) {
babelHelpers.classPrivateFieldSet(this, _privateField, newValue);
};

View File

@@ -1,3 +1,7 @@
var _privateField = new WeakMap();
var _privateFieldValue = new WeakMap();
class Cl {
constructor() {
_privateFieldValue.set(this, {
@@ -15,10 +19,6 @@ class Cl {
}
var _privateField = new WeakMap();
var _privateFieldValue = new WeakMap();
var _get_privateFieldValue = function () {
return babelHelpers.classPrivateFieldGet(this, _privateField);
};

View File

@@ -1,3 +1,7 @@
var _privateField = new WeakMap();
var _privateFieldValue = new WeakMap();
class Cl {
constructor() {
_privateFieldValue.set(this, {
@@ -46,10 +50,6 @@ class Cl {
}
var _privateField = new WeakMap();
var _privateFieldValue = new WeakMap();
var _get_privateFieldValue = function () {
return babelHelpers.classPrivateFieldGet(this, _privateField);
};

View File

@@ -1,3 +1,7 @@
var _privateField = new WeakMap();
var _getSet = new WeakMap();
class Cl {
constructor() {
_getSet.set(this, {
@@ -13,10 +17,6 @@ class Cl {
}
var _privateField = new WeakMap();
var _getSet = new WeakMap();
var _get_getSet = function () {
return babelHelpers.classPrivateFieldGet(this, _privateField);
};

View File

@@ -1,3 +1,7 @@
var _privateField = new WeakMap();
var _getSet = new WeakMap();
class Cl {
constructor() {
_getSet.set(this, {
@@ -13,10 +17,6 @@ class Cl {
}
var _privateField = new WeakMap();
var _getSet = new WeakMap();
var _set_getSet = function (newValue) {
babelHelpers.classPrivateFieldSet(this, _privateField, newValue);
};

View File

@@ -1,3 +1,5 @@
var _privateMethod = babelHelpers.classPrivateFieldLooseKey("privateMethod");
class Foo {
constructor() {
Object.defineProperty(this, _privateMethod, {
@@ -8,8 +10,6 @@ class Foo {
}
var _privateMethod = babelHelpers.classPrivateFieldLooseKey("privateMethod");
var _privateMethod2 = function _privateMethod2() {
return 42;
};

View File

@@ -1,3 +1,5 @@
var _foo = babelHelpers.classPrivateFieldLooseKey("foo");
class Cl {
constructor() {
Object.defineProperty(this, _foo, {
@@ -11,8 +13,6 @@ class Cl {
}
var _foo = babelHelpers.classPrivateFieldLooseKey("foo");
var _foo2 = async function _foo2() {
return 2;
};

View File

@@ -1,3 +1,7 @@
var _priv = babelHelpers.classPrivateFieldLooseKey("priv");
var _method = babelHelpers.classPrivateFieldLooseKey("method");
class Cl {
constructor() {
Object.defineProperty(this, _method, {
@@ -16,10 +20,6 @@ class Cl {
}
var _priv = babelHelpers.classPrivateFieldLooseKey("priv");
var _method = babelHelpers.classPrivateFieldLooseKey("method");
var _method2 = function _method2(x) {
return x;
};

View File

@@ -1,3 +1,5 @@
var _getStatus = babelHelpers.classPrivateFieldLooseKey("getStatus");
class Foo {
constructor(status) {
Object.defineProperty(this, _getStatus, {
@@ -33,8 +35,6 @@ class Foo {
}
var _getStatus = babelHelpers.classPrivateFieldLooseKey("getStatus");
var _getStatus2 = function _getStatus2() {
return this.status;
};

View File

@@ -1,5 +1,7 @@
var exfiltrated;
var _privateMethod = babelHelpers.classPrivateFieldLooseKey("privateMethod");
class Foo {
constructor() {
Object.defineProperty(this, _privateMethod, {
@@ -13,6 +15,4 @@ class Foo {
}
var _privateMethod = babelHelpers.classPrivateFieldLooseKey("privateMethod");
var _privateMethod2 = function _privateMethod2() {};

View File

@@ -1,3 +1,5 @@
var _foo = babelHelpers.classPrivateFieldLooseKey("foo");
class Cl {
constructor() {
Object.defineProperty(this, _foo, {
@@ -11,8 +13,6 @@ class Cl {
}
var _foo = babelHelpers.classPrivateFieldLooseKey("foo");
var _foo2 = function* _foo2() {
yield 2;
return 3;

View File

@@ -5,6 +5,8 @@ class Base {
}
var _privateMethod = babelHelpers.classPrivateFieldLooseKey("privateMethod");
class Sub extends Base {
constructor(...args) {
super(...args);
@@ -23,8 +25,6 @@ class Sub extends Base {
}
var _privateMethod = babelHelpers.classPrivateFieldLooseKey("privateMethod");
var _privateMethod2 = function _privateMethod2() {
return Base.prototype.superMethod.call(this);
};

View File

@@ -1,3 +1,5 @@
var _privateMethod = new WeakSet();
class Foo {
constructor() {
_privateMethod.add(this);
@@ -7,8 +9,6 @@ class Foo {
}
var _privateMethod = new WeakSet();
var _privateMethod2 = function _privateMethod2() {
return 42;
};

View File

@@ -1,3 +1,5 @@
var _foo = new WeakSet();
class Cl {
constructor() {
_foo.add(this);
@@ -9,8 +11,6 @@ class Cl {
}
var _foo = new WeakSet();
var _foo2 = async function _foo2() {
return 2;
};

View File

@@ -1,3 +1,7 @@
var _priv = new WeakMap();
var _method = new WeakSet();
class Cl {
constructor() {
_method.add(this);
@@ -16,10 +20,6 @@ class Cl {
}
var _priv = new WeakMap();
var _method = new WeakSet();
var _method2 = function _method2(x) {
return x;
};

View File

@@ -1,3 +1,5 @@
var _getStatus = new WeakSet();
class Foo {
constructor(status) {
_getStatus.add(this);
@@ -31,8 +33,6 @@ class Foo {
}
var _getStatus = new WeakSet();
var _getStatus2 = function _getStatus2() {
return this.status;
};

View File

@@ -1,5 +1,7 @@
var exfiltrated;
var _privateMethod = new WeakSet();
class Foo {
constructor() {
_privateMethod.add(this);
@@ -11,6 +13,4 @@ class Foo {
}
var _privateMethod = new WeakSet();
var _privateMethod2 = function _privateMethod2() {};

View File

@@ -1,3 +1,5 @@
var _foo = new WeakSet();
class Cl {
constructor() {
_foo.add(this);
@@ -9,8 +11,6 @@ class Cl {
}
var _foo = new WeakSet();
var _foo2 = function* _foo2() {
yield 2;
return 3;

View File

@@ -5,6 +5,8 @@ class Base {
}
var _privateMethod = new WeakSet();
class Sub extends Base {
constructor(...args) {
super(...args);
@@ -22,8 +24,6 @@ class Sub extends Base {
}
var _privateMethod = new WeakSet();
var _privateMethod2 = function _privateMethod2() {
return babelHelpers.get(babelHelpers.getPrototypeOf(Sub.prototype), "superMethod", this).call(this);
};

View File

@@ -1,3 +1,5 @@
var _privateStaticMethod = babelHelpers.classPrivateFieldLooseKey("privateStaticMethod");
class Cl {
static staticMethod2() {
return babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticMethod)[_privateStaticMethod]();
@@ -21,8 +23,6 @@ class Cl {
}
var _privateStaticMethod = babelHelpers.classPrivateFieldLooseKey("privateStaticMethod");
var _privateStaticMethod2 = function _privateStaticMethod2() {
return 1017;
};

View File

@@ -1,3 +1,5 @@
var _privateStaticMethod = babelHelpers.classPrivateFieldLooseKey("privateStaticMethod");
class Cl {
publicMethod(checked) {
return babelHelpers.classPrivateFieldLooseBase(checked, _privateStaticMethod)[_privateStaticMethod]();
@@ -5,8 +7,6 @@ class Cl {
}
var _privateStaticMethod = babelHelpers.classPrivateFieldLooseKey("privateStaticMethod");
var _privateStaticMethod2 = function _privateStaticMethod2() {};
Object.defineProperty(Cl, _privateStaticMethod, {

View File

@@ -1,5 +1,7 @@
var exfiltrated;
var _privateStaticMethod = babelHelpers.classPrivateFieldLooseKey("privateStaticMethod");
class Cl {
constructor() {
if (exfiltrated === undefined) {
@@ -9,8 +11,6 @@ class Cl {
}
var _privateStaticMethod = babelHelpers.classPrivateFieldLooseKey("privateStaticMethod");
var _privateStaticMethod2 = function _privateStaticMethod2() {
return 1017;
};

View File

@@ -1,3 +1,5 @@
var _foo = babelHelpers.classPrivateFieldLooseKey("foo");
class Cl {
test() {
return babelHelpers.classPrivateFieldLooseBase(Cl, _foo)[_foo]();
@@ -5,8 +7,6 @@ class Cl {
}
var _foo = babelHelpers.classPrivateFieldLooseKey("foo");
var _foo2 = function* _foo2() {
yield 2;
return 3;

View File

@@ -1,3 +1,5 @@
var _privateStaticMethod = babelHelpers.classPrivateFieldLooseKey("privateStaticMethod");
class Cl {
constructor() {
babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticMethod)[_privateStaticMethod] = null;
@@ -5,8 +7,6 @@ class Cl {
}
var _privateStaticMethod = babelHelpers.classPrivateFieldLooseKey("privateStaticMethod");
var _privateStaticMethod2 = function _privateStaticMethod2() {};
Object.defineProperty(Cl, _privateStaticMethod, {

View File

@@ -5,6 +5,8 @@ class Base {
}
var _subStaticPrivateMethod = babelHelpers.classPrivateFieldLooseKey("subStaticPrivateMethod");
class Sub extends Base {
static basePublicStaticMethod() {
return 'bad';
@@ -16,8 +18,6 @@ class Sub extends Base {
}
var _subStaticPrivateMethod = babelHelpers.classPrivateFieldLooseKey("subStaticPrivateMethod");
var _subStaticPrivateMethod2 = function _subStaticPrivateMethod2() {
return Base.basePublicStaticMethod.call(this);
};

View File

@@ -5,6 +5,10 @@ class A {
}
var _getA = babelHelpers.classPrivateFieldLooseKey("getA");
var _getB = babelHelpers.classPrivateFieldLooseKey("getB");
class B extends A {
static get b() {
return 2;
@@ -16,10 +20,6 @@ class B extends A {
}
var _getA = babelHelpers.classPrivateFieldLooseKey("getA");
var _getB = babelHelpers.classPrivateFieldLooseKey("getB");
var _getB2 = function _getB2() {
return this.b;
};

View File

@@ -1,3 +1,7 @@
var _PRIVATE_STATIC_FIELD = babelHelpers.classPrivateFieldLooseKey("PRIVATE_STATIC_FIELD");
var _privateStaticFieldValue = babelHelpers.classPrivateFieldLooseKey("privateStaticFieldValue");
class Cl {
static getValue() {
return babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticFieldValue)[_privateStaticFieldValue];
@@ -9,10 +13,6 @@ class Cl {
}
var _PRIVATE_STATIC_FIELD = babelHelpers.classPrivateFieldLooseKey("PRIVATE_STATIC_FIELD");
var _privateStaticFieldValue = babelHelpers.classPrivateFieldLooseKey("privateStaticFieldValue");
var _set_privateStaticFieldValue = function (newValue) {
babelHelpers.classPrivateFieldLooseBase(Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = `Updated: ${newValue}`;
};

View File

@@ -1,3 +1,7 @@
var _PRIVATE_STATIC_FIELD = babelHelpers.classPrivateFieldLooseKey("PRIVATE_STATIC_FIELD");
var _privateStaticFieldValue = babelHelpers.classPrivateFieldLooseKey("privateStaticFieldValue");
class Cl {
static getPrivateStaticFieldValue() {
return babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticFieldValue)[_privateStaticFieldValue];
@@ -5,10 +9,6 @@ class Cl {
}
var _PRIVATE_STATIC_FIELD = babelHelpers.classPrivateFieldLooseKey("PRIVATE_STATIC_FIELD");
var _privateStaticFieldValue = babelHelpers.classPrivateFieldLooseKey("privateStaticFieldValue");
var _set_privateStaticFieldValue = function (newValue) {
babelHelpers.classPrivateFieldLooseBase(Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD] = newValue;
};

View File

@@ -1,3 +1,7 @@
var _PRIVATE_STATIC_FIELD = babelHelpers.classPrivateFieldLooseKey("PRIVATE_STATIC_FIELD");
var _privateStaticFieldValue = babelHelpers.classPrivateFieldLooseKey("privateStaticFieldValue");
class Cl {
static setPrivateStaticFieldValue() {
babelHelpers.classPrivateFieldLooseBase(Cl, _privateStaticFieldValue)[_privateStaticFieldValue] = 1;
@@ -5,10 +9,6 @@ class Cl {
}
var _PRIVATE_STATIC_FIELD = babelHelpers.classPrivateFieldLooseKey("PRIVATE_STATIC_FIELD");
var _privateStaticFieldValue = babelHelpers.classPrivateFieldLooseKey("privateStaticFieldValue");
var _get_privateStaticFieldValue = function () {
return babelHelpers.classPrivateFieldLooseBase(Cl, _PRIVATE_STATIC_FIELD)[_PRIVATE_STATIC_FIELD];
};

View File

@@ -1,3 +1,7 @@
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");
var _privateFieldValue = babelHelpers.classPrivateFieldLooseKey("privateFieldValue");
class Cl {
static publicGetPrivateField() {
return babelHelpers.classPrivateFieldLooseBase(Cl, _privateFieldValue)[_privateFieldValue];
@@ -30,10 +34,6 @@ class Cl {
}
var _privateField = babelHelpers.classPrivateFieldLooseKey("privateField");
var _privateFieldValue = babelHelpers.classPrivateFieldLooseKey("privateFieldValue");
var _set_privateFieldValue = function (newValue) {
babelHelpers.classPrivateFieldLooseBase(Cl, _privateField)[_privateField] = newValue;
};