diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-before-member-call/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-before-member-call/output.js index 71a4277d0032..b7af70ee733a 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-before-member-call/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-before-member-call/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-member-call-with-transform/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-member-call-with-transform/output.js index e754115aea72..32ae1bb304ad 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-member-call-with-transform/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-member-call-with-transform/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-member-call/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-member-call/output.js index f3282ff89c62..a1485a30f95a 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-member-call/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-member-call/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-property-with-transform/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-property-with-transform/output.js index 1f754b075002..ad63189c3cd7 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-property-with-transform/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-property-with-transform/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-property/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-property/output.js index 0ba37b422f2a..8f03cb3a6165 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-property/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-before-property/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-delete-property/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-delete-property/output.js index f7a3fc21af1d..622246637201 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-delete-property/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-delete-property/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-in-function-param-with-transform/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-in-function-param-with-transform/output.js index 1c52675c3085..0e771ea1ccfa 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-in-function-param-with-transform/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-in-function-param-with-transform/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-in-function-param/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-in-function-param/output.js index 782d93a5793a..d13828b2ce5f 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-in-function-param/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-in-function-param/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-member-optional-call-with-transform/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-member-optional-call-with-transform/output.js index 349cb4e9e213..507b06ca0fd6 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-member-optional-call-with-transform/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-member-optional-call-with-transform/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-member-optional-call/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-member-optional-call/output.js index c9e4dcb46a81..e64d52e718c1 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-member-optional-call/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-member-optional-call/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-member-call-with-transform/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-member-call-with-transform/output.js index a2c6eae6d3b4..2ae35dd1a2ce 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-member-call-with-transform/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-member-call-with-transform/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-member-call/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-member-call/output.js index c5d75bcaca63..32597a015bcc 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-member-call/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-member-call/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-property-with-transform/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-property-with-transform/output.js index be682ce43b57..971892c789af 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-property-with-transform/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-property-with-transform/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-property/output.js b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-property/output.js index de6a92dd23e0..99587455ce4d 100644 --- a/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-property/output.js +++ b/packages/babel-plugin-proposal-class-properties/test/fixtures/private/optional-chain-optional-property/output.js @@ -1,6 +1,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo { static getSelf() { diff --git a/packages/babel-plugin-proposal-class-static-block/test/fixtures/integration/name-conflict/output.js b/packages/babel-plugin-proposal-class-static-block/test/fixtures/integration/name-conflict/output.js index afd334165910..f058dec5fa41 100644 --- a/packages/babel-plugin-proposal-class-static-block/test/fixtures/integration/name-conflict/output.js +++ b/packages/babel-plugin-proposal-class-static-block/test/fixtures/integration/name-conflict/output.js @@ -1,4 +1,4 @@ -function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { if (receiver !== classConstructor) { throw new TypeError("Private static access of wrong provenance"); } if (descriptor === undefined) { throw new TypeError("attempted to get private static field before its declaration"); } if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } class Foo {}