From 9a9fde70ea11dff72e8a7995dea7e344d2ec247c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Wed, 7 Feb 2024 15:57:13 -0800 Subject: [PATCH] Do not use descriptors for private class elements (#16261) --- Makefile.js | 4 +- Makefile.source.mjs | 9 + .../src/fields.ts | 518 +++++++++++++----- .../src/index.ts | 2 +- .../private-accessor/output.js | 11 +- .../private-field/output.js | 7 +- packages/babel-helper-fixtures/src/index.ts | 10 +- .../babel-helpers/src/helpers-generated.ts | 30 + packages/babel-helpers/src/helpers.ts | 62 ++- .../src/helpers/assertClassBrand.js | 8 + .../src/helpers/classPrivateFieldGet2.js | 7 + .../src/helpers/classPrivateFieldSet2.js | 8 + .../src/helpers/classPrivateGetter.js | 7 + .../src/helpers/classPrivateSetter.js | 13 + .../babel-helpers/src/helpers/toSetter.js | 14 + .../output.mjs | 9 +- .../class-private-integration/output.mjs | 9 +- .../context-name/output.js | 67 +-- .../private/output.js | 30 +- .../public/output.js | 27 +- .../static-private/output.js | 22 +- .../static-public/output.js | 21 +- .../undecorated-private/output.js | 30 +- .../undecorated-public/output.js | 27 +- .../undecorated-static-private/output.js | 22 +- .../undecorated-static-public/output.js | 21 +- .../output.js | 30 +- .../context-name/output.js | 7 +- .../private/output.js | 18 +- .../static-private/output.js | 14 +- .../context-name/output.js | 4 - .../private/output.js | 9 +- .../static-private/output.js | 6 +- .../private/output.js | 11 +- .../static-private/output.js | 8 +- .../context-name/output.js | 3 +- .../private/output.js | 7 +- .../static-private/output.js | 5 +- .../valid-expression-formats/output.js | 7 +- .../context-name/output.js | 4 - .../private/output.js | 9 +- .../static-private/output.js | 6 +- .../context-name/output.js | 67 +-- .../private/output.js | 30 +- .../public/output.js | 27 +- .../static-private/output.js | 22 +- .../static-public/output.js | 21 +- .../undecorated-private/output.js | 30 +- .../undecorated-public/output.js | 27 +- .../undecorated-static-private/output.js | 22 +- .../undecorated-static-public/output.js | 21 +- .../output.js | 30 +- .../context-name/output.js | 7 +- .../private/output.js | 18 +- .../static-private/output.js | 14 +- .../context-name/output.js | 4 - .../private/output.js | 9 +- .../static-private/output.js | 6 +- .../private/output.js | 11 +- .../static-private/output.js | 8 +- .../context-name/output.js | 3 +- .../private/output.js | 7 +- .../static-private/output.js | 5 +- .../valid-expression-formats/output.js | 7 +- .../context-name/output.js | 4 - .../private/output.js | 9 +- .../static-private/output.js | 6 +- .../context-name/output.js | 65 +-- .../private/output.js | 24 +- .../public/output.js | 27 +- .../static-private/output.js | 16 +- .../static-public/output.js | 21 +- .../undecorated-private/output.js | 30 +- .../undecorated-public/output.js | 27 +- .../undecorated-static-private/output.js | 22 +- .../undecorated-static-public/output.js | 21 +- .../output.js | 30 +- .../context-name/output.js | 5 +- .../private/output.js | 12 +- .../static-private/output.js | 8 +- .../context-name/output.js | 4 - .../private/output.js | 9 +- .../static-private/output.js | 6 +- .../private/output.js | 11 +- .../static-private/output.js | 8 +- .../context-name/output.js | 3 +- .../private/output.js | 7 +- .../static-private/output.js | 5 +- .../valid-expression-formats/output.js | 7 +- .../context-name/output.js | 4 - .../private/output.js | 9 +- .../static-private/output.js | 6 +- .../context-name/output.js | 65 +-- .../private/output.js | 24 +- .../public/output.js | 27 +- .../static-private/output.js | 16 +- .../static-public/output.js | 21 +- .../undecorated-private/output.js | 30 +- .../undecorated-public/output.js | 27 +- .../undecorated-static-private/output.js | 24 +- .../undecorated-static-public/output.js | 21 +- .../output.js | 30 +- .../context-name/output.js | 5 +- .../private/output.js | 12 +- .../static-private/output.js | 8 +- .../context-name/output.js | 4 - .../private/output.js | 9 +- .../static-private/output.js | 6 +- .../private/output.js | 11 +- .../static-private/output.js | 8 +- .../context-name/output.js | 3 +- .../private/output.js | 7 +- .../static-private/output.js | 5 +- .../valid-expression-formats/output.js | 7 +- .../initializers-and-static-blocks/output.js | 18 +- .../context-name/output.js | 4 - .../private/output.js | 9 +- .../static-private/output.js | 6 +- .../context-name/output.js | 65 +-- .../private/output.js | 24 +- .../public/output.js | 27 +- .../static-private/output.js | 16 +- .../static-public/output.js | 21 +- .../undecorated-private/output.js | 30 +- .../undecorated-public/output.js | 27 +- .../undecorated-static-private/output.js | 24 +- .../undecorated-static-public/output.js | 21 +- .../output.js | 30 +- .../context-name/output.js | 5 +- .../private/output.js | 12 +- .../static-private/output.js | 8 +- .../context-name/output.js | 4 - .../private/output.js | 9 +- .../static-private/output.js | 6 +- .../private/output.js | 11 +- .../static-private/output.js | 8 +- .../context-name/output.js | 3 +- .../private-async-and-generator/output.js | 15 +- .../private/output.js | 7 +- .../static-private/output.js | 5 +- .../valid-expression-formats/output.js | 7 +- .../context-name/output.js | 4 - .../private/output.js | 9 +- .../static-private/output.js | 6 +- .../array-rest-destructuring-middle/output.js | 5 +- .../array-rest-only/output.js | 5 +- .../assignment--es2015/array-rest/output.js | 5 +- .../assignment--es2015/basic/output.js | 5 +- .../completion-do-expression/output.js | 5 +- .../member-expression/output.js | 11 +- .../nested-under-array-pattern/output.js | 11 +- .../assignment--es2015/nested/output.js | 18 +- .../object-rest-and-keys/output.js | 8 +- .../object-rest-and-private-keys/output.js | 8 +- .../object-rest-under-private/output.js | 9 +- .../assignment--es2015/object-rest/output.js | 10 +- .../under-param-initializer/output.js | 7 +- .../function-params/output.js | 11 +- .../variable-declaration/output.js | 10 +- .../no-shadowed-params/output.js | 7 +- .../lhs-with-assign/output.js | 5 +- .../fixtures/for-init--es2015/lhs/output.js | 7 +- .../output.js | 5 +- .../variable-declaration/output.js | 7 +- .../lhs-with-shadowed-block-scoped/output.js | 5 +- .../fixtures/for-of--es2015/lhs/output.js | 7 +- .../output.js | 5 +- .../variable-declaration/output.js | 7 +- .../function-length/output.js | 11 +- .../no-shadowed-params/output.js | 7 +- .../shadowed-params/output.js | 7 +- .../array-rest-only/output.js | 5 +- .../array-rest/output.js | 5 +- .../basic/output.js | 5 +- .../nested-under-array-pattern/output.js | 19 +- .../nested/output.js | 28 +- .../object-rest-and-keys/output.js | 5 +- .../object-rest-and-private-keys/output.js | 10 +- .../object-rest-under-private/output.js | 9 +- .../object-rest/output.js | 10 +- .../private-field-transformed/output.js | 17 +- .../private-field-transformed/output.js | 17 +- .../output.js | 89 ++- .../optional-chain-cast-to-boolean/output.js | 37 +- .../super-property-in-accessor-key/output.js | 9 +- .../class-shadow-builtins/options.json | 2 +- .../class-shadow-builtins/output.mjs | 11 +- .../options.json | 2 +- .../output.js | 36 +- .../private-loose/static-shadow/options.json | 2 +- .../private-loose/static-shadow/output.js | 13 +- .../output.js | 36 +- .../private/access-before-declaration/exec.js | 6 +- .../fixtures/private/assignment/output.js | 15 +- .../test/fixtures/private/call/output.js | 13 +- .../test/fixtures/private/canonical/output.js | 28 +- .../private/class-shadow-builtins/output.mjs | 5 +- .../private/constructor-collision/output.js | 7 +- .../private/declaration-order/output.js | 9 +- .../private/derived-multiple-supers/output.js | 12 +- .../test/fixtures/private/derived/output.js | 14 +- .../destructuring-array-pattern-1/output.js | 11 +- .../destructuring-array-pattern-2/output.js | 9 +- .../destructuring-array-pattern-3/output.js | 9 +- .../output.js | 7 +- .../destructuring-array-pattern/output.js | 9 +- .../destructuring-object-pattern-1/output.js | 15 +- .../destructuring-object-pattern-2/output.js | 9 +- .../destructuring-object-pattern-3/output.js | 9 +- .../output.js | 7 +- .../destructuring-object-pattern/output.js | 9 +- .../fixtures/private/extracted-this/output.js | 12 +- .../test/fixtures/private/foobar/output.js | 9 +- .../private/instance-undefined/output.js | 7 +- .../test/fixtures/private/instance/output.js | 5 +- .../private/logical-assignment/output.js | 23 +- .../test/fixtures/private/multiple/output.js | 12 +- .../fixtures/private/native-classes/output.js | 12 +- .../output.js | 20 +- .../private/nested-class-computed/output.js | 13 +- .../output.js | 23 +- .../nested-class-extends-computed/output.js | 18 +- .../nested-class-other-redeclared/output.js | 27 +- .../private/nested-class-redeclared/output.js | 18 +- .../fixtures/private/nested-class/output.js | 13 +- .../private/non-block-arrow-func/output.mjs | 3 +- .../output.js | 89 ++- .../output.js | 89 ++- .../output.js | 84 ++- .../optional-chain-before-property/output.js | 84 ++- .../optional-chain-cast-to-boolean/output.js | 37 +- .../optional-chain-delete-property/output.js | 68 ++- .../output.js | 21 +- .../output.js | 21 +- .../output.js | 11 +- .../output.js | 95 ++-- .../output.js | 95 ++-- .../output.js | 95 ++-- .../output.js | 95 ++-- .../output.js | 90 ++- .../output.js | 90 ++- .../test/fixtures/private/options.json | 6 +- .../output.js | 28 +- .../output.js | 28 +- .../private/preserve-comments/output.js | 10 +- .../private/private-in-derived/output.js | 11 +- .../fixtures/private/reevaluated/output.js | 16 +- .../reference-in-other-property/output.js | 21 +- .../private/regression-T2983/output.mjs | 6 +- .../private/regression-T6719/output.js | 3 +- .../private/regression-T7364/output.mjs | 42 +- .../fixtures/private/static-call/output.js | 7 +- .../private/static-class-binding/output.js | 8 +- .../fixtures/private/static-export/output.mjs | 6 +- .../private/static-infer-name/output.js | 3 +- .../private/static-inherited/output.js | 16 +- .../private/static-self-field/output.js | 3 +- .../fixtures/private/static-shadow/output.js | 5 +- .../fixtures/private/static-this/output.js | 8 +- .../private/static-undefined/output.js | 7 +- .../test/fixtures/private/static/output.js | 7 +- .../fixtures/private/super-call/output.js | 9 +- .../private/super-expression/output.js | 7 +- .../private/super-statement/output.js | 7 +- .../private/tagged-template-static/output.js | 5 +- .../private/tagged-template/output.js | 9 +- .../test/fixtures/private/update/output.js | 15 +- .../test/fixtures/regression/8882/output.js | 7 +- .../fixtures/regression/old-helpers/exec.js | 68 +++ .../fixtures/regression/old-helpers/input.js | 62 +++ .../regression/old-helpers/options.json | 6 + .../fixtures/regression/old-helpers/output.js | 93 ++++ .../multiple-static-initializers/output.js | 5 +- .../integration/name-conflict/output.js | 5 +- .../test/fixtures/accessors/basic/output.js | 20 +- .../accessors/class-binding/output.js | 7 +- .../fixtures/accessors/destructuring/input.js | 9 + .../accessors/destructuring/output.js | 12 + .../accessors/get-only-setter/output.js | 14 +- .../accessors/preserve-comments/output.js | 7 +- .../fixtures/accessors/reassignment/output.js | 7 +- .../accessors/set-only-getter/output.js | 16 +- .../accessors/tagged-template/output.js | 9 +- .../accessors/updates-bigint/output.js | 30 +- .../test/fixtures/accessors/updates/output.js | 30 +- .../duplicated-names/get-set/output.js | 16 +- .../duplicated-names/set-get/output.js | 16 +- .../test/fixtures/misc/multiple/input.js | 18 + .../test/fixtures/misc/multiple/output.js | 16 + .../test/fixtures/misc/options.json | 7 + .../private-method/before-fields/output.js | 7 +- .../private-method/destructuring/input.js | 7 + .../private-method/destructuring/output.js | 10 + .../private-method/read-only/output.js | 2 +- .../async/output.js | 2 +- .../private-static-method/async/output.js | 2 +- .../private-static-method/basic/output.js | 10 +- .../class-check/output.js | 2 +- .../class-expression/output.js | 2 +- .../exfiltrated/output.js | 2 +- .../private-static-method/generator/output.js | 2 +- .../private-static-method/read-only/output.js | 4 +- .../private-static-method/super/output.js | 2 +- .../tagged-template/output.js | 2 +- .../private-static-method/this/output.js | 2 +- .../fixtures/static-accessors/basic/output.js | 17 +- .../destructure-set/output.js | 13 +- .../get-only-setter/output.js | 13 +- .../preserve-comments/output.js | 4 - .../set-only-getter/output.js | 13 +- .../tagged-template/output.js | 6 +- .../static-accessors/updates/output.js | 27 +- .../private-loose/native-classes/output.js | 8 +- .../private-loose/static-shadow/output.js | 3 +- .../test/fixtures/private/accessor/output.js | 7 +- .../test/fixtures/private/field/output.js | 5 +- .../fixtures/private/native-classes/output.js | 8 +- .../nested-class-other-redeclared/output.js | 15 +- .../private/nested-class-redeclared/output.js | 10 +- .../fixtures/private/nested-class/output.js | 5 +- .../private/static-accessor/output.js | 4 - .../fixtures/private/static-field/output.js | 3 +- .../fixtures/private/static-shadow/output.js | 3 +- .../to-native-fields/static-shadow/output.js | 3 +- .../class-features-node-12-babel-7/output.js | 7 +- .../class-features-node-12/output.js | 7 +- .../new-class-features-firefox-70/output.js | 5 +- packages/babel-runtime-corejs2/package.json | 54 ++ packages/babel-runtime-corejs3/package.json | 54 ++ packages/babel-runtime/package.json | 54 ++ 330 files changed, 2791 insertions(+), 3201 deletions(-) create mode 100644 packages/babel-helpers/src/helpers/assertClassBrand.js create mode 100644 packages/babel-helpers/src/helpers/classPrivateFieldGet2.js create mode 100644 packages/babel-helpers/src/helpers/classPrivateFieldSet2.js create mode 100644 packages/babel-helpers/src/helpers/classPrivateGetter.js create mode 100644 packages/babel-helpers/src/helpers/classPrivateSetter.js create mode 100644 packages/babel-helpers/src/helpers/toSetter.js create mode 100644 packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/exec.js create mode 100644 packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/input.js create mode 100644 packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/options.json create mode 100644 packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/output.js create mode 100644 packages/babel-plugin-transform-private-methods/test/fixtures/accessors/destructuring/input.js create mode 100644 packages/babel-plugin-transform-private-methods/test/fixtures/accessors/destructuring/output.js create mode 100644 packages/babel-plugin-transform-private-methods/test/fixtures/misc/multiple/input.js create mode 100644 packages/babel-plugin-transform-private-methods/test/fixtures/misc/multiple/output.js create mode 100644 packages/babel-plugin-transform-private-methods/test/fixtures/misc/options.json create mode 100644 packages/babel-plugin-transform-private-methods/test/fixtures/private-method/destructuring/input.js create mode 100644 packages/babel-plugin-transform-private-methods/test/fixtures/private-method/destructuring/output.js diff --git a/Makefile.js b/Makefile.js index 21ae974f397e..862544f5e22e 100644 --- a/Makefile.js +++ b/Makefile.js @@ -1,4 +1,4 @@ -// source hash: b47ae62878be6143f0702a46e444ad8cd6fa0772 +// source hash: 30886e754f89ed33a82d2f9d1c60eb1ae8794cd5 /* eslint-disable */ // prettier-ignore -"use strict";var e=require("os"),r=require("fs"),t=require("path"),n=require("events"),i=require("assert"),o=require("util"),s=require("child_process"),c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var a=function(e){return e&&e.Math===Math&&e},u=a("object"==typeof globalThis&&globalThis)||a("object"==typeof window&&window)||a("object"==typeof self&&self)||a("object"==typeof c&&c)||a("object"==typeof c&&c)||function(){return this}()||Function("return this")(),l={},f=function(e){try{return!!e()}catch(e){return!0}},p=!f((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),h=!f((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),d=h,v=Function.prototype.call,g=d?v.bind(v):function(){return v.apply(v,arguments)},y={},m={}.propertyIsEnumerable,E=Object.getOwnPropertyDescriptor,b=E&&!m.call({1:2},1);y.f=b?function(e){var r=E(this,e);return!!r&&r.enumerable}:m;var w,O,S=function(e,r){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:r}},R=h,I=Function.prototype,A=I.call,j=R&&I.bind.bind(A,A),x=R?j:function(e){return function(){return A.apply(e,arguments)}},k=x,L=k({}.toString),T=k("".slice),_=function(e){return T(L(e),8,-1)},N=f,P=_,F=Object,D=x("".split),C=N((function(){return!F("z").propertyIsEnumerable(0)}))?function(e){return"String"===P(e)?D(e,""):F(e)}:F,M=function(e){return null==e},G=M,$=TypeError,B=function(e){if(G(e))throw new $("Can't call method on "+e);return e},U=C,X=B,q=function(e){return U(X(e))},W="object"==typeof document&&document.all,V=void 0===W&&void 0!==W?function(e){return"function"==typeof e||e===W}:function(e){return"function"==typeof e},H=V,z=function(e){return"object"==typeof e?null!==e:H(e)},Y=u,K=V,J=function(e,r){return arguments.length<2?(t=Y[e],K(t)?t:void 0):Y[e]&&Y[e][r];var t},Q=x({}.isPrototypeOf),Z="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ee=u,re=Z,te=ee.process,ne=ee.Deno,ie=te&&te.versions||ne&&ne.version,oe=ie&&ie.v8;oe&&(O=(w=oe.split("."))[0]>0&&w[0]<4?1:+(w[0]+w[1])),!O&&re&&(!(w=re.match(/Edge\/(\d+)/))||w[1]>=74)&&(w=re.match(/Chrome\/(\d+)/))&&(O=+w[1]);var se=O,ce=se,ae=f,ue=u.String,le=!!Object.getOwnPropertySymbols&&!ae((function(){var e=Symbol("symbol detection");return!ue(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ce&&ce<41})),fe=le&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,pe=J,he=V,de=Q,ve=Object,ge=fe?function(e){return"symbol"==typeof e}:function(e){var r=pe("Symbol");return he(r)&&de(r.prototype,ve(e))},ye=String,me=function(e){try{return ye(e)}catch(e){return"Object"}},Ee=V,be=me,we=TypeError,Oe=function(e){if(Ee(e))return e;throw new we(be(e)+" is not a function")},Se=Oe,Re=M,Ie=function(e,r){var t=e[r];return Re(t)?void 0:Se(t)},Ae=g,je=V,xe=z,ke=TypeError,Le={exports:{}},Te=u,_e=Object.defineProperty,Ne=function(e,r){try{_e(Te,e,{value:r,configurable:!0,writable:!0})}catch(t){Te[e]=r}return r},Pe=Ne,Fe="__core-js_shared__",De=u[Fe]||Pe(Fe,{}),Ce=De;(Le.exports=function(e,r){return Ce[e]||(Ce[e]=void 0!==r?r:{})})("versions",[]).push({version:"3.35.0",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Me=Le.exports,Ge=B,$e=Object,Be=function(e){return $e(Ge(e))},Ue=Be,Xe=x({}.hasOwnProperty),qe=Object.hasOwn||function(e,r){return Xe(Ue(e),r)},We=x,Ve=0,He=Math.random(),ze=We(1..toString),Ye=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ze(++Ve+He,36)},Ke=Me,Je=qe,Qe=Ye,Ze=le,er=fe,rr=u.Symbol,tr=Ke("wks"),nr=er?rr.for||rr:rr&&rr.withoutSetter||Qe,ir=function(e){return Je(tr,e)||(tr[e]=Ze&&Je(rr,e)?rr[e]:nr("Symbol."+e)),tr[e]},or=g,sr=z,cr=ge,ar=Ie,ur=function(e,r){var t,n;if("string"===r&&je(t=e.toString)&&!xe(n=Ae(t,e)))return n;if(je(t=e.valueOf)&&!xe(n=Ae(t,e)))return n;if("string"!==r&&je(t=e.toString)&&!xe(n=Ae(t,e)))return n;throw new ke("Can't convert object to primitive value")},lr=TypeError,fr=ir("toPrimitive"),pr=function(e,r){if(!sr(e)||cr(e))return e;var t,n=ar(e,fr);if(n){if(void 0===r&&(r="default"),t=or(n,e,r),!sr(t)||cr(t))return t;throw new lr("Can't convert object to primitive value")}return void 0===r&&(r="number"),ur(e,r)},hr=ge,dr=function(e){var r=pr(e,"string");return hr(r)?r:r+""},vr=z,gr=u.document,yr=vr(gr)&&vr(gr.createElement),mr=function(e){return yr?gr.createElement(e):{}},Er=mr,br=!p&&!f((function(){return 7!==Object.defineProperty(Er("div"),"a",{get:function(){return 7}}).a})),wr=p,Or=g,Sr=y,Rr=S,Ir=q,Ar=dr,jr=qe,xr=br,kr=Object.getOwnPropertyDescriptor;l.f=wr?kr:function(e,r){if(e=Ir(e),r=Ar(r),xr)try{return kr(e,r)}catch(e){}if(jr(e,r))return Rr(!Or(Sr.f,e,r),e[r])};var Lr={},Tr=p&&f((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),_r=z,Nr=String,Pr=TypeError,Fr=function(e){if(_r(e))return e;throw new Pr(Nr(e)+" is not an object")},Dr=p,Cr=br,Mr=Tr,Gr=Fr,$r=dr,Br=TypeError,Ur=Object.defineProperty,Xr=Object.getOwnPropertyDescriptor,qr="enumerable",Wr="configurable",Vr="writable";Lr.f=Dr?Mr?function(e,r,t){if(Gr(e),r=$r(r),Gr(t),"function"==typeof e&&"prototype"===r&&"value"in t&&Vr in t&&!t[Vr]){var n=Xr(e,r);n&&n[Vr]&&(e[r]=t.value,t={configurable:Wr in t?t[Wr]:n[Wr],enumerable:qr in t?t[qr]:n[qr],writable:!1})}return Ur(e,r,t)}:Ur:function(e,r,t){if(Gr(e),r=$r(r),Gr(t),Cr)try{return Ur(e,r,t)}catch(e){}if("get"in t||"set"in t)throw new Br("Accessors not supported");return"value"in t&&(e[r]=t.value),e};var Hr=Lr,zr=S,Yr=p?function(e,r,t){return Hr.f(e,r,zr(1,t))}:function(e,r,t){return e[r]=t,e},Kr={exports:{}},Jr=p,Qr=qe,Zr=Function.prototype,et=Jr&&Object.getOwnPropertyDescriptor,rt=Qr(Zr,"name"),tt={EXISTS:rt,PROPER:rt&&"something"===function(){}.name,CONFIGURABLE:rt&&(!Jr||Jr&&et(Zr,"name").configurable)},nt=V,it=De,ot=x(Function.toString);nt(it.inspectSource)||(it.inspectSource=function(e){return ot(e)});var st,ct,at,ut=it.inspectSource,lt=V,ft=u.WeakMap,pt=lt(ft)&&/native code/.test(String(ft)),ht=Ye,dt=Me("keys"),vt=function(e){return dt[e]||(dt[e]=ht(e))},gt={},yt=pt,mt=u,Et=z,bt=Yr,wt=qe,Ot=De,St=vt,Rt=gt,It="Object already initialized",At=mt.TypeError,jt=mt.WeakMap;if(yt||Ot.state){var xt=Ot.state||(Ot.state=new jt);xt.get=xt.get,xt.has=xt.has,xt.set=xt.set,st=function(e,r){if(xt.has(e))throw new At(It);return r.facade=e,xt.set(e,r),r},ct=function(e){return xt.get(e)||{}},at=function(e){return xt.has(e)}}else{var kt=St("state");Rt[kt]=!0,st=function(e,r){if(wt(e,kt))throw new At(It);return r.facade=e,bt(e,kt,r),r},ct=function(e){return wt(e,kt)?e[kt]:{}},at=function(e){return wt(e,kt)}}var Lt={set:st,get:ct,has:at,enforce:function(e){return at(e)?ct(e):st(e,{})},getterFor:function(e){return function(r){var t;if(!Et(r)||(t=ct(r)).type!==e)throw new At("Incompatible receiver, "+e+" required");return t}}},Tt=x,_t=f,Nt=V,Pt=qe,Ft=p,Dt=tt.CONFIGURABLE,Ct=ut,Mt=Lt.enforce,Gt=Lt.get,$t=String,Bt=Object.defineProperty,Ut=Tt("".slice),Xt=Tt("".replace),qt=Tt([].join),Wt=Ft&&!_t((function(){return 8!==Bt((function(){}),"length",{value:8}).length})),Vt=String(String).split("String"),Ht=Kr.exports=function(e,r,t){"Symbol("===Ut($t(r),0,7)&&(r="["+Xt($t(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(r="get "+r),t&&t.setter&&(r="set "+r),(!Pt(e,"name")||Dt&&e.name!==r)&&(Ft?Bt(e,"name",{value:r,configurable:!0}):e.name=r),Wt&&t&&Pt(t,"arity")&&e.length!==t.arity&&Bt(e,"length",{value:t.arity});try{t&&Pt(t,"constructor")&&t.constructor?Ft&&Bt(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=Mt(e);return Pt(n,"source")||(n.source=qt(Vt,"string"==typeof r?r:"")),e};Function.prototype.toString=Ht((function(){return Nt(this)&&Gt(this).source||Ct(this)}),"toString");var zt=Kr.exports,Yt=V,Kt=Lr,Jt=zt,Qt=Ne,Zt=function(e,r,t,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:r;if(Yt(t)&&Jt(t,o,n),n.global)i?e[r]=t:Qt(r,t);else{try{n.unsafe?e[r]&&(i=!0):delete e[r]}catch(e){}i?e[r]=t:Kt.f(e,r,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},en={},rn=Math.ceil,tn=Math.floor,nn=Math.trunc||function(e){var r=+e;return(r>0?tn:rn)(r)},on=nn,sn=function(e){var r=+e;return r!=r||0===r?0:on(r)},cn=sn,an=Math.max,un=Math.min,ln=function(e,r){var t=cn(e);return t<0?an(t+r,0):un(t,r)},fn=sn,pn=Math.min,hn=function(e){return e>0?pn(fn(e),9007199254740991):0},dn=hn,vn=function(e){return dn(e.length)},gn=q,yn=ln,mn=vn,En=function(e){return function(r,t,n){var i,o=gn(r),s=mn(o),c=yn(n,s);if(e&&t!=t){for(;s>c;)if((i=o[c++])!=i)return!0}else for(;s>c;c++)if((e||c in o)&&o[c]===t)return e||c||0;return!e&&-1}},bn={includes:En(!0),indexOf:En(!1)},wn=qe,On=q,Sn=bn.indexOf,Rn=gt,In=x([].push),An=function(e,r){var t,n=On(e),i=0,o=[];for(t in n)!wn(Rn,t)&&wn(n,t)&&In(o,t);for(;r.length>i;)wn(n,t=r[i++])&&(~Sn(o,t)||In(o,t));return o},jn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],xn=An,kn=jn.concat("length","prototype");en.f=Object.getOwnPropertyNames||function(e){return xn(e,kn)};var Ln={};Ln.f=Object.getOwnPropertySymbols;var Tn=J,_n=en,Nn=Ln,Pn=Fr,Fn=x([].concat),Dn=Tn("Reflect","ownKeys")||function(e){var r=_n.f(Pn(e)),t=Nn.f;return t?Fn(r,t(e)):r},Cn=qe,Mn=Dn,Gn=l,$n=Lr,Bn=function(e,r,t){for(var n=Mn(r),i=$n.f,o=Gn.f,s=0;ss;)yi.f(e,t=i[s++],n[t]);return e};var wi,Oi=J("document","documentElement"),Si=Fr,Ri=fi,Ii=jn,Ai=gt,ji=Oi,xi=mr,ki="prototype",Li="script",Ti=vt("IE_PROTO"),_i=function(){},Ni=function(e){return"<"+Li+">"+e+""},Pi=function(e){e.write(Ni("")),e.close();var r=e.parentWindow.Object;return e=null,r},Fi=function(){try{wi=new ActiveXObject("htmlfile")}catch(e){}var e,r,t;Fi="undefined"!=typeof document?document.domain&&wi?Pi(wi):(r=xi("iframe"),t="java"+Li+":",r.style.display="none",ji.appendChild(r),r.src=String(t),(e=r.contentWindow.document).open(),e.write(Ni("document.F=Object")),e.close(),e.F):Pi(wi);for(var n=Ii.length;n--;)delete Fi[ki][Ii[n]];return Fi()};Ai[Ti]=!0;var Di=Object.create||function(e,r){var t;return null!==e?(_i[ki]=Si(e),t=new _i,_i[ki]=null,t[Ti]=e):t=Fi(),void 0===r?t:Ri.f(t,r)},Ci=ir,Mi=Di,Gi=Lr.f,$i=Ci("unscopables"),Bi=Array.prototype;void 0===Bi[$i]&&Gi(Bi,$i,{configurable:!0,value:Mi(null)});var Ui,Xi,qi,Wi={},Vi=!f((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Hi=qe,zi=V,Yi=Be,Ki=Vi,Ji=vt("IE_PROTO"),Qi=Object,Zi=Qi.prototype,eo=Ki?Qi.getPrototypeOf:function(e){var r=Yi(e);if(Hi(r,Ji))return r[Ji];var t=r.constructor;return zi(t)&&r instanceof t?t.prototype:r instanceof Qi?Zi:null},ro=f,to=V,no=z,io=eo,oo=Zt,so=ir("iterator"),co=!1;[].keys&&("next"in(qi=[].keys())?(Xi=io(io(qi)))!==Object.prototype&&(Ui=Xi):co=!0);var ao=!no(Ui)||ro((function(){var e={};return Ui[so].call(e)!==e}));ao&&(Ui={}),to(Ui[so])||oo(Ui,so,(function(){return this}));var uo={IteratorPrototype:Ui,BUGGY_SAFARI_ITERATORS:co},lo=uo.IteratorPrototype,fo=Di,po=S,ho=ai,vo=Wi,go=function(){return this},yo=x,mo=Oe,Eo=z,bo=function(e){return Eo(e)||null===e},wo=String,Oo=TypeError,So=function(e,r,t){try{return yo(mo(Object.getOwnPropertyDescriptor(e,r)[t]))}catch(e){}},Ro=Fr,Io=function(e){if(bo(e))return e;throw new Oo("Can't set "+wo(e)+" as a prototype")},Ao=Object.setPrototypeOf||("__proto__"in{}?function(){var e,r=!1,t={};try{(e=So(Object.prototype,"__proto__","set"))(t,[]),r=t instanceof Array}catch(e){}return function(t,n){return Ro(t),Io(n),r?e(t,n):t.__proto__=n,t}}():void 0),jo=ii,xo=g,ko=V,Lo=function(e,r,t,n){var i=r+" Iterator";return e.prototype=fo(lo,{next:po(+!n,t)}),ho(e,i,!1),vo[i]=go,e},To=eo,_o=Ao,No=ai,Po=Yr,Fo=Zt,Do=Wi,Co=tt.PROPER,Mo=tt.CONFIGURABLE,Go=uo.IteratorPrototype,$o=uo.BUGGY_SAFARI_ITERATORS,Bo=ir("iterator"),Uo="keys",Xo="values",qo="entries",Wo=function(){return this},Vo=q,Ho=function(e){Bi[$i][e]=!0},zo=Wi,Yo=Lt,Ko=Lr.f,Jo=function(e,r,t,n,i,o,s){Lo(t,r,n);var c,a,u,l=function(e){if(e===i&&v)return v;if(!$o&&e&&e in h)return h[e];switch(e){case Uo:case Xo:case qo:return function(){return new t(this,e)}}return function(){return new t(this)}},f=r+" Iterator",p=!1,h=e.prototype,d=h[Bo]||h["@@iterator"]||i&&h[i],v=!$o&&d||l(i),g="Array"===r&&h.entries||d;if(g&&(c=To(g.call(new e)))!==Object.prototype&&c.next&&(To(c)!==Go&&(_o?_o(c,Go):ko(c[Bo])||Fo(c,Bo,Wo)),No(c,f,!0)),Co&&i===Xo&&d&&d.name!==Xo&&(Mo?Po(h,"name",Xo):(p=!0,v=function(){return xo(d,this)})),i)if(a={values:l(Xo),keys:o?v:l(Uo),entries:l(qo)},s)for(u in a)($o||p||!(u in h))&&Fo(h,u,a[u]);else jo({target:r,proto:!0,forced:$o||p},a);return h[Bo]!==v&&Fo(h,Bo,v,{name:i}),Do[r]=v,a},Qo=function(e,r){return{value:e,done:r}},Zo=p,es="Array Iterator",rs=Yo.set,ts=Yo.getterFor(es);Jo(Array,"Array",(function(e,r){rs(this,{type:es,target:Vo(e),index:0,kind:r})}),(function(){var e=ts(this),r=e.target,t=e.index++;if(!r||t>=r.length)return e.target=void 0,Qo(void 0,!0);switch(e.kind){case"keys":return Qo(t,!1);case"values":return Qo(r[t],!1)}return Qo([t,r[t]],!1)}),"values");var ns=zo.Arguments=zo.Array;if(Ho("keys"),Ho("values"),Ho("entries"),Zo&&"values"!==ns.name)try{Ko(ns,"name",{value:"values"})}catch(e){}var is={};is[ir("toStringTag")]="z";var os="[object z]"===String(is),ss=V,cs=_,as=ir("toStringTag"),us=Object,ls="Arguments"===cs(function(){return arguments}()),fs=os?cs:function(e){var r,t,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,r){try{return e[r]}catch(e){}}(r=us(e),as))?t:ls?cs(r):"Object"===(n=cs(r))&&ss(r.callee)?"Arguments":n},ps=fs,hs=String,ds=function(e){if("Symbol"===ps(e))throw new TypeError("Cannot convert a Symbol value to a string");return hs(e)},vs=Fr,gs=function(){var e=vs(this),r="";return e.hasIndices&&(r+="d"),e.global&&(r+="g"),e.ignoreCase&&(r+="i"),e.multiline&&(r+="m"),e.dotAll&&(r+="s"),e.unicode&&(r+="u"),e.unicodeSets&&(r+="v"),e.sticky&&(r+="y"),r},ys=f,ms=u.RegExp,Es=ys((function(){var e=ms("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),bs=Es||ys((function(){return!ms("a","y").sticky})),ws=Es||ys((function(){var e=ms("^r","gy");return e.lastIndex=2,null!==e.exec("str")})),Os={BROKEN_CARET:ws,MISSED_STICKY:bs,UNSUPPORTED_Y:Es},Ss=f,Rs=u.RegExp,Is=Ss((function(){var e=Rs(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)})),As=f,js=u.RegExp,xs=As((function(){var e=js("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")})),ks=g,Ls=x,Ts=ds,_s=gs,Ns=Os,Ps=Di,Fs=Lt.get,Ds=Is,Cs=xs,Ms=Me("native-string-replace",String.prototype.replace),Gs=RegExp.prototype.exec,$s=Gs,Bs=Ls("".charAt),Us=Ls("".indexOf),Xs=Ls("".replace),qs=Ls("".slice),Ws=function(){var e=/a/,r=/b*/g;return ks(Gs,e,"a"),ks(Gs,r,"a"),0!==e.lastIndex||0!==r.lastIndex}(),Vs=Ns.BROKEN_CARET,Hs=void 0!==/()??/.exec("")[1];(Ws||Hs||Vs||Ds||Cs)&&($s=function(e){var r,t,n,i,o,s,c,a=this,u=Fs(a),l=Ts(e),f=u.raw;if(f)return f.lastIndex=a.lastIndex,r=ks($s,f,l),a.lastIndex=f.lastIndex,r;var p=u.groups,h=Vs&&a.sticky,d=ks(_s,a),v=a.source,g=0,y=l;if(h&&(d=Xs(d,"y",""),-1===Us(d,"g")&&(d+="g"),y=qs(l,a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==Bs(l,a.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,g++),t=new RegExp("^(?:"+v+")",d)),Hs&&(t=new RegExp("^"+v+"$(?!\\s)",d)),Ws&&(n=a.lastIndex),i=ks(Gs,h?t:a,y),h?i?(i.input=qs(i.input,g),i[0]=qs(i[0],g),i.index=a.lastIndex,a.lastIndex+=i[0].length):a.lastIndex=0:Ws&&i&&(a.lastIndex=a.global?i.index+i[0].length:n),Hs&&i&&i.length>1&&ks(Ms,i[0],t,(function(){for(o=1;o=c?e?"":void 0:(n=yc(o,s))<55296||n>56319||s+1===c||(i=yc(o,s+1))<56320||i>57343?e?gc(o,s):n:e?mc(o,s,s+2):i-56320+(n-55296<<10)+65536}},bc={codeAt:Ec(!1),charAt:Ec(!0)}.charAt,wc=function(e,r,t){return r+(t?bc(e,r).length:1)},Oc=x,Sc=Be,Rc=Math.floor,Ic=Oc("".charAt),Ac=Oc("".replace),jc=Oc("".slice),xc=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,kc=/\$([$&'`]|\d{1,2})/g,Lc=function(e,r,t,n,i,o){var s=t+e.length,c=n.length,a=kc;return void 0!==i&&(i=Sc(i),a=xc),Ac(o,a,(function(o,a){var u;switch(Ic(a,0)){case"$":return"$";case"&":return e;case"`":return jc(r,0,t);case"'":return jc(r,s);case"<":u=i[jc(a,1,-1)];break;default:var l=+a;if(0===l)return o;if(l>c){var f=Rc(l/10);return 0===f?o:f<=c?void 0===n[f-1]?Ic(a,1):n[f-1]+Ic(a,1):o}u=n[l-1]}return void 0===u?"":u}))},Tc=g,_c=Fr,Nc=V,Pc=_,Fc=zs,Dc=TypeError,Cc=function(e,r){var t=e.exec;if(Nc(t)){var n=Tc(t,e,r);return null!==n&&_c(n),n}if("RegExp"===Pc(e))return Tc(Fc,e,r);throw new Dc("RegExp#exec called on incompatible receiver")},Mc=Zs,Gc=g,$c=x,Bc=fc,Uc=f,Xc=Fr,qc=V,Wc=M,Vc=sn,Hc=hn,zc=ds,Yc=B,Kc=wc,Jc=Ie,Qc=Lc,Zc=Cc,ea=ir("replace"),ra=Math.max,ta=Math.min,na=$c([].concat),ia=$c([].push),oa=$c("".indexOf),sa=$c("".slice),ca="$0"==="a".replace(/./,"$0"),aa=!!/./[ea]&&""===/./[ea]("a","$0"),ua=!Uc((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}));Bc("replace",(function(e,r,t){var n=aa?"$":"$0";return[function(e,t){var n=Yc(this),i=Wc(e)?void 0:Jc(e,ea);return i?Gc(i,e,n,t):Gc(r,zc(n),e,t)},function(e,i){var o=Xc(this),s=zc(e);if("string"==typeof i&&-1===oa(i,n)&&-1===oa(i,"$<")){var c=t(r,o,s,i);if(c.done)return c.value}var a=qc(i);a||(i=zc(i));var u,l=o.global;l&&(u=o.unicode,o.lastIndex=0);for(var f,p=[];null!==(f=Zc(o,s))&&(ia(p,f),l);){""===zc(f[0])&&(o.lastIndex=Kc(s,Hc(o.lastIndex),u))}for(var h,d="",v=0,g=0;g=v&&(d+=sa(s,v,E)+y,v=E+m.length)}return d+sa(s,v)}]}),!ua||!ca||aa);var la=z,fa=_,pa=ir("match"),ha=function(e){var r;return la(e)&&(void 0!==(r=e[pa])?!!r:"RegExp"===fa(e))},da=g,va=qe,ga=Q,ya=gs,ma=RegExp.prototype,Ea=function(e){var r=e.flags;return void 0!==r||"flags"in ma||va(e,"flags")||!ga(ma,e)?r:da(ya,e)},ba=ii,wa=g,Oa=x,Sa=B,Ra=V,Ia=M,Aa=ha,ja=ds,xa=Ie,ka=Ea,La=Lc,Ta=ir("replace"),_a=TypeError,Na=Oa("".indexOf);Oa("".replace);var Pa=Oa("".slice),Fa=Math.max,Da=function(e,r,t){return t>e.length?-1:""===r?t:Na(e,r,t)};ba({target:"String",proto:!0},{replaceAll:function(e,r){var t,n,i,o,s,c,a,u,l=Sa(this),f=0,p=0,h="";if(!Ia(e)){if(Aa(e)&&(t=ja(Sa(ka(e))),!~Na(t,"g")))throw new _a("`.replaceAll` does not allow non-global regexes");if(n=xa(e,Ta))return wa(n,e,l,r)}for(i=ja(l),o=ja(e),(s=Ra(r))||(r=ja(r)),c=o.length,a=Fa(1,c),f=Da(i,o,0);-1!==f;)u=s?ja(r(o,f,i)):La(o,i,f,[],void 0,r),h+=Pa(i,p,f)+u,p=f+c,f=Da(i,o,f+a);return po&&pu(i,arguments[o]),i}));f.prototype=u,"Error"!==c?cu?cu(f,l):au(f,l,{name:!0}):du&&i in a&&(uu(f,a,i),uu(f,a,"prepareStackTrace")),au(f,a);try{u.name!==c&&ou(u,"name",c),u.constructor=f}catch(e){}return f}},mu="WebAssembly",Eu=u[mu],bu=7!==new Error("e",{cause:7}).cause,wu=function(e,r){var t={};t[e]=yu(e,r,bu),vu({global:!0,constructor:!0,arity:1,forced:bu},t)},Ou=function(e,r){if(Eu&&Eu[e]){var t={};t[e]=yu(mu+"."+e,r,bu),vu({target:mu,stat:!0,constructor:!0,arity:1,forced:bu},t)}};wu("Error",(function(e){return function(r){return gu(e,this,arguments)}})),wu("EvalError",(function(e){return function(r){return gu(e,this,arguments)}})),wu("RangeError",(function(e){return function(r){return gu(e,this,arguments)}})),wu("ReferenceError",(function(e){return function(r){return gu(e,this,arguments)}})),wu("SyntaxError",(function(e){return function(r){return gu(e,this,arguments)}})),wu("TypeError",(function(e){return function(r){return gu(e,this,arguments)}})),wu("URIError",(function(e){return function(r){return gu(e,this,arguments)}})),Ou("CompileError",(function(e){return function(r){return gu(e,this,arguments)}})),Ou("LinkError",(function(e){return function(r){return gu(e,this,arguments)}})),Ou("RuntimeError",(function(e){return function(r){return gu(e,this,arguments)}}));var Su=Oe,Ru=h,Iu=tc(tc.bind),Au=_,ju=Array.isArray||function(e){return"Array"===Au(e)},xu=x,ku=f,Lu=V,Tu=fs,_u=ut,Nu=function(){},Pu=[],Fu=J("Reflect","construct"),Du=/^\s*(?:class|function)\b/,Cu=xu(Du.exec),Mu=!Du.test(Nu),Gu=function(e){if(!Lu(e))return!1;try{return Fu(Nu,Pu,e),!0}catch(e){return!1}},$u=function(e){if(!Lu(e))return!1;switch(Tu(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Mu||!!Cu(Du,_u(e))}catch(e){return!0}};$u.sham=!0;var Bu=!Fu||ku((function(){var e;return Gu(Gu.call)||!Gu(Object)||!Gu((function(){e=!0}))||e}))?$u:Gu,Uu=ju,Xu=Bu,qu=z,Wu=ir("species"),Vu=Array,Hu=function(e){var r;return Uu(e)&&(r=e.constructor,(Xu(r)&&(r===Vu||Uu(r.prototype))||qu(r)&&null===(r=r[Wu]))&&(r=void 0)),void 0===r?Vu:r},zu=function(e,r){return new(Hu(e))(0===r?0:r)},Yu=function(e,r){return Su(e),void 0===r?e:Ru?Iu(e,r):function(){return e.apply(r,arguments)}},Ku=C,Ju=Be,Qu=vn,Zu=zu,el=x([].push),rl=function(e){var r=1===e,t=2===e,n=3===e,i=4===e,o=6===e,s=7===e,c=5===e||o;return function(a,u,l,f){for(var p,h,d=Ju(a),v=Ku(d),g=Qu(v),y=Yu(u,l),m=0,E=f||Zu,b=r?E(a,g):t||s?E(a,0):void 0;g>m;m++)if((c||m in v)&&(h=y(p=v[m],m,d),e))if(r)b[m]=h;else if(h)switch(e){case 3:return!0;case 5:return p;case 6:return m;case 2:el(b,p)}else switch(e){case 4:return!1;case 7:el(b,p)}return o?-1:n||i?i:b}},tl={forEach:rl(0),map:rl(1),filter:rl(2),some:rl(3),every:rl(4),find:rl(5),findIndex:rl(6),filterReject:rl(7)},nl=f,il=se,ol=ir("species"),sl=function(e){return il>=51||!nl((function(){var r=[];return(r.constructor={})[ol]=function(){return{foo:1}},1!==r[e](Boolean).foo}))},cl=tl.map;ii({target:"Array",proto:!0,forced:!sl("map")},{map:function(e){return cl(this,e,arguments.length>1?arguments[1]:void 0)}});var al,ul,ll=ii,fl=g,pl=V,hl=Fr,dl=ds,vl=(al=!1,(ul=/[ac]/).exec=function(){return al=!0,/./.exec.apply(this,arguments)},!0===ul.test("abc")&&al),gl=/./.test;ll({target:"RegExp",proto:!0,forced:!vl},{test:function(e){var r=hl(this),t=dl(e),n=r.exec;if(!pl(n))return fl(gl,r,t);var i=fl(n,r,t);return null!==i&&(hl(i),!0)}});var yl=g,ml=Fr,El=M,bl=hn,wl=ds,Ol=B,Sl=Ie,Rl=wc,Il=Cc;fc("match",(function(e,r,t){return[function(r){var t=Ol(this),n=El(r)?void 0:Sl(r,e);return n?yl(n,r,t):new RegExp(r)[e](wl(t))},function(e){var n=ml(this),i=wl(e),o=t(r,n,i);if(o.done)return o.value;if(!n.global)return Il(n,i);var s=n.unicode;n.lastIndex=0;for(var c,a=[],u=0;null!==(c=Il(n,i));){var l=wl(c[0]);a[u]=l,""===l&&(n.lastIndex=Rl(i,bl(n.lastIndex),s)),u++}return 0===u?null:a}]}));var Al=zt,jl=Lr,xl=function(e,r,t){return t.get&&Al(t.get,r,{getter:!0}),t.set&&Al(t.set,r,{setter:!0}),jl.f(e,r,t)},kl=J,Ll=xl,Tl=p,_l=ir("species"),Nl=p,Pl=u,Fl=x,Dl=Kn,Cl=Ua,Ml=Yr,Gl=Di,$l=en.f,Bl=Q,Ul=ha,Xl=ds,ql=Ea,Wl=Os,Vl=Ma,Hl=Zt,zl=f,Yl=qe,Kl=Lt.enforce,Jl=function(e){var r=kl(e);Tl&&r&&!r[_l]&&Ll(r,_l,{configurable:!0,get:function(){return this}})},Ql=Is,Zl=xs,ef=ir("match"),rf=Pl.RegExp,tf=rf.prototype,nf=Pl.SyntaxError,of=Fl(tf.exec),sf=Fl("".charAt),cf=Fl("".replace),af=Fl("".indexOf),uf=Fl("".slice),lf=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,ff=/a/g,pf=/a/g,hf=new rf(ff)!==ff,df=Wl.MISSED_STICKY,vf=Wl.UNSUPPORTED_Y,gf=Nl&&(!hf||df||Ql||Zl||zl((function(){return pf[ef]=!1,rf(ff)!==ff||rf(pf)===pf||"/a/i"!==String(rf(ff,"i"))})));if(Dl("RegExp",gf)){for(var yf=function(e,r){var t,n,i,o,s,c,a=Bl(tf,this),u=Ul(e),l=void 0===r,f=[],p=e;if(!a&&u&&l&&e.constructor===yf)return e;if((u||Bl(tf,e))&&(e=e.source,l&&(r=ql(p))),e=void 0===e?"":Xl(e),r=void 0===r?"":Xl(r),p=e,Ql&&"dotAll"in ff&&(n=!!r&&af(r,"s")>-1)&&(r=cf(r,/s/g,"")),t=r,df&&"sticky"in ff&&(i=!!r&&af(r,"y")>-1)&&vf&&(r=cf(r,/y/g,"")),Zl&&(o=function(e){for(var r,t=e.length,n=0,i="",o=[],s=Gl(null),c=!1,a=!1,u=0,l="";n<=t;n++){if("\\"===(r=sf(e,n)))r+=sf(e,++n);else if("]"===r)c=!1;else if(!c)switch(!0){case"["===r:c=!0;break;case"("===r:of(lf,uf(e,n+1))&&(n+=2,a=!0),i+=r,u++;continue;case">"===r&&a:if(""===l||Yl(s,l))throw new nf("Invalid capture group name");s[l]=!0,o[o.length]=[l,u],a=!1,l="";continue}a?l+=r:i+=r}return[i,o]}(e),e=o[0],f=o[1]),s=Cl(rf(e,r),a?this:tf,yf),(n||i||f.length)&&(c=Kl(s),n&&(c.dotAll=!0,c.raw=yf(function(e){for(var r,t=e.length,n=0,i="",o=!1;n<=t;n++)"\\"!==(r=sf(e,n))?o||"."!==r?("["===r?o=!0:"]"===r&&(o=!1),i+=r):i+="[\\s\\S]":i+=r+sf(e,++n);return i}(e),t)),i&&(c.sticky=!0),f.length&&(c.groups=f)),e!==p)try{Ml(s,"source",""===p?"(?:)":p)}catch(e){}return s},mf=$l(rf),Ef=0;mf.length>Ef;)Vl(yf,rf,mf[Ef++]);tf.constructor=yf,yf.prototype=tf,Hl(Pl,"RegExp",yf,{constructor:!0})}Jl("RegExp");var bf=p,wf=Is,Of=_,Sf=xl,Rf=Lt.get,If=RegExp.prototype,Af=TypeError;bf&&wf&&Sf(If,"dotAll",{configurable:!0,get:function(){if(this!==If){if("RegExp"===Of(this))return!!Rf(this).dotAll;throw new Af("Incompatible receiver, RegExp required")}}});var jf="\t\n\v\f\r                 \u2028\u2029\ufeff",xf=B,kf=ds,Lf=jf,Tf=x("".replace),_f=RegExp("^["+Lf+"]+"),Nf=RegExp("(^|[^"+Lf+"])["+Lf+"]+$"),Pf=function(e){return function(r){var t=kf(xf(r));return 1&e&&(t=Tf(t,_f,"")),2&e&&(t=Tf(t,Nf,"$1")),t}},Ff={start:Pf(1),end:Pf(2),trim:Pf(3)},Df=tt.PROPER,Cf=f,Mf=jf,Gf=function(e){return Cf((function(){return!!Mf[e]()||"​…᠎"!=="​…᠎"[e]()||Df&&Mf[e].name!==e}))},$f=Ff.trim;ii({target:"String",proto:!0,forced:Gf("trim")},{trim:function(){return $f(this)}});var Bf=x([].slice),Uf=ju,Xf=V,qf=_,Wf=ds,Vf=x([].push),Hf=ii,zf=J,Yf=Zs,Kf=g,Jf=x,Qf=f,Zf=V,ep=ge,rp=Bf,tp=function(e){if(Xf(e))return e;if(Uf(e)){for(var r=e.length,t=[],n=0;n1?arguments[1]:void 0;return Up?Bp(this,e,r)||0:Gp(this,e,r)}});var Xp=p,qp=ju,Wp=TypeError,Vp=Object.getOwnPropertyDescriptor,Hp=Xp&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,r){if(qp(e)&&!Vp(e,"length").writable)throw new Wp("Cannot set read only .length");return e.length=r}:function(e,r){return e.length=r},zp=TypeError,Yp=function(e){if(e>9007199254740991)throw zp("Maximum allowed index exceeded");return e},Kp=Be,Jp=vn,Qp=Hp,Zp=Yp;ii({target:"Array",proto:!0,arity:1,forced:f((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var r=Kp(this),t=Jp(r),n=arguments.length;Zp(t+n);for(var i=0;i=51||!rh((function(){var e=[];return e[fh]=!1,e.concat()[0]!==e})),hh=function(e){if(!nh(e))return!1;var r=e[fh];return void 0!==r?!!r:th(e)};eh({target:"Array",proto:!0,arity:1,forced:!ph||!uh("concat")},{concat:function(e){var r,t,n,i,o,s=ih(this),c=ah(s,0),a=0;for(r=-1,n=arguments.length;r=r.length)return t&&(t[h]=r),o(null,r);c.lastIndex=u;var e=c.exec(r);return p=l,l+=e[0],f=p+e[1],u=c.lastIndex,v[f]||t&&t[f]===f?process.nextTick(y):t&&Object.prototype.hasOwnProperty.call(t,f)?b(t[f]):i.lstat(f,m)}function m(e,r){if(e)return o(e);if(!r.isSymbolicLink())return v[f]=!0,t&&(t[f]=f),process.nextTick(y);if(!n){var s=r.dev.toString(32)+":"+r.ino.toString(32);if(d.hasOwnProperty(s))return E(null,d[s],f)}i.stat(f,(function(e){if(e)return o(e);i.readlink(f,(function(e,r){n||(d[s]=r),E(e,r)}))}))}function E(r,n,i){if(r)return o(r);var s=e.resolve(p,n);t&&(t[i]=s),b(s)}function b(t){r=e.resolve(t,r.slice(u)),g()}g()},Ah}function xh(){if(Rh)return Sh;Rh=1,Sh=a,a.realpath=a,a.sync=u,a.realpathSync=u,a.monkeypatch=function(){e.realpath=a,e.realpathSync=u},a.unmonkeypatch=function(){e.realpath=t,e.realpathSync=n};var e=r,t=e.realpath,n=e.realpathSync,i=process.version,o=/^v[0-5]\./.test(i),s=jh();function c(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function a(e,r,n){if(o)return t(e,r,n);"function"==typeof r&&(n=r,r=null),t(e,r,(function(t,i){c(t)?s.realpath(e,r,n):n(t,i)}))}function u(e,r){if(o)return n(e,r);try{return n(e,r)}catch(t){if(c(t))return s.realpathSync(e,r);throw t}}return Sh}var kh=tl.filter;ii({target:"Array",proto:!0,forced:!sl("filter")},{filter:function(e){return kh(this,e,arguments.length>1?arguments[1]:void 0)}});var Lh,Th,_h,Nh,Ph,Fh,Dh,Ch,Mh=Bu,Gh=me,$h=TypeError,Bh=Fr,Uh=function(e){if(Mh(e))return e;throw new $h(Gh(e)+" is not a constructor")},Xh=M,qh=ir("species"),Wh=Zs,Vh=g,Hh=x,zh=fc,Yh=Fr,Kh=M,Jh=ha,Qh=B,Zh=function(e,r){var t,n=Bh(e).constructor;return void 0===n||Xh(t=Bh(n)[qh])?r:Uh(t)},ed=wc,rd=hn,td=ds,nd=Ie,id=Bf,od=Cc,sd=zs,cd=f,ad=Os.UNSUPPORTED_Y,ud=4294967295,ld=Math.min,fd=[].push,pd=Hh(/./.exec),hd=Hh(fd),dd=Hh("".slice),vd=!cd((function(){var e=/(?:)/,r=e.exec;e.exec=function(){return r.apply(this,arguments)};var t="ab".split(e);return 2!==t.length||"a"!==t[0]||"b"!==t[1]}));function gd(){if(Th)return Lh;Th=1,Lh=function(r,t){for(var n=[],i=0;i=0&&u>0){for(n=[],o=t.length;l>=0&&!c;)l==a?(n.push(l),a=t.indexOf(e,l+1)):1==n.length?c=[n.pop(),u]:((i=n.pop())=0?a:u;n.length&&(c=[o,s])}return c}return Nh=1,_h=e,e.range=t,_h}();Ph=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return d(function(e){return e.split("\\\\").join(t).split("\\{").join(n).split("\\}").join(i).split("\\,").join(o).split("\\.").join(s)}(e),!0).map(a)};var t="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function c(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function a(e){return e.split(t).join("\\").split(n).join("{").split(i).join("}").split(o).join(",").split(s).join(".")}function u(e){if(!e)return[""];var t=[],n=r("{","}",e);if(!n)return e.split(",");var i=n.pre,o=n.body,s=n.post,c=i.split(",");c[c.length-1]+="{"+o+"}";var a=u(s);return s.length&&(c[c.length-1]+=a.shift(),c.push.apply(c,a)),t.push.apply(t,c),t}function l(e){return"{"+e+"}"}function f(e){return/^-?0\d/.test(e)}function p(e,r){return e<=r}function h(e,r){return e>=r}function d(t,n){var o=[],s=r("{","}",t);if(!s||/\$$/.test(s.pre))return[t];var a,v=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),y=v||g,m=s.body.indexOf(",")>=0;if(!y&&!m)return s.post.match(/,.*\}/)?d(t=s.pre+"{"+s.body+i+s.post):[t];if(y)a=s.body.split(/\.\./);else if(1===(a=u(s.body)).length&&1===(a=d(a[0],!1).map(l)).length)return(w=s.post.length?d(s.post,!1):[""]).map((function(e){return s.pre+a[0]+e}));var E,b=s.pre,w=s.post.length?d(s.post,!1):[""];if(y){var O=c(a[0]),S=c(a[1]),R=Math.max(a[0].length,a[1].length),I=3==a.length?Math.abs(c(a[2])):1,A=p;S0){var T=new Array(L+1).join("0");k=x<0?"-"+T+k.slice(1):T+k}}E.push(k)}}else E=e(a,(function(e){return d(e,!1)}));for(var _=0;_65536)throw new TypeError("pattern is too long")};l.prototype.parse=function(e,t){p(e);var c=this.options;if("**"===e){if(!c.noglobstar)return r;e="*"}if(""===e)return"";var a,u="",l=!!c.nocase,f=!1,d=[],v=[],g=!1,y=-1,m=-1,E="."===e.charAt(0)?"":c.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",b=this;function w(){if(a){switch(a){case"*":u+=o,l=!0;break;case"?":u+=i,l=!0;break;default:u+="\\"+a}b.debug("clearStateChar %j %j",a,u),a=!1}}for(var O,S=0,R=e.length;S-1;T--){var _=v[T],N=u.slice(0,_.reStart),P=u.slice(_.reStart,_.reEnd-8),F=u.slice(_.reEnd-8,_.reEnd),D=u.slice(_.reEnd);F+=D;var C=N.split("(").length-1,M=D;for(S=0;S=0&&!(i=r[o]);o--);for(o=0;o>> no match, partial?",e,p,t,h),p!==c))}if("string"==typeof l?(u=f===l,this.debug("string match",l,f,u)):(u=f.match(l),this.debug("pattern match",l,f,u)),!u)return!1}if(o===c&&s===a)return!0;if(o===c)return n;if(s===a)return o===c-1&&""===e[o];throw new Error("wtf?")},Dh}zh("split",(function(e,r,t){var n;return n="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var n=td(Qh(this)),i=void 0===t?ud:t>>>0;if(0===i)return[];if(void 0===e)return[n];if(!Jh(e))return Vh(r,n,e,i);for(var o,s,c,a=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=new RegExp(e.source,u+"g");(o=Vh(sd,f,n))&&!((s=f.lastIndex)>l&&(hd(a,dd(n,l,o.index)),o.length>1&&o.index=i));)f.lastIndex===o.index&&f.lastIndex++;return l===n.length?!c&&pd(f,"")||hd(a,""):hd(a,dd(n,l)),a.length>i?id(a,0,i):a}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:Vh(r,this,e,t)}:r,[function(r,t){var i=Qh(this),o=Kh(r)?void 0:nd(r,e);return o?Vh(o,r,i,t):Vh(n,td(i),r,t)},function(e,i){var o=Yh(this),s=td(e),c=t(n,o,s,i,n!==r);if(c.done)return c.value;var a=Zh(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(ad?"g":"y"),f=new a(ad?"^(?:"+o.source+")":o,l),p=void 0===i?ud:i>>>0;if(0===p)return[];if(0===s.length)return null===od(f,s)?[s]:[];for(var h=0,d=0,v=[];d0;)e[i]=e[--i];i!==o++&&(e[i]=n)}else for(var s=xd(t/2),c=kd(jd(e,0,s),r),a=kd(jd(e,s),r),u=c.length,l=a.length,f=0,p=0;f3)){if(Hd)return!0;if(Yd)return Yd<603;var e,r,t,n,i="";for(e=65;e<76;e++){switch(r=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(n=0;n<47;n++)Kd.push({k:r+n,v:t})}for(Kd.sort((function(e,r){return r.v-e.v})),n=0;nUd(t)?1:-1}}(e)),t=$d(i),n=0;nu-n+t;o--)Ev(a,o-1)}else if(t>n)for(o=u-n;o>l;o--)c=o+t-1,(s=o+n-1)in a?a[c]=a[s]:Ev(a,c);for(o=0;oi?(n.splice(0,i),process.nextTick((function(){t.apply(null,o)}))):delete r[e]}}))}(e))})),Iv}function Bv(){if(xv)return jv;xv=1,jv=m;var e=xh(),r=md();r.Minimatch;var o=Sd(),s=n.EventEmitter,c=t,a=i,u=Ad(),l=function(){if(ov)return iv;ov=1,iv=p,p.GlobSync=h;var e=xh(),r=md();r.Minimatch,Bv().Glob;var n=t,o=i,s=Ad(),c=cv(),a=c.setopts,u=c.ownProp,l=c.childrenIgnored,f=c.isIgnored;function p(e,r){if("function"==typeof r||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new h(e,r).found}function h(e,r){if(!e)throw new Error("must provide pattern");if("function"==typeof r||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof h))return new h(e,r);if(a(this,e,r),this.noprocess)return this;var t=this.minimatch.set.length;this.matches=new Array(t);for(var n=0;nthis.maxLength)return!1;if(!this.stat&&u(this.cache,r)){var n=this.cache[r];if(Array.isArray(n)&&(n="DIR"),!t||"DIR"===n)return n;if(t&&"FILE"===n)return!1}var i=this.statCache[r];if(!i){var o;try{o=this.fs.lstatSync(r)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[r]=!1,!1}if(o&&o.isSymbolicLink())try{i=this.fs.statSync(r)}catch(e){i=o}else i=o}return this.statCache[r]=i,n=!0,i&&(n=i.isDirectory()?"DIR":"FILE"),this.cache[r]=this.cache[r]||n,(!t||"FILE"!==n)&&n},h.prototype._mark=function(e){return c.mark(this,e)},h.prototype._makeAbs=function(e){return c.makeAbs(this,e)},iv}(),f=cv(),p=f.setopts,h=f.ownProp,d=$v(),v=f.childrenIgnored,g=f.isIgnored,y=Gv();function m(e,r,t){if("function"==typeof r&&(t=r,r={}),r||(r={}),r.sync){if(t)throw new TypeError("callback provided to sync glob");return l(e,r)}return new b(e,r,t)}m.sync=l;var E=m.GlobSync=l.GlobSync;function b(e,r,t){if("function"==typeof r&&(t=r,r=null),r&&r.sync){if(t)throw new TypeError("callback provided to sync glob");return new E(e,r)}if(!(this instanceof b))return new b(e,r,t);p(this,e,r),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),"function"==typeof t&&(t=y(t),this.on("error",t),this.on("end",(function(e){t(null,e)})));var i=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===n)return c();for(var o=!0,s=0;s1)return!0;for(var i=0;ithis.maxLength)return r();if(!this.stat&&h(this.cache,t)){var i=this.cache[t];if(Array.isArray(i)&&(i="DIR"),!n||"DIR"===i)return r(null,i);if(n&&"FILE"===i)return r()}var o=this.statCache[t];if(void 0!==o){if(!1===o)return r(null,o);var s=o.isDirectory()?"DIR":"FILE";return n&&"FILE"===s?r():r(null,s,o)}var c=this,a=d("stat\0"+t,(function(n,i){if(i&&i.isSymbolicLink())return c.fs.stat(t,(function(n,o){n?c._stat2(e,t,null,i,r):c._stat2(e,t,n,o,r)}));c._stat2(e,t,n,i,r)}));a&&c.fs.lstat(t,a)},b.prototype._stat2=function(e,r,t,n,i){if(t&&("ENOENT"===t.code||"ENOTDIR"===t.code))return this.statCache[r]=!1,i();var o="/"===e.slice(-1);if(this.statCache[r]=n,"/"===r.slice(-1)&&n&&!n.isDirectory())return i(null,!1,n);var s=!0;return n&&(s=n.isDirectory()?"DIR":"FILE"),this.cache[r]=this.cache[r]||s,o&&"FILE"===s?i():i(null,s,n)},jv}function Uv(){if(kv)return Ih;kv=1;var t=e,n=r,i=Bv(),o=Ly(),s=Object.create(o);Ih.extend=Object.assign;var c=Boolean(process.versions.electron),a={fatal:!1,globOptions:{},maxdepth:255,noglob:!1,silent:!1,verbose:!1,execPath:null,bufLength:65536},u={reset:function(){Object.assign(this,a),c||(this.execPath=process.execPath)},resetForTesting:function(){this.reset(),this.silent=!0}};u.reset(),Ih.config=u;var l={error:null,errorCode:0,currentCmd:"shell.js"};function f(e){return"object"==typeof e&&null!==e}function p(){u.silent||console.error.apply(console,arguments)}function h(e){if("string"!=typeof e)throw new TypeError("input must be a string");return e.replace(/\\/g,"/")}function d(e,r,t){if("string"!=typeof e)throw new Error("msg must be a string");var n={continue:!1,code:1,prefix:l.currentCmd+": ",silent:!1};"number"==typeof r&&f(t)?t.code=r:f(r)?t=r:"number"==typeof r?t={code:r}:"number"!=typeof r&&(t={}),t=Object.assign({},n,t),l.errorCode||(l.errorCode=t.code);var i=h(t.prefix+e);if(l.error=l.error?l.error+"\n":"",l.error+=i,u.fatal)throw new Error(i);if(e.length>0&&!t.silent&&p(i),!t.continue)throw{msg:"earlyExit",retValue:new v("",l.error,l.errorCode)}}function v(e,r,t){var n;return e instanceof Array?((n=e).stdout=e.join("\n"),e.length>0&&(n.stdout+="\n")):(n=new String(e)).stdout=e,n.stderr=r,n.code=t,w.forEach((function(e){n[e]=s[e].bind(n)})),n}function g(e,r,t){if("string"!=typeof e&&!f(e))throw new Error("options must be strings or key-value pairs");if(!f(r))throw new Error("parseOptions() internal error: map must be an object");if(t&&!f(t))throw new Error("parseOptions() internal error: errorOptions must be object");if("--"===e)return{};var n={};if(Object.keys(r).forEach((function(e){var t=r[e];"!"!==t[0]&&(n[t]=!1)})),""===e)return n;if("string"==typeof e){if("-"!==e[0])throw new Error("Options string must start with a '-'");e.slice(1).split("").forEach((function(e){if(e in r){var i=r[e];"!"===i[0]?n[i.slice(1)]=!1:n[i]=!0}else d("option not recognized: "+e,t||{})}))}else Object.keys(e).forEach((function(i){var o=i[1];if(o in r){var s=r[o];n[s]=e[i]}else d("option not recognized: "+o,t||{})}));return n}function y(e){if(!Array.isArray(e))throw new TypeError("must be an array");var r=[];return e.forEach((function(e){if("string"!=typeof e)r.push(e);else{var t;try{t=(t=i.sync(e,u.globOptions)).length>0?t:[e]}catch(r){t=[e]}r=r.concat(t)}})),r}Ih.state=l,delete process.env.OLDPWD,Ih.isObject=f,Ih.log=p,Ih.convertErrorOutput=h,Ih.error=d,Ih.ShellString=v,Ih.parseOptions=g,Ih.expand=y;var m="function"==typeof Buffer.alloc?function(e){return Buffer.alloc(e||u.bufLength)}:function(e){return new Buffer(e||u.bufLength)};function E(e,r,n){return n=n||{},function(){var i=null;l.currentCmd=e,l.error=null,l.errorCode=0;try{var o=[].slice.call(arguments,0);if(u.verbose&&console.error.apply(console,[e].concat(o)),l.pipedValue=this&&"string"==typeof this.stdout?this.stdout:"",!1===n.unix)i=r.apply(this,o);else{f(o[0])&&"Object"===o[0].constructor.name||(0===o.length||"string"!=typeof o[0]||o[0].length<=1||"-"!==o[0][0])&&o.unshift(""),o=(o=o.reduce((function(e,r){return Array.isArray(r)?e.concat(r):(e.push(r),e)}),[])).map((function(e){return f(e)&&"String"===e.constructor.name?e.toString():e}));var s=t.homedir();o=o.map((function(e){return"string"==typeof e&&"~/"===e.slice(0,2)||"~"===e?e.replace(/^~/,s):e})),u.noglob||!0!==n.allowGlobbing||(o=o.slice(0,n.globStart).concat(y(o.slice(n.globStart))));try{f(n.cmdOptions)&&(o[0]=g(o[0],n.cmdOptions)),i=r.apply(this,o)}catch(e){if("earlyExit"!==e.msg)throw e;i=e.retValue}}}catch(e){if(!l.error)throw e.name="ShellJSInternalError",e;if(u.fatal)throw e}return n.wrapOutput&&("string"==typeof i||Array.isArray(i))&&(i=new v(i,l.error,l.errorCode)),l.currentCmd="shell.js",i}}Ih.buffer=m,Ih.unlinkSync=function(e){try{n.unlinkSync(e)}catch(r){if("EPERM"!==r.code)throw r;n.chmodSync(e,"0666"),n.unlinkSync(e)}},Ih.statFollowLinks=function(){return n.statSync.apply(n,arguments)},Ih.statNoFollowLinks=function(){return n.lstatSync.apply(n,arguments)},Ih.randomFileName=function(){return"shelljs_"+function e(r){if(1===r)return parseInt(16*Math.random(),10).toString(16);for(var t="",n=0;n0&&"-"===e.charAt(0)?[].unshift.call(arguments,""):n.error("You must specify a file.")),e=n.parseOptions(e,{R:"recursive",c:"changes",v:"verbose"}),t=[].slice.call(arguments,2),e.recursive?(c=[],t.forEach((function e(r){var t=n.statNoFollowLinks(r);t.isSymbolicLink()||(c.push(r),t.isDirectory()&&i.readdirSync(r).forEach((function(t){e(r+"/"+t)})))}))):c=t,c.forEach((function(t){if(t=o.resolve(t),i.existsSync(t)||n.error("File not found: "+t),!e.recursive||!n.statNoFollowLinks(t).isSymbolicLink()){var c=n.statFollowLinks(t),a=c.isDirectory(),u=c.mode,l=u&s.TYPE_MASK,f=u;isNaN(parseInt(r,8))?r.split(",").forEach((function(r){var o=/([ugoa]*)([=\+-])([rwxXst]*)/i.exec(r);if(o){var c=o[1],p=o[2],h=o[3],d=-1!==c.indexOf("u")||"a"===c||""===c,v=-1!==c.indexOf("g")||"a"===c||""===c,g=-1!==c.indexOf("o")||"a"===c||""===c,y=-1!==h.indexOf("r"),m=-1!==h.indexOf("w"),E=-1!==h.indexOf("x"),b=-1!==h.indexOf("X"),w=-1!==h.indexOf("t"),O=-1!==h.indexOf("s");b&&a&&(E=!0);var S=0;switch(d&&(S|=(y?s.OWNER_READ:0)+(m?s.OWNER_WRITE:0)+(E?s.OWNER_EXEC:0)+(O?s.SETUID:0)),v&&(S|=(y?s.GROUP_READ:0)+(m?s.GROUP_WRITE:0)+(E?s.GROUP_EXEC:0)+(O?s.SETGID:0)),g&&(S|=(y?s.OTHER_READ:0)+(m?s.OTHER_WRITE:0)+(E?s.OTHER_EXEC:0)),w&&(S|=s.STICKY),p){case"+":f|=S;break;case"-":f&=~S;break;case"=":f=l+S,n.statFollowLinks(t).isDirectory()&&(f|=s.SETUID+s.SETGID&u);break;default:n.error("Could not recognize operator: `"+p+"`")}e.verbose&&console.log(t+" -> "+f.toString(8)),u!==f&&(!e.verbose&&e.changes&&console.log(t+" -> "+f.toString(8)),i.chmodSync(t,f),u=f)}else n.error("Invalid symbolic mode change: "+r)})):(f=l+parseInt(r,8),n.statFollowLinks(t).isDirectory()&&(f|=s.SETUID+s.SETGID&u),i.chmodSync(t,f))}})),""}return n.register("chmod",c,{}),Pv=c}function Vv(){if(Cv)return Dv;Cv=1;var e=r,n=t,i=Uv();function o(r,t,n){e.existsSync(r)||i.error("copyFileSync: no such file or directory: "+r);var o="win32"===process.platform;try{if(n.update&&i.statFollowLinks(r).mtime=i.config.maxdepth)){n++;var u="win32"===process.platform;try{e.mkdirSync(t)}catch(e){if("EEXIST"!==e.code)throw e}for(var l=e.readdirSync(r),f=0;f and/or "):(t=[].slice.call(arguments,1,arguments.length-1),c=arguments[arguments.length-1]);var a=e.existsSync(c),u=a&&i.statFollowLinks(c);return a&&u.isDirectory()||!(t.length>1)||i.error("dest is not a directory (too many sources)"),a&&u.isFile()&&r.no_force?new i.ShellString("","",0):(t.forEach((function(a,l){if(!e.existsSync(a))return""===a&&(a="''"),void i.error("no such file or directory: "+a,{continue:!0});var f=i.statFollowLinks(a);if(!r.noFollowsymlink&&f.isDirectory())if(r.recursive){var p=u&&u.isDirectory()?n.join(c,n.basename(a)):c;try{i.statFollowLinks(n.dirname(c)),s(a,p,0,{no_force:r.no_force,followsymlink:r.followsymlink})}catch(e){i.error("cannot create directory '"+c+"': No such file or directory")}}else i.error("omitting directory '"+a+"'",{continue:!0});else{var h=c;u&&u.isDirectory()&&(h=n.normalize(c+"/"+n.basename(a)));var d=e.existsSync(h);if(d&&function(e,r){var t=e[r];return e.slice(0,r).some((function(e){return n.basename(e)===n.basename(t)}))}(t,l))return void(r.no_force||i.error("will not overwrite just-created '"+h+"' with '"+a+"'",{continue:!0}));if(d&&r.no_force)return;if(""===n.relative(a,h))return void i.error("'"+h+"' and '"+a+"' are the same file",{continue:!0});o(a,h,r)}})),new i.ShellString("",i.state.error,i.state.errorCode))}return i.register("cp",a,{cmdOptions:{f:"!no_force",n:"no_force",u:"update",R:"recursive",r:"recursive",L:"followsymlink",P:"noFollowsymlink"},wrapOutput:!1}),Dv=a}var Hv,zv,Yv,Kv,Jv,Qv={};function Zv(){if(Hv)return Qv;Hv=1;var e=Uv(),r=qv(),n=t;e.register("dirs",l,{wrapOutput:!1}),e.register("pushd",a,{wrapOutput:!1}),e.register("popd",u,{wrapOutput:!1});var i=[];function o(e){return/^[\-+]\d+$/.test(e)}function s(r){if(o(r)){if(Math.abs(r)1))return e.error("no other directory");u=u.splice(1,1).concat(u)}return t["no-cd"]?u=u.slice(1):(a=n.resolve(u.shift()),r("",a)),i=u,l(t.quiet?"-q":"")}function u(t,c){if(o(t)&&(c=t,t=""),t=e.parseOptions(t,{n:"no-cd",q:"quiet"}),!i.length)return e.error("directory stack empty");if(c=s(c||"+0"),t["no-cd"]||c>0||i.length+c===0)c=c>0?c-1:c,i.splice(c,1);else{var a=n.resolve(i.shift());r("",a)}return l(t.quiet?"-q":"")}function l(r,t){if(o(r)&&(t=r,r=""),(r=e.parseOptions(r,{c:"clear",q:"quiet"})).clear)return i=[];var n=c();return t?((t=s(t))<0&&(t=n.length+t),r.quiet||e.log(n[t]),n[t]):(r.quiet||e.log(n.join(" ")),n)}return Qv.pushd=a,Qv.popd=u,Qv.dirs=l,Qv}function eg(){if(Yv)return zv;Yv=1;var e=o.format,r=Uv();function t(t){var n=[].slice.call(arguments,t?0:1),i={};try{i=r.parseOptions(n[0],{e:"escapes",n:"no_newline"},{silent:!0}),n[0]&&n.shift()}catch(e){r.state.error=null}var o=e.apply(null,n);return i.no_newline||(o+="\n"),process.stdout.write(o),o}return r.register("echo",t,{allowGlobbing:!1}),zv=t}function rg(){if(Jv)return Kv;Jv=1;var e=Uv();return Kv=function(){return e.state.error}}var tg,ng={exports:{}};function ig(){return tg||(tg=1,function(e){if(require.main!==e)throw new Error("This file should not be required");var t=s,n=r,i=process.argv[2],o=n.readFileSync(i,"utf8"),c=JSON.parse(o),a=c.command,u=c.execOptions,l=c.pipe,f=c.stdoutFile,p=c.stderrFile,h=t.exec(a,u,(function(e){e?void 0===e.code?process.exitCode=1:process.exitCode=e.code:process.exitCode=0})),d=n.createWriteStream(f),v=n.createWriteStream(p);h.stdout.pipe(d),h.stderr.pipe(v),h.stdout.pipe(process.stdout),h.stderr.pipe(process.stderr),l&&h.stdin.end(l)}(ng)),ng.exports}ng.exports;var og,sg,cg,ag,ug,lg,fg,pg,hg,dg,vg,gg,yg,mg,Eg,bg,wg,Og,Sg,Rg,Ig,Ag={};function jg(){if(og)return Ag;og=1;var t,n=Uv(),i=e,o=r;function s(e){if(!e||!o.existsSync(e))return!1;if(!n.statFollowLinks(e).isDirectory())return!1;var r=e+"/"+n.randomFileName();try{return o.writeFileSync(r," "),n.unlinkSync(r),e}catch(e){return!1}}function c(){return t||(t=s(i.tmpdir())||s(process.env.TMPDIR)||s(process.env.TEMP)||s(process.env.TMP)||s(process.env.Wimp$ScrapDir)||s("C:\\TEMP")||s("C:\\TMP")||s("\\TEMP")||s("\\TMP")||s("/tmp")||s("/var/tmp")||s("/usr/tmp")||s("."))}return n.register("tempdir",c,{allowGlobbing:!1,wrapOutput:!1}),Ag.tempDir=c,Ag.isCached=function(){return t},Ag.clearCache=function(){t=void 0},Ag}function xg(){if(cg)return sg;cg=1;var e=t;function r(){return e.resolve(process.cwd())}return Uv().register("pwd",r,{allowGlobbing:!1}),sg=r}function kg(){if(ug)return ag;ug=1;var e=Uv(),n=jg().tempDir,i=xg(),o=t,c=r,a=s,u=20971520,l=1;function f(r,t,s){t=t||{},r||e.error("must specify command");var f=e.readFromPipe();return"function"==typeof t&&(s=t,t={async:!0}),"object"==typeof t&&"function"==typeof s&&(t.async=!0),(t=e.extend({silent:e.config.silent,async:!1},t)).async?function(r,t,n,o){t=e.extend({silent:e.config.silent,cwd:i().toString(),env:process.env,maxBuffer:u,encoding:"utf8"},t);var s=a.exec(r,t,(function(e,r,t){o&&(e?void 0===e.code?o(1,r,t):o(e.code,r,t):o(0,r,t))}));return n&&s.stdin.end(n),t.silent||(s.stdout.pipe(process.stdout),s.stderr.pipe(process.stderr)),s}(r,t,f,s):function(r,t,s){e.config.execPath||e.error("Unable to find a path to the node binary. Please manually set config.execPath");var f=n(),p=o.resolve(f+"/"+e.randomFileName()),h=o.resolve(f+"/"+e.randomFileName()),d=o.resolve(f+"/"+e.randomFileName());t=e.extend({silent:e.config.silent,cwd:i().toString(),env:process.env,maxBuffer:u,encoding:"utf8"},t),c.existsSync(p)&&e.unlinkSync(p),c.existsSync(h)&&e.unlinkSync(h),c.existsSync(d)&&e.unlinkSync(d),t.cwd=o.resolve(t.cwd);var v={command:r,execOptions:t,pipe:s,stdoutFile:d,stderrFile:h};function g(e,r){c.writeFileSync(e,r,{encoding:"utf8",mode:parseInt("600",8)})}g(d,""),g(h,""),g(p,JSON.stringify(v));var y=[o.join(__dirname,"exec-child.js"),p];t.silent?t.stdio="ignore":t.stdio=[0,1,2];var m=0;try{delete t.shell,a.execFileSync(e.config.execPath,y,t)}catch(e){m=e.status||l}var E="",b="";"buffer"===t.encoding?(E=c.readFileSync(d),b=c.readFileSync(h)):(E=c.readFileSync(d,t.encoding),b=c.readFileSync(h,t.encoding));try{e.unlinkSync(p)}catch(e){}try{e.unlinkSync(h)}catch(e){}try{e.unlinkSync(d)}catch(e){}return 0!==m&&e.error(b,m,{continue:!0,silent:!0}),e.ShellString(E,b,m)}(r,t,f)}return e.register("exec",f,{unix:!1,canReceivePipe:!0,wrapOutput:!1}),ag=f}function Lg(){if(fg)return lg;fg=1;var e=t,n=r,i=Uv(),o=Bv(),s=e.sep+"**";function c(r,t){r.all_deprecated&&(i.log("ls: Option -a is deprecated. Use -A instead"),r.all=!0),t=t?[].slice.call(arguments,1):["."];var c=[];function a(e,t,n){var o,s;"win32"===process.platform&&(t=t.replace(/\\/g,"/")),r.long?(n=n||(r.link?i.statFollowLinks(e):i.statNoFollowLinks(e)),c.push((o=t,(s=n).name=o,s.toString=function(){return[this.mode,this.nlink,this.uid,this.gid,this.size,this.mtime,this.name].join(" ")},s))):c.push(t)}return t.forEach((function(t){var c;try{if((c=r.link?i.statFollowLinks(t):i.statNoFollowLinks(t)).isSymbolicLink())try{var u=i.statFollowLinks(t);u.isDirectory()&&(c=u)}catch(e){}}catch(e){return void i.error("no such file or directory: "+t,2,{continue:!0})}c.isDirectory()&&!r.directory?r.recursive?o.sync(t+s,{dot:r.all,follow:r.link}).forEach((function(r){e.relative(t,r)&&a(r,e.relative(t,r))})):r.all?n.readdirSync(t).forEach((function(r){a(e.join(t,r),r)})):n.readdirSync(t).forEach((function(r){"."!==r[0]&&a(e.join(t,r),r)})):a(t,t,c)})),c}return i.register("ls",c,{cmdOptions:{R:"recursive",A:"all",L:"link",a:"all_deprecated",d:"directory",l:"long"}}),lg=c}function Tg(){if(hg)return pg;hg=1;var e=t,r=Uv(),n=Lg();function i(t,i){i?"string"==typeof i&&(i=[].slice.call(arguments,1)):r.error("no path specified");var o=[];function s(e){"win32"===process.platform&&(e=e.replace(/\\/g,"/")),o.push(e)}return i.forEach((function(t){var i;try{i=r.statFollowLinks(t)}catch(e){r.error("no such file or directory: "+t)}s(t),i.isDirectory()&&n({recursive:!0,all:!0},t).forEach((function(r){s(e.join(t,r))}))})),o}return r.register("find",i,{}),pg=i}function _g(){if(vg)return dg;vg=1;var e=Uv(),t=r;function n(r,n,i){var o=e.readFromPipe();i||o||e.error("no paths given",2),i=[].slice.call(arguments,2),o&&i.unshift("-");var s=[];return r.ignoreCase&&(n=new RegExp(n,"i")),i.forEach((function(i){if(t.existsSync(i)||"-"===i){var c="-"===i?o:t.readFileSync(i,"utf8");if(r.nameOnly)c.match(n)&&s.push(i);else c.split("\n").forEach((function(e){var t=e.match(n);(r.inverse&&!t||!r.inverse&&t)&&s.push(e)}))}else e.error("no such file or directory: "+i,2,{continue:!0})})),s.join("\n")+"\n"}return e.register("grep",n,{globStart:2,canReceivePipe:!0,cmdOptions:{v:"inverse",l:"nameOnly",i:"ignoreCase"}}),dg=n}function Ng(){if(yg)return gg;yg=1;var e=Uv(),t=r;function n(r,n){var i=[],o=e.readFromPipe();n||o||e.error("no paths given");var s=1;!0===r.numLines?(s=2,r.numLines=Number(arguments[1])):!1===r.numLines&&(r.numLines=10),n=[].slice.call(arguments,s),o&&n.unshift("-");var c=!1;return n.forEach((function(n){if("-"!==n){if(!t.existsSync(n))return void e.error("no such file or directory: "+n,{continue:!0});if(e.statFollowLinks(n).isDirectory())return void e.error("error reading '"+n+"': Is a directory",{continue:!0})}var s;s="-"===n?o:r.numLines<0?t.readFileSync(n,"utf8"):function(r,n){for(var i=e.buffer(),o=i.length,s=o,c=0,a=t.openSync(r,"r"),u=0,l="";s===o&&u and/or "),t=String(t);var s=n.normalize(t).replace(RegExp(n.sep+"$"),""),c=n.resolve(t)===s;if(o=n.resolve(process.cwd(),String(o)),e.existsSync(o)&&(r.force||i.error("Destination file exists",{continue:!0}),e.unlinkSync(o)),r.symlink){var a="win32"===process.platform,u=a?"file":null,l=c?s:n.resolve(process.cwd(),n.dirname(o),t);e.existsSync(l)?a&&i.statFollowLinks(l).isDirectory()&&(u="junction"):i.error("Source file does not exist",{continue:!0});try{e.symlinkSync("junction"===u?l:t,o,u)}catch(e){i.error(e.message)}}else{e.existsSync(t)||i.error("Source file does not exist",{continue:!0});try{e.linkSync(t,o)}catch(e){i.error(e.message)}}return""}return i.register("ln",o,{cmdOptions:{s:"symlink",f:"force"}}),mg=o}function Fg(){if(wg)return bg;wg=1;var e=Uv(),n=r,i=t;function o(r){var t=i.dirname(r);t===r&&e.error("dirname() failed: ["+r+"]"),n.existsSync(t)||o(t),n.mkdirSync(r,parseInt("0777",8))}function s(r,t){return t||e.error("no paths given"),"string"==typeof t&&(t=[].slice.call(arguments,1)),t.forEach((function(t){try{var s=e.statNoFollowLinks(t);return void(r.fullpath?s.isFile()&&e.error("cannot create directory "+t+": File exists",{continue:!0}):e.error("path already exists: "+t,{continue:!0}))}catch(e){}var c=i.dirname(t);if(n.existsSync(c)||r.fullpath)try{r.fullpath?o(i.resolve(t)):n.mkdirSync(t,parseInt("0777",8))}catch(r){var a;if("EACCES"===r.code)a="Permission denied";else{if("ENOTDIR"!==r.code&&"ENOENT"!==r.code)throw r;a="Not a directory"}e.error("cannot create directory "+t+": "+a,{continue:!0})}else e.error("no such file or directory: "+c,{continue:!0})})),""}return e.register("mkdir",s,{cmdOptions:{p:"fullpath"}}),bg=s}function Dg(){if(Sg)return Og;Sg=1;var e=Uv(),t=r;function n(r,o,s){var c;c=t.readdirSync(r);for(var a=0;a1e3)throw e}}catch(t){e.error("could not remove directory (code "+t.code+"): "+r,{continue:!0})}return l}}function i(e){var r=!0;try{var n=t.openSync(e,"a");t.closeSync(n)}catch(e){r=!1}return r}function o(r,t){return t||e.error("no paths given"),(t=[].slice.call(arguments,1)).forEach((function(t){var o;try{var s="/"===t[t.length-1]?t.slice(0,-1):t;o=e.statNoFollowLinks(s)}catch(n){return void(r.force||e.error("no such file or directory: "+t,{continue:!0}))}o.isFile()?function(r,t){t.force||i(r)?e.unlinkSync(r):e.error("permission denied: "+r,{continue:!0})}(t,r):o.isDirectory()?function(r,t){t.recursive?n(r,t.force):e.error("path is a directory",{continue:!0})}(t,r):o.isSymbolicLink()?function(r,t){var i;try{i=e.statFollowLinks(r)}catch(t){return void e.unlinkSync(r)}i.isFile()?e.unlinkSync(r):i.isDirectory()&&("/"===r[r.length-1]?t.recursive?n(r,t.force,!0):e.error("path is a directory",{continue:!0}):e.unlinkSync(r))}(t,r):o.isFIFO()&&function(r){e.unlinkSync(r)}(t)})),""}return e.register("rm",o,{cmdOptions:{f:"force",r:"recursive",R:"recursive"}}),Og=o}function Cg(){if(Ig)return Rg;Ig=1;var e=r,n=t,i=Uv(),o=Vv(),s=Dg();function c(r,t,c){arguments.length<3?i.error("missing and/or "):arguments.length>3?(t=[].slice.call(arguments,1,arguments.length-1),c=arguments[arguments.length-1]):"string"==typeof t?t=[t]:i.error("invalid arguments");var a=e.existsSync(c),u=a&&i.statFollowLinks(c);return a&&u.isDirectory()||!(t.length>1)||i.error("dest is not a directory (too many sources)"),a&&u.isFile()&&r.no_force&&i.error("dest file already exists: "+c),t.forEach((function(a,u){if(e.existsSync(a)){var l=c;if(e.existsSync(c)&&i.statFollowLinks(c).isDirectory()&&(l=n.normalize(c+"/"+n.basename(a))),e.existsSync(l)&&function(e,r){var t=e[r];return e.slice(0,r).some((function(e){return n.basename(e)===n.basename(t)}))}(t,u))r.no_force||i.error("will not overwrite just-created '"+l+"' with '"+a+"'",{continue:!0});else if(e.existsSync(l)&&r.no_force)i.error("dest file already exists: "+l,{continue:!0});else if(n.resolve(a)!==n.dirname(n.resolve(l)))try{e.renameSync(a,l)}catch(e){"EXDEV"===e.code&&(o("-r",a,l),s("-rf",a))}else i.error("cannot move to self: "+a,{continue:!0})}else i.error("no such file or directory: "+a,{continue:!0})})),""}return i.register("mv",c,{cmdOptions:{f:"!no_force",n:"no_force"}}),Rg=c}var Mg,Gg={};function $g(){return Mg||(Mg=1),Gg}var Bg,Ug,Xg,qg,Wg,Vg={};function Hg(){return Bg||(Bg=1),Vg}function zg(){if(Xg)return Ug;Xg=1;var e=Uv(),t=r;function n(r,n,i,o){var s=e.readFromPipe();"string"!=typeof i&&"function"!=typeof i&&("number"==typeof i?i=i.toString():e.error("invalid replacement string")),"string"==typeof n&&(n=RegExp(n)),o||s||e.error("no files given"),o=[].slice.call(arguments,3),s&&o.unshift("-");var c=[];return o.forEach((function(o){if(t.existsSync(o)||"-"===o){var a=("-"===o?s:t.readFileSync(o,"utf8")).split("\n").map((function(e){return e.replace(n,i)})).join("\n");c.push(a),r.inplace&&t.writeFileSync(o,a,"utf8")}else e.error("no such file or directory: "+o,2,{continue:!0})})),c.join("\n")}return e.register("sed",n,{globStart:3,canReceivePipe:!0,cmdOptions:{i:"inplace"}}),Ug=n}function Yg(){if(Wg)return qg;Wg=1;var e=Uv();function r(r){if(!r){var t=[].slice.call(arguments,0);t.length<2&&e.error("must provide an argument"),r=t[1]}var n="+"===r[0];n&&(r="-"+r.slice(1)),r=e.parseOptions(r,{e:"fatal",v:"verbose",f:"noglob"}),n&&Object.keys(r).forEach((function(e){r[e]=!r[e]})),Object.keys(r).forEach((function(t){n!==r[t]&&(e.config[t]=r[t])}))}return e.register("set",r,{allowGlobbing:!1,wrapOutput:!1}),qg=r}var Kg=Ff.end,Jg=Gf("trimEnd")?function(){return Kg(this)}:"".trimEnd;ii({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==Jg},{trimRight:Jg});var Qg,Zg,ey,ry,ty,ny,iy,oy,sy,cy,ay,uy,ly,fy,py,hy,dy;function vy(){if(Zg)return Qg;Zg=1;var e=Uv(),t=r;function n(e){var r=e.match(/^\s*(\d*)\s*(.*)$/);return{num:Number(r[1]),value:r[2]}}function i(e,r){var t=e.toLowerCase(),n=r.toLowerCase();return t===n?-1*e.localeCompare(r):t.localeCompare(n)}function o(e,r){var t=n(e),o=n(r);return t.hasOwnProperty("num")&&o.hasOwnProperty("num")&&t.num!==o.num?t.num-o.num:i(t.value,o.value)}function s(r,n){var s=e.readFromPipe();n||s||e.error("no files given"),n=[].slice.call(arguments,1),s&&n.unshift("-");var c=n.reduce((function(r,n){if("-"!==n){if(!t.existsSync(n))return e.error("no such file or directory: "+n,{continue:!0}),r;if(e.statFollowLinks(n).isDirectory())return e.error("read failed: "+n+": Is a directory",{continue:!0}),r}var i="-"===n?s:t.readFileSync(n,"utf8");return r.concat(i.trimRight().split("\n"))}),[]).sort(r.numerical?o:i);return r.reverse&&(c=c.reverse()),c.join("\n")+"\n"}return e.register("sort",s,{canReceivePipe:!0,cmdOptions:{r:"reverse",n:"numerical"}}),Qg=s}function gy(){if(ry)return ey;ry=1;var e=Uv(),t=r;function n(r,n){var i=[],o=e.readFromPipe();n||o||e.error("no paths given");var s=1;!0===r.numLines?(s=2,r.numLines=Number(arguments[1])):!1===r.numLines&&(r.numLines=10),r.numLines=-1*Math.abs(r.numLines),n=[].slice.call(arguments,s),o&&n.unshift("-");var c=!1;return n.forEach((function(n){if("-"!==n){if(!t.existsSync(n))return void e.error("no such file or directory: "+n,{continue:!0});if(e.statFollowLinks(n).isDirectory())return void e.error("error reading '"+n+"': Is a directory",{continue:!0})}var s=("-"===n?o:t.readFileSync(n,"utf8")).split("\n");""===s[s.length-1]?(s.pop(),c=!0):c=!1,i=i.concat(s.slice(r.numLines))})),c&&i.push(""),i.join("\n")}return e.register("tail",n,{canReceivePipe:!0,cmdOptions:{n:"numLines"}}),ey=n}function yy(){if(ny)return ty;ny=1;var e=Uv(),t=r;function n(r,n){n||e.error("no path given");var i=!1;if(Object.keys(r).forEach((function(e){!0===r[e]&&(i=!0)})),i||e.error("could not interpret expression"),r.link)try{return e.statNoFollowLinks(n).isSymbolicLink()}catch(e){return!1}if(!t.existsSync(n))return!1;if(r.exists)return!0;var o=e.statFollowLinks(n);return r.block?o.isBlockDevice():r.character?o.isCharacterDevice():r.directory?o.isDirectory():r.file?o.isFile():r.pipe?o.isFIFO():!!r.socket&&o.isSocket()}return e.register("test",n,{cmdOptions:{b:"block",c:"character",d:"directory",e:"exists",f:"file",L:"link",p:"pipe",S:"socket"},wrapOutput:!1,allowGlobbing:!1}),ty=n}function my(){if(oy)return iy;oy=1;var e=Uv(),n=r,i=t;function o(r,t){t||e.error("wrong arguments"),n.existsSync(i.dirname(t))||e.error("no such file or directory: "+i.dirname(t));try{return n.writeFileSync(t,this.stdout||this.toString(),"utf8"),this}catch(r){e.error("could not write to file (code "+r.code+"): "+t,{continue:!0})}}return e.register("to",o,{pipeOnly:!0,wrapOutput:!1}),iy=o}function Ey(){if(cy)return sy;cy=1;var e=Uv(),n=r,i=t;function o(r,t){t||e.error("wrong arguments"),n.existsSync(i.dirname(t))||e.error("no such file or directory: "+i.dirname(t));try{return n.appendFileSync(t,this.stdout||this.toString(),"utf8"),this}catch(r){e.error("could not append to file (code "+r.code+"): "+t,{continue:!0})}}return e.register("toEnd",o,{pipeOnly:!0,wrapOutput:!1}),sy=o}function by(){if(uy)return ay;uy=1;var e=Uv(),t=r;function n(r,n){return n?"string"==typeof n?n=[].slice.call(arguments,1):e.error("file arg should be a string file path or an Array of string file paths"):e.error("no files given"),n.forEach((function(n){!function(r,n){var o=i(n);if(o&&o.isDirectory())return;if(!o&&r.no_create)return;t.closeSync(t.openSync(n,"a"));var s=new Date,c=r.date||s,a=r.date||s;if(r.reference){var u=i(r.reference);u||e.error("failed to get attributess of "+r.reference),c=u.mtime,a=u.atime}else r.date&&(c=r.date,a=r.date);r.atime_only&&r.mtime_only||(r.atime_only?c=o.mtime:r.mtime_only&&(a=o.atime));t.utimesSync(n,a,c)}(r,n)})),""}function i(r){try{return e.statFollowLinks(r)}catch(e){return null}}return e.register("touch",n,{cmdOptions:{a:"atime_only",c:"no_create",d:"date",m:"mtime_only",r:"reference"}}),ay=n}function wy(){if(fy)return ly;fy=1;var e=Uv(),t=r;function n(r,n,i){var o=e.readFromPipe();o||(n||e.error("no input given"),t.existsSync(n)?e.statFollowLinks(n).isDirectory()&&e.error("error reading '"+n+"'"):e.error(n+": No such file or directory")),i&&t.existsSync(i)&&e.statFollowLinks(i).isDirectory()&&e.error(i+": Is a directory");var s=(n?t.readFileSync(n,"utf8"):o).trimRight().split("\n"),c=s.reduceRight((function(e,t){return 0===e.length?[{count:1,ln:t}]:0===(n=e[0].ln,i=t,r.ignoreCase?n.toLocaleLowerCase().localeCompare(i.toLocaleLowerCase()):n.localeCompare(i))?[{count:e[0].count+1,ln:t}].concat(e.slice(1)):[{count:1,ln:t}].concat(e);var n,i}),[]).filter((function(e){return!r.duplicates||e.count>1})).map((function(e){return(r.count?(t=7,n=e.count,(i=""+n).length0)||r.all);p++){var h=i.resolve(s[p],t);n&&(h=h.toUpperCase());var d=h.match(/\.[^<>:"/\|?*.]+$/);if(d&&f.indexOf(d[0])>=0){if(u(h)){l.push(h);break}}else for(var v=0;v0?r.all?l:l[0]:r.all?[]:null}return py=l}function Sy(){return dy||(dy={"/node_modules/shelljs/src/cat.js":Xv,"/node_modules/shelljs/src/cd.js":qv,"/node_modules/shelljs/src/chmod.js":Wv,"/node_modules/shelljs/src/common.js":Uv,"/node_modules/shelljs/src/cp.js":Vv,"/node_modules/shelljs/src/dirs.js":Zv,"/node_modules/shelljs/src/echo.js":eg,"/node_modules/shelljs/src/error.js":rg,"/node_modules/shelljs/src/exec-child.js":ig,"/node_modules/shelljs/src/exec.js":kg,"/node_modules/shelljs/src/find.js":Tg,"/node_modules/shelljs/src/grep.js":_g,"/node_modules/shelljs/src/head.js":Ng,"/node_modules/shelljs/src/ln.js":Pg,"/node_modules/shelljs/src/ls.js":Lg,"/node_modules/shelljs/src/mkdir.js":Fg,"/node_modules/shelljs/src/mv.js":Cg,"/node_modules/shelljs/src/popd.js":$g,"/node_modules/shelljs/src/pushd.js":Hg,"/node_modules/shelljs/src/pwd.js":xg,"/node_modules/shelljs/src/rm.js":Dg,"/node_modules/shelljs/src/sed.js":zg,"/node_modules/shelljs/src/set.js":Yg,"/node_modules/shelljs/src/sort.js":vy,"/node_modules/shelljs/src/tail.js":gy,"/node_modules/shelljs/src/tempdir.js":jg,"/node_modules/shelljs/src/test.js":yy,"/node_modules/shelljs/src/to.js":my,"/node_modules/shelljs/src/toEnd.js":Ey,"/node_modules/shelljs/src/touch.js":by,"/node_modules/shelljs/src/uniq.js":wy,"/node_modules/shelljs/src/which.js":Oy})}function Ry(e,r){var t,n=function(e){var r=e[0];if("/"===r||"\\"===r)return!1;var t=e[1],n=e[2];return!(!("."!==r||t&&"/"!==t&&"\\"!==t)||!("."!==r||"."!==t||n&&"/"!==n&&"\\"!==n))&&(":"!==t||"/"!==n&&"\\"!==n)}(e);"/"===(e=Iy(e))[0]&&(r="");for(var i=Sy(),o=["",".js",".json"];!(t=Iy(n?r+"/node_modules/"+e:r+"/"+e)).endsWith("/..");){for(var s=0;s0&&".."!==r[n-1]&&"."!==r[n-1]&&(r.splice(--n,2),n--);return e=r.join("/"),t&&"/"!==e[0]?e="/"+e:0===e.length&&(e="."),e}ii({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==Jg},{trimEnd:Jg});var Ay,jy,xy,ky={};function Ly(){if(xy)return ky;xy=1;var e=Uv();return(jy?Ay:(jy=1,Ay=["cat","cd","chmod","cp","dirs","echo","exec","find","grep","head","ln","ls","mkdir","mv","pwd","rm","sed","set","sort","tail","tempdir","test","to","toEnd","touch","uniq","which"])).forEach((function(e){!function(e){function r(r){var t=Ry(r,e);if(null!==t)return Sy()[t]();throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}return r.resolve=function(r){var t=Ry(r,e);return null!==t?t:require.resolve(r)},r}("/node_modules/shelljs")("./src/"+e)})),ky.exit=process.exit,ky.error=rg(),ky.ShellString=e.ShellString,ky.env=process.env,ky.config=e.config,ky}var Ty=Ly(),_y=Uv();Object.keys(Ty).forEach((function(e){c[e]=Ty[e]}));var Ny=my();String.prototype.to=_y.wrap("to",Ny);var Py=Ey();String.prototype.toEnd=_y.wrap("toEnd",Py),c.config.fatal=!0,c.target={};var Fy,Dy=process.argv.slice(2),Cy=Dy.indexOf("--");Cy>-1&&(Fy=Dy.slice(Cy+1,Dy.length),Dy=Dy.slice(0,Cy)),setTimeout((function(){var e;if(1!==Dy.length||"--help"!==Dy[0]){for(e in c.target)!function(e,r){c.target[e]=function(){return r.done||(r.done=!0,r.result=r.apply(r,arguments)),r.result}}(e,c.target[e]);Dy.length>0?Dy.forEach((function(e){e in c.target?c.target[e](Fy):console.log("no such target: "+e)})):"all"in c.target&&c.target.all(Fy)}else for(e in console.log("Available targets:"),c.target)console.log(" "+e)}),0);var My={exports:{}};!function(e,r){var t;r=My.exports=y,t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},r.SEMVER_SPEC_VERSION="2.0.0";var n=256,i=Number.MAX_SAFE_INTEGER||9007199254740991,o=n-6,s=r.re=[],c=r.safeRe=[],a=r.src=[],u=r.tokens={},l=0;function f(e){u[e]=l++}var p="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",n],[p,o]];function d(e){for(var r=0;r)?=?)",f("XRANGEIDENTIFIERLOOSE"),a[u.XRANGEIDENTIFIERLOOSE]=a[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",f("XRANGEIDENTIFIER"),a[u.XRANGEIDENTIFIER]=a[u.NUMERICIDENTIFIER]+"|x|X|\\*",f("XRANGEPLAIN"),a[u.XRANGEPLAIN]="[v=\\s]*("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:"+a[u.PRERELEASE]+")?"+a[u.BUILD]+"?)?)?",f("XRANGEPLAINLOOSE"),a[u.XRANGEPLAINLOOSE]="[v=\\s]*("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:"+a[u.PRERELEASELOOSE]+")?"+a[u.BUILD]+"?)?)?",f("XRANGE"),a[u.XRANGE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAIN]+"$",f("XRANGELOOSE"),a[u.XRANGELOOSE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAINLOOSE]+"$",f("COERCE"),a[u.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",f("COERCERTL"),s[u.COERCERTL]=new RegExp(a[u.COERCE],"g"),c[u.COERCERTL]=new RegExp(d(a[u.COERCE]),"g"),f("LONETILDE"),a[u.LONETILDE]="(?:~>?)",f("TILDETRIM"),a[u.TILDETRIM]="(\\s*)"+a[u.LONETILDE]+"\\s+",s[u.TILDETRIM]=new RegExp(a[u.TILDETRIM],"g"),c[u.TILDETRIM]=new RegExp(d(a[u.TILDETRIM]),"g");f("TILDE"),a[u.TILDE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAIN]+"$",f("TILDELOOSE"),a[u.TILDELOOSE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAINLOOSE]+"$",f("LONECARET"),a[u.LONECARET]="(?:\\^)",f("CARETTRIM"),a[u.CARETTRIM]="(\\s*)"+a[u.LONECARET]+"\\s+",s[u.CARETTRIM]=new RegExp(a[u.CARETTRIM],"g"),c[u.CARETTRIM]=new RegExp(d(a[u.CARETTRIM]),"g");f("CARET"),a[u.CARET]="^"+a[u.LONECARET]+a[u.XRANGEPLAIN]+"$",f("CARETLOOSE"),a[u.CARETLOOSE]="^"+a[u.LONECARET]+a[u.XRANGEPLAINLOOSE]+"$",f("COMPARATORLOOSE"),a[u.COMPARATORLOOSE]="^"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+")$|^$",f("COMPARATOR"),a[u.COMPARATOR]="^"+a[u.GTLT]+"\\s*("+a[u.FULLPLAIN]+")$|^$",f("COMPARATORTRIM"),a[u.COMPARATORTRIM]="(\\s*)"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+"|"+a[u.XRANGEPLAIN]+")",s[u.COMPARATORTRIM]=new RegExp(a[u.COMPARATORTRIM],"g"),c[u.COMPARATORTRIM]=new RegExp(d(a[u.COMPARATORTRIM]),"g");f("HYPHENRANGE"),a[u.HYPHENRANGE]="^\\s*("+a[u.XRANGEPLAIN]+")\\s+-\\s+("+a[u.XRANGEPLAIN]+")\\s*$",f("HYPHENRANGELOOSE"),a[u.HYPHENRANGELOOSE]="^\\s*("+a[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+a[u.XRANGEPLAINLOOSE]+")\\s*$",f("STAR"),a[u.STAR]="(<|>)?=?\\s*\\*";for(var v=0;vn)return null;if(!(r.loose?c[u.LOOSE]:c[u.FULL]).test(e))return null;try{return new y(e,r)}catch(e){return null}}function y(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof y){if(e.loose===r.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof y))return new y(e,r);t("SemVer",e,r),this.options=r,this.loose=!!r.loose;var o=e.trim().match(r.loose?c[u.LOOSE]:c[u.FULL]);if(!o)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var r=+e;if(r>=0&&r=0;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}r&&(this.prerelease[0]===r?isNaN(this.prerelease[1])&&(this.prerelease=[r,0]):this.prerelease=[r,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},r.inc=function(e,r,t,n){"string"==typeof t&&(n=t,t=void 0);try{return new y(e,t).inc(r,n).version}catch(e){return null}},r.diff=function(e,r){if(S(e,r))return null;var t=g(e),n=g(r),i="";if(t.prerelease.length||n.prerelease.length){i="pre";var o="prerelease"}for(var s in t)if(("major"===s||"minor"===s||"patch"===s)&&t[s]!==n[s])return i+s;return o},r.compareIdentifiers=E;var m=/^[0-9]+$/;function E(e,r){var t=m.test(e),n=m.test(r);return t&&n&&(e=+e,r=+r),e===r?0:t&&!n?-1:n&&!t?1:e0}function O(e,r,t){return b(e,r,t)<0}function S(e,r,t){return 0===b(e,r,t)}function R(e,r,t){return 0!==b(e,r,t)}function I(e,r,t){return b(e,r,t)>=0}function A(e,r,t){return b(e,r,t)<=0}function j(e,r,t,n){switch(r){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e===t;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e!==t;case"":case"=":case"==":return S(e,t,n);case"!=":return R(e,t,n);case">":return w(e,t,n);case">=":return I(e,t,n);case"<":return O(e,t,n);case"<=":return A(e,t,n);default:throw new TypeError("Invalid operator: "+r)}}function x(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof x){if(e.loose===!!r.loose)return e;e=e.value}if(!(this instanceof x))return new x(e,r);e=e.trim().split(/\s+/).join(" "),t("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===k?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}r.rcompareIdentifiers=function(e,r){return E(r,e)},r.major=function(e,r){return new y(e,r).major},r.minor=function(e,r){return new y(e,r).minor},r.patch=function(e,r){return new y(e,r).patch},r.compare=b,r.compareLoose=function(e,r){return b(e,r,!0)},r.compareBuild=function(e,r,t){var n=new y(e,t),i=new y(r,t);return n.compare(i)||n.compareBuild(i)},r.rcompare=function(e,r,t){return b(r,e,t)},r.sort=function(e,t){return e.sort((function(e,n){return r.compareBuild(e,n,t)}))},r.rsort=function(e,t){return e.sort((function(e,n){return r.compareBuild(n,e,t)}))},r.gt=w,r.lt=O,r.eq=S,r.neq=R,r.gte=I,r.lte=A,r.cmp=j,r.Comparator=x;var k={};function L(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof L)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new L(e.raw,r);if(e instanceof x)return new L(e.value,r);if(!(this instanceof L))return new L(e,r);if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function T(e,r){for(var t=!0,n=e.slice(),i=n.pop();t&&n.length;)t=n.every((function(e){return i.intersects(e,r)})),i=n.pop();return t}function _(e){return!e||"x"===e.toLowerCase()||"*"===e}function N(e,r,t,n,i,o,s,c,a,u,l,f,p){return((r=_(t)?"":_(n)?">="+t+".0.0":_(i)?">="+t+"."+n+".0":">="+r)+" "+(c=_(a)?"":_(u)?"<"+(+a+1)+".0.0":_(l)?"<"+a+"."+(+u+1)+".0":f?"<="+a+"."+u+"."+l+"-"+f:"<="+c)).trim()}function P(e,r,n){for(var i=0;i0){var o=e[i].semver;if(o.major===r.major&&o.minor===r.minor&&o.patch===r.patch)return!0}return!1}return!0}function F(e,r,t){try{r=new L(r,t)}catch(e){return!1}return r.test(e)}function D(e,r,t,n){var i,o,s,c,a;switch(e=new y(e,n),r=new L(r,n),t){case">":i=w,o=A,s=O,c=">",a=">=";break;case"<":i=O,o=I,s=w,c="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(F(e,r,n))return!1;for(var u=0;u=0.0.0")),f=f||e,p=p||e,i(e.semver,f.semver,n)?f=e:s(e.semver,p.semver,n)&&(p=e)})),f.operator===c||f.operator===a)return!1;if((!p.operator||p.operator===c)&&o(e,p.semver))return!1;if(p.operator===a&&s(e,p.semver))return!1}return!0}x.prototype.parse=function(e){var r=this.options.loose?c[u.COMPARATORLOOSE]:c[u.COMPARATOR],t=e.match(r);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),t[2]?this.semver=new y(t[2],this.options.loose):this.semver=k},x.prototype.toString=function(){return this.value},x.prototype.test=function(e){if(t("Comparator.test",e,this.options.loose),this.semver===k||e===k)return!0;if("string"==typeof e)try{e=new y(e,this.options)}catch(e){return!1}return j(e,this.operator,this.semver,this.options)},x.prototype.intersects=function(e,r){if(!(e instanceof x))throw new TypeError("a Comparator is required");var t;if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),""===this.operator)return""===this.value||(t=new L(e.value,r),F(this.value,t,r));if(""===e.operator)return""===e.value||(t=new L(this.value,r),F(e.semver,t,r));var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),c=j(this.semver,"<",e.semver,r)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),a=j(this.semver,">",e.semver,r)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||i||o&&s||c||a},r.Range=L,L.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},L.prototype.toString=function(){return this.range},L.prototype.parseRange=function(e){var r=this.options.loose,n=r?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(n,N),t("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],"$1$2$3"),t("comparator trim",e,c[u.COMPARATORTRIM]),e=(e=(e=e.replace(c[u.TILDETRIM],"$1~")).replace(c[u.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=r?c[u.COMPARATORLOOSE]:c[u.COMPARATOR],o=e.split(" ").map((function(e){return function(e,r){return t("comp",e,r),e=function(e,r){return e.trim().split(/\s+/).map((function(e){return function(e,r){t("caret",e,r);var n=r.loose?c[u.CARETLOOSE]:c[u.CARET];return e.replace(n,(function(r,n,i,o,s){var c;return t("caret",e,r,n,i,o,s),_(n)?c="":_(i)?c=">="+n+".0.0 <"+(+n+1)+".0.0":_(o)?c="0"===n?">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":">="+n+"."+i+".0 <"+(+n+1)+".0.0":s?(t("replaceCaret pr",s),c="0"===n?"0"===i?">="+n+"."+i+"."+o+"-"+s+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+"-"+s+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+"-"+s+" <"+(+n+1)+".0.0"):(t("no pr"),c="0"===n?"0"===i?">="+n+"."+i+"."+o+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+" <"+(+n+1)+".0.0"),t("caret return",c),c}))}(e,r)})).join(" ")}(e,r),t("caret",e),e=function(e,r){return e.trim().split(/\s+/).map((function(e){return function(e,r){var n=r.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(n,(function(r,n,i,o,s){var c;return t("tilde",e,r,n,i,o,s),_(n)?c="":_(i)?c=">="+n+".0.0 <"+(+n+1)+".0.0":_(o)?c=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":s?(t("replaceTilde pr",s),c=">="+n+"."+i+"."+o+"-"+s+" <"+n+"."+(+i+1)+".0"):c=">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0",t("tilde return",c),c}))}(e,r)})).join(" ")}(e,r),t("tildes",e),e=function(e,r){return t("replaceXRanges",e,r),e.split(/\s+/).map((function(e){return function(e,r){e=e.trim();var n=r.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,(function(n,i,o,s,c,a){t("xRange",e,n,i,o,s,c,a);var u=_(o),l=u||_(s),f=l||_(c),p=f;return"="===i&&p&&(i=""),a=r.includePrerelease?"-0":"",u?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&p?(l&&(s=0),c=0,">"===i?(i=">=",l?(o=+o+1,s=0,c=0):(s=+s+1,c=0)):"<="===i&&(i="<",l?o=+o+1:s=+s+1),n=i+o+"."+s+"."+c+a):l?n=">="+o+".0.0"+a+" <"+(+o+1)+".0.0"+a:f&&(n=">="+o+"."+s+".0"+a+" <"+o+"."+(+s+1)+".0"+a),t("xRange return",n),n}))}(e,r)})).join(" ")}(e,r),t("xrange",e),e=function(e,r){return t("replaceStars",e,r),e.trim().replace(c[u.STAR],"")}(e,r),t("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter((function(e){return!!e.match(i)}))),o=o.map((function(e){return new x(e,this.options)}),this)},L.prototype.intersects=function(e,r){if(!(e instanceof L))throw new TypeError("a Range is required");return this.set.some((function(t){return T(t,r)&&e.set.some((function(e){return T(e,r)&&t.every((function(t){return e.every((function(e){return t.intersects(e,r)}))}))}))}))},r.toComparators=function(e,r){return new L(e,r).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},L.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new y(e,this.options)}catch(e){return!1}for(var r=0;r":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":t&&!w(t,r)||(t=r);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(t&&e.test(t))return t;return null},r.validRange=function(e,r){try{return new L(e,r).range||"*"}catch(e){return null}},r.ltr=function(e,r,t){return D(e,r,"<",t)},r.gtr=function(e,r,t){return D(e,r,">",t)},r.outside=D,r.prerelease=function(e,r){var t=g(e,r);return t&&t.prerelease.length?t.prerelease:null},r.intersects=function(e,r,t){return e=new L(e,t),r=new L(r,t),e.intersects(r)},r.coerce=function(e,r){if(e instanceof y)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var t=null;if((r=r||{}).rtl){for(var n;(n=c[u.COERCERTL].exec(e))&&(!t||t.index+t[0].length!==e.length);)t&&n.index+n[0].length===t.index+t[0].length||(t=n),c[u.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;c[u.COERCERTL].lastIndex=-1}else t=e.match(c[u.COERCE]);if(null===t)return null;return g(t[2]+"."+(t[3]||"0")+"."+(t[4]||"0"),r)}}(0,My.exports);var Gy,$y=(Gy=My.exports)&&Gy.__esModule&&Object.prototype.hasOwnProperty.call(Gy,"default")?Gy.default:Gy;const By=global,Uy=new Proxy(global.target,{set:function(e,r,t){return Reflect.set(...arguments)},get:function(e,r,t){return Hy(`make ${r}`),Reflect.get(...arguments)}}),Xy=["packages","codemods","eslint"],qy=["eslint","scripts","benchmark",...Xy,"*.{js,cjs,mjs,ts}","--format","codeframe"],Wy=By.which("yarn").stdout,Vy=process.execPath;function Hy(...e){console.log.apply(console,e)}function zy(e,r,n,i=!0){Hy(`${e.replaceAll(Wy,"yarn").replaceAll(Vy,"node")} ${r.join(" ")}`);try{return s.execFileSync(e,r,{stdio:i?"inherit":void 0,cwd:n&&t.resolve(n),env:process.env})}catch(t){throw i&&0!=t.status&&(console.error(new Error(`\ncommand: ${e} ${r.join(" ")}\ncode: ${t.status}`)),process.exit(t.status)),t}}function Yy(e,r,t){return zy(Wy,e,r,t)}function Ky(e,r,t){return zy(Vy,e,r,t)}function Jy(e,r){const t=process.env;process.env=Object.assign(Object.assign({},t),r),e(),process.env=t}function Qy(e,t,n){const i="./build/"+e.toLowerCase();By.rm("-rf",i),By.mkdir("-p","build"),zy("git",["clone","--filter=blob:none","--sparse","--single-branch","--shallow-since='2 years ago'",t,i]),zy("git",["sparse-checkout","set",...n],i),zy("git",["checkout","-q",function(e){const t=r.readFileSync("./Makefile","utf8").match(new RegExp(`${e}_COMMIT = (\\w{40})`))[1];if(!t)throw new Error(`Could not find ${e}_COMMIT in Makefile`);return t}(e)],i)}function Zy(){const e=JSON.parse(r.readFileSync("./package.json","utf8")).version_babel8;return Xy.forEach((t=>{r.readdirSync(t).forEach((n=>{const i=`${t}/${n}/package.json`;if(r.existsSync(i)){var o,s,c;const t=JSON.parse(r.readFileSync(i,"utf8"));null!=(o=t.peerDependencies)&&o["@babel/core"]&&(t.peerDependencies["@babel/core"]=`^${e}`);const a=null==(s=t.conditions)?void 0:s.BABEL_8_BREAKING[0];null!=a&&null!=(c=a.peerDependencies)&&c["@babel/core"]&&(a.peerDependencies["@babel/core"]=`^${e}`),"babel-eslint-plugin"===n&&(a.peerDependencies["@babel/eslint-parser"]=`^${e}`),r.writeFileSync(i,JSON.stringify(t,null,2)+"\n")}}))})),Jy((()=>Yy(["install"])),{YARN_ENABLE_IMMUTABLE_INSTALLS:!1}),e}By.config.verbose=!0,Uy["clean-all"]=function(){By.rm("-rf",["node_modules","package-lock.json",".changelog"]),Xy.forEach((e=>{By.rm("-rf",`${e}/*/test/tmp`),By.rm("-rf",`${e}/*/package-lock.json`)})),Uy.clean(),Uy["clean-lib"]()},Uy.clean=function(){Uy["test-clean"](),By.rm("-rf",[".npmrc","coverage","packages/*/npm-debug*","node_modules/.cache"])},Uy["test-clean"]=function(){Xy.forEach((e=>{By.rm("-rf",`${e}/*/test/tmp`),By.rm("-rf",`${e}/*/test-fixtures.json`)}))},Uy["clean-lib"]=function(){By.rm("-rf",Xy.map((e=>`${e}/*/lib`))),Ky(["scripts/set-module-type.js"])},Uy["clean-runtime-helpers"]=function(){By.rm("-rf",["packages/babel-runtime/helpers/**/*.js","packages/babel-runtime-corejs2/helpers/**/*.js","packages/babel-runtime-corejs3/helpers/**/*.js","packages/babel-runtime/helpers/**/*.mjs","packages/babel-runtime-corejs2/helpers/**/*.mjs","packages/babel-runtime-corejs3/helpers/**/*.mjs","packages/babel-runtime-corejs2/core-js"])},Uy["use-cjs"]=function(){Ky(["scripts/set-module-type.js","commonjs"]),Uy.bootstrap()},Uy["use-esm"]=function(){Ky(["scripts/set-module-type.js","module"]),Uy.bootstrap()},Uy["bootstrap-only"]=function(){Uy["clean-all"](),Yy(["install"])},Uy.bootstrap=function(){Uy["bootstrap-only"](),Uy["generate-tsconfig"](),Uy.build()},Uy.build=function(){Uy["build-no-bundle"](),"true"!=process.env.BABEL_COVERAGE&&Uy["build-standalone"]()},Uy["build-standalone"]=function(){Yy(["gulp","build-babel-standalone"])},Uy["build-bundle"]=function(){Uy.clean(),Uy["clean-lib"](),Ky(["scripts/set-module-type.js"]),Yy(["gulp","build"]),Uy["build-dist"]()},Uy["build-no-bundle"]=function(){Uy.clean(),Uy["clean-lib"](),Ky(["scripts/set-module-type.js"]),Jy((()=>{Yy(["gulp","build-dev"])}),{BABEL_ENV:"development"}),Uy["build-dist"]()},Uy["build-flow-typings"]=function(){r.writeFileSync("packages/babel-types/lib/index.js.flow",Ky(["packages/babel-types/scripts/generators/flow.js"],void 0,!1))},Uy["build-dist"]=function(){Uy["build-plugin-transform-runtime-dist"]()},Uy["build-plugin-transform-runtime-dist"]=function(){Ky(["scripts/build-dist.js"],"packages/babel-plugin-transform-runtime")},Uy.prepublish=function(){process.env.BABEL_8_BREAKING?Ky(["scripts/set-module-type.js","module"]):Ky(["scripts/set-module-type.js","commonjs"]),Uy["bootstrap-only"](),Jy((()=>{Uy["prepublish-build"](),Uy.test()}),{IS_PUBLISH:"true"}),Ky(["scripts/set-module-type.js","clean"])},Uy["prepublish-build"]=function(){Uy["clean-lib"](),Uy["clean-runtime-helpers"](),Jy((()=>{Uy["build-bundle"]()}),{NODE_ENV:"production",BABEL_ENV:"production",STRIP_BABEL_8_FLAG:"true"}),Jy((()=>{Uy["prepublish-build-standalone"](),Uy["clone-license"](),Uy["prepublish-prepare-dts"](),Uy["build-flow-typings"]()}),{NODE_ENV:"production",STRIP_BABEL_8_FLAG:"true"})},Uy["prepublish-build-standalone"]=function(){Jy((()=>{Uy["build-standalone"]()}),{BABEL_ENV:"production",IS_PUBLISH:"true"})},Uy["prepublish-prepare-dts"]=function(){Uy.tscheck(),Yy(["gulp","bundle-dts"]),Uy["build-typescript-legacy-typings"]()},Uy.tscheck=function(){Uy["generate-tsconfig"](),By.rm("-rf","tsconfig.tsbuildinfo"),By.rm("-rf","dts"),Yy(["tsc","-b","."])},Uy["generate-tsconfig"]=function(){Ky(["scripts/generators/tsconfig.js"]),Ky(["scripts/generators/archived-libs-typings.js"])},Uy["generate-type-helpers"]=function(){Yy(["gulp","generate-type-helpers"])},Uy["build-typescript-legacy-typings"]=function(){r.writeFileSync("packages/babel-types/lib/index-legacy.d.ts",Ky(["packages/babel-types/scripts/generators/typescript-legacy.js"],void 0,!1))},Uy["clone-license"]=function(){Ky(["scripts/clone-license.js"])},Uy.lint=function(){Jy((()=>{Yy(qy)}),{BABEL_ENV:"test"})},Uy.fix=function(){Uy["fix-json"](),Uy["fix-js"]()},Uy["fix-js"]=function(){Yy([...qy,"--fix"])},Uy["fix-json"]=function(){Yy(["prettier",`{${Xy.join(",")}}/*/test/fixtures/**/options.json`,"--write","--loglevel","warn"])},Uy.watch=function(){Uy["build-no-bundle"](),Jy((()=>{Yy(["gulp","watch"])}),{BABEL_ENV:"development",WATCH_SKIP_BUILD:"true"})},Uy.test=function(){Uy.lint(),Uy["test-only"]()},Uy["test-only"]=function(e=[]){Yy(["jest",...e])},Uy["test-cov"]=function(){Uy.build(),Jy((()=>{Yy(["c8","jest"])}),{BABEL_ENV:"test",BABEL_COVERAGE:"true"})},Uy["bootstrap-test262"]=function(){Qy("TEST262","https://github.com/tc39/test262.git",["test","harness"])},Uy["bootstrap-typescript"]=function(){Qy("TYPESCRIPT","https://github.com/microsoft/TypeScript.git",["tests"])},Uy["bootstrap-flow"]=function(){Qy("FLOW","https://github.com/facebook/flow.git",["src/parser/test/flow"])},Uy["new-version-checklist"]=function(){console.log("\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n!!!!!! !!!!!!\nUpdate minVersion in packages/babel-helpers/src/helpers/applyDecs2311.ts\n!!!!!! Write any important message here, and change the !!!!!!\n!!!!!! if (0) above to if (1) !!!!!!\n!!!!!! !!!!!!\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n ".trim()),process.exit(1)},Uy["new-version"]=function(){Uy["new-version-checklist"](),zy("git",["pull","--rebase"]),Yy(["release-tool","version","-f","@babel/standalone"])},Uy["new-babel-8-version"]=function(){zy("git",["pull","--rebase"]);const e=JSON.parse(r.readFileSync("./package.json","utf8")),t=$y.inc(e.version_babel8,"prerelease");return e.version_babel8=t,r.writeFileSync("./package.json",JSON.stringify(e,null,2)+"\n"),zy("git",["add","./package.json"]),zy("git",["commit","-m","Bump Babel 8 version to "+t]),zy("git",["tag",`v${t}`,"-m",`v${t}`]),t},Uy["new-babel-8-version-create-commit-ci"]=function(){Yy(["release-tool","version",Zy(),"--all","--tag-version-prefix","tmp.v","--yes"])},Uy["new-babel-8-version-create-commit"]=function(){const e=Zy();zy("git",["checkout","-b",`release/temp/v${e}`]),Yy(["release-tool","version",e,"--all","--tag-version-prefix","tmp.v"]),console.log("Run `BABEL_8_BREAKING=true make publish` to finish publishing")}; +"use strict";var e=require("os"),r=require("fs"),t=require("path"),n=require("events"),i=require("assert"),o=require("util"),s=require("child_process"),c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var a=function(e){return e&&e.Math===Math&&e},u=a("object"==typeof globalThis&&globalThis)||a("object"==typeof window&&window)||a("object"==typeof self&&self)||a("object"==typeof c&&c)||a("object"==typeof c&&c)||function(){return this}()||Function("return this")(),l={},f=function(e){try{return!!e()}catch(e){return!0}},p=!f((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),h=!f((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),d=h,v=Function.prototype.call,g=d?v.bind(v):function(){return v.apply(v,arguments)},y={},m={}.propertyIsEnumerable,E=Object.getOwnPropertyDescriptor,b=E&&!m.call({1:2},1);y.f=b?function(e){var r=E(this,e);return!!r&&r.enumerable}:m;var w,O,S=function(e,r){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:r}},R=h,I=Function.prototype,A=I.call,j=R&&I.bind.bind(A,A),x=R?j:function(e){return function(){return A.apply(e,arguments)}},k=x,L=k({}.toString),T=k("".slice),_=function(e){return T(L(e),8,-1)},N=f,P=_,F=Object,C=x("".split),D=N((function(){return!F("z").propertyIsEnumerable(0)}))?function(e){return"String"===P(e)?C(e,""):F(e)}:F,M=function(e){return null==e},G=M,$=TypeError,B=function(e){if(G(e))throw new $("Can't call method on "+e);return e},U=D,X=B,q=function(e){return U(X(e))},W="object"==typeof document&&document.all,V=void 0===W&&void 0!==W?function(e){return"function"==typeof e||e===W}:function(e){return"function"==typeof e},H=V,z=function(e){return"object"==typeof e?null!==e:H(e)},Y=u,K=V,J=function(e,r){return arguments.length<2?(t=Y[e],K(t)?t:void 0):Y[e]&&Y[e][r];var t},Q=x({}.isPrototypeOf),Z="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ee=u,re=Z,te=ee.process,ne=ee.Deno,ie=te&&te.versions||ne&&ne.version,oe=ie&&ie.v8;oe&&(O=(w=oe.split("."))[0]>0&&w[0]<4?1:+(w[0]+w[1])),!O&&re&&(!(w=re.match(/Edge\/(\d+)/))||w[1]>=74)&&(w=re.match(/Chrome\/(\d+)/))&&(O=+w[1]);var se=O,ce=se,ae=f,ue=u.String,le=!!Object.getOwnPropertySymbols&&!ae((function(){var e=Symbol("symbol detection");return!ue(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ce&&ce<41})),fe=le&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,pe=J,he=V,de=Q,ve=Object,ge=fe?function(e){return"symbol"==typeof e}:function(e){var r=pe("Symbol");return he(r)&&de(r.prototype,ve(e))},ye=String,me=function(e){try{return ye(e)}catch(e){return"Object"}},Ee=V,be=me,we=TypeError,Oe=function(e){if(Ee(e))return e;throw new we(be(e)+" is not a function")},Se=Oe,Re=M,Ie=function(e,r){var t=e[r];return Re(t)?void 0:Se(t)},Ae=g,je=V,xe=z,ke=TypeError,Le={exports:{}},Te=u,_e=Object.defineProperty,Ne=function(e,r){try{_e(Te,e,{value:r,configurable:!0,writable:!0})}catch(t){Te[e]=r}return r},Pe=Ne,Fe="__core-js_shared__",Ce=u[Fe]||Pe(Fe,{}),De=Ce;(Le.exports=function(e,r){return De[e]||(De[e]=void 0!==r?r:{})})("versions",[]).push({version:"3.35.0",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE",source:"https://github.com/zloirock/core-js"});var Me=Le.exports,Ge=B,$e=Object,Be=function(e){return $e(Ge(e))},Ue=Be,Xe=x({}.hasOwnProperty),qe=Object.hasOwn||function(e,r){return Xe(Ue(e),r)},We=x,Ve=0,He=Math.random(),ze=We(1..toString),Ye=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ze(++Ve+He,36)},Ke=Me,Je=qe,Qe=Ye,Ze=le,er=fe,rr=u.Symbol,tr=Ke("wks"),nr=er?rr.for||rr:rr&&rr.withoutSetter||Qe,ir=function(e){return Je(tr,e)||(tr[e]=Ze&&Je(rr,e)?rr[e]:nr("Symbol."+e)),tr[e]},or=g,sr=z,cr=ge,ar=Ie,ur=function(e,r){var t,n;if("string"===r&&je(t=e.toString)&&!xe(n=Ae(t,e)))return n;if(je(t=e.valueOf)&&!xe(n=Ae(t,e)))return n;if("string"!==r&&je(t=e.toString)&&!xe(n=Ae(t,e)))return n;throw new ke("Can't convert object to primitive value")},lr=TypeError,fr=ir("toPrimitive"),pr=function(e,r){if(!sr(e)||cr(e))return e;var t,n=ar(e,fr);if(n){if(void 0===r&&(r="default"),t=or(n,e,r),!sr(t)||cr(t))return t;throw new lr("Can't convert object to primitive value")}return void 0===r&&(r="number"),ur(e,r)},hr=ge,dr=function(e){var r=pr(e,"string");return hr(r)?r:r+""},vr=z,gr=u.document,yr=vr(gr)&&vr(gr.createElement),mr=function(e){return yr?gr.createElement(e):{}},Er=mr,br=!p&&!f((function(){return 7!==Object.defineProperty(Er("div"),"a",{get:function(){return 7}}).a})),wr=p,Or=g,Sr=y,Rr=S,Ir=q,Ar=dr,jr=qe,xr=br,kr=Object.getOwnPropertyDescriptor;l.f=wr?kr:function(e,r){if(e=Ir(e),r=Ar(r),xr)try{return kr(e,r)}catch(e){}if(jr(e,r))return Rr(!Or(Sr.f,e,r),e[r])};var Lr={},Tr=p&&f((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),_r=z,Nr=String,Pr=TypeError,Fr=function(e){if(_r(e))return e;throw new Pr(Nr(e)+" is not an object")},Cr=p,Dr=br,Mr=Tr,Gr=Fr,$r=dr,Br=TypeError,Ur=Object.defineProperty,Xr=Object.getOwnPropertyDescriptor,qr="enumerable",Wr="configurable",Vr="writable";Lr.f=Cr?Mr?function(e,r,t){if(Gr(e),r=$r(r),Gr(t),"function"==typeof e&&"prototype"===r&&"value"in t&&Vr in t&&!t[Vr]){var n=Xr(e,r);n&&n[Vr]&&(e[r]=t.value,t={configurable:Wr in t?t[Wr]:n[Wr],enumerable:qr in t?t[qr]:n[qr],writable:!1})}return Ur(e,r,t)}:Ur:function(e,r,t){if(Gr(e),r=$r(r),Gr(t),Dr)try{return Ur(e,r,t)}catch(e){}if("get"in t||"set"in t)throw new Br("Accessors not supported");return"value"in t&&(e[r]=t.value),e};var Hr=Lr,zr=S,Yr=p?function(e,r,t){return Hr.f(e,r,zr(1,t))}:function(e,r,t){return e[r]=t,e},Kr={exports:{}},Jr=p,Qr=qe,Zr=Function.prototype,et=Jr&&Object.getOwnPropertyDescriptor,rt=Qr(Zr,"name"),tt={EXISTS:rt,PROPER:rt&&"something"===function(){}.name,CONFIGURABLE:rt&&(!Jr||Jr&&et(Zr,"name").configurable)},nt=V,it=Ce,ot=x(Function.toString);nt(it.inspectSource)||(it.inspectSource=function(e){return ot(e)});var st,ct,at,ut=it.inspectSource,lt=V,ft=u.WeakMap,pt=lt(ft)&&/native code/.test(String(ft)),ht=Ye,dt=Me("keys"),vt=function(e){return dt[e]||(dt[e]=ht(e))},gt={},yt=pt,mt=u,Et=z,bt=Yr,wt=qe,Ot=Ce,St=vt,Rt=gt,It="Object already initialized",At=mt.TypeError,jt=mt.WeakMap;if(yt||Ot.state){var xt=Ot.state||(Ot.state=new jt);xt.get=xt.get,xt.has=xt.has,xt.set=xt.set,st=function(e,r){if(xt.has(e))throw new At(It);return r.facade=e,xt.set(e,r),r},ct=function(e){return xt.get(e)||{}},at=function(e){return xt.has(e)}}else{var kt=St("state");Rt[kt]=!0,st=function(e,r){if(wt(e,kt))throw new At(It);return r.facade=e,bt(e,kt,r),r},ct=function(e){return wt(e,kt)?e[kt]:{}},at=function(e){return wt(e,kt)}}var Lt={set:st,get:ct,has:at,enforce:function(e){return at(e)?ct(e):st(e,{})},getterFor:function(e){return function(r){var t;if(!Et(r)||(t=ct(r)).type!==e)throw new At("Incompatible receiver, "+e+" required");return t}}},Tt=x,_t=f,Nt=V,Pt=qe,Ft=p,Ct=tt.CONFIGURABLE,Dt=ut,Mt=Lt.enforce,Gt=Lt.get,$t=String,Bt=Object.defineProperty,Ut=Tt("".slice),Xt=Tt("".replace),qt=Tt([].join),Wt=Ft&&!_t((function(){return 8!==Bt((function(){}),"length",{value:8}).length})),Vt=String(String).split("String"),Ht=Kr.exports=function(e,r,t){"Symbol("===Ut($t(r),0,7)&&(r="["+Xt($t(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(r="get "+r),t&&t.setter&&(r="set "+r),(!Pt(e,"name")||Ct&&e.name!==r)&&(Ft?Bt(e,"name",{value:r,configurable:!0}):e.name=r),Wt&&t&&Pt(t,"arity")&&e.length!==t.arity&&Bt(e,"length",{value:t.arity});try{t&&Pt(t,"constructor")&&t.constructor?Ft&&Bt(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=Mt(e);return Pt(n,"source")||(n.source=qt(Vt,"string"==typeof r?r:"")),e};Function.prototype.toString=Ht((function(){return Nt(this)&&Gt(this).source||Dt(this)}),"toString");var zt=Kr.exports,Yt=V,Kt=Lr,Jt=zt,Qt=Ne,Zt=function(e,r,t,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:r;if(Yt(t)&&Jt(t,o,n),n.global)i?e[r]=t:Qt(r,t);else{try{n.unsafe?e[r]&&(i=!0):delete e[r]}catch(e){}i?e[r]=t:Kt.f(e,r,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},en={},rn=Math.ceil,tn=Math.floor,nn=Math.trunc||function(e){var r=+e;return(r>0?tn:rn)(r)},on=nn,sn=function(e){var r=+e;return r!=r||0===r?0:on(r)},cn=sn,an=Math.max,un=Math.min,ln=function(e,r){var t=cn(e);return t<0?an(t+r,0):un(t,r)},fn=sn,pn=Math.min,hn=function(e){return e>0?pn(fn(e),9007199254740991):0},dn=hn,vn=function(e){return dn(e.length)},gn=q,yn=ln,mn=vn,En=function(e){return function(r,t,n){var i,o=gn(r),s=mn(o),c=yn(n,s);if(e&&t!=t){for(;s>c;)if((i=o[c++])!=i)return!0}else for(;s>c;c++)if((e||c in o)&&o[c]===t)return e||c||0;return!e&&-1}},bn={includes:En(!0),indexOf:En(!1)},wn=qe,On=q,Sn=bn.indexOf,Rn=gt,In=x([].push),An=function(e,r){var t,n=On(e),i=0,o=[];for(t in n)!wn(Rn,t)&&wn(n,t)&&In(o,t);for(;r.length>i;)wn(n,t=r[i++])&&(~Sn(o,t)||In(o,t));return o},jn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],xn=An,kn=jn.concat("length","prototype");en.f=Object.getOwnPropertyNames||function(e){return xn(e,kn)};var Ln={};Ln.f=Object.getOwnPropertySymbols;var Tn=J,_n=en,Nn=Ln,Pn=Fr,Fn=x([].concat),Cn=Tn("Reflect","ownKeys")||function(e){var r=_n.f(Pn(e)),t=Nn.f;return t?Fn(r,t(e)):r},Dn=qe,Mn=Cn,Gn=l,$n=Lr,Bn=function(e,r,t){for(var n=Mn(r),i=$n.f,o=Gn.f,s=0;ss;)yi.f(e,t=i[s++],n[t]);return e};var wi,Oi=J("document","documentElement"),Si=Fr,Ri=fi,Ii=jn,Ai=gt,ji=Oi,xi=mr,ki="prototype",Li="script",Ti=vt("IE_PROTO"),_i=function(){},Ni=function(e){return"<"+Li+">"+e+""},Pi=function(e){e.write(Ni("")),e.close();var r=e.parentWindow.Object;return e=null,r},Fi=function(){try{wi=new ActiveXObject("htmlfile")}catch(e){}var e,r,t;Fi="undefined"!=typeof document?document.domain&&wi?Pi(wi):(r=xi("iframe"),t="java"+Li+":",r.style.display="none",ji.appendChild(r),r.src=String(t),(e=r.contentWindow.document).open(),e.write(Ni("document.F=Object")),e.close(),e.F):Pi(wi);for(var n=Ii.length;n--;)delete Fi[ki][Ii[n]];return Fi()};Ai[Ti]=!0;var Ci=Object.create||function(e,r){var t;return null!==e?(_i[ki]=Si(e),t=new _i,_i[ki]=null,t[Ti]=e):t=Fi(),void 0===r?t:Ri.f(t,r)},Di=ir,Mi=Ci,Gi=Lr.f,$i=Di("unscopables"),Bi=Array.prototype;void 0===Bi[$i]&&Gi(Bi,$i,{configurable:!0,value:Mi(null)});var Ui,Xi,qi,Wi={},Vi=!f((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Hi=qe,zi=V,Yi=Be,Ki=Vi,Ji=vt("IE_PROTO"),Qi=Object,Zi=Qi.prototype,eo=Ki?Qi.getPrototypeOf:function(e){var r=Yi(e);if(Hi(r,Ji))return r[Ji];var t=r.constructor;return zi(t)&&r instanceof t?t.prototype:r instanceof Qi?Zi:null},ro=f,to=V,no=z,io=eo,oo=Zt,so=ir("iterator"),co=!1;[].keys&&("next"in(qi=[].keys())?(Xi=io(io(qi)))!==Object.prototype&&(Ui=Xi):co=!0);var ao=!no(Ui)||ro((function(){var e={};return Ui[so].call(e)!==e}));ao&&(Ui={}),to(Ui[so])||oo(Ui,so,(function(){return this}));var uo={IteratorPrototype:Ui,BUGGY_SAFARI_ITERATORS:co},lo=uo.IteratorPrototype,fo=Ci,po=S,ho=ai,vo=Wi,go=function(){return this},yo=x,mo=Oe,Eo=z,bo=function(e){return Eo(e)||null===e},wo=String,Oo=TypeError,So=function(e,r,t){try{return yo(mo(Object.getOwnPropertyDescriptor(e,r)[t]))}catch(e){}},Ro=Fr,Io=function(e){if(bo(e))return e;throw new Oo("Can't set "+wo(e)+" as a prototype")},Ao=Object.setPrototypeOf||("__proto__"in{}?function(){var e,r=!1,t={};try{(e=So(Object.prototype,"__proto__","set"))(t,[]),r=t instanceof Array}catch(e){}return function(t,n){return Ro(t),Io(n),r?e(t,n):t.__proto__=n,t}}():void 0),jo=ii,xo=g,ko=V,Lo=function(e,r,t,n){var i=r+" Iterator";return e.prototype=fo(lo,{next:po(+!n,t)}),ho(e,i,!1),vo[i]=go,e},To=eo,_o=Ao,No=ai,Po=Yr,Fo=Zt,Co=Wi,Do=tt.PROPER,Mo=tt.CONFIGURABLE,Go=uo.IteratorPrototype,$o=uo.BUGGY_SAFARI_ITERATORS,Bo=ir("iterator"),Uo="keys",Xo="values",qo="entries",Wo=function(){return this},Vo=q,Ho=function(e){Bi[$i][e]=!0},zo=Wi,Yo=Lt,Ko=Lr.f,Jo=function(e,r,t,n,i,o,s){Lo(t,r,n);var c,a,u,l=function(e){if(e===i&&v)return v;if(!$o&&e&&e in h)return h[e];switch(e){case Uo:case Xo:case qo:return function(){return new t(this,e)}}return function(){return new t(this)}},f=r+" Iterator",p=!1,h=e.prototype,d=h[Bo]||h["@@iterator"]||i&&h[i],v=!$o&&d||l(i),g="Array"===r&&h.entries||d;if(g&&(c=To(g.call(new e)))!==Object.prototype&&c.next&&(To(c)!==Go&&(_o?_o(c,Go):ko(c[Bo])||Fo(c,Bo,Wo)),No(c,f,!0)),Do&&i===Xo&&d&&d.name!==Xo&&(Mo?Po(h,"name",Xo):(p=!0,v=function(){return xo(d,this)})),i)if(a={values:l(Xo),keys:o?v:l(Uo),entries:l(qo)},s)for(u in a)($o||p||!(u in h))&&Fo(h,u,a[u]);else jo({target:r,proto:!0,forced:$o||p},a);return h[Bo]!==v&&Fo(h,Bo,v,{name:i}),Co[r]=v,a},Qo=function(e,r){return{value:e,done:r}},Zo=p,es="Array Iterator",rs=Yo.set,ts=Yo.getterFor(es);Jo(Array,"Array",(function(e,r){rs(this,{type:es,target:Vo(e),index:0,kind:r})}),(function(){var e=ts(this),r=e.target,t=e.index++;if(!r||t>=r.length)return e.target=void 0,Qo(void 0,!0);switch(e.kind){case"keys":return Qo(t,!1);case"values":return Qo(r[t],!1)}return Qo([t,r[t]],!1)}),"values");var ns=zo.Arguments=zo.Array;if(Ho("keys"),Ho("values"),Ho("entries"),Zo&&"values"!==ns.name)try{Ko(ns,"name",{value:"values"})}catch(e){}var is={};is[ir("toStringTag")]="z";var os="[object z]"===String(is),ss=V,cs=_,as=ir("toStringTag"),us=Object,ls="Arguments"===cs(function(){return arguments}()),fs=os?cs:function(e){var r,t,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,r){try{return e[r]}catch(e){}}(r=us(e),as))?t:ls?cs(r):"Object"===(n=cs(r))&&ss(r.callee)?"Arguments":n},ps=fs,hs=String,ds=function(e){if("Symbol"===ps(e))throw new TypeError("Cannot convert a Symbol value to a string");return hs(e)},vs=Fr,gs=function(){var e=vs(this),r="";return e.hasIndices&&(r+="d"),e.global&&(r+="g"),e.ignoreCase&&(r+="i"),e.multiline&&(r+="m"),e.dotAll&&(r+="s"),e.unicode&&(r+="u"),e.unicodeSets&&(r+="v"),e.sticky&&(r+="y"),r},ys=f,ms=u.RegExp,Es=ys((function(){var e=ms("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),bs=Es||ys((function(){return!ms("a","y").sticky})),ws=Es||ys((function(){var e=ms("^r","gy");return e.lastIndex=2,null!==e.exec("str")})),Os={BROKEN_CARET:ws,MISSED_STICKY:bs,UNSUPPORTED_Y:Es},Ss=f,Rs=u.RegExp,Is=Ss((function(){var e=Rs(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)})),As=f,js=u.RegExp,xs=As((function(){var e=js("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")})),ks=g,Ls=x,Ts=ds,_s=gs,Ns=Os,Ps=Ci,Fs=Lt.get,Cs=Is,Ds=xs,Ms=Me("native-string-replace",String.prototype.replace),Gs=RegExp.prototype.exec,$s=Gs,Bs=Ls("".charAt),Us=Ls("".indexOf),Xs=Ls("".replace),qs=Ls("".slice),Ws=function(){var e=/a/,r=/b*/g;return ks(Gs,e,"a"),ks(Gs,r,"a"),0!==e.lastIndex||0!==r.lastIndex}(),Vs=Ns.BROKEN_CARET,Hs=void 0!==/()??/.exec("")[1];(Ws||Hs||Vs||Cs||Ds)&&($s=function(e){var r,t,n,i,o,s,c,a=this,u=Fs(a),l=Ts(e),f=u.raw;if(f)return f.lastIndex=a.lastIndex,r=ks($s,f,l),a.lastIndex=f.lastIndex,r;var p=u.groups,h=Vs&&a.sticky,d=ks(_s,a),v=a.source,g=0,y=l;if(h&&(d=Xs(d,"y",""),-1===Us(d,"g")&&(d+="g"),y=qs(l,a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==Bs(l,a.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,g++),t=new RegExp("^(?:"+v+")",d)),Hs&&(t=new RegExp("^"+v+"$(?!\\s)",d)),Ws&&(n=a.lastIndex),i=ks(Gs,h?t:a,y),h?i?(i.input=qs(i.input,g),i[0]=qs(i[0],g),i.index=a.lastIndex,a.lastIndex+=i[0].length):a.lastIndex=0:Ws&&i&&(a.lastIndex=a.global?i.index+i[0].length:n),Hs&&i&&i.length>1&&ks(Ms,i[0],t,(function(){for(o=1;o=c?e?"":void 0:(n=yc(o,s))<55296||n>56319||s+1===c||(i=yc(o,s+1))<56320||i>57343?e?gc(o,s):n:e?mc(o,s,s+2):i-56320+(n-55296<<10)+65536}},bc={codeAt:Ec(!1),charAt:Ec(!0)}.charAt,wc=function(e,r,t){return r+(t?bc(e,r).length:1)},Oc=x,Sc=Be,Rc=Math.floor,Ic=Oc("".charAt),Ac=Oc("".replace),jc=Oc("".slice),xc=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,kc=/\$([$&'`]|\d{1,2})/g,Lc=function(e,r,t,n,i,o){var s=t+e.length,c=n.length,a=kc;return void 0!==i&&(i=Sc(i),a=xc),Ac(o,a,(function(o,a){var u;switch(Ic(a,0)){case"$":return"$";case"&":return e;case"`":return jc(r,0,t);case"'":return jc(r,s);case"<":u=i[jc(a,1,-1)];break;default:var l=+a;if(0===l)return o;if(l>c){var f=Rc(l/10);return 0===f?o:f<=c?void 0===n[f-1]?Ic(a,1):n[f-1]+Ic(a,1):o}u=n[l-1]}return void 0===u?"":u}))},Tc=g,_c=Fr,Nc=V,Pc=_,Fc=zs,Cc=TypeError,Dc=function(e,r){var t=e.exec;if(Nc(t)){var n=Tc(t,e,r);return null!==n&&_c(n),n}if("RegExp"===Pc(e))return Tc(Fc,e,r);throw new Cc("RegExp#exec called on incompatible receiver")},Mc=Zs,Gc=g,$c=x,Bc=fc,Uc=f,Xc=Fr,qc=V,Wc=M,Vc=sn,Hc=hn,zc=ds,Yc=B,Kc=wc,Jc=Ie,Qc=Lc,Zc=Dc,ea=ir("replace"),ra=Math.max,ta=Math.min,na=$c([].concat),ia=$c([].push),oa=$c("".indexOf),sa=$c("".slice),ca="$0"==="a".replace(/./,"$0"),aa=!!/./[ea]&&""===/./[ea]("a","$0"),ua=!Uc((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}));Bc("replace",(function(e,r,t){var n=aa?"$":"$0";return[function(e,t){var n=Yc(this),i=Wc(e)?void 0:Jc(e,ea);return i?Gc(i,e,n,t):Gc(r,zc(n),e,t)},function(e,i){var o=Xc(this),s=zc(e);if("string"==typeof i&&-1===oa(i,n)&&-1===oa(i,"$<")){var c=t(r,o,s,i);if(c.done)return c.value}var a=qc(i);a||(i=zc(i));var u,l=o.global;l&&(u=o.unicode,o.lastIndex=0);for(var f,p=[];null!==(f=Zc(o,s))&&(ia(p,f),l);){""===zc(f[0])&&(o.lastIndex=Kc(s,Hc(o.lastIndex),u))}for(var h,d="",v=0,g=0;g=v&&(d+=sa(s,v,E)+y,v=E+m.length)}return d+sa(s,v)}]}),!ua||!ca||aa);var la=z,fa=_,pa=ir("match"),ha=function(e){var r;return la(e)&&(void 0!==(r=e[pa])?!!r:"RegExp"===fa(e))},da=g,va=qe,ga=Q,ya=gs,ma=RegExp.prototype,Ea=function(e){var r=e.flags;return void 0!==r||"flags"in ma||va(e,"flags")||!ga(ma,e)?r:da(ya,e)},ba=ii,wa=g,Oa=x,Sa=B,Ra=V,Ia=M,Aa=ha,ja=ds,xa=Ie,ka=Ea,La=Lc,Ta=ir("replace"),_a=TypeError,Na=Oa("".indexOf);Oa("".replace);var Pa=Oa("".slice),Fa=Math.max,Ca=function(e,r,t){return t>e.length?-1:""===r?t:Na(e,r,t)};ba({target:"String",proto:!0},{replaceAll:function(e,r){var t,n,i,o,s,c,a,u,l=Sa(this),f=0,p=0,h="";if(!Ia(e)){if(Aa(e)&&(t=ja(Sa(ka(e))),!~Na(t,"g")))throw new _a("`.replaceAll` does not allow non-global regexes");if(n=xa(e,Ta))return wa(n,e,l,r)}for(i=ja(l),o=ja(e),(s=Ra(r))||(r=ja(r)),c=o.length,a=Fa(1,c),f=Ca(i,o,0);-1!==f;)u=s?ja(r(o,f,i)):La(o,i,f,[],void 0,r),h+=Pa(i,p,f)+u,p=f+c,f=Ca(i,o,f+a);return po&&pu(i,arguments[o]),i}));f.prototype=u,"Error"!==c?cu?cu(f,l):au(f,l,{name:!0}):du&&i in a&&(uu(f,a,i),uu(f,a,"prepareStackTrace")),au(f,a);try{u.name!==c&&ou(u,"name",c),u.constructor=f}catch(e){}return f}},mu="WebAssembly",Eu=u[mu],bu=7!==new Error("e",{cause:7}).cause,wu=function(e,r){var t={};t[e]=yu(e,r,bu),vu({global:!0,constructor:!0,arity:1,forced:bu},t)},Ou=function(e,r){if(Eu&&Eu[e]){var t={};t[e]=yu(mu+"."+e,r,bu),vu({target:mu,stat:!0,constructor:!0,arity:1,forced:bu},t)}};wu("Error",(function(e){return function(r){return gu(e,this,arguments)}})),wu("EvalError",(function(e){return function(r){return gu(e,this,arguments)}})),wu("RangeError",(function(e){return function(r){return gu(e,this,arguments)}})),wu("ReferenceError",(function(e){return function(r){return gu(e,this,arguments)}})),wu("SyntaxError",(function(e){return function(r){return gu(e,this,arguments)}})),wu("TypeError",(function(e){return function(r){return gu(e,this,arguments)}})),wu("URIError",(function(e){return function(r){return gu(e,this,arguments)}})),Ou("CompileError",(function(e){return function(r){return gu(e,this,arguments)}})),Ou("LinkError",(function(e){return function(r){return gu(e,this,arguments)}})),Ou("RuntimeError",(function(e){return function(r){return gu(e,this,arguments)}}));var Su=Oe,Ru=h,Iu=tc(tc.bind),Au=_,ju=Array.isArray||function(e){return"Array"===Au(e)},xu=x,ku=f,Lu=V,Tu=fs,_u=ut,Nu=function(){},Pu=[],Fu=J("Reflect","construct"),Cu=/^\s*(?:class|function)\b/,Du=xu(Cu.exec),Mu=!Cu.test(Nu),Gu=function(e){if(!Lu(e))return!1;try{return Fu(Nu,Pu,e),!0}catch(e){return!1}},$u=function(e){if(!Lu(e))return!1;switch(Tu(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Mu||!!Du(Cu,_u(e))}catch(e){return!0}};$u.sham=!0;var Bu=!Fu||ku((function(){var e;return Gu(Gu.call)||!Gu(Object)||!Gu((function(){e=!0}))||e}))?$u:Gu,Uu=ju,Xu=Bu,qu=z,Wu=ir("species"),Vu=Array,Hu=function(e){var r;return Uu(e)&&(r=e.constructor,(Xu(r)&&(r===Vu||Uu(r.prototype))||qu(r)&&null===(r=r[Wu]))&&(r=void 0)),void 0===r?Vu:r},zu=function(e,r){return new(Hu(e))(0===r?0:r)},Yu=function(e,r){return Su(e),void 0===r?e:Ru?Iu(e,r):function(){return e.apply(r,arguments)}},Ku=D,Ju=Be,Qu=vn,Zu=zu,el=x([].push),rl=function(e){var r=1===e,t=2===e,n=3===e,i=4===e,o=6===e,s=7===e,c=5===e||o;return function(a,u,l,f){for(var p,h,d=Ju(a),v=Ku(d),g=Qu(v),y=Yu(u,l),m=0,E=f||Zu,b=r?E(a,g):t||s?E(a,0):void 0;g>m;m++)if((c||m in v)&&(h=y(p=v[m],m,d),e))if(r)b[m]=h;else if(h)switch(e){case 3:return!0;case 5:return p;case 6:return m;case 2:el(b,p)}else switch(e){case 4:return!1;case 7:el(b,p)}return o?-1:n||i?i:b}},tl={forEach:rl(0),map:rl(1),filter:rl(2),some:rl(3),every:rl(4),find:rl(5),findIndex:rl(6),filterReject:rl(7)},nl=f,il=se,ol=ir("species"),sl=function(e){return il>=51||!nl((function(){var r=[];return(r.constructor={})[ol]=function(){return{foo:1}},1!==r[e](Boolean).foo}))},cl=tl.map;ii({target:"Array",proto:!0,forced:!sl("map")},{map:function(e){return cl(this,e,arguments.length>1?arguments[1]:void 0)}});var al,ul,ll=ii,fl=g,pl=V,hl=Fr,dl=ds,vl=(al=!1,(ul=/[ac]/).exec=function(){return al=!0,/./.exec.apply(this,arguments)},!0===ul.test("abc")&&al),gl=/./.test;ll({target:"RegExp",proto:!0,forced:!vl},{test:function(e){var r=hl(this),t=dl(e),n=r.exec;if(!pl(n))return fl(gl,r,t);var i=fl(n,r,t);return null!==i&&(hl(i),!0)}});var yl=g,ml=Fr,El=M,bl=hn,wl=ds,Ol=B,Sl=Ie,Rl=wc,Il=Dc;fc("match",(function(e,r,t){return[function(r){var t=Ol(this),n=El(r)?void 0:Sl(r,e);return n?yl(n,r,t):new RegExp(r)[e](wl(t))},function(e){var n=ml(this),i=wl(e),o=t(r,n,i);if(o.done)return o.value;if(!n.global)return Il(n,i);var s=n.unicode;n.lastIndex=0;for(var c,a=[],u=0;null!==(c=Il(n,i));){var l=wl(c[0]);a[u]=l,""===l&&(n.lastIndex=Rl(i,bl(n.lastIndex),s)),u++}return 0===u?null:a}]}));var Al=zt,jl=Lr,xl=function(e,r,t){return t.get&&Al(t.get,r,{getter:!0}),t.set&&Al(t.set,r,{setter:!0}),jl.f(e,r,t)},kl=J,Ll=xl,Tl=p,_l=ir("species"),Nl=p,Pl=u,Fl=x,Cl=Kn,Dl=Ua,Ml=Yr,Gl=Ci,$l=en.f,Bl=Q,Ul=ha,Xl=ds,ql=Ea,Wl=Os,Vl=Ma,Hl=Zt,zl=f,Yl=qe,Kl=Lt.enforce,Jl=function(e){var r=kl(e);Tl&&r&&!r[_l]&&Ll(r,_l,{configurable:!0,get:function(){return this}})},Ql=Is,Zl=xs,ef=ir("match"),rf=Pl.RegExp,tf=rf.prototype,nf=Pl.SyntaxError,of=Fl(tf.exec),sf=Fl("".charAt),cf=Fl("".replace),af=Fl("".indexOf),uf=Fl("".slice),lf=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,ff=/a/g,pf=/a/g,hf=new rf(ff)!==ff,df=Wl.MISSED_STICKY,vf=Wl.UNSUPPORTED_Y,gf=Nl&&(!hf||df||Ql||Zl||zl((function(){return pf[ef]=!1,rf(ff)!==ff||rf(pf)===pf||"/a/i"!==String(rf(ff,"i"))})));if(Cl("RegExp",gf)){for(var yf=function(e,r){var t,n,i,o,s,c,a=Bl(tf,this),u=Ul(e),l=void 0===r,f=[],p=e;if(!a&&u&&l&&e.constructor===yf)return e;if((u||Bl(tf,e))&&(e=e.source,l&&(r=ql(p))),e=void 0===e?"":Xl(e),r=void 0===r?"":Xl(r),p=e,Ql&&"dotAll"in ff&&(n=!!r&&af(r,"s")>-1)&&(r=cf(r,/s/g,"")),t=r,df&&"sticky"in ff&&(i=!!r&&af(r,"y")>-1)&&vf&&(r=cf(r,/y/g,"")),Zl&&(o=function(e){for(var r,t=e.length,n=0,i="",o=[],s=Gl(null),c=!1,a=!1,u=0,l="";n<=t;n++){if("\\"===(r=sf(e,n)))r+=sf(e,++n);else if("]"===r)c=!1;else if(!c)switch(!0){case"["===r:c=!0;break;case"("===r:of(lf,uf(e,n+1))&&(n+=2,a=!0),i+=r,u++;continue;case">"===r&&a:if(""===l||Yl(s,l))throw new nf("Invalid capture group name");s[l]=!0,o[o.length]=[l,u],a=!1,l="";continue}a?l+=r:i+=r}return[i,o]}(e),e=o[0],f=o[1]),s=Dl(rf(e,r),a?this:tf,yf),(n||i||f.length)&&(c=Kl(s),n&&(c.dotAll=!0,c.raw=yf(function(e){for(var r,t=e.length,n=0,i="",o=!1;n<=t;n++)"\\"!==(r=sf(e,n))?o||"."!==r?("["===r?o=!0:"]"===r&&(o=!1),i+=r):i+="[\\s\\S]":i+=r+sf(e,++n);return i}(e),t)),i&&(c.sticky=!0),f.length&&(c.groups=f)),e!==p)try{Ml(s,"source",""===p?"(?:)":p)}catch(e){}return s},mf=$l(rf),Ef=0;mf.length>Ef;)Vl(yf,rf,mf[Ef++]);tf.constructor=yf,yf.prototype=tf,Hl(Pl,"RegExp",yf,{constructor:!0})}Jl("RegExp");var bf=p,wf=Is,Of=_,Sf=xl,Rf=Lt.get,If=RegExp.prototype,Af=TypeError;bf&&wf&&Sf(If,"dotAll",{configurable:!0,get:function(){if(this!==If){if("RegExp"===Of(this))return!!Rf(this).dotAll;throw new Af("Incompatible receiver, RegExp required")}}});var jf="\t\n\v\f\r                 \u2028\u2029\ufeff",xf=B,kf=ds,Lf=jf,Tf=x("".replace),_f=RegExp("^["+Lf+"]+"),Nf=RegExp("(^|[^"+Lf+"])["+Lf+"]+$"),Pf=function(e){return function(r){var t=kf(xf(r));return 1&e&&(t=Tf(t,_f,"")),2&e&&(t=Tf(t,Nf,"$1")),t}},Ff={start:Pf(1),end:Pf(2),trim:Pf(3)},Cf=tt.PROPER,Df=f,Mf=jf,Gf=function(e){return Df((function(){return!!Mf[e]()||"​…᠎"!=="​…᠎"[e]()||Cf&&Mf[e].name!==e}))},$f=Ff.trim;ii({target:"String",proto:!0,forced:Gf("trim")},{trim:function(){return $f(this)}});var Bf=x([].slice),Uf=ju,Xf=V,qf=_,Wf=ds,Vf=x([].push),Hf=ii,zf=J,Yf=Zs,Kf=g,Jf=x,Qf=f,Zf=V,ep=ge,rp=Bf,tp=function(e){if(Xf(e))return e;if(Uf(e)){for(var r=e.length,t=[],n=0;n1?arguments[1]:void 0;return Up?Bp(this,e,r)||0:Gp(this,e,r)}});var Xp=p,qp=ju,Wp=TypeError,Vp=Object.getOwnPropertyDescriptor,Hp=Xp&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,r){if(qp(e)&&!Vp(e,"length").writable)throw new Wp("Cannot set read only .length");return e.length=r}:function(e,r){return e.length=r},zp=TypeError,Yp=function(e){if(e>9007199254740991)throw zp("Maximum allowed index exceeded");return e},Kp=Be,Jp=vn,Qp=Hp,Zp=Yp;ii({target:"Array",proto:!0,arity:1,forced:f((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var r=Kp(this),t=Jp(r),n=arguments.length;Zp(t+n);for(var i=0;i=51||!rh((function(){var e=[];return e[fh]=!1,e.concat()[0]!==e})),hh=function(e){if(!nh(e))return!1;var r=e[fh];return void 0!==r?!!r:th(e)};eh({target:"Array",proto:!0,arity:1,forced:!ph||!uh("concat")},{concat:function(e){var r,t,n,i,o,s=ih(this),c=ah(s,0),a=0;for(r=-1,n=arguments.length;r=r.length)return t&&(t[h]=r),o(null,r);c.lastIndex=u;var e=c.exec(r);return p=l,l+=e[0],f=p+e[1],u=c.lastIndex,v[f]||t&&t[f]===f?process.nextTick(y):t&&Object.prototype.hasOwnProperty.call(t,f)?b(t[f]):i.lstat(f,m)}function m(e,r){if(e)return o(e);if(!r.isSymbolicLink())return v[f]=!0,t&&(t[f]=f),process.nextTick(y);if(!n){var s=r.dev.toString(32)+":"+r.ino.toString(32);if(d.hasOwnProperty(s))return E(null,d[s],f)}i.stat(f,(function(e){if(e)return o(e);i.readlink(f,(function(e,r){n||(d[s]=r),E(e,r)}))}))}function E(r,n,i){if(r)return o(r);var s=e.resolve(p,n);t&&(t[i]=s),b(s)}function b(t){r=e.resolve(t,r.slice(u)),g()}g()},Ah}function xh(){if(Rh)return Sh;Rh=1,Sh=a,a.realpath=a,a.sync=u,a.realpathSync=u,a.monkeypatch=function(){e.realpath=a,e.realpathSync=u},a.unmonkeypatch=function(){e.realpath=t,e.realpathSync=n};var e=r,t=e.realpath,n=e.realpathSync,i=process.version,o=/^v[0-5]\./.test(i),s=jh();function c(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function a(e,r,n){if(o)return t(e,r,n);"function"==typeof r&&(n=r,r=null),t(e,r,(function(t,i){c(t)?s.realpath(e,r,n):n(t,i)}))}function u(e,r){if(o)return n(e,r);try{return n(e,r)}catch(t){if(c(t))return s.realpathSync(e,r);throw t}}return Sh}var kh=tl.filter;ii({target:"Array",proto:!0,forced:!sl("filter")},{filter:function(e){return kh(this,e,arguments.length>1?arguments[1]:void 0)}});var Lh,Th,_h,Nh,Ph,Fh,Ch,Dh,Mh=Bu,Gh=me,$h=TypeError,Bh=Fr,Uh=function(e){if(Mh(e))return e;throw new $h(Gh(e)+" is not a constructor")},Xh=M,qh=ir("species"),Wh=Zs,Vh=g,Hh=x,zh=fc,Yh=Fr,Kh=M,Jh=ha,Qh=B,Zh=function(e,r){var t,n=Bh(e).constructor;return void 0===n||Xh(t=Bh(n)[qh])?r:Uh(t)},ed=wc,rd=hn,td=ds,nd=Ie,id=Bf,od=Dc,sd=zs,cd=f,ad=Os.UNSUPPORTED_Y,ud=4294967295,ld=Math.min,fd=[].push,pd=Hh(/./.exec),hd=Hh(fd),dd=Hh("".slice),vd=!cd((function(){var e=/(?:)/,r=e.exec;e.exec=function(){return r.apply(this,arguments)};var t="ab".split(e);return 2!==t.length||"a"!==t[0]||"b"!==t[1]}));function gd(){if(Th)return Lh;Th=1,Lh=function(r,t){for(var n=[],i=0;i=0&&u>0){for(n=[],o=t.length;l>=0&&!c;)l==a?(n.push(l),a=t.indexOf(e,l+1)):1==n.length?c=[n.pop(),u]:((i=n.pop())=0?a:u;n.length&&(c=[o,s])}return c}return Nh=1,_h=e,e.range=t,_h}();Ph=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return d(function(e){return e.split("\\\\").join(t).split("\\{").join(n).split("\\}").join(i).split("\\,").join(o).split("\\.").join(s)}(e),!0).map(a)};var t="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function c(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function a(e){return e.split(t).join("\\").split(n).join("{").split(i).join("}").split(o).join(",").split(s).join(".")}function u(e){if(!e)return[""];var t=[],n=r("{","}",e);if(!n)return e.split(",");var i=n.pre,o=n.body,s=n.post,c=i.split(",");c[c.length-1]+="{"+o+"}";var a=u(s);return s.length&&(c[c.length-1]+=a.shift(),c.push.apply(c,a)),t.push.apply(t,c),t}function l(e){return"{"+e+"}"}function f(e){return/^-?0\d/.test(e)}function p(e,r){return e<=r}function h(e,r){return e>=r}function d(t,n){var o=[],s=r("{","}",t);if(!s||/\$$/.test(s.pre))return[t];var a,v=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),y=v||g,m=s.body.indexOf(",")>=0;if(!y&&!m)return s.post.match(/,.*\}/)?d(t=s.pre+"{"+s.body+i+s.post):[t];if(y)a=s.body.split(/\.\./);else if(1===(a=u(s.body)).length&&1===(a=d(a[0],!1).map(l)).length)return(w=s.post.length?d(s.post,!1):[""]).map((function(e){return s.pre+a[0]+e}));var E,b=s.pre,w=s.post.length?d(s.post,!1):[""];if(y){var O=c(a[0]),S=c(a[1]),R=Math.max(a[0].length,a[1].length),I=3==a.length?Math.abs(c(a[2])):1,A=p;S0){var T=new Array(L+1).join("0");k=x<0?"-"+T+k.slice(1):T+k}}E.push(k)}}else E=e(a,(function(e){return d(e,!1)}));for(var _=0;_65536)throw new TypeError("pattern is too long")};l.prototype.parse=function(e,t){p(e);var c=this.options;if("**"===e){if(!c.noglobstar)return r;e="*"}if(""===e)return"";var a,u="",l=!!c.nocase,f=!1,d=[],v=[],g=!1,y=-1,m=-1,E="."===e.charAt(0)?"":c.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",b=this;function w(){if(a){switch(a){case"*":u+=o,l=!0;break;case"?":u+=i,l=!0;break;default:u+="\\"+a}b.debug("clearStateChar %j %j",a,u),a=!1}}for(var O,S=0,R=e.length;S-1;T--){var _=v[T],N=u.slice(0,_.reStart),P=u.slice(_.reStart,_.reEnd-8),F=u.slice(_.reEnd-8,_.reEnd),C=u.slice(_.reEnd);F+=C;var D=N.split("(").length-1,M=C;for(S=0;S=0&&!(i=r[o]);o--);for(o=0;o>> no match, partial?",e,p,t,h),p!==c))}if("string"==typeof l?(u=f===l,this.debug("string match",l,f,u)):(u=f.match(l),this.debug("pattern match",l,f,u)),!u)return!1}if(o===c&&s===a)return!0;if(o===c)return n;if(s===a)return o===c-1&&""===e[o];throw new Error("wtf?")},Ch}zh("split",(function(e,r,t){var n;return n="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var n=td(Qh(this)),i=void 0===t?ud:t>>>0;if(0===i)return[];if(void 0===e)return[n];if(!Jh(e))return Vh(r,n,e,i);for(var o,s,c,a=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=new RegExp(e.source,u+"g");(o=Vh(sd,f,n))&&!((s=f.lastIndex)>l&&(hd(a,dd(n,l,o.index)),o.length>1&&o.index=i));)f.lastIndex===o.index&&f.lastIndex++;return l===n.length?!c&&pd(f,"")||hd(a,""):hd(a,dd(n,l)),a.length>i?id(a,0,i):a}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:Vh(r,this,e,t)}:r,[function(r,t){var i=Qh(this),o=Kh(r)?void 0:nd(r,e);return o?Vh(o,r,i,t):Vh(n,td(i),r,t)},function(e,i){var o=Yh(this),s=td(e),c=t(n,o,s,i,n!==r);if(c.done)return c.value;var a=Zh(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(ad?"g":"y"),f=new a(ad?"^(?:"+o.source+")":o,l),p=void 0===i?ud:i>>>0;if(0===p)return[];if(0===s.length)return null===od(f,s)?[s]:[];for(var h=0,d=0,v=[];d0;)e[i]=e[--i];i!==o++&&(e[i]=n)}else for(var s=xd(t/2),c=kd(jd(e,0,s),r),a=kd(jd(e,s),r),u=c.length,l=a.length,f=0,p=0;f3)){if(Hd)return!0;if(Yd)return Yd<603;var e,r,t,n,i="";for(e=65;e<76;e++){switch(r=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(n=0;n<47;n++)Kd.push({k:r+n,v:t})}for(Kd.sort((function(e,r){return r.v-e.v})),n=0;nUd(t)?1:-1}}(e)),t=$d(i),n=0;nu-n+t;o--)Ev(a,o-1)}else if(t>n)for(o=u-n;o>l;o--)c=o+t-1,(s=o+n-1)in a?a[c]=a[s]:Ev(a,c);for(o=0;oi?(n.splice(0,i),process.nextTick((function(){t.apply(null,o)}))):delete r[e]}}))}(e))})),Iv}function Bv(){if(xv)return jv;xv=1,jv=m;var e=xh(),r=md();r.Minimatch;var o=Sd(),s=n.EventEmitter,c=t,a=i,u=Ad(),l=function(){if(ov)return iv;ov=1,iv=p,p.GlobSync=h;var e=xh(),r=md();r.Minimatch,Bv().Glob;var n=t,o=i,s=Ad(),c=cv(),a=c.setopts,u=c.ownProp,l=c.childrenIgnored,f=c.isIgnored;function p(e,r){if("function"==typeof r||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new h(e,r).found}function h(e,r){if(!e)throw new Error("must provide pattern");if("function"==typeof r||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof h))return new h(e,r);if(a(this,e,r),this.noprocess)return this;var t=this.minimatch.set.length;this.matches=new Array(t);for(var n=0;nthis.maxLength)return!1;if(!this.stat&&u(this.cache,r)){var n=this.cache[r];if(Array.isArray(n)&&(n="DIR"),!t||"DIR"===n)return n;if(t&&"FILE"===n)return!1}var i=this.statCache[r];if(!i){var o;try{o=this.fs.lstatSync(r)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[r]=!1,!1}if(o&&o.isSymbolicLink())try{i=this.fs.statSync(r)}catch(e){i=o}else i=o}return this.statCache[r]=i,n=!0,i&&(n=i.isDirectory()?"DIR":"FILE"),this.cache[r]=this.cache[r]||n,(!t||"FILE"!==n)&&n},h.prototype._mark=function(e){return c.mark(this,e)},h.prototype._makeAbs=function(e){return c.makeAbs(this,e)},iv}(),f=cv(),p=f.setopts,h=f.ownProp,d=$v(),v=f.childrenIgnored,g=f.isIgnored,y=Gv();function m(e,r,t){if("function"==typeof r&&(t=r,r={}),r||(r={}),r.sync){if(t)throw new TypeError("callback provided to sync glob");return l(e,r)}return new b(e,r,t)}m.sync=l;var E=m.GlobSync=l.GlobSync;function b(e,r,t){if("function"==typeof r&&(t=r,r=null),r&&r.sync){if(t)throw new TypeError("callback provided to sync glob");return new E(e,r)}if(!(this instanceof b))return new b(e,r,t);p(this,e,r),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),"function"==typeof t&&(t=y(t),this.on("error",t),this.on("end",(function(e){t(null,e)})));var i=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===n)return c();for(var o=!0,s=0;s1)return!0;for(var i=0;ithis.maxLength)return r();if(!this.stat&&h(this.cache,t)){var i=this.cache[t];if(Array.isArray(i)&&(i="DIR"),!n||"DIR"===i)return r(null,i);if(n&&"FILE"===i)return r()}var o=this.statCache[t];if(void 0!==o){if(!1===o)return r(null,o);var s=o.isDirectory()?"DIR":"FILE";return n&&"FILE"===s?r():r(null,s,o)}var c=this,a=d("stat\0"+t,(function(n,i){if(i&&i.isSymbolicLink())return c.fs.stat(t,(function(n,o){n?c._stat2(e,t,null,i,r):c._stat2(e,t,n,o,r)}));c._stat2(e,t,n,i,r)}));a&&c.fs.lstat(t,a)},b.prototype._stat2=function(e,r,t,n,i){if(t&&("ENOENT"===t.code||"ENOTDIR"===t.code))return this.statCache[r]=!1,i();var o="/"===e.slice(-1);if(this.statCache[r]=n,"/"===r.slice(-1)&&n&&!n.isDirectory())return i(null,!1,n);var s=!0;return n&&(s=n.isDirectory()?"DIR":"FILE"),this.cache[r]=this.cache[r]||s,o&&"FILE"===s?i():i(null,s,n)},jv}function Uv(){if(kv)return Ih;kv=1;var t=e,n=r,i=Bv(),o=Ly(),s=Object.create(o);Ih.extend=Object.assign;var c=Boolean(process.versions.electron),a={fatal:!1,globOptions:{},maxdepth:255,noglob:!1,silent:!1,verbose:!1,execPath:null,bufLength:65536},u={reset:function(){Object.assign(this,a),c||(this.execPath=process.execPath)},resetForTesting:function(){this.reset(),this.silent=!0}};u.reset(),Ih.config=u;var l={error:null,errorCode:0,currentCmd:"shell.js"};function f(e){return"object"==typeof e&&null!==e}function p(){u.silent||console.error.apply(console,arguments)}function h(e){if("string"!=typeof e)throw new TypeError("input must be a string");return e.replace(/\\/g,"/")}function d(e,r,t){if("string"!=typeof e)throw new Error("msg must be a string");var n={continue:!1,code:1,prefix:l.currentCmd+": ",silent:!1};"number"==typeof r&&f(t)?t.code=r:f(r)?t=r:"number"==typeof r?t={code:r}:"number"!=typeof r&&(t={}),t=Object.assign({},n,t),l.errorCode||(l.errorCode=t.code);var i=h(t.prefix+e);if(l.error=l.error?l.error+"\n":"",l.error+=i,u.fatal)throw new Error(i);if(e.length>0&&!t.silent&&p(i),!t.continue)throw{msg:"earlyExit",retValue:new v("",l.error,l.errorCode)}}function v(e,r,t){var n;return e instanceof Array?((n=e).stdout=e.join("\n"),e.length>0&&(n.stdout+="\n")):(n=new String(e)).stdout=e,n.stderr=r,n.code=t,w.forEach((function(e){n[e]=s[e].bind(n)})),n}function g(e,r,t){if("string"!=typeof e&&!f(e))throw new Error("options must be strings or key-value pairs");if(!f(r))throw new Error("parseOptions() internal error: map must be an object");if(t&&!f(t))throw new Error("parseOptions() internal error: errorOptions must be object");if("--"===e)return{};var n={};if(Object.keys(r).forEach((function(e){var t=r[e];"!"!==t[0]&&(n[t]=!1)})),""===e)return n;if("string"==typeof e){if("-"!==e[0])throw new Error("Options string must start with a '-'");e.slice(1).split("").forEach((function(e){if(e in r){var i=r[e];"!"===i[0]?n[i.slice(1)]=!1:n[i]=!0}else d("option not recognized: "+e,t||{})}))}else Object.keys(e).forEach((function(i){var o=i[1];if(o in r){var s=r[o];n[s]=e[i]}else d("option not recognized: "+o,t||{})}));return n}function y(e){if(!Array.isArray(e))throw new TypeError("must be an array");var r=[];return e.forEach((function(e){if("string"!=typeof e)r.push(e);else{var t;try{t=(t=i.sync(e,u.globOptions)).length>0?t:[e]}catch(r){t=[e]}r=r.concat(t)}})),r}Ih.state=l,delete process.env.OLDPWD,Ih.isObject=f,Ih.log=p,Ih.convertErrorOutput=h,Ih.error=d,Ih.ShellString=v,Ih.parseOptions=g,Ih.expand=y;var m="function"==typeof Buffer.alloc?function(e){return Buffer.alloc(e||u.bufLength)}:function(e){return new Buffer(e||u.bufLength)};function E(e,r,n){return n=n||{},function(){var i=null;l.currentCmd=e,l.error=null,l.errorCode=0;try{var o=[].slice.call(arguments,0);if(u.verbose&&console.error.apply(console,[e].concat(o)),l.pipedValue=this&&"string"==typeof this.stdout?this.stdout:"",!1===n.unix)i=r.apply(this,o);else{f(o[0])&&"Object"===o[0].constructor.name||(0===o.length||"string"!=typeof o[0]||o[0].length<=1||"-"!==o[0][0])&&o.unshift(""),o=(o=o.reduce((function(e,r){return Array.isArray(r)?e.concat(r):(e.push(r),e)}),[])).map((function(e){return f(e)&&"String"===e.constructor.name?e.toString():e}));var s=t.homedir();o=o.map((function(e){return"string"==typeof e&&"~/"===e.slice(0,2)||"~"===e?e.replace(/^~/,s):e})),u.noglob||!0!==n.allowGlobbing||(o=o.slice(0,n.globStart).concat(y(o.slice(n.globStart))));try{f(n.cmdOptions)&&(o[0]=g(o[0],n.cmdOptions)),i=r.apply(this,o)}catch(e){if("earlyExit"!==e.msg)throw e;i=e.retValue}}}catch(e){if(!l.error)throw e.name="ShellJSInternalError",e;if(u.fatal)throw e}return n.wrapOutput&&("string"==typeof i||Array.isArray(i))&&(i=new v(i,l.error,l.errorCode)),l.currentCmd="shell.js",i}}Ih.buffer=m,Ih.unlinkSync=function(e){try{n.unlinkSync(e)}catch(r){if("EPERM"!==r.code)throw r;n.chmodSync(e,"0666"),n.unlinkSync(e)}},Ih.statFollowLinks=function(){return n.statSync.apply(n,arguments)},Ih.statNoFollowLinks=function(){return n.lstatSync.apply(n,arguments)},Ih.randomFileName=function(){return"shelljs_"+function e(r){if(1===r)return parseInt(16*Math.random(),10).toString(16);for(var t="",n=0;n0&&"-"===e.charAt(0)?[].unshift.call(arguments,""):n.error("You must specify a file.")),e=n.parseOptions(e,{R:"recursive",c:"changes",v:"verbose"}),t=[].slice.call(arguments,2),e.recursive?(c=[],t.forEach((function e(r){var t=n.statNoFollowLinks(r);t.isSymbolicLink()||(c.push(r),t.isDirectory()&&i.readdirSync(r).forEach((function(t){e(r+"/"+t)})))}))):c=t,c.forEach((function(t){if(t=o.resolve(t),i.existsSync(t)||n.error("File not found: "+t),!e.recursive||!n.statNoFollowLinks(t).isSymbolicLink()){var c=n.statFollowLinks(t),a=c.isDirectory(),u=c.mode,l=u&s.TYPE_MASK,f=u;isNaN(parseInt(r,8))?r.split(",").forEach((function(r){var o=/([ugoa]*)([=\+-])([rwxXst]*)/i.exec(r);if(o){var c=o[1],p=o[2],h=o[3],d=-1!==c.indexOf("u")||"a"===c||""===c,v=-1!==c.indexOf("g")||"a"===c||""===c,g=-1!==c.indexOf("o")||"a"===c||""===c,y=-1!==h.indexOf("r"),m=-1!==h.indexOf("w"),E=-1!==h.indexOf("x"),b=-1!==h.indexOf("X"),w=-1!==h.indexOf("t"),O=-1!==h.indexOf("s");b&&a&&(E=!0);var S=0;switch(d&&(S|=(y?s.OWNER_READ:0)+(m?s.OWNER_WRITE:0)+(E?s.OWNER_EXEC:0)+(O?s.SETUID:0)),v&&(S|=(y?s.GROUP_READ:0)+(m?s.GROUP_WRITE:0)+(E?s.GROUP_EXEC:0)+(O?s.SETGID:0)),g&&(S|=(y?s.OTHER_READ:0)+(m?s.OTHER_WRITE:0)+(E?s.OTHER_EXEC:0)),w&&(S|=s.STICKY),p){case"+":f|=S;break;case"-":f&=~S;break;case"=":f=l+S,n.statFollowLinks(t).isDirectory()&&(f|=s.SETUID+s.SETGID&u);break;default:n.error("Could not recognize operator: `"+p+"`")}e.verbose&&console.log(t+" -> "+f.toString(8)),u!==f&&(!e.verbose&&e.changes&&console.log(t+" -> "+f.toString(8)),i.chmodSync(t,f),u=f)}else n.error("Invalid symbolic mode change: "+r)})):(f=l+parseInt(r,8),n.statFollowLinks(t).isDirectory()&&(f|=s.SETUID+s.SETGID&u),i.chmodSync(t,f))}})),""}return n.register("chmod",c,{}),Pv=c}function Vv(){if(Dv)return Cv;Dv=1;var e=r,n=t,i=Uv();function o(r,t,n){e.existsSync(r)||i.error("copyFileSync: no such file or directory: "+r);var o="win32"===process.platform;try{if(n.update&&i.statFollowLinks(r).mtime=i.config.maxdepth)){n++;var u="win32"===process.platform;try{e.mkdirSync(t)}catch(e){if("EEXIST"!==e.code)throw e}for(var l=e.readdirSync(r),f=0;f and/or "):(t=[].slice.call(arguments,1,arguments.length-1),c=arguments[arguments.length-1]);var a=e.existsSync(c),u=a&&i.statFollowLinks(c);return a&&u.isDirectory()||!(t.length>1)||i.error("dest is not a directory (too many sources)"),a&&u.isFile()&&r.no_force?new i.ShellString("","",0):(t.forEach((function(a,l){if(!e.existsSync(a))return""===a&&(a="''"),void i.error("no such file or directory: "+a,{continue:!0});var f=i.statFollowLinks(a);if(!r.noFollowsymlink&&f.isDirectory())if(r.recursive){var p=u&&u.isDirectory()?n.join(c,n.basename(a)):c;try{i.statFollowLinks(n.dirname(c)),s(a,p,0,{no_force:r.no_force,followsymlink:r.followsymlink})}catch(e){i.error("cannot create directory '"+c+"': No such file or directory")}}else i.error("omitting directory '"+a+"'",{continue:!0});else{var h=c;u&&u.isDirectory()&&(h=n.normalize(c+"/"+n.basename(a)));var d=e.existsSync(h);if(d&&function(e,r){var t=e[r];return e.slice(0,r).some((function(e){return n.basename(e)===n.basename(t)}))}(t,l))return void(r.no_force||i.error("will not overwrite just-created '"+h+"' with '"+a+"'",{continue:!0}));if(d&&r.no_force)return;if(""===n.relative(a,h))return void i.error("'"+h+"' and '"+a+"' are the same file",{continue:!0});o(a,h,r)}})),new i.ShellString("",i.state.error,i.state.errorCode))}return i.register("cp",a,{cmdOptions:{f:"!no_force",n:"no_force",u:"update",R:"recursive",r:"recursive",L:"followsymlink",P:"noFollowsymlink"},wrapOutput:!1}),Cv=a}var Hv,zv,Yv,Kv,Jv,Qv={};function Zv(){if(Hv)return Qv;Hv=1;var e=Uv(),r=qv(),n=t;e.register("dirs",l,{wrapOutput:!1}),e.register("pushd",a,{wrapOutput:!1}),e.register("popd",u,{wrapOutput:!1});var i=[];function o(e){return/^[\-+]\d+$/.test(e)}function s(r){if(o(r)){if(Math.abs(r)1))return e.error("no other directory");u=u.splice(1,1).concat(u)}return t["no-cd"]?u=u.slice(1):(a=n.resolve(u.shift()),r("",a)),i=u,l(t.quiet?"-q":"")}function u(t,c){if(o(t)&&(c=t,t=""),t=e.parseOptions(t,{n:"no-cd",q:"quiet"}),!i.length)return e.error("directory stack empty");if(c=s(c||"+0"),t["no-cd"]||c>0||i.length+c===0)c=c>0?c-1:c,i.splice(c,1);else{var a=n.resolve(i.shift());r("",a)}return l(t.quiet?"-q":"")}function l(r,t){if(o(r)&&(t=r,r=""),(r=e.parseOptions(r,{c:"clear",q:"quiet"})).clear)return i=[];var n=c();return t?((t=s(t))<0&&(t=n.length+t),r.quiet||e.log(n[t]),n[t]):(r.quiet||e.log(n.join(" ")),n)}return Qv.pushd=a,Qv.popd=u,Qv.dirs=l,Qv}function eg(){if(Yv)return zv;Yv=1;var e=o.format,r=Uv();function t(t){var n=[].slice.call(arguments,t?0:1),i={};try{i=r.parseOptions(n[0],{e:"escapes",n:"no_newline"},{silent:!0}),n[0]&&n.shift()}catch(e){r.state.error=null}var o=e.apply(null,n);return i.no_newline||(o+="\n"),process.stdout.write(o),o}return r.register("echo",t,{allowGlobbing:!1}),zv=t}function rg(){if(Jv)return Kv;Jv=1;var e=Uv();return Kv=function(){return e.state.error}}var tg,ng={exports:{}};function ig(){return tg||(tg=1,function(e){if(require.main!==e)throw new Error("This file should not be required");var t=s,n=r,i=process.argv[2],o=n.readFileSync(i,"utf8"),c=JSON.parse(o),a=c.command,u=c.execOptions,l=c.pipe,f=c.stdoutFile,p=c.stderrFile,h=t.exec(a,u,(function(e){e?void 0===e.code?process.exitCode=1:process.exitCode=e.code:process.exitCode=0})),d=n.createWriteStream(f),v=n.createWriteStream(p);h.stdout.pipe(d),h.stderr.pipe(v),h.stdout.pipe(process.stdout),h.stderr.pipe(process.stderr),l&&h.stdin.end(l)}(ng)),ng.exports}ng.exports;var og,sg,cg,ag,ug,lg,fg,pg,hg,dg,vg,gg,yg,mg,Eg,bg,wg,Og,Sg,Rg,Ig,Ag={};function jg(){if(og)return Ag;og=1;var t,n=Uv(),i=e,o=r;function s(e){if(!e||!o.existsSync(e))return!1;if(!n.statFollowLinks(e).isDirectory())return!1;var r=e+"/"+n.randomFileName();try{return o.writeFileSync(r," "),n.unlinkSync(r),e}catch(e){return!1}}function c(){return t||(t=s(i.tmpdir())||s(process.env.TMPDIR)||s(process.env.TEMP)||s(process.env.TMP)||s(process.env.Wimp$ScrapDir)||s("C:\\TEMP")||s("C:\\TMP")||s("\\TEMP")||s("\\TMP")||s("/tmp")||s("/var/tmp")||s("/usr/tmp")||s("."))}return n.register("tempdir",c,{allowGlobbing:!1,wrapOutput:!1}),Ag.tempDir=c,Ag.isCached=function(){return t},Ag.clearCache=function(){t=void 0},Ag}function xg(){if(cg)return sg;cg=1;var e=t;function r(){return e.resolve(process.cwd())}return Uv().register("pwd",r,{allowGlobbing:!1}),sg=r}function kg(){if(ug)return ag;ug=1;var e=Uv(),n=jg().tempDir,i=xg(),o=t,c=r,a=s,u=20971520,l=1;function f(r,t,s){t=t||{},r||e.error("must specify command");var f=e.readFromPipe();return"function"==typeof t&&(s=t,t={async:!0}),"object"==typeof t&&"function"==typeof s&&(t.async=!0),(t=e.extend({silent:e.config.silent,async:!1},t)).async?function(r,t,n,o){t=e.extend({silent:e.config.silent,cwd:i().toString(),env:process.env,maxBuffer:u,encoding:"utf8"},t);var s=a.exec(r,t,(function(e,r,t){o&&(e?void 0===e.code?o(1,r,t):o(e.code,r,t):o(0,r,t))}));return n&&s.stdin.end(n),t.silent||(s.stdout.pipe(process.stdout),s.stderr.pipe(process.stderr)),s}(r,t,f,s):function(r,t,s){e.config.execPath||e.error("Unable to find a path to the node binary. Please manually set config.execPath");var f=n(),p=o.resolve(f+"/"+e.randomFileName()),h=o.resolve(f+"/"+e.randomFileName()),d=o.resolve(f+"/"+e.randomFileName());t=e.extend({silent:e.config.silent,cwd:i().toString(),env:process.env,maxBuffer:u,encoding:"utf8"},t),c.existsSync(p)&&e.unlinkSync(p),c.existsSync(h)&&e.unlinkSync(h),c.existsSync(d)&&e.unlinkSync(d),t.cwd=o.resolve(t.cwd);var v={command:r,execOptions:t,pipe:s,stdoutFile:d,stderrFile:h};function g(e,r){c.writeFileSync(e,r,{encoding:"utf8",mode:parseInt("600",8)})}g(d,""),g(h,""),g(p,JSON.stringify(v));var y=[o.join(__dirname,"exec-child.js"),p];t.silent?t.stdio="ignore":t.stdio=[0,1,2];var m=0;try{delete t.shell,a.execFileSync(e.config.execPath,y,t)}catch(e){m=e.status||l}var E="",b="";"buffer"===t.encoding?(E=c.readFileSync(d),b=c.readFileSync(h)):(E=c.readFileSync(d,t.encoding),b=c.readFileSync(h,t.encoding));try{e.unlinkSync(p)}catch(e){}try{e.unlinkSync(h)}catch(e){}try{e.unlinkSync(d)}catch(e){}return 0!==m&&e.error(b,m,{continue:!0,silent:!0}),e.ShellString(E,b,m)}(r,t,f)}return e.register("exec",f,{unix:!1,canReceivePipe:!0,wrapOutput:!1}),ag=f}function Lg(){if(fg)return lg;fg=1;var e=t,n=r,i=Uv(),o=Bv(),s=e.sep+"**";function c(r,t){r.all_deprecated&&(i.log("ls: Option -a is deprecated. Use -A instead"),r.all=!0),t=t?[].slice.call(arguments,1):["."];var c=[];function a(e,t,n){var o,s;"win32"===process.platform&&(t=t.replace(/\\/g,"/")),r.long?(n=n||(r.link?i.statFollowLinks(e):i.statNoFollowLinks(e)),c.push((o=t,(s=n).name=o,s.toString=function(){return[this.mode,this.nlink,this.uid,this.gid,this.size,this.mtime,this.name].join(" ")},s))):c.push(t)}return t.forEach((function(t){var c;try{if((c=r.link?i.statFollowLinks(t):i.statNoFollowLinks(t)).isSymbolicLink())try{var u=i.statFollowLinks(t);u.isDirectory()&&(c=u)}catch(e){}}catch(e){return void i.error("no such file or directory: "+t,2,{continue:!0})}c.isDirectory()&&!r.directory?r.recursive?o.sync(t+s,{dot:r.all,follow:r.link}).forEach((function(r){e.relative(t,r)&&a(r,e.relative(t,r))})):r.all?n.readdirSync(t).forEach((function(r){a(e.join(t,r),r)})):n.readdirSync(t).forEach((function(r){"."!==r[0]&&a(e.join(t,r),r)})):a(t,t,c)})),c}return i.register("ls",c,{cmdOptions:{R:"recursive",A:"all",L:"link",a:"all_deprecated",d:"directory",l:"long"}}),lg=c}function Tg(){if(hg)return pg;hg=1;var e=t,r=Uv(),n=Lg();function i(t,i){i?"string"==typeof i&&(i=[].slice.call(arguments,1)):r.error("no path specified");var o=[];function s(e){"win32"===process.platform&&(e=e.replace(/\\/g,"/")),o.push(e)}return i.forEach((function(t){var i;try{i=r.statFollowLinks(t)}catch(e){r.error("no such file or directory: "+t)}s(t),i.isDirectory()&&n({recursive:!0,all:!0},t).forEach((function(r){s(e.join(t,r))}))})),o}return r.register("find",i,{}),pg=i}function _g(){if(vg)return dg;vg=1;var e=Uv(),t=r;function n(r,n,i){var o=e.readFromPipe();i||o||e.error("no paths given",2),i=[].slice.call(arguments,2),o&&i.unshift("-");var s=[];return r.ignoreCase&&(n=new RegExp(n,"i")),i.forEach((function(i){if(t.existsSync(i)||"-"===i){var c="-"===i?o:t.readFileSync(i,"utf8");if(r.nameOnly)c.match(n)&&s.push(i);else c.split("\n").forEach((function(e){var t=e.match(n);(r.inverse&&!t||!r.inverse&&t)&&s.push(e)}))}else e.error("no such file or directory: "+i,2,{continue:!0})})),s.join("\n")+"\n"}return e.register("grep",n,{globStart:2,canReceivePipe:!0,cmdOptions:{v:"inverse",l:"nameOnly",i:"ignoreCase"}}),dg=n}function Ng(){if(yg)return gg;yg=1;var e=Uv(),t=r;function n(r,n){var i=[],o=e.readFromPipe();n||o||e.error("no paths given");var s=1;!0===r.numLines?(s=2,r.numLines=Number(arguments[1])):!1===r.numLines&&(r.numLines=10),n=[].slice.call(arguments,s),o&&n.unshift("-");var c=!1;return n.forEach((function(n){if("-"!==n){if(!t.existsSync(n))return void e.error("no such file or directory: "+n,{continue:!0});if(e.statFollowLinks(n).isDirectory())return void e.error("error reading '"+n+"': Is a directory",{continue:!0})}var s;s="-"===n?o:r.numLines<0?t.readFileSync(n,"utf8"):function(r,n){for(var i=e.buffer(),o=i.length,s=o,c=0,a=t.openSync(r,"r"),u=0,l="";s===o&&u and/or "),t=String(t);var s=n.normalize(t).replace(RegExp(n.sep+"$"),""),c=n.resolve(t)===s;if(o=n.resolve(process.cwd(),String(o)),e.existsSync(o)&&(r.force||i.error("Destination file exists",{continue:!0}),e.unlinkSync(o)),r.symlink){var a="win32"===process.platform,u=a?"file":null,l=c?s:n.resolve(process.cwd(),n.dirname(o),t);e.existsSync(l)?a&&i.statFollowLinks(l).isDirectory()&&(u="junction"):i.error("Source file does not exist",{continue:!0});try{e.symlinkSync("junction"===u?l:t,o,u)}catch(e){i.error(e.message)}}else{e.existsSync(t)||i.error("Source file does not exist",{continue:!0});try{e.linkSync(t,o)}catch(e){i.error(e.message)}}return""}return i.register("ln",o,{cmdOptions:{s:"symlink",f:"force"}}),mg=o}function Fg(){if(wg)return bg;wg=1;var e=Uv(),n=r,i=t;function o(r){var t=i.dirname(r);t===r&&e.error("dirname() failed: ["+r+"]"),n.existsSync(t)||o(t),n.mkdirSync(r,parseInt("0777",8))}function s(r,t){return t||e.error("no paths given"),"string"==typeof t&&(t=[].slice.call(arguments,1)),t.forEach((function(t){try{var s=e.statNoFollowLinks(t);return void(r.fullpath?s.isFile()&&e.error("cannot create directory "+t+": File exists",{continue:!0}):e.error("path already exists: "+t,{continue:!0}))}catch(e){}var c=i.dirname(t);if(n.existsSync(c)||r.fullpath)try{r.fullpath?o(i.resolve(t)):n.mkdirSync(t,parseInt("0777",8))}catch(r){var a;if("EACCES"===r.code)a="Permission denied";else{if("ENOTDIR"!==r.code&&"ENOENT"!==r.code)throw r;a="Not a directory"}e.error("cannot create directory "+t+": "+a,{continue:!0})}else e.error("no such file or directory: "+c,{continue:!0})})),""}return e.register("mkdir",s,{cmdOptions:{p:"fullpath"}}),bg=s}function Cg(){if(Sg)return Og;Sg=1;var e=Uv(),t=r;function n(r,o,s){var c;c=t.readdirSync(r);for(var a=0;a1e3)throw e}}catch(t){e.error("could not remove directory (code "+t.code+"): "+r,{continue:!0})}return l}}function i(e){var r=!0;try{var n=t.openSync(e,"a");t.closeSync(n)}catch(e){r=!1}return r}function o(r,t){return t||e.error("no paths given"),(t=[].slice.call(arguments,1)).forEach((function(t){var o;try{var s="/"===t[t.length-1]?t.slice(0,-1):t;o=e.statNoFollowLinks(s)}catch(n){return void(r.force||e.error("no such file or directory: "+t,{continue:!0}))}o.isFile()?function(r,t){t.force||i(r)?e.unlinkSync(r):e.error("permission denied: "+r,{continue:!0})}(t,r):o.isDirectory()?function(r,t){t.recursive?n(r,t.force):e.error("path is a directory",{continue:!0})}(t,r):o.isSymbolicLink()?function(r,t){var i;try{i=e.statFollowLinks(r)}catch(t){return void e.unlinkSync(r)}i.isFile()?e.unlinkSync(r):i.isDirectory()&&("/"===r[r.length-1]?t.recursive?n(r,t.force,!0):e.error("path is a directory",{continue:!0}):e.unlinkSync(r))}(t,r):o.isFIFO()&&function(r){e.unlinkSync(r)}(t)})),""}return e.register("rm",o,{cmdOptions:{f:"force",r:"recursive",R:"recursive"}}),Og=o}function Dg(){if(Ig)return Rg;Ig=1;var e=r,n=t,i=Uv(),o=Vv(),s=Cg();function c(r,t,c){arguments.length<3?i.error("missing and/or "):arguments.length>3?(t=[].slice.call(arguments,1,arguments.length-1),c=arguments[arguments.length-1]):"string"==typeof t?t=[t]:i.error("invalid arguments");var a=e.existsSync(c),u=a&&i.statFollowLinks(c);return a&&u.isDirectory()||!(t.length>1)||i.error("dest is not a directory (too many sources)"),a&&u.isFile()&&r.no_force&&i.error("dest file already exists: "+c),t.forEach((function(a,u){if(e.existsSync(a)){var l=c;if(e.existsSync(c)&&i.statFollowLinks(c).isDirectory()&&(l=n.normalize(c+"/"+n.basename(a))),e.existsSync(l)&&function(e,r){var t=e[r];return e.slice(0,r).some((function(e){return n.basename(e)===n.basename(t)}))}(t,u))r.no_force||i.error("will not overwrite just-created '"+l+"' with '"+a+"'",{continue:!0});else if(e.existsSync(l)&&r.no_force)i.error("dest file already exists: "+l,{continue:!0});else if(n.resolve(a)!==n.dirname(n.resolve(l)))try{e.renameSync(a,l)}catch(e){"EXDEV"===e.code&&(o("-r",a,l),s("-rf",a))}else i.error("cannot move to self: "+a,{continue:!0})}else i.error("no such file or directory: "+a,{continue:!0})})),""}return i.register("mv",c,{cmdOptions:{f:"!no_force",n:"no_force"}}),Rg=c}var Mg,Gg={};function $g(){return Mg||(Mg=1),Gg}var Bg,Ug,Xg,qg,Wg,Vg={};function Hg(){return Bg||(Bg=1),Vg}function zg(){if(Xg)return Ug;Xg=1;var e=Uv(),t=r;function n(r,n,i,o){var s=e.readFromPipe();"string"!=typeof i&&"function"!=typeof i&&("number"==typeof i?i=i.toString():e.error("invalid replacement string")),"string"==typeof n&&(n=RegExp(n)),o||s||e.error("no files given"),o=[].slice.call(arguments,3),s&&o.unshift("-");var c=[];return o.forEach((function(o){if(t.existsSync(o)||"-"===o){var a=("-"===o?s:t.readFileSync(o,"utf8")).split("\n").map((function(e){return e.replace(n,i)})).join("\n");c.push(a),r.inplace&&t.writeFileSync(o,a,"utf8")}else e.error("no such file or directory: "+o,2,{continue:!0})})),c.join("\n")}return e.register("sed",n,{globStart:3,canReceivePipe:!0,cmdOptions:{i:"inplace"}}),Ug=n}function Yg(){if(Wg)return qg;Wg=1;var e=Uv();function r(r){if(!r){var t=[].slice.call(arguments,0);t.length<2&&e.error("must provide an argument"),r=t[1]}var n="+"===r[0];n&&(r="-"+r.slice(1)),r=e.parseOptions(r,{e:"fatal",v:"verbose",f:"noglob"}),n&&Object.keys(r).forEach((function(e){r[e]=!r[e]})),Object.keys(r).forEach((function(t){n!==r[t]&&(e.config[t]=r[t])}))}return e.register("set",r,{allowGlobbing:!1,wrapOutput:!1}),qg=r}var Kg=Ff.end,Jg=Gf("trimEnd")?function(){return Kg(this)}:"".trimEnd;ii({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==Jg},{trimRight:Jg});var Qg,Zg,ey,ry,ty,ny,iy,oy,sy,cy,ay,uy,ly,fy,py,hy,dy;function vy(){if(Zg)return Qg;Zg=1;var e=Uv(),t=r;function n(e){var r=e.match(/^\s*(\d*)\s*(.*)$/);return{num:Number(r[1]),value:r[2]}}function i(e,r){var t=e.toLowerCase(),n=r.toLowerCase();return t===n?-1*e.localeCompare(r):t.localeCompare(n)}function o(e,r){var t=n(e),o=n(r);return t.hasOwnProperty("num")&&o.hasOwnProperty("num")&&t.num!==o.num?t.num-o.num:i(t.value,o.value)}function s(r,n){var s=e.readFromPipe();n||s||e.error("no files given"),n=[].slice.call(arguments,1),s&&n.unshift("-");var c=n.reduce((function(r,n){if("-"!==n){if(!t.existsSync(n))return e.error("no such file or directory: "+n,{continue:!0}),r;if(e.statFollowLinks(n).isDirectory())return e.error("read failed: "+n+": Is a directory",{continue:!0}),r}var i="-"===n?s:t.readFileSync(n,"utf8");return r.concat(i.trimRight().split("\n"))}),[]).sort(r.numerical?o:i);return r.reverse&&(c=c.reverse()),c.join("\n")+"\n"}return e.register("sort",s,{canReceivePipe:!0,cmdOptions:{r:"reverse",n:"numerical"}}),Qg=s}function gy(){if(ry)return ey;ry=1;var e=Uv(),t=r;function n(r,n){var i=[],o=e.readFromPipe();n||o||e.error("no paths given");var s=1;!0===r.numLines?(s=2,r.numLines=Number(arguments[1])):!1===r.numLines&&(r.numLines=10),r.numLines=-1*Math.abs(r.numLines),n=[].slice.call(arguments,s),o&&n.unshift("-");var c=!1;return n.forEach((function(n){if("-"!==n){if(!t.existsSync(n))return void e.error("no such file or directory: "+n,{continue:!0});if(e.statFollowLinks(n).isDirectory())return void e.error("error reading '"+n+"': Is a directory",{continue:!0})}var s=("-"===n?o:t.readFileSync(n,"utf8")).split("\n");""===s[s.length-1]?(s.pop(),c=!0):c=!1,i=i.concat(s.slice(r.numLines))})),c&&i.push(""),i.join("\n")}return e.register("tail",n,{canReceivePipe:!0,cmdOptions:{n:"numLines"}}),ey=n}function yy(){if(ny)return ty;ny=1;var e=Uv(),t=r;function n(r,n){n||e.error("no path given");var i=!1;if(Object.keys(r).forEach((function(e){!0===r[e]&&(i=!0)})),i||e.error("could not interpret expression"),r.link)try{return e.statNoFollowLinks(n).isSymbolicLink()}catch(e){return!1}if(!t.existsSync(n))return!1;if(r.exists)return!0;var o=e.statFollowLinks(n);return r.block?o.isBlockDevice():r.character?o.isCharacterDevice():r.directory?o.isDirectory():r.file?o.isFile():r.pipe?o.isFIFO():!!r.socket&&o.isSocket()}return e.register("test",n,{cmdOptions:{b:"block",c:"character",d:"directory",e:"exists",f:"file",L:"link",p:"pipe",S:"socket"},wrapOutput:!1,allowGlobbing:!1}),ty=n}function my(){if(oy)return iy;oy=1;var e=Uv(),n=r,i=t;function o(r,t){t||e.error("wrong arguments"),n.existsSync(i.dirname(t))||e.error("no such file or directory: "+i.dirname(t));try{return n.writeFileSync(t,this.stdout||this.toString(),"utf8"),this}catch(r){e.error("could not write to file (code "+r.code+"): "+t,{continue:!0})}}return e.register("to",o,{pipeOnly:!0,wrapOutput:!1}),iy=o}function Ey(){if(cy)return sy;cy=1;var e=Uv(),n=r,i=t;function o(r,t){t||e.error("wrong arguments"),n.existsSync(i.dirname(t))||e.error("no such file or directory: "+i.dirname(t));try{return n.appendFileSync(t,this.stdout||this.toString(),"utf8"),this}catch(r){e.error("could not append to file (code "+r.code+"): "+t,{continue:!0})}}return e.register("toEnd",o,{pipeOnly:!0,wrapOutput:!1}),sy=o}function by(){if(uy)return ay;uy=1;var e=Uv(),t=r;function n(r,n){return n?"string"==typeof n?n=[].slice.call(arguments,1):e.error("file arg should be a string file path or an Array of string file paths"):e.error("no files given"),n.forEach((function(n){!function(r,n){var o=i(n);if(o&&o.isDirectory())return;if(!o&&r.no_create)return;t.closeSync(t.openSync(n,"a"));var s=new Date,c=r.date||s,a=r.date||s;if(r.reference){var u=i(r.reference);u||e.error("failed to get attributess of "+r.reference),c=u.mtime,a=u.atime}else r.date&&(c=r.date,a=r.date);r.atime_only&&r.mtime_only||(r.atime_only?c=o.mtime:r.mtime_only&&(a=o.atime));t.utimesSync(n,a,c)}(r,n)})),""}function i(r){try{return e.statFollowLinks(r)}catch(e){return null}}return e.register("touch",n,{cmdOptions:{a:"atime_only",c:"no_create",d:"date",m:"mtime_only",r:"reference"}}),ay=n}function wy(){if(fy)return ly;fy=1;var e=Uv(),t=r;function n(r,n,i){var o=e.readFromPipe();o||(n||e.error("no input given"),t.existsSync(n)?e.statFollowLinks(n).isDirectory()&&e.error("error reading '"+n+"'"):e.error(n+": No such file or directory")),i&&t.existsSync(i)&&e.statFollowLinks(i).isDirectory()&&e.error(i+": Is a directory");var s=(n?t.readFileSync(n,"utf8"):o).trimRight().split("\n"),c=s.reduceRight((function(e,t){return 0===e.length?[{count:1,ln:t}]:0===(n=e[0].ln,i=t,r.ignoreCase?n.toLocaleLowerCase().localeCompare(i.toLocaleLowerCase()):n.localeCompare(i))?[{count:e[0].count+1,ln:t}].concat(e.slice(1)):[{count:1,ln:t}].concat(e);var n,i}),[]).filter((function(e){return!r.duplicates||e.count>1})).map((function(e){return(r.count?(t=7,n=e.count,(i=""+n).length0)||r.all);p++){var h=i.resolve(s[p],t);n&&(h=h.toUpperCase());var d=h.match(/\.[^<>:"/\|?*.]+$/);if(d&&f.indexOf(d[0])>=0){if(u(h)){l.push(h);break}}else for(var v=0;v0?r.all?l:l[0]:r.all?[]:null}return py=l}function Sy(){return dy||(dy={"/node_modules/shelljs/src/cat.js":Xv,"/node_modules/shelljs/src/cd.js":qv,"/node_modules/shelljs/src/chmod.js":Wv,"/node_modules/shelljs/src/common.js":Uv,"/node_modules/shelljs/src/cp.js":Vv,"/node_modules/shelljs/src/dirs.js":Zv,"/node_modules/shelljs/src/echo.js":eg,"/node_modules/shelljs/src/error.js":rg,"/node_modules/shelljs/src/exec-child.js":ig,"/node_modules/shelljs/src/exec.js":kg,"/node_modules/shelljs/src/find.js":Tg,"/node_modules/shelljs/src/grep.js":_g,"/node_modules/shelljs/src/head.js":Ng,"/node_modules/shelljs/src/ln.js":Pg,"/node_modules/shelljs/src/ls.js":Lg,"/node_modules/shelljs/src/mkdir.js":Fg,"/node_modules/shelljs/src/mv.js":Dg,"/node_modules/shelljs/src/popd.js":$g,"/node_modules/shelljs/src/pushd.js":Hg,"/node_modules/shelljs/src/pwd.js":xg,"/node_modules/shelljs/src/rm.js":Cg,"/node_modules/shelljs/src/sed.js":zg,"/node_modules/shelljs/src/set.js":Yg,"/node_modules/shelljs/src/sort.js":vy,"/node_modules/shelljs/src/tail.js":gy,"/node_modules/shelljs/src/tempdir.js":jg,"/node_modules/shelljs/src/test.js":yy,"/node_modules/shelljs/src/to.js":my,"/node_modules/shelljs/src/toEnd.js":Ey,"/node_modules/shelljs/src/touch.js":by,"/node_modules/shelljs/src/uniq.js":wy,"/node_modules/shelljs/src/which.js":Oy})}function Ry(e,r){var t,n=function(e){var r=e[0];if("/"===r||"\\"===r)return!1;var t=e[1],n=e[2];return!(!("."!==r||t&&"/"!==t&&"\\"!==t)||!("."!==r||"."!==t||n&&"/"!==n&&"\\"!==n))&&(":"!==t||"/"!==n&&"\\"!==n)}(e);"/"===(e=Iy(e))[0]&&(r="");for(var i=Sy(),o=["",".js",".json"];!(t=Iy(n?r+"/node_modules/"+e:r+"/"+e)).endsWith("/..");){for(var s=0;s0&&".."!==r[n-1]&&"."!==r[n-1]&&(r.splice(--n,2),n--);return e=r.join("/"),t&&"/"!==e[0]?e="/"+e:0===e.length&&(e="."),e}ii({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==Jg},{trimEnd:Jg});var Ay,jy,xy,ky={};function Ly(){if(xy)return ky;xy=1;var e=Uv();return(jy?Ay:(jy=1,Ay=["cat","cd","chmod","cp","dirs","echo","exec","find","grep","head","ln","ls","mkdir","mv","pwd","rm","sed","set","sort","tail","tempdir","test","to","toEnd","touch","uniq","which"])).forEach((function(e){!function(e){function r(r){var t=Ry(r,e);if(null!==t)return Sy()[t]();throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}return r.resolve=function(r){var t=Ry(r,e);return null!==t?t:require.resolve(r)},r}("/node_modules/shelljs")("./src/"+e)})),ky.exit=process.exit,ky.error=rg(),ky.ShellString=e.ShellString,ky.env=process.env,ky.config=e.config,ky}var Ty=Ly(),_y=Uv();Object.keys(Ty).forEach((function(e){c[e]=Ty[e]}));var Ny=my();String.prototype.to=_y.wrap("to",Ny);var Py=Ey();String.prototype.toEnd=_y.wrap("toEnd",Py),c.config.fatal=!0,c.target={};var Fy,Cy=process.argv.slice(2),Dy=Cy.indexOf("--");Dy>-1&&(Fy=Cy.slice(Dy+1,Cy.length),Cy=Cy.slice(0,Dy)),setTimeout((function(){var e;if(1!==Cy.length||"--help"!==Cy[0]){for(e in c.target)!function(e,r){c.target[e]=function(){return r.done||(r.done=!0,r.result=r.apply(r,arguments)),r.result}}(e,c.target[e]);Cy.length>0?Cy.forEach((function(e){e in c.target?c.target[e](Fy):console.log("no such target: "+e)})):"all"in c.target&&c.target.all(Fy)}else for(e in console.log("Available targets:"),c.target)console.log(" "+e)}),0);var My={exports:{}};!function(e,r){var t;r=My.exports=y,t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},r.SEMVER_SPEC_VERSION="2.0.0";var n=256,i=Number.MAX_SAFE_INTEGER||9007199254740991,o=n-6,s=r.re=[],c=r.safeRe=[],a=r.src=[],u=r.tokens={},l=0;function f(e){u[e]=l++}var p="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",n],[p,o]];function d(e){for(var r=0;r)?=?)",f("XRANGEIDENTIFIERLOOSE"),a[u.XRANGEIDENTIFIERLOOSE]=a[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",f("XRANGEIDENTIFIER"),a[u.XRANGEIDENTIFIER]=a[u.NUMERICIDENTIFIER]+"|x|X|\\*",f("XRANGEPLAIN"),a[u.XRANGEPLAIN]="[v=\\s]*("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:"+a[u.PRERELEASE]+")?"+a[u.BUILD]+"?)?)?",f("XRANGEPLAINLOOSE"),a[u.XRANGEPLAINLOOSE]="[v=\\s]*("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:"+a[u.PRERELEASELOOSE]+")?"+a[u.BUILD]+"?)?)?",f("XRANGE"),a[u.XRANGE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAIN]+"$",f("XRANGELOOSE"),a[u.XRANGELOOSE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAINLOOSE]+"$",f("COERCE"),a[u.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",f("COERCERTL"),s[u.COERCERTL]=new RegExp(a[u.COERCE],"g"),c[u.COERCERTL]=new RegExp(d(a[u.COERCE]),"g"),f("LONETILDE"),a[u.LONETILDE]="(?:~>?)",f("TILDETRIM"),a[u.TILDETRIM]="(\\s*)"+a[u.LONETILDE]+"\\s+",s[u.TILDETRIM]=new RegExp(a[u.TILDETRIM],"g"),c[u.TILDETRIM]=new RegExp(d(a[u.TILDETRIM]),"g");f("TILDE"),a[u.TILDE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAIN]+"$",f("TILDELOOSE"),a[u.TILDELOOSE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAINLOOSE]+"$",f("LONECARET"),a[u.LONECARET]="(?:\\^)",f("CARETTRIM"),a[u.CARETTRIM]="(\\s*)"+a[u.LONECARET]+"\\s+",s[u.CARETTRIM]=new RegExp(a[u.CARETTRIM],"g"),c[u.CARETTRIM]=new RegExp(d(a[u.CARETTRIM]),"g");f("CARET"),a[u.CARET]="^"+a[u.LONECARET]+a[u.XRANGEPLAIN]+"$",f("CARETLOOSE"),a[u.CARETLOOSE]="^"+a[u.LONECARET]+a[u.XRANGEPLAINLOOSE]+"$",f("COMPARATORLOOSE"),a[u.COMPARATORLOOSE]="^"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+")$|^$",f("COMPARATOR"),a[u.COMPARATOR]="^"+a[u.GTLT]+"\\s*("+a[u.FULLPLAIN]+")$|^$",f("COMPARATORTRIM"),a[u.COMPARATORTRIM]="(\\s*)"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+"|"+a[u.XRANGEPLAIN]+")",s[u.COMPARATORTRIM]=new RegExp(a[u.COMPARATORTRIM],"g"),c[u.COMPARATORTRIM]=new RegExp(d(a[u.COMPARATORTRIM]),"g");f("HYPHENRANGE"),a[u.HYPHENRANGE]="^\\s*("+a[u.XRANGEPLAIN]+")\\s+-\\s+("+a[u.XRANGEPLAIN]+")\\s*$",f("HYPHENRANGELOOSE"),a[u.HYPHENRANGELOOSE]="^\\s*("+a[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+a[u.XRANGEPLAINLOOSE]+")\\s*$",f("STAR"),a[u.STAR]="(<|>)?=?\\s*\\*";for(var v=0;vn)return null;if(!(r.loose?c[u.LOOSE]:c[u.FULL]).test(e))return null;try{return new y(e,r)}catch(e){return null}}function y(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof y){if(e.loose===r.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof y))return new y(e,r);t("SemVer",e,r),this.options=r,this.loose=!!r.loose;var o=e.trim().match(r.loose?c[u.LOOSE]:c[u.FULL]);if(!o)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var r=+e;if(r>=0&&r=0;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}r&&(this.prerelease[0]===r?isNaN(this.prerelease[1])&&(this.prerelease=[r,0]):this.prerelease=[r,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},r.inc=function(e,r,t,n){"string"==typeof t&&(n=t,t=void 0);try{return new y(e,t).inc(r,n).version}catch(e){return null}},r.diff=function(e,r){if(S(e,r))return null;var t=g(e),n=g(r),i="";if(t.prerelease.length||n.prerelease.length){i="pre";var o="prerelease"}for(var s in t)if(("major"===s||"minor"===s||"patch"===s)&&t[s]!==n[s])return i+s;return o},r.compareIdentifiers=E;var m=/^[0-9]+$/;function E(e,r){var t=m.test(e),n=m.test(r);return t&&n&&(e=+e,r=+r),e===r?0:t&&!n?-1:n&&!t?1:e0}function O(e,r,t){return b(e,r,t)<0}function S(e,r,t){return 0===b(e,r,t)}function R(e,r,t){return 0!==b(e,r,t)}function I(e,r,t){return b(e,r,t)>=0}function A(e,r,t){return b(e,r,t)<=0}function j(e,r,t,n){switch(r){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e===t;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e!==t;case"":case"=":case"==":return S(e,t,n);case"!=":return R(e,t,n);case">":return w(e,t,n);case">=":return I(e,t,n);case"<":return O(e,t,n);case"<=":return A(e,t,n);default:throw new TypeError("Invalid operator: "+r)}}function x(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof x){if(e.loose===!!r.loose)return e;e=e.value}if(!(this instanceof x))return new x(e,r);e=e.trim().split(/\s+/).join(" "),t("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===k?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}r.rcompareIdentifiers=function(e,r){return E(r,e)},r.major=function(e,r){return new y(e,r).major},r.minor=function(e,r){return new y(e,r).minor},r.patch=function(e,r){return new y(e,r).patch},r.compare=b,r.compareLoose=function(e,r){return b(e,r,!0)},r.compareBuild=function(e,r,t){var n=new y(e,t),i=new y(r,t);return n.compare(i)||n.compareBuild(i)},r.rcompare=function(e,r,t){return b(r,e,t)},r.sort=function(e,t){return e.sort((function(e,n){return r.compareBuild(e,n,t)}))},r.rsort=function(e,t){return e.sort((function(e,n){return r.compareBuild(n,e,t)}))},r.gt=w,r.lt=O,r.eq=S,r.neq=R,r.gte=I,r.lte=A,r.cmp=j,r.Comparator=x;var k={};function L(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof L)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new L(e.raw,r);if(e instanceof x)return new L(e.value,r);if(!(this instanceof L))return new L(e,r);if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function T(e,r){for(var t=!0,n=e.slice(),i=n.pop();t&&n.length;)t=n.every((function(e){return i.intersects(e,r)})),i=n.pop();return t}function _(e){return!e||"x"===e.toLowerCase()||"*"===e}function N(e,r,t,n,i,o,s,c,a,u,l,f,p){return((r=_(t)?"":_(n)?">="+t+".0.0":_(i)?">="+t+"."+n+".0":">="+r)+" "+(c=_(a)?"":_(u)?"<"+(+a+1)+".0.0":_(l)?"<"+a+"."+(+u+1)+".0":f?"<="+a+"."+u+"."+l+"-"+f:"<="+c)).trim()}function P(e,r,n){for(var i=0;i0){var o=e[i].semver;if(o.major===r.major&&o.minor===r.minor&&o.patch===r.patch)return!0}return!1}return!0}function F(e,r,t){try{r=new L(r,t)}catch(e){return!1}return r.test(e)}function C(e,r,t,n){var i,o,s,c,a;switch(e=new y(e,n),r=new L(r,n),t){case">":i=w,o=A,s=O,c=">",a=">=";break;case"<":i=O,o=I,s=w,c="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(F(e,r,n))return!1;for(var u=0;u=0.0.0")),f=f||e,p=p||e,i(e.semver,f.semver,n)?f=e:s(e.semver,p.semver,n)&&(p=e)})),f.operator===c||f.operator===a)return!1;if((!p.operator||p.operator===c)&&o(e,p.semver))return!1;if(p.operator===a&&s(e,p.semver))return!1}return!0}x.prototype.parse=function(e){var r=this.options.loose?c[u.COMPARATORLOOSE]:c[u.COMPARATOR],t=e.match(r);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),t[2]?this.semver=new y(t[2],this.options.loose):this.semver=k},x.prototype.toString=function(){return this.value},x.prototype.test=function(e){if(t("Comparator.test",e,this.options.loose),this.semver===k||e===k)return!0;if("string"==typeof e)try{e=new y(e,this.options)}catch(e){return!1}return j(e,this.operator,this.semver,this.options)},x.prototype.intersects=function(e,r){if(!(e instanceof x))throw new TypeError("a Comparator is required");var t;if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),""===this.operator)return""===this.value||(t=new L(e.value,r),F(this.value,t,r));if(""===e.operator)return""===e.value||(t=new L(this.value,r),F(e.semver,t,r));var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),c=j(this.semver,"<",e.semver,r)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),a=j(this.semver,">",e.semver,r)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||i||o&&s||c||a},r.Range=L,L.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},L.prototype.toString=function(){return this.range},L.prototype.parseRange=function(e){var r=this.options.loose,n=r?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(n,N),t("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],"$1$2$3"),t("comparator trim",e,c[u.COMPARATORTRIM]),e=(e=(e=e.replace(c[u.TILDETRIM],"$1~")).replace(c[u.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=r?c[u.COMPARATORLOOSE]:c[u.COMPARATOR],o=e.split(" ").map((function(e){return function(e,r){return t("comp",e,r),e=function(e,r){return e.trim().split(/\s+/).map((function(e){return function(e,r){t("caret",e,r);var n=r.loose?c[u.CARETLOOSE]:c[u.CARET];return e.replace(n,(function(r,n,i,o,s){var c;return t("caret",e,r,n,i,o,s),_(n)?c="":_(i)?c=">="+n+".0.0 <"+(+n+1)+".0.0":_(o)?c="0"===n?">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":">="+n+"."+i+".0 <"+(+n+1)+".0.0":s?(t("replaceCaret pr",s),c="0"===n?"0"===i?">="+n+"."+i+"."+o+"-"+s+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+"-"+s+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+"-"+s+" <"+(+n+1)+".0.0"):(t("no pr"),c="0"===n?"0"===i?">="+n+"."+i+"."+o+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+" <"+(+n+1)+".0.0"),t("caret return",c),c}))}(e,r)})).join(" ")}(e,r),t("caret",e),e=function(e,r){return e.trim().split(/\s+/).map((function(e){return function(e,r){var n=r.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(n,(function(r,n,i,o,s){var c;return t("tilde",e,r,n,i,o,s),_(n)?c="":_(i)?c=">="+n+".0.0 <"+(+n+1)+".0.0":_(o)?c=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":s?(t("replaceTilde pr",s),c=">="+n+"."+i+"."+o+"-"+s+" <"+n+"."+(+i+1)+".0"):c=">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0",t("tilde return",c),c}))}(e,r)})).join(" ")}(e,r),t("tildes",e),e=function(e,r){return t("replaceXRanges",e,r),e.split(/\s+/).map((function(e){return function(e,r){e=e.trim();var n=r.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,(function(n,i,o,s,c,a){t("xRange",e,n,i,o,s,c,a);var u=_(o),l=u||_(s),f=l||_(c),p=f;return"="===i&&p&&(i=""),a=r.includePrerelease?"-0":"",u?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&p?(l&&(s=0),c=0,">"===i?(i=">=",l?(o=+o+1,s=0,c=0):(s=+s+1,c=0)):"<="===i&&(i="<",l?o=+o+1:s=+s+1),n=i+o+"."+s+"."+c+a):l?n=">="+o+".0.0"+a+" <"+(+o+1)+".0.0"+a:f&&(n=">="+o+"."+s+".0"+a+" <"+o+"."+(+s+1)+".0"+a),t("xRange return",n),n}))}(e,r)})).join(" ")}(e,r),t("xrange",e),e=function(e,r){return t("replaceStars",e,r),e.trim().replace(c[u.STAR],"")}(e,r),t("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter((function(e){return!!e.match(i)}))),o=o.map((function(e){return new x(e,this.options)}),this)},L.prototype.intersects=function(e,r){if(!(e instanceof L))throw new TypeError("a Range is required");return this.set.some((function(t){return T(t,r)&&e.set.some((function(e){return T(e,r)&&t.every((function(t){return e.every((function(e){return t.intersects(e,r)}))}))}))}))},r.toComparators=function(e,r){return new L(e,r).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},L.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new y(e,this.options)}catch(e){return!1}for(var r=0;r":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":t&&!w(t,r)||(t=r);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(t&&e.test(t))return t;return null},r.validRange=function(e,r){try{return new L(e,r).range||"*"}catch(e){return null}},r.ltr=function(e,r,t){return C(e,r,"<",t)},r.gtr=function(e,r,t){return C(e,r,">",t)},r.outside=C,r.prerelease=function(e,r){var t=g(e,r);return t&&t.prerelease.length?t.prerelease:null},r.intersects=function(e,r,t){return e=new L(e,t),r=new L(r,t),e.intersects(r)},r.coerce=function(e,r){if(e instanceof y)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var t=null;if((r=r||{}).rtl){for(var n;(n=c[u.COERCERTL].exec(e))&&(!t||t.index+t[0].length!==e.length);)t&&n.index+n[0].length===t.index+t[0].length||(t=n),c[u.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;c[u.COERCERTL].lastIndex=-1}else t=e.match(c[u.COERCE]);if(null===t)return null;return g(t[2]+"."+(t[3]||"0")+"."+(t[4]||"0"),r)}}(0,My.exports);var Gy,$y=(Gy=My.exports)&&Gy.__esModule&&Object.prototype.hasOwnProperty.call(Gy,"default")?Gy.default:Gy;const By=global,Uy=new Proxy(global.target,{set:function(e,r,t){return Reflect.set(...arguments)},get:function(e,r,t){return Hy(`make ${r}`),Reflect.get(...arguments)}}),Xy=["packages","codemods","eslint"],qy=["eslint","scripts","benchmark",...Xy,"*.{js,cjs,mjs,ts}","--format","codeframe"],Wy=By.which("yarn").stdout,Vy=process.execPath;function Hy(...e){console.log.apply(console,e)}function zy(e,r,n,i=!0){Hy(`${e.replaceAll(Wy,"yarn").replaceAll(Vy,"node")} ${r.join(" ")}`);try{return s.execFileSync(e,r,{stdio:i?"inherit":void 0,cwd:n&&t.resolve(n),env:process.env})}catch(t){throw i&&0!=t.status&&(console.error(new Error(`\ncommand: ${e} ${r.join(" ")}\ncode: ${t.status}`)),process.exit(t.status)),t}}function Yy(e,r,t){return zy(Wy,e,r,t)}function Ky(e,r,t){return zy(Vy,e,r,t)}function Jy(e,r){const t=process.env;process.env=Object.assign(Object.assign({},t),r),e(),process.env=t}function Qy(e,t,n){const i="./build/"+e.toLowerCase();By.rm("-rf",i),By.mkdir("-p","build"),zy("git",["clone","--filter=blob:none","--sparse","--single-branch","--shallow-since='2 years ago'",t,i]),zy("git",["sparse-checkout","set",...n],i),zy("git",["checkout","-q",function(e){const t=r.readFileSync("./Makefile","utf8").match(new RegExp(`${e}_COMMIT = (\\w{40})`))[1];if(!t)throw new Error(`Could not find ${e}_COMMIT in Makefile`);return t}(e)],i)}function Zy(){const e=JSON.parse(r.readFileSync("./package.json","utf8")).version_babel8;return Xy.forEach((t=>{r.readdirSync(t).forEach((n=>{const i=`${t}/${n}/package.json`;if(r.existsSync(i)){var o,s,c;const t=JSON.parse(r.readFileSync(i,"utf8"));null!=(o=t.peerDependencies)&&o["@babel/core"]&&(t.peerDependencies["@babel/core"]=`^${e}`);const a=null==(s=t.conditions)?void 0:s.BABEL_8_BREAKING[0];null!=a&&null!=(c=a.peerDependencies)&&c["@babel/core"]&&(a.peerDependencies["@babel/core"]=`^${e}`),"babel-eslint-plugin"===n&&(a.peerDependencies["@babel/eslint-parser"]=`^${e}`),r.writeFileSync(i,JSON.stringify(t,null,2)+"\n")}}))})),Jy((()=>Yy(["install"])),{YARN_ENABLE_IMMUTABLE_INSTALLS:!1}),e}By.config.verbose=!0,Uy["clean-all"]=function(){By.rm("-rf",["node_modules","package-lock.json",".changelog"]),Xy.forEach((e=>{By.rm("-rf",`${e}/*/test/tmp`),By.rm("-rf",`${e}/*/package-lock.json`)})),Uy.clean(),Uy["clean-lib"]()},Uy.clean=function(){Uy["test-clean"](),By.rm("-rf",[".npmrc","coverage","packages/*/npm-debug*","node_modules/.cache"])},Uy["test-clean"]=function(){Xy.forEach((e=>{By.rm("-rf",`${e}/*/test/tmp`),By.rm("-rf",`${e}/*/test-fixtures.json`)}))},Uy["clean-lib"]=function(){By.rm("-rf",Xy.map((e=>`${e}/*/lib`))),Ky(["scripts/set-module-type.js"])},Uy["clean-runtime-helpers"]=function(){By.rm("-rf",["packages/babel-runtime/helpers/**/*.js","packages/babel-runtime-corejs2/helpers/**/*.js","packages/babel-runtime-corejs3/helpers/**/*.js","packages/babel-runtime/helpers/**/*.mjs","packages/babel-runtime-corejs2/helpers/**/*.mjs","packages/babel-runtime-corejs3/helpers/**/*.mjs","packages/babel-runtime-corejs2/core-js"])},Uy["use-cjs"]=function(){Ky(["scripts/set-module-type.js","commonjs"]),Uy.bootstrap()},Uy["use-esm"]=function(){Ky(["scripts/set-module-type.js","module"]),Uy.bootstrap()},Uy["bootstrap-only"]=function(){Uy["clean-all"](),Yy(["install"])},Uy.bootstrap=function(){Uy["bootstrap-only"](),Uy["generate-tsconfig"](),Uy.build()},Uy.build=function(){Uy["build-no-bundle"](),"true"!=process.env.BABEL_COVERAGE&&Uy["build-standalone"]()},Uy["build-standalone"]=function(){Yy(["gulp","build-babel-standalone"])},Uy["build-bundle"]=function(){Uy.clean(),Uy["clean-lib"](),Ky(["scripts/set-module-type.js"]),Yy(["gulp","build"]),Uy["build-dist"]()},Uy["build-no-bundle"]=function(){Uy.clean(),Uy["clean-lib"](),Ky(["scripts/set-module-type.js"]),Jy((()=>{Yy(["gulp","build-dev"])}),{BABEL_ENV:"development"}),Uy["build-dist"]()},Uy["build-flow-typings"]=function(){r.writeFileSync("packages/babel-types/lib/index.js.flow",Ky(["packages/babel-types/scripts/generators/flow.js"],void 0,!1))},Uy["build-dist"]=function(){Uy["build-plugin-transform-runtime-dist"]()},Uy["build-plugin-transform-runtime-dist"]=function(){Ky(["scripts/build-dist.js"],"packages/babel-plugin-transform-runtime")},Uy.prepublish=function(){process.env.BABEL_8_BREAKING?Ky(["scripts/set-module-type.js","module"]):Ky(["scripts/set-module-type.js","commonjs"]),Uy["bootstrap-only"](),Jy((()=>{Uy["prepublish-build"](),Uy.test()}),{IS_PUBLISH:"true"}),Ky(["scripts/set-module-type.js","clean"])},Uy["prepublish-build"]=function(){Uy["clean-lib"](),Uy["clean-runtime-helpers"](),Jy((()=>{Uy["build-bundle"]()}),{NODE_ENV:"production",BABEL_ENV:"production",STRIP_BABEL_8_FLAG:"true"}),Jy((()=>{Uy["prepublish-build-standalone"](),Uy["clone-license"](),Uy["prepublish-prepare-dts"](),Uy["build-flow-typings"]()}),{NODE_ENV:"production",STRIP_BABEL_8_FLAG:"true"})},Uy["prepublish-build-standalone"]=function(){Jy((()=>{Uy["build-standalone"]()}),{BABEL_ENV:"production",IS_PUBLISH:"true"})},Uy["prepublish-prepare-dts"]=function(){Uy.tscheck(),Yy(["gulp","bundle-dts"]),Uy["build-typescript-legacy-typings"]()},Uy.tscheck=function(){Uy["generate-tsconfig"](),By.rm("-rf","tsconfig.tsbuildinfo"),By.rm("-rf","dts"),Yy(["tsc","-b","."])},Uy["generate-tsconfig"]=function(){Ky(["scripts/generators/tsconfig.js"]),Ky(["scripts/generators/archived-libs-typings.js"])},Uy["generate-type-helpers"]=function(){Yy(["gulp","generate-type-helpers"])},Uy["build-typescript-legacy-typings"]=function(){r.writeFileSync("packages/babel-types/lib/index-legacy.d.ts",Ky(["packages/babel-types/scripts/generators/typescript-legacy.js"],void 0,!1))},Uy["clone-license"]=function(){Ky(["scripts/clone-license.js"])},Uy.lint=function(){Jy((()=>{Yy(qy)}),{BABEL_ENV:"test"})},Uy.fix=function(){Uy["fix-json"](),Uy["fix-js"]()},Uy["fix-js"]=function(){Yy([...qy,"--fix"])},Uy["fix-json"]=function(){Yy(["prettier",`{${Xy.join(",")}}/*/test/fixtures/**/options.json`,"--write","--loglevel","warn"])},Uy.watch=function(){Uy["build-no-bundle"](),Jy((()=>{Yy(["gulp","watch"])}),{BABEL_ENV:"development",WATCH_SKIP_BUILD:"true"})},Uy.test=function(){Uy.lint(),Uy["test-only"]()},Uy["test-only"]=function(e=[]){Yy(["jest",...e])},Uy["test-cov"]=function(){Uy.build(),Jy((()=>{Yy(["c8","jest"])}),{BABEL_ENV:"test",BABEL_COVERAGE:"true"})},Uy["bootstrap-test262"]=function(){Qy("TEST262","https://github.com/tc39/test262.git",["test","harness"])},Uy["bootstrap-typescript"]=function(){Qy("TYPESCRIPT","https://github.com/microsoft/TypeScript.git",["tests"])},Uy["bootstrap-flow"]=function(){Qy("FLOW","https://github.com/facebook/flow.git",["src/parser/test/flow"])},Uy["new-version-checklist"]=function(){console.log("\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n!!!!!! !!!!!!\nUpdate minVersion in packages/babel-helpers/src/helpers/applyDecs2311.ts\n!!!!!! Write any important message here, and change the !!!!!!\n!!!!!! if (0) above to if (1) !!!!!!\n\n- Update the version:\n - assertClassBrand\n - classPrivateFieldGet2\n - classPrivateFieldSet2\n - classPrivateGetter\n - classPrivateSetter\n - toSetter\n\n!!!!!! !!!!!!\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n ".trim()),process.exit(1)},Uy["new-version"]=function(){Uy["new-version-checklist"](),zy("git",["pull","--rebase"]),Yy(["release-tool","version","-f","@babel/standalone"])},Uy["new-babel-8-version"]=function(){zy("git",["pull","--rebase"]);const e=JSON.parse(r.readFileSync("./package.json","utf8")),t=$y.inc(e.version_babel8,"prerelease");return e.version_babel8=t,r.writeFileSync("./package.json",JSON.stringify(e,null,2)+"\n"),zy("git",["add","./package.json"]),zy("git",["commit","-m","Bump Babel 8 version to "+t]),zy("git",["tag",`v${t}`,"-m",`v${t}`]),t},Uy["new-babel-8-version-create-commit-ci"]=function(){Yy(["release-tool","version",Zy(),"--all","--tag-version-prefix","tmp.v","--yes"])},Uy["new-babel-8-version-create-commit"]=function(){const e=Zy();zy("git",["checkout","-b",`release/temp/v${e}`]),Yy(["release-tool","version",e,"--all","--tag-version-prefix","tmp.v"]),console.log("Run `BABEL_8_BREAKING=true make publish` to finish publishing")}; diff --git a/Makefile.source.mjs b/Makefile.source.mjs index 46024b0f5866..03e82d30d101 100644 --- a/Makefile.source.mjs +++ b/Makefile.source.mjs @@ -459,6 +459,15 @@ target["new-version-checklist"] = function () { Update minVersion in packages/babel-helpers/src/helpers/applyDecs2311.ts !!!!!! Write any important message here, and change the !!!!!! !!!!!! if (0) above to if (1) !!!!!! + +- Update the version: + - assertClassBrand + - classPrivateFieldGet2 + - classPrivateFieldSet2 + - classPrivateGetter + - classPrivateSetter + - toSetter + !!!!!! !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/packages/babel-helper-create-class-features-plugin/src/fields.ts b/packages/babel-helper-create-class-features-plugin/src/fields.ts index 983745d7d54a..e6a72a10f0e9 100644 --- a/packages/babel-helper-create-class-features-plugin/src/fields.ts +++ b/packages/babel-helper-create-class-features-plugin/src/fields.ts @@ -30,18 +30,47 @@ type PrivateNamesMapGeneric = Map; type PrivateNamesMap = PrivateNamesMapGeneric; -export function buildPrivateNamesMap(props: PropPath[]) { +if (!process.env.BABEL_8_BREAKING) { + // eslint-disable-next-line no-var + var newHelpers = (file: File) => { + if (!process.env.IS_PUBLISH) { + const { comments } = file.ast; + // This is needed for the test in + // babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers + if (comments?.some(c => c.value.includes("@force-old-private-helpers"))) { + return false; + } + } + return file.availableHelper("classPrivateFieldGet2"); + }; +} + +export function buildPrivateNamesMap(props: PropPath[], file: File) { const privateNamesMap: PrivateNamesMap = new Map(); + let classBrandId: t.Identifier; for (const prop of props) { if (prop.isPrivate()) { const { name } = prop.node.key.id; - const update: PrivateNameMetadata = privateNamesMap.has(name) - ? privateNamesMap.get(name) - : { - id: prop.scope.generateUidIdentifier(name), - static: prop.node.static, - method: !prop.isProperty(), - }; + let update: PrivateNameMetadata = privateNamesMap.get(name); + if (!update) { + const isMethod = !prop.isProperty(); + const isStatic = prop.node.static; + let initAdded = false; + let id: t.Identifier; + if ( + (process.env.BABEL_8_BREAKING || newHelpers(file)) && + isMethod && + !isStatic + ) { + initAdded = !!classBrandId; + classBrandId ??= prop.scope.generateUidIdentifier(name); + id = classBrandId; + } else { + id = prop.scope.generateUidIdentifier(name); + } + update = { id, static: isStatic, method: isMethod, initAdded }; + privateNamesMap.set(name, update); + } if (prop.isClassPrivateMethod()) { if (prop.node.kind === "get") { update.getId = prop.scope.generateUidIdentifier(`get_${name}`); @@ -65,6 +94,8 @@ export function buildPrivateNamesNodes( ) { const initNodes: t.Statement[] = []; + const injectedIds = new Set(); + for (const [name, value] of privateNamesMap) { // - When the privateFieldsAsProperties assumption is enabled, // both static and instance fields are transpiled using a @@ -77,7 +108,7 @@ export function buildPrivateNamesNodes( // because static fields are directly assigned to a variable in the // buildPrivateStaticFieldInitSpec function. const { static: isStatic, method: isMethod, getId, setId } = value; - const isAccessor = getId || setId; + const isGetterOrSetter = getId || setId; const id = t.cloneNode(value.id); let init: t.Expression; @@ -89,8 +120,18 @@ export function buildPrivateNamesNodes( } else if (privateFieldsAsSymbols) { init = t.callExpression(t.identifier("Symbol"), [t.stringLiteral(name)]); } else if (!isStatic) { + if (injectedIds.has(id.name)) continue; + injectedIds.add(id.name); + init = t.newExpression( - t.identifier(!isMethod || isAccessor ? "WeakMap" : "WeakSet"), + t.identifier( + isMethod && + (process.env.BABEL_8_BREAKING || + !isGetterOrSetter || + newHelpers(state)) + ? "WeakSet" + : "WeakMap", + ), [], ); } @@ -291,6 +332,27 @@ interface Receiver { ): t.Expression; } +function readOnlyError(file: File, name: string) { + return t.callExpression(file.addHelper("readOnlyError"), [ + t.stringLiteral(`#${name}`), + ]); +} + +function writeOnlyError(file: File, name: string) { + if ( + !process.env.BABEL_8_BREAKING && + !file.availableHelper("writeOnlyError") + ) { + console.warn( + `@babel/helpers is outdated, update it to silence this warning.`, + ); + return t.buildUndefinedNode(); + } + return t.callExpression(file.addHelper("writeOnlyError"), [ + t.stringLiteral(`#${name}`), + ]); +} + const privateNameHandlerSpec: Handler & Receiver = { memoise(member, count) { @@ -326,45 +388,99 @@ const privateNameHandlerSpec: Handler & Receiver = getId, setId, } = privateNamesMap.get(name); - const isAccessor = getId || setId; + const isGetterOrSetter = getId || setId; if (isStatic) { - // NOTE: This package has a peerDependency on @babel/core@^7.0.0, but these - // helpers have been introduced in @babel/helpers@7.1.0. - const helperName = - isMethod && !isAccessor - ? "classStaticPrivateMethodGet" - : "classStaticPrivateFieldSpecGet"; - // if there are any local variable shadowing classRef, unshadow it // see #12960 unshadow(classRef.name, member.scope, innerBinding); - return t.callExpression(file.addHelper(helperName), [ - this.receiver(member), + if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) { + // NOTE: This package has a peerDependency on @babel/core@^7.0.0, but these + // helpers have been introduced in @babel/helpers@7.1.0. + const helperName = + isMethod && !isGetterOrSetter + ? "classStaticPrivateMethodGet" + : "classStaticPrivateFieldSpecGet"; + + return t.callExpression(file.addHelper(helperName), [ + this.receiver(member), + t.cloneNode(classRef), + t.cloneNode(id), + ]); + } + + const receiver = this.receiver(member); + const skipCheck = + t.isIdentifier(receiver) && receiver.name === classRef.name; + + if (!isMethod) { + if (skipCheck) { + return t.memberExpression(t.cloneNode(id), t.identifier("_")); + } + + return t.memberExpression( + t.callExpression(file.addHelper("assertClassBrand"), [ + receiver, + t.cloneNode(classRef), + t.cloneNode(id), + ]), + t.identifier("_"), + ); + } + + if (getId) { + if (skipCheck) { + return t.callExpression( + t.memberExpression(t.cloneNode(getId), t.identifier("call")), + [t.cloneNode(classRef)], + ); + } + return t.callExpression(file.addHelper("classPrivateGetter"), [ + receiver, + t.cloneNode(classRef), + t.cloneNode(getId), + ]); + } + + if (setId) { + const err = t.buildUndefinedNode(); // TODO: writeOnlyError(file, name) + if (skipCheck) return err; + return t.sequenceExpression([ + t.callExpression(file.addHelper("assertClassBrand"), [ + receiver, + t.cloneNode(classRef), + ]), + err, + ]); + } + + if (skipCheck) return t.cloneNode(id); + return t.callExpression(file.addHelper("assertClassBrand"), [ + receiver, t.cloneNode(classRef), t.cloneNode(id), ]); } if (isMethod) { - if (isAccessor) { - if (!getId && setId) { - if (file.availableHelper("writeOnlyError")) { - return t.sequenceExpression([ - this.receiver(member), - t.callExpression(file.addHelper("writeOnlyError"), [ - t.stringLiteral(`#${name}`), - ]), - ]); - } - console.warn( - `@babel/helpers is outdated, update it to silence this warning.`, - ); + if (isGetterOrSetter) { + if (!getId) { + return t.sequenceExpression([ + this.receiver(member), + writeOnlyError(file, name), + ]); + } + if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) { + return t.callExpression(file.addHelper("classPrivateFieldGet"), [ + this.receiver(member), + t.cloneNode(id), + ]); } - return t.callExpression(file.addHelper("classPrivateFieldGet"), [ + return t.callExpression(file.addHelper("classPrivateGetter"), [ this.receiver(member), t.cloneNode(id), + t.cloneNode(getId), ]); } return t.callExpression(file.addHelper("classPrivateMethodGet"), [ @@ -373,10 +489,12 @@ const privateNameHandlerSpec: Handler & Receiver = t.cloneNode(methodId), ]); } - return t.callExpression(file.addHelper("classPrivateFieldGet"), [ - this.receiver(member), - t.cloneNode(id), - ]); + return t.callExpression( + process.env.BABEL_8_BREAKING || newHelpers(file) + ? file.addHelper("classPrivateFieldGet2") + : file.addHelper("classPrivateFieldGet"), + [this.receiver(member), t.cloneNode(id)], + ); }, boundGet(member) { @@ -398,75 +516,185 @@ const privateNameHandlerSpec: Handler & Receiver = setId, getId, } = privateNamesMap.get(name); - const isAccessor = getId || setId; + const isGetterOrSetter = getId || setId; if (isStatic) { - const helperName = - isMethod && !isAccessor - ? "classStaticPrivateMethodSet" - : "classStaticPrivateFieldSpecSet"; + if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) { + const helperName = + isMethod && !isGetterOrSetter + ? "classStaticPrivateMethodSet" + : "classStaticPrivateFieldSpecSet"; - return t.callExpression(file.addHelper(helperName), [ - this.receiver(member), - t.cloneNode(classRef), - t.cloneNode(id), - value, - ]); + return t.callExpression(file.addHelper(helperName), [ + this.receiver(member), + t.cloneNode(classRef), + t.cloneNode(id), + value, + ]); + } + + const receiver = this.receiver(member); + const skipCheck = + t.isIdentifier(receiver) && receiver.name === classRef.name; + + if (isMethod && !setId) { + const err = readOnlyError(file, name); + if (skipCheck) return t.sequenceExpression([value, err]); + return t.sequenceExpression([ + value, + t.callExpression(file.addHelper("assertClassBrand"), [ + receiver, + t.cloneNode(classRef), + ]), + readOnlyError(file, name), + ]); + } + + if (setId) { + if (skipCheck) { + return t.callExpression( + t.memberExpression(t.cloneNode(setId), t.identifier("call")), + [t.cloneNode(classRef), value], + ); + } + return t.callExpression(file.addHelper("classPrivateSetter"), [ + receiver, + t.cloneNode(classRef), + t.cloneNode(setId), + value, + ]); + } + return t.assignmentExpression( + "=", + t.memberExpression(t.cloneNode(id), t.identifier("_")), + skipCheck + ? value + : t.callExpression(file.addHelper("assertClassBrand"), [ + receiver, + t.cloneNode(classRef), + value, + ]), + ); } if (isMethod) { if (setId) { - return t.callExpression(file.addHelper("classPrivateFieldSet"), [ + if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) { + return t.callExpression(file.addHelper("classPrivateFieldSet"), [ + this.receiver(member), + t.cloneNode(id), + value, + ]); + } + return t.callExpression(file.addHelper("classPrivateSetter"), [ this.receiver(member), t.cloneNode(id), + t.cloneNode(setId), value, ]); } return t.sequenceExpression([ this.receiver(member), value, - t.callExpression(file.addHelper("readOnlyError"), [ - t.stringLiteral(`#${name}`), - ]), + readOnlyError(file, name), ]); } - return t.callExpression(file.addHelper("classPrivateFieldSet"), [ - this.receiver(member), - t.cloneNode(id), - value, - ]); + return t.callExpression( + process.env.BABEL_8_BREAKING || newHelpers(file) + ? file.addHelper("classPrivateFieldSet2") + : file.addHelper("classPrivateFieldSet"), + [this.receiver(member), t.cloneNode(id), value], + ); }, destructureSet(member) { const { classRef, privateNamesMap, file } = this; const { name } = (member.node.property as t.PrivateName).id; - const { id, static: isStatic } = privateNamesMap.get(name); - if (isStatic) { - try { - // classStaticPrivateFieldDestructureSet was introduced in 7.13.10 - // eslint-disable-next-line no-var - var helper = file.addHelper("classStaticPrivateFieldDestructureSet"); - } catch { - throw new Error( - "Babel can not transpile `[C.#p] = [0]` with @babel/helpers < 7.13.10, \n" + - "please update @babel/helpers to the latest version.", + const { + id, + static: isStatic, + method: isMethod, + setId, + } = privateNamesMap.get(name); + + if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) { + if (isStatic) { + try { + // classStaticPrivateFieldDestructureSet was introduced in 7.13.10 + // eslint-disable-next-line no-var + var helper = file.addHelper( + "classStaticPrivateFieldDestructureSet", + ); + } catch { + throw new Error( + "Babel can not transpile `[C.#p] = [0]` with @babel/helpers < 7.13.10, \n" + + "please update @babel/helpers to the latest version.", + ); + } + return t.memberExpression( + t.callExpression(helper, [ + this.receiver(member), + t.cloneNode(classRef), + t.cloneNode(id), + ]), + t.identifier("value"), ); } + return t.memberExpression( - t.callExpression(helper, [ + t.callExpression(file.addHelper("classPrivateFieldDestructureSet"), [ this.receiver(member), - t.cloneNode(classRef), t.cloneNode(id), ]), t.identifier("value"), ); } + if (isMethod && !setId) { + return t.memberExpression( + t.sequenceExpression([ + // @ts-ignore(Babel 7 vs Babel 8) member.node.object is not t.Super + member.node.object, + readOnlyError(file, name), + ]), + t.identifier("_"), + ); + } + + if (isStatic && !isMethod) { + return this.get(member); + } + + const setCall = this.set(member, t.identifier("_")); + if ( + !t.isCallExpression(setCall) || + !t.isIdentifier(setCall.arguments[setCall.arguments.length - 1], { + name: "_", + }) + ) { + throw member.buildCodeFrameError( + "Internal Babel error while compiling this code. This is a Babel bug. " + + "Please report it at https://github.com/babel/babel/issues.", + ); + } + + // someHelper(foo, bar, _) -> someHelper, null, foo, bar + // aFn.call(foo, bar, _) -> aFn, foo, bar + const args: t.Expression[] = setCall.arguments as t.Expression[]; + if ( + t.isMemberExpression(setCall.callee, { computed: false }) && + t.isIdentifier(setCall.callee.property) && + setCall.callee.property.name === "call" + ) { + // @ts-ignore(Babel 7 vs Babel 8) member.node.object is not t.Super + args.unshift(setCall.callee.object); + } else { + args.unshift(setCall.callee as t.Expression, t.nullLiteral()); + } + args.pop(); // Remove '_' + return t.memberExpression( - t.callExpression(file.addHelper("classPrivateFieldDestructureSet"), [ - this.receiver(member), - t.cloneNode(id), - ]), - t.identifier("value"), + t.callExpression(file.addHelper("toSetter"), args), + t.identifier("_"), ); }, @@ -624,14 +852,15 @@ function buildPrivateInstanceFieldInitSpec( const helper = state.addHelper("classPrivateFieldInitSpec"); return inheritPropComments( - template.statement.ast`${helper}( - ${t.thisExpression()}, - ${t.cloneNode(id)}, - { - writable: true, - value: ${value} - }, - )` as t.ExpressionStatement, + t.expressionStatement( + t.callExpression(helper, [ + t.thisExpression(), + t.cloneNode(id), + process.env.BABEL_8_BREAKING || newHelpers(state) + ? value + : template.expression.ast`{ writable: true, value: ${value} }`, + ]), + ), prop, ); } @@ -641,43 +870,61 @@ function buildPrivateStaticFieldInitSpec( privateNamesMap: PrivateNamesMap, ) { const privateName = privateNamesMap.get(prop.node.key.id.name); - const { id, getId, setId, initAdded } = privateName; - const isAccessor = getId || setId; + return inheritPropComments( + template.statement.ast` + var ${t.cloneNode(privateName.id)} = { + _: ${prop.node.value || t.buildUndefinedNode()} + }; + `, + prop, + ); +} - if (!prop.isProperty() && (initAdded || !isAccessor)) return; +if (!process.env.BABEL_8_BREAKING) { + // eslint-disable-next-line no-var + var buildPrivateStaticFieldInitSpecOld = function ( + prop: NodePath, + privateNamesMap: PrivateNamesMap, + ) { + const privateName = privateNamesMap.get(prop.node.key.id.name); + const { id, getId, setId, initAdded } = privateName; + const isGetterOrSetter = getId || setId; - if (isAccessor) { - privateNamesMap.set(prop.node.key.id.name, { - ...privateName, - initAdded: true, - }); + if (!prop.isProperty() && (initAdded || !isGetterOrSetter)) return; + + if (isGetterOrSetter) { + privateNamesMap.set(prop.node.key.id.name, { + ...privateName, + initAdded: true, + }); + + return inheritPropComments( + template.statement.ast` + var ${t.cloneNode(id)} = { + // configurable is false by default + // enumerable is false by default + // writable is false by default + get: ${getId ? getId.name : prop.scope.buildUndefinedNode()}, + set: ${setId ? setId.name : prop.scope.buildUndefinedNode()} + } + `, + prop, + ); + } + const value = prop.node.value || prop.scope.buildUndefinedNode(); return inheritPropComments( template.statement.ast` var ${t.cloneNode(id)} = { // configurable is false by default // enumerable is false by default - // writable is false by default - get: ${getId ? getId.name : prop.scope.buildUndefinedNode()}, - set: ${setId ? setId.name : prop.scope.buildUndefinedNode()} - } + writable: true, + value: ${value} + }; `, prop, ); - } - - const value = prop.node.value || prop.scope.buildUndefinedNode(); - return inheritPropComments( - template.statement.ast` - var ${t.cloneNode(id)} = { - // configurable is false by default - // enumerable is false by default - writable: true, - value: ${value} - }; - `, - prop, - ); + }; } function buildPrivateMethodInitLoose( @@ -702,8 +949,8 @@ function buildPrivateMethodInitLoose( prop, ); } - const isAccessor = getId || setId; - if (isAccessor) { + const isGetterOrSetter = getId || setId; + if (isGetterOrSetter) { privateNamesMap.set(prop.node.key.id.name, { ...privateName, initAdded: true, @@ -731,18 +978,19 @@ function buildPrivateInstanceMethodInitSpec( state: File, ) { const privateName = privateNamesMap.get(prop.node.key.id.name); - const { getId, setId, initAdded } = privateName; - if (initAdded) return; + if (privateName.initAdded) return; - const isAccessor = getId || setId; - if (isAccessor) { - return buildPrivateAccessorInitialization( - ref, - prop, - privateNamesMap, - state, - ); + if (!process.env.BABEL_8_BREAKING && !newHelpers(state)) { + const isGetterOrSetter = privateName.getId || privateName.setId; + if (isGetterOrSetter) { + return buildPrivateAccessorInitialization( + ref, + prop, + privateNamesMap, + state, + ); + } } return buildPrivateInstanceMethodInitialization( @@ -875,8 +1123,8 @@ function buildPrivateStaticMethodInitLoose( if (initAdded) return; - const isAccessor = getId || setId; - if (isAccessor) { + const isGetterOrSetter = getId || setId; + if (isGetterOrSetter) { privateNamesMap.set(prop.node.key.id.name, { ...privateName, initAdded: true, @@ -934,12 +1182,14 @@ function buildPrivateMethodDeclaration( privateNamesMap.set(prop.node.key.id.name, { ...privateName, getterDeclared: true, + initAdded: true, }); declId = getId; } else if (isSetter) { privateNamesMap.set(prop.node.key.id.name, { ...privateName, setterDeclared: true, + initAdded: true, }); declId = setId; } else if (isStatic && !privateFieldsAsProperties) { @@ -1197,9 +1447,15 @@ export function buildFieldsInitNodes( ); break; case isStatic && isPrivate && isField && !privateFieldsAsProperties: - staticNodes.push( - buildPrivateStaticFieldInitSpec(prop, privateNamesMap), - ); + if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) { + staticNodes.push( + buildPrivateStaticFieldInitSpecOld(prop, privateNamesMap), + ); + } else { + staticNodes.push( + buildPrivateStaticFieldInitSpec(prop, privateNamesMap), + ); + } break; case isStatic && isPublic && isField && setPublicClassFields: // Functions always have non-writable .name and .length properties, @@ -1273,10 +1529,12 @@ export function buildFieldsInitNodes( ); break; case isStatic && isPrivate && isMethod && !privateFieldsAsProperties: - staticNodes.unshift( - // @ts-expect-error checked in switch - buildPrivateStaticFieldInitSpec(prop, privateNamesMap), - ); + if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) { + staticNodes.unshift( + // @ts-expect-error checked in switch + buildPrivateStaticFieldInitSpecOld(prop, privateNamesMap), + ); + } pureStaticNodes.push( buildPrivateMethodDeclaration( // @ts-expect-error checked in switch diff --git a/packages/babel-helper-create-class-features-plugin/src/index.ts b/packages/babel-helper-create-class-features-plugin/src/index.ts index d14806fd4c88..71e6eb35020c 100644 --- a/packages/babel-helper-create-class-features-plugin/src/index.ts +++ b/packages/babel-helper-create-class-features-plugin/src/index.ts @@ -239,7 +239,7 @@ export function createClassFeaturePlugin({ // NODE: These three functions don't support decorators yet, // but verifyUsedFeatures throws if there are both // decorators and private fields. - const privateNamesMap = buildPrivateNamesMap(props); + const privateNamesMap = buildPrivateNamesMap(props, file); const privateNamesNodes = buildPrivateNamesNodes( privateNamesMap, privateFieldsAsProperties ?? loose, diff --git a/packages/babel-helper-create-class-features-plugin/test/fixtures/field-reinitialization/private-accessor/output.js b/packages/babel-helper-create-class-features-plugin/test/fixtures/field-reinitialization/private-accessor/output.js index c83db8d3b1a9..ecb6f16feb73 100644 --- a/packages/babel-helper-create-class-features-plugin/test/fixtures/field-reinitialization/private-accessor/output.js +++ b/packages/babel-helper-create-class-features-plugin/test/fixtures/field-reinitialization/private-accessor/output.js @@ -3,22 +3,19 @@ class Base { return obj; } } -var _foo = /*#__PURE__*/new WeakMap(); +var _foo = /*#__PURE__*/new WeakSet(); class Derived extends Base { constructor(...args) { super(...args); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - get: _get_foo, - set: _set_foo - }); + babelHelpers.classPrivateMethodInitSpec(this, _foo); } static get(obj) { - return babelHelpers.classPrivateFieldGet(obj, _foo).call(obj); + return babelHelpers.classPrivateGetter(obj, _foo, _get_foo).call(obj); } } function _get_foo() { return 'bar'; } function _set_foo(value) { - babelHelpers.classPrivateFieldSet(this, _foo, value); + babelHelpers.classPrivateSetter(this, _foo, _set_foo, value); } diff --git a/packages/babel-helper-create-class-features-plugin/test/fixtures/field-reinitialization/private-field/output.js b/packages/babel-helper-create-class-features-plugin/test/fixtures/field-reinitialization/private-field/output.js index 85ef3e3b1c13..b994cf4c4cec 100644 --- a/packages/babel-helper-create-class-features-plugin/test/fixtures/field-reinitialization/private-field/output.js +++ b/packages/babel-helper-create-class-features-plugin/test/fixtures/field-reinitialization/private-field/output.js @@ -8,12 +8,9 @@ var _foo = /*#__PURE__*/new WeakMap(); class Derived extends Base { constructor(...args) { super(...args); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: ++counter - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, ++counter); } static get(obj) { - return babelHelpers.classPrivateFieldGet(obj, _foo); + return babelHelpers.classPrivateFieldGet2(obj, _foo); } } diff --git a/packages/babel-helper-fixtures/src/index.ts b/packages/babel-helper-fixtures/src/index.ts index a110ae6efd04..529582f9da3f 100644 --- a/packages/babel-helper-fixtures/src/index.ts +++ b/packages/babel-helper-fixtures/src/index.ts @@ -49,6 +49,7 @@ export interface Test { export interface TaskOptions extends InputOptions { BABEL_8_BREAKING?: boolean; DO_NOT_SET_SOURCE_TYPE?: boolean; + SKIP_ON_PUBLISH?: boolean; externalHelpers?: boolean; ignoreOutput?: boolean; minNodeVersion?: string; @@ -191,9 +192,11 @@ function pushTask( return; } - const shouldIgnore = process.env.BABEL_8_BREAKING - ? taskOpts.BABEL_8_BREAKING === false - : taskOpts.BABEL_8_BREAKING === true; + const shouldIgnore = + (process.env.BABEL_8_BREAKING + ? taskOpts.BABEL_8_BREAKING === false + : taskOpts.BABEL_8_BREAKING === true) || + (process.env.IS_PUBLISH ? taskOpts.SKIP_ON_PUBLISH : false); if (shouldIgnore) return; @@ -253,6 +256,7 @@ function pushTask( delete taskOpts.BABEL_8_BREAKING; delete taskOpts.DO_NOT_SET_SOURCE_TYPE; + delete taskOpts.SKIP_ON_PUBLISH; // If there's node requirement, check it before pushing task if (taskOpts.minNodeVersion) { diff --git a/packages/babel-helpers/src/helpers-generated.ts b/packages/babel-helpers/src/helpers-generated.ts index 6ff7344dfaf3..97671d041a9a 100644 --- a/packages/babel-helpers/src/helpers-generated.ts +++ b/packages/babel-helpers/src/helpers-generated.ts @@ -53,6 +53,11 @@ export default Object.freeze({ "7.23.0", 'import checkInRHS from"checkInRHS";import setFunctionName from"setFunctionName";import toPropertyKey from"toPropertyKey";export default function applyDecs2311(e,t,n,r,o,i){var c,a,u=Symbol.metadata||Symbol.for("Symbol.metadata"),s=Object.defineProperty,l={},f=n.length;function p(e,t,n,r){for(var o=0;o=0;H-=n?2:1){var K=b[H],R=n?b[H-1]:void 0,T={},A={kind:["field","accessor","method","getter","setter","class"][o],name:r,metadata:c,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");d(t,"An initializer","be",!0),i.push(t)}.bind(null,T)};if(D)a=K.call(R,z,A),T.v=1,d(a,"class decorators","return")&&(z=a);else if(A.static=f,A.private=m,a=A.access={has:m?v.bind():function(e){return r in e}},E||(P(),a.get=m?I?function(e){return g(e),F.value}:k("get",g):function(e){return e[r]}),j||(P(1),a.set=m?k("set",g):function(e,t){e[r]=t}),z=K.call(R,y?{get:F.get,set:F.set}:F[O],A),T.v=1,y){if("object"==typeof z&&z)(a=d(z.get,"accessor.get"))&&(F.get=a),(a=d(z.set,"accessor.set"))&&(F.set=a),(a=d(z.init,"accessor.init"))&&N.unshift(a);else if(void 0!==z)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else d(z,(h?"field":"method")+" decorators","return")&&(h?N.unshift(z):F[O]=z)}return o<2&&u.push(p.bind(null,N,1),p.bind(null,i,0)),h||D||(m?y?u.splice(-1,0,k("get"),k("set")):u.push(I?F[O]:p.call.bind(F[O])):s(e,r,F)),z}function m(e){return s(e,u,{configurable:!0,enumerable:!0,value:c})}return void 0!==i&&(c=i[u]),c=Object.create(null==c?null:c),a=function(){var n,r,i=[];function c(e){e&&i.push(p.bind(null,e,0))}for(var a=0;a { _computedKey = babelHelpers.toPropertyKey(f()); class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _A); + return babelHelpers.assertClassBrand(this, Foo, _A)._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _A, v); + _A._ = babelHelpers.assertClassBrand(this, Foo, v); } static get "b"() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _C); + return babelHelpers.assertClassBrand(this, Foo, _C)._; } static set "b"(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _C, v); + _C._ = babelHelpers.assertClassBrand(this, Foo, v); } static get ["c"]() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _D); + return babelHelpers.assertClassBrand(this, Foo, _D)._; } static set ["c"](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _D, v); + _D._ = babelHelpers.assertClassBrand(this, Foo, v); } static get 0() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _E); + return babelHelpers.assertClassBrand(this, Foo, _E)._; } static set 0(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _E, v); + _E._ = babelHelpers.assertClassBrand(this, Foo, v); } static get [1]() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _F); + return babelHelpers.assertClassBrand(this, Foo, _F)._; } static set [1](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _F, v); + _F._ = babelHelpers.assertClassBrand(this, Foo, v); } static get 2n() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _G); + return babelHelpers.assertClassBrand(this, Foo, _G)._; } static set 2n(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _G, v); + _G._ = babelHelpers.assertClassBrand(this, Foo, v); } static get [3n]() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _H); + return babelHelpers.assertClassBrand(this, Foo, _H)._; } static set [3n](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _H, v); + _H._ = babelHelpers.assertClassBrand(this, Foo, v); } static get [_computedKey]() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _I); + return babelHelpers.assertClassBrand(this, Foo, _I)._; } static set [_computedKey](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _I, v); + _I._ = babelHelpers.assertClassBrand(this, Foo, v); } } _Foo = Foo; @@ -67,52 +67,39 @@ function _set_a2(v) { function _get_a2() { return _get_a(this); } -var _a = { - get: _get_a2, - set: _set_a2 -}; (() => { [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 6, "a"], [dec, 6, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); + return babelHelpers.assertClassBrand(this, _Foo, _B)._; }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, value); + _B._ = babelHelpers.assertClassBrand(this, _Foo, value); }], [dec, 6, "b"], [dec, 6, "c"], [dec, 6, 0], [dec, 6, 1], [dec, 6, 2n], [dec, 6, 3n], [dec, 6, _computedKey]], []); _initStatic(_Foo); })(); var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: _init_a2(_Foo) + _: _init_a2(_Foo) }; var _C = { - writable: true, - value: _init_computedKey(_Foo) + _: _init_computedKey(_Foo) }; var _D = { - writable: true, - value: _init_computedKey2(_Foo) + _: _init_computedKey2(_Foo) }; var _E = { - writable: true, - value: _init_computedKey3(_Foo) + _: _init_computedKey3(_Foo) }; var _F = { - writable: true, - value: _init_computedKey4(_Foo) + _: _init_computedKey4(_Foo) }; var _G = { - writable: true, - value: _init_computedKey5(_Foo) + _: _init_computedKey5(_Foo) }; var _H = { - writable: true, - value: _init_computedKey6(_Foo) + _: _init_computedKey6(_Foo) }; var _I = { - writable: true, - value: _init_computedKey7(_Foo) + _: _init_computedKey7(_Foo) }; expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/private/output.js index 117452f65a31..8c7f08d3c04b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/private/output.js @@ -1,27 +1,13 @@ var _initProto, _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _Foo; const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); var _B = /*#__PURE__*/new WeakMap(); -var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _b, { - get: _get_b2, - set: _set_b2 - }); - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a2, - set: _set_a2 - }); - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: (_initProto(this), _init_a(this)) - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: _init_b(this, 123) - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); + babelHelpers.classPrivateFieldInitSpec(this, _A, (_initProto(this), _init_a(this))); + babelHelpers.classPrivateFieldInitSpec(this, _B, _init_b(this, 123)); } } _Foo = Foo; @@ -38,11 +24,11 @@ function _get_b2() { return _get_b(this); } [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs(_Foo, [[dec, 1, "a", function () { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); }, function (value) { - babelHelpers.classPrivateFieldSet(this, _A, value); + babelHelpers.classPrivateFieldSet2(this, _A, value); }], [dec, 1, "b", function () { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); }, function (value) { - babelHelpers.classPrivateFieldSet(this, _B, value); + babelHelpers.classPrivateFieldSet2(this, _B, value); }]], []); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js index 4de0c546f290..45baffceaaeb 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/public/output.js @@ -5,36 +5,27 @@ var _B = /*#__PURE__*/new WeakMap(); var _C = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: (_initProto(this), _init_a(this)) - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: _init_b(this, 123) - }); - babelHelpers.classPrivateFieldInitSpec(this, _C, { - writable: true, - value: _init_computedKey(this, 456) - }); + babelHelpers.classPrivateFieldInitSpec(this, _A, (_initProto(this), _init_a(this))); + babelHelpers.classPrivateFieldInitSpec(this, _B, _init_b(this, 123)); + babelHelpers.classPrivateFieldInitSpec(this, _C, _init_computedKey(this, 456)); } get a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } set a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } get b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } set b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } get ['c']() { - return babelHelpers.classPrivateFieldGet(this, _C); + return babelHelpers.classPrivateFieldGet2(this, _C); } set ['c'](v) { - babelHelpers.classPrivateFieldSet(this, _C, v); + babelHelpers.classPrivateFieldSet2(this, _C, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js index e499d60397bd..f9ad313f9d45 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-private/output.js @@ -14,31 +14,21 @@ function _set_b2(v) { function _get_b2() { return _get_b(this); } -var _b = { - get: _get_b2, - set: _set_b2 -}; -var _a = { - get: _get_a2, - set: _set_a2 -}; (() => { [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 6, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _A); + return babelHelpers.assertClassBrand(this, _Foo, _A)._; }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _A, value); + _A._ = babelHelpers.assertClassBrand(this, _Foo, value); }], [dec, 6, "b", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); + return babelHelpers.assertClassBrand(this, _Foo, _B)._; }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, value); + _B._ = babelHelpers.assertClassBrand(this, _Foo, value); }]], []); _initStatic(_Foo); })(); var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: _init_b(_Foo, 123) + _: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js index 46980cbc00d2..7b7adc6deefa 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/static-public/output.js @@ -2,22 +2,22 @@ var _initStatic, _init_a, _init_b, _init_computedKey, _Foo; const dec = () => {}; class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _A); + return babelHelpers.assertClassBrand(this, Foo, _A)._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _A, v); + _A._ = babelHelpers.assertClassBrand(this, Foo, v); } static get b() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _B); + return babelHelpers.assertClassBrand(this, Foo, _B)._; } static set b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _B, v); + _B._ = babelHelpers.assertClassBrand(this, Foo, v); } static get ['c']() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _C); + return babelHelpers.assertClassBrand(this, Foo, _C)._; } static set ['c'](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _C, v); + _C._ = babelHelpers.assertClassBrand(this, Foo, v); } } _Foo = Foo; @@ -26,14 +26,11 @@ _Foo = Foo; _initStatic(_Foo); })(); var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: _init_b(_Foo, 123) + _: _init_b(_Foo, 123) }; var _C = { - writable: true, - value: _init_computedKey(_Foo, 456) + _: _init_computedKey(_Foo, 456) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-private/output.js index 84ce390b7799..7eec69358ee3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-private/output.js @@ -1,37 +1,23 @@ const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); var _B = /*#__PURE__*/new WeakMap(); -var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _b, { - get: _get_b, - set: _set_b - }); - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }); - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: 123 - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); + babelHelpers.classPrivateFieldInitSpec(this, _A, void 0); + babelHelpers.classPrivateFieldInitSpec(this, _B, 123); } } function _get_a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } function _set_a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } function _get_b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } function _set_b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-public/output.js index 070b4006e2e9..74270e9c1588 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-public/output.js @@ -4,35 +4,26 @@ var _B = /*#__PURE__*/new WeakMap(); var _C = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: 123 - }); - babelHelpers.classPrivateFieldInitSpec(this, _C, { - writable: true, - value: 456 - }); + babelHelpers.classPrivateFieldInitSpec(this, _A, void 0); + babelHelpers.classPrivateFieldInitSpec(this, _B, 123); + babelHelpers.classPrivateFieldInitSpec(this, _C, 456); } get a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } set a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } get b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } set b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } get ['c']() { - return babelHelpers.classPrivateFieldGet(this, _C); + return babelHelpers.classPrivateFieldGet2(this, _C); } set ['c'](v) { - babelHelpers.classPrivateFieldSet(this, _C, v); + babelHelpers.classPrivateFieldSet2(this, _C, v); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-private/output.js index ae0ff8265ff9..cc3f5fe85c73 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-private/output.js @@ -3,30 +3,20 @@ const dec = () => {}; class Foo {} _Foo = Foo; function _get_a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _A); + return babelHelpers.assertClassBrand(this, _Foo, _A)._; } function _set_a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _A, v); + _A._ = babelHelpers.assertClassBrand(this, _Foo, v); } function _get_b() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); + return babelHelpers.assertClassBrand(this, _Foo, _B)._; } function _set_b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, v); + _B._ = babelHelpers.assertClassBrand(this, _Foo, v); } -var _b = { - get: _get_b, - set: _set_b -}; -var _a = { - get: _get_a, - set: _set_a -}; var _A = { - writable: true, - value: void 0 + _: void 0 }; var _B = { - writable: true, - value: 123 + _: 123 }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-public/output.js index 5041e9a95d6e..991a71fe80f8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-accessors--to-es2015/undecorated-static-public/output.js @@ -1,33 +1,30 @@ const dec = () => {}; class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _A); + return babelHelpers.assertClassBrand(this, Foo, _A)._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _A, v); + _A._ = babelHelpers.assertClassBrand(this, Foo, v); } static get b() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _B); + return babelHelpers.assertClassBrand(this, Foo, _B)._; } static set b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _B, v); + _B._ = babelHelpers.assertClassBrand(this, Foo, v); } static get ['c']() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _C); + return babelHelpers.assertClassBrand(this, Foo, _C)._; } static set ['c'](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _C, v); + _C._ = babelHelpers.assertClassBrand(this, Foo, v); } } var _A = { - writable: true, - value: void 0 + _: void 0 }; var _B = { - writable: true, - value: 123 + _: 123 }; var _C = { - writable: true, - value: 456 + _: 456 }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js index 10f8a096308b..d13a14090f52 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/output.js @@ -1,34 +1,22 @@ -var _initClass, _x, _A, _a, _m, _B, _temp; +var _initClass, _x, _A, _a, _B, _temp; const dec = () => {}; let hasX, hasA, hasM; let _Foo; -new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#__PURE__*/new WeakMap(), _m = /*#__PURE__*/new WeakSet(), _B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identity { +new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#__PURE__*/new WeakSet(), _B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identity { constructor() { - (super(_Foo), babelHelpers.classPrivateMethodInitSpec(this, _m), babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }), babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }), babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }), babelHelpers.defineProperty(this, "x", void 0), babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: void 0 - }), this), (() => { + (super(_Foo), babelHelpers.classPrivateMethodInitSpec(this, _a), babelHelpers.classPrivateFieldInitSpec(this, _x, void 0), babelHelpers.classPrivateFieldInitSpec(this, _A, void 0), babelHelpers.defineProperty(this, "x", void 0), babelHelpers.classPrivateFieldInitSpec(this, _B, void 0), this), (() => { hasX = o => _x.has(babelHelpers.checkInRHS(o)); hasA = o => _a.has(babelHelpers.checkInRHS(o)); - hasM = o => _m.has(babelHelpers.checkInRHS(o)); + hasM = o => _a.has(babelHelpers.checkInRHS(o)); })(), _initClass(); } }, (_Foo2 => { class Foo { static get a() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } static set a(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } static m() {} } @@ -36,9 +24,9 @@ new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#_ [_Foo, _initClass] = babelHelpers.applyDecs(_Foo2, [], [dec]); })(), _temp))(); function _get_a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } function _set_a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } -function _m2() {} +function _m() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/context-name/output.js index 4aafcdfb4802..dddff5bdc12b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/context-name/output.js @@ -13,14 +13,13 @@ _computedKey = babelHelpers.toPropertyKey(f()); class Foo {} _Foo = Foo; [_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs(_Foo, [[dec, 5, "a"], [dec, 5, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _a); + return babelHelpers.assertClassBrand(this, _Foo, _a)._; }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _a, value); + _a._ = babelHelpers.assertClassBrand(this, _Foo, value); }], [dec, 5, "b"], [dec, 5, "c"], [dec, 5, 0], [dec, 5, 1], [dec, 5, 2n], [dec, 5, 3n], [dec, 5, _computedKey]], []); babelHelpers.defineProperty(Foo, "a", _init_a(_Foo)); var _a = { - writable: true, - value: _init_a2(_Foo) + _: _init_a2(_Foo) }; babelHelpers.defineProperty(Foo, "b", _init_computedKey(_Foo)); babelHelpers.defineProperty(Foo, "c", _init_computedKey2(_Foo)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js index 8304c745a458..0ac901251b37 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/private/output.js @@ -4,23 +4,17 @@ var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: _init_a(this) - }); - babelHelpers.classPrivateFieldInitSpec(this, _b, { - writable: true, - value: _init_b(this, 123) - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, _init_a(this)); + babelHelpers.classPrivateFieldInitSpec(this, _b, _init_b(this, 123)); } } _Foo = Foo; [_init_a, _init_b] = babelHelpers.applyDecs(_Foo, [[dec, 0, "a", function () { - return babelHelpers.classPrivateFieldGet(this, _a); + return babelHelpers.classPrivateFieldGet2(this, _a); }, function (value) { - babelHelpers.classPrivateFieldSet(this, _a, value); + babelHelpers.classPrivateFieldSet2(this, _a, value); }], [dec, 0, "b", function () { - return babelHelpers.classPrivateFieldGet(this, _b); + return babelHelpers.classPrivateFieldGet2(this, _b); }, function (value) { - babelHelpers.classPrivateFieldSet(this, _b, value); + babelHelpers.classPrivateFieldSet2(this, _b, value); }]], []); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js index c901b3068bd3..5ba055e50820 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-fields--to-es2015/static-private/output.js @@ -3,19 +3,17 @@ const dec = () => {}; class Foo {} _Foo = Foo; [_init_a, _init_b] = babelHelpers.applyDecs(_Foo, [[dec, 5, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _a); + return babelHelpers.assertClassBrand(this, _Foo, _a)._; }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _a, value); + _a._ = babelHelpers.assertClassBrand(this, _Foo, value); }], [dec, 5, "b", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _b); + return babelHelpers.assertClassBrand(this, _Foo, _b)._; }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _b, value); + _b._ = babelHelpers.assertClassBrand(this, _Foo, value); }]], []); var _a = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _b = { - writable: true, - value: _init_b(_Foo, 123) + _: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/context-name/output.js index 42c29002e121..3a174007a032 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/context-name/output.js @@ -24,10 +24,6 @@ _Foo = Foo; function _get_a() { return _call_a(this); } -var _a = { - get: _get_a, - set: void 0 -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 8, "a"], [dec, 8, "a", function () {}], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []); _initStatic(_Foo); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js index 02cc0656da15..629933ff6fc6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/output.js @@ -1,16 +1,13 @@ var _initProto, _call_a, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: void 0 - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } getA() { - return babelHelpers.classPrivateFieldGet(this, _a); + return babelHelpers.classPrivateGetter(this, _a, _get_a); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js index 9408079c478d..688bab97ebbf 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/static-private/output.js @@ -2,17 +2,13 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static getA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); + return babelHelpers.classPrivateGetter(this, Foo, _get_a); } } _Foo = Foo; function _get_a() { return _call_a(this); } -var _a = { - get: _get_a, - set: void 0 -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 8, "a", function () { return this.value; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js index e6ec5cadd2ea..e83c5f9866d7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/private/output.js @@ -1,19 +1,16 @@ var _initProto, _call_a, _call_a2, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } getA() { - return babelHelpers.classPrivateFieldGet(this, _a); + return babelHelpers.classPrivateGetter(this, _a, _get_a); } setA(v) { - babelHelpers.classPrivateFieldSet(this, _a, v); + babelHelpers.classPrivateSetter(this, _a, _set_a, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js index 0cbad3888fb6..916ba217ac4f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters-and-setters--to-es2015/static-private/output.js @@ -2,10 +2,10 @@ var _initStatic, _call_a, _call_a2, _Foo; const dec = () => {}; class Foo { static getA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); + return babelHelpers.classPrivateGetter(this, Foo, _get_a); } static setA(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); + babelHelpers.classPrivateSetter(this, Foo, _set_a, v); } } _Foo = Foo; @@ -15,10 +15,6 @@ function _get_a() { function _set_a(v) { _call_a2(this, v); } -var _a = { - get: _get_a, - set: _set_a -}; (() => { [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 8, "a", function () { return this.value; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/context-name/output.js index 2b98c9842847..0669b1297661 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/context-name/output.js @@ -26,7 +26,6 @@ _Foo = Foo; _initStatic(_Foo); })(); var _a = { - writable: true, - value: _call_a + _: _call_a }; expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js index 137c0212f964..0ac3ba4a450a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/private/output.js @@ -3,14 +3,11 @@ const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: _call_a - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, _call_a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } callA() { - return babelHelpers.classPrivateFieldGet(this, _a).call(this); + return babelHelpers.classPrivateFieldGet2(this, _a).call(this); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js index 011d8b51838f..be3eb222c608 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-methods--to-es2015/static-private/output.js @@ -2,7 +2,7 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static callA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a).call(this); + return babelHelpers.assertClassBrand(this, Foo, _a)._.call(this); } } _Foo = Foo; @@ -13,7 +13,6 @@ _Foo = Foo; _initStatic(_Foo); })(); var _a = { - writable: true, - value: _call_a + _: _call_a }; babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js index f061d8b5c003..c512b212a786 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-misc--to-es2015/valid-expression-formats/output.js @@ -9,15 +9,12 @@ let _Foo; var _a = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: void _initProto(this) - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, void _initProto(this)); } method() {} makeClass() { var _dec5, _init_bar, _Nested; - return _dec5 = babelHelpers.classPrivateFieldGet(this, _a), (_Nested = class Nested { + return _dec5 = babelHelpers.classPrivateFieldGet2(this, _a), (_Nested = class Nested { constructor() { babelHelpers.defineProperty(this, "bar", _init_bar(this)); } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/context-name/output.js index 4e78cb9a3bb8..8caa23df100d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/context-name/output.js @@ -24,10 +24,6 @@ _Foo = Foo; function _set_a(v) { _call_a(this, v); } -var _a = { - get: void 0, - set: _set_a -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 9, "a"], [dec, 9, "a", function (v) {}], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []); _initStatic(_Foo); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js index d858e92ba82c..73c807865b4a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/private/output.js @@ -1,16 +1,13 @@ var _initProto, _call_a, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: void 0, - set: _set_a - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } setA(v) { - babelHelpers.classPrivateFieldSet(this, _a, v); + babelHelpers.classPrivateSetter(this, _a, _set_a, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js index 89da3a32ac1a..28b67dd66877 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-setters--to-es2015/static-private/output.js @@ -2,17 +2,13 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static setA(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); + babelHelpers.classPrivateSetter(this, Foo, _set_a, v); } } _Foo = Foo; function _set_a(v) { _call_a(this, v); } -var _a = { - get: void 0, - set: _set_a -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs(_Foo, [[dec, 9, "a", function (v) { return this.value = v; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/context-name/output.js index 5ecb54f2249e..5ad756f33c30 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/context-name/output.js @@ -12,52 +12,52 @@ const f = () => { _computedKey = babelHelpers.toPropertyKey(f()); class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _A); + return babelHelpers.assertClassBrand(this, Foo, _A)._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _A, v); + _A._ = babelHelpers.assertClassBrand(this, Foo, v); } static get "b"() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _C); + return babelHelpers.assertClassBrand(this, Foo, _C)._; } static set "b"(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _C, v); + _C._ = babelHelpers.assertClassBrand(this, Foo, v); } static get ["c"]() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _D); + return babelHelpers.assertClassBrand(this, Foo, _D)._; } static set ["c"](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _D, v); + _D._ = babelHelpers.assertClassBrand(this, Foo, v); } static get 0() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _E); + return babelHelpers.assertClassBrand(this, Foo, _E)._; } static set 0(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _E, v); + _E._ = babelHelpers.assertClassBrand(this, Foo, v); } static get [1]() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _F); + return babelHelpers.assertClassBrand(this, Foo, _F)._; } static set [1](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _F, v); + _F._ = babelHelpers.assertClassBrand(this, Foo, v); } static get 2n() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _G); + return babelHelpers.assertClassBrand(this, Foo, _G)._; } static set 2n(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _G, v); + _G._ = babelHelpers.assertClassBrand(this, Foo, v); } static get [3n]() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _H); + return babelHelpers.assertClassBrand(this, Foo, _H)._; } static set [3n](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _H, v); + _H._ = babelHelpers.assertClassBrand(this, Foo, v); } static get [_computedKey]() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _I); + return babelHelpers.assertClassBrand(this, Foo, _I)._; } static set [_computedKey](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _I, v); + _I._ = babelHelpers.assertClassBrand(this, Foo, v); } } _Foo = Foo; @@ -67,52 +67,39 @@ function _set_a2(v) { function _get_a2() { return _get_a(this); } -var _a = { - get: _get_a2, - set: _set_a2 -}; (() => { [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 6, "a"], [dec, 6, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); + return babelHelpers.assertClassBrand(this, _Foo, _B)._; }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, value); + _B._ = babelHelpers.assertClassBrand(this, _Foo, value); }], [dec, 6, "b"], [dec, 6, "c"], [dec, 6, 0], [dec, 6, 1], [dec, 6, 2n], [dec, 6, 3n], [dec, 6, _computedKey]], []).e; _initStatic(_Foo); })(); var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: _init_a2(_Foo) + _: _init_a2(_Foo) }; var _C = { - writable: true, - value: _init_computedKey(_Foo) + _: _init_computedKey(_Foo) }; var _D = { - writable: true, - value: _init_computedKey2(_Foo) + _: _init_computedKey2(_Foo) }; var _E = { - writable: true, - value: _init_computedKey3(_Foo) + _: _init_computedKey3(_Foo) }; var _F = { - writable: true, - value: _init_computedKey4(_Foo) + _: _init_computedKey4(_Foo) }; var _G = { - writable: true, - value: _init_computedKey5(_Foo) + _: _init_computedKey5(_Foo) }; var _H = { - writable: true, - value: _init_computedKey6(_Foo) + _: _init_computedKey6(_Foo) }; var _I = { - writable: true, - value: _init_computedKey7(_Foo) + _: _init_computedKey7(_Foo) }; expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/private/output.js index b78d5ffb5670..c9c351b39135 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/private/output.js @@ -1,27 +1,13 @@ var _initProto, _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _Foo; const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); var _B = /*#__PURE__*/new WeakMap(); -var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _b, { - get: _get_b2, - set: _set_b2 - }); - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a2, - set: _set_a2 - }); - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: (_initProto(this), _init_a(this)) - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: _init_b(this, 123) - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); + babelHelpers.classPrivateFieldInitSpec(this, _A, (_initProto(this), _init_a(this))); + babelHelpers.classPrivateFieldInitSpec(this, _B, _init_b(this, 123)); } } _Foo = Foo; @@ -38,11 +24,11 @@ function _get_b2() { return _get_b(this); } [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs2203R(_Foo, [[dec, 1, "a", function () { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); }, function (value) { - babelHelpers.classPrivateFieldSet(this, _A, value); + babelHelpers.classPrivateFieldSet2(this, _A, value); }], [dec, 1, "b", function () { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); }, function (value) { - babelHelpers.classPrivateFieldSet(this, _B, value); + babelHelpers.classPrivateFieldSet2(this, _B, value); }]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/public/output.js index 087f5b2b94a1..f628a8c17fab 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/public/output.js @@ -5,36 +5,27 @@ var _B = /*#__PURE__*/new WeakMap(); var _C = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: (_initProto(this), _init_a(this)) - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: _init_b(this, 123) - }); - babelHelpers.classPrivateFieldInitSpec(this, _C, { - writable: true, - value: _init_computedKey(this, 456) - }); + babelHelpers.classPrivateFieldInitSpec(this, _A, (_initProto(this), _init_a(this))); + babelHelpers.classPrivateFieldInitSpec(this, _B, _init_b(this, 123)); + babelHelpers.classPrivateFieldInitSpec(this, _C, _init_computedKey(this, 456)); } get a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } set a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } get b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } set b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } get ['c']() { - return babelHelpers.classPrivateFieldGet(this, _C); + return babelHelpers.classPrivateFieldGet2(this, _C); } set ['c'](v) { - babelHelpers.classPrivateFieldSet(this, _C, v); + babelHelpers.classPrivateFieldSet2(this, _C, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-private/output.js index 0661a48f2a7a..1508e744bc87 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-private/output.js @@ -14,31 +14,21 @@ function _set_b2(v) { function _get_b2() { return _get_b(this); } -var _b = { - get: _get_b2, - set: _set_b2 -}; -var _a = { - get: _get_a2, - set: _set_a2 -}; (() => { [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 6, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _A); + return babelHelpers.assertClassBrand(this, _Foo, _A)._; }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _A, value); + _A._ = babelHelpers.assertClassBrand(this, _Foo, value); }], [dec, 6, "b", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); + return babelHelpers.assertClassBrand(this, _Foo, _B)._; }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, value); + _B._ = babelHelpers.assertClassBrand(this, _Foo, value); }]], []).e; _initStatic(_Foo); })(); var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: _init_b(_Foo, 123) + _: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-public/output.js index e03d19a220be..f2ed180ebfff 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-public/output.js @@ -2,22 +2,22 @@ var _initStatic, _init_a, _init_b, _init_computedKey, _Foo; const dec = () => {}; class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _A); + return babelHelpers.assertClassBrand(this, Foo, _A)._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _A, v); + _A._ = babelHelpers.assertClassBrand(this, Foo, v); } static get b() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _B); + return babelHelpers.assertClassBrand(this, Foo, _B)._; } static set b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _B, v); + _B._ = babelHelpers.assertClassBrand(this, Foo, v); } static get ['c']() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _C); + return babelHelpers.assertClassBrand(this, Foo, _C)._; } static set ['c'](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _C, v); + _C._ = babelHelpers.assertClassBrand(this, Foo, v); } } _Foo = Foo; @@ -26,14 +26,11 @@ _Foo = Foo; _initStatic(_Foo); })(); var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: _init_b(_Foo, 123) + _: _init_b(_Foo, 123) }; var _C = { - writable: true, - value: _init_computedKey(_Foo, 456) + _: _init_computedKey(_Foo, 456) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-private/output.js index 84ce390b7799..7eec69358ee3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-private/output.js @@ -1,37 +1,23 @@ const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); var _B = /*#__PURE__*/new WeakMap(); -var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _b, { - get: _get_b, - set: _set_b - }); - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }); - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: 123 - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); + babelHelpers.classPrivateFieldInitSpec(this, _A, void 0); + babelHelpers.classPrivateFieldInitSpec(this, _B, 123); } } function _get_a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } function _set_a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } function _get_b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } function _set_b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-public/output.js index 070b4006e2e9..74270e9c1588 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-public/output.js @@ -4,35 +4,26 @@ var _B = /*#__PURE__*/new WeakMap(); var _C = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: 123 - }); - babelHelpers.classPrivateFieldInitSpec(this, _C, { - writable: true, - value: 456 - }); + babelHelpers.classPrivateFieldInitSpec(this, _A, void 0); + babelHelpers.classPrivateFieldInitSpec(this, _B, 123); + babelHelpers.classPrivateFieldInitSpec(this, _C, 456); } get a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } set a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } get b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } set b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } get ['c']() { - return babelHelpers.classPrivateFieldGet(this, _C); + return babelHelpers.classPrivateFieldGet2(this, _C); } set ['c'](v) { - babelHelpers.classPrivateFieldSet(this, _C, v); + babelHelpers.classPrivateFieldSet2(this, _C, v); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-static-private/output.js index ae0ff8265ff9..cc3f5fe85c73 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-static-private/output.js @@ -3,30 +3,20 @@ const dec = () => {}; class Foo {} _Foo = Foo; function _get_a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _A); + return babelHelpers.assertClassBrand(this, _Foo, _A)._; } function _set_a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _A, v); + _A._ = babelHelpers.assertClassBrand(this, _Foo, v); } function _get_b() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); + return babelHelpers.assertClassBrand(this, _Foo, _B)._; } function _set_b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, v); + _B._ = babelHelpers.assertClassBrand(this, _Foo, v); } -var _b = { - get: _get_b, - set: _set_b -}; -var _a = { - get: _get_a, - set: _set_a -}; var _A = { - writable: true, - value: void 0 + _: void 0 }; var _B = { - writable: true, - value: 123 + _: 123 }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-static-public/output.js index 5041e9a95d6e..991a71fe80f8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/undecorated-static-public/output.js @@ -1,33 +1,30 @@ const dec = () => {}; class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _A); + return babelHelpers.assertClassBrand(this, Foo, _A)._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _A, v); + _A._ = babelHelpers.assertClassBrand(this, Foo, v); } static get b() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _B); + return babelHelpers.assertClassBrand(this, Foo, _B)._; } static set b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _B, v); + _B._ = babelHelpers.assertClassBrand(this, Foo, v); } static get ['c']() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _C); + return babelHelpers.assertClassBrand(this, Foo, _C)._; } static set ['c'](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _C, v); + _C._ = babelHelpers.assertClassBrand(this, Foo, v); } } var _A = { - writable: true, - value: void 0 + _: void 0 }; var _B = { - writable: true, - value: 123 + _: 123 }; var _C = { - writable: true, - value: 456 + _: 456 }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-static-installed-on-correct-class/output.js index de87944f0887..3fc6f6e6707d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-classes--to-es2015/replacement-static-installed-on-correct-class/output.js @@ -1,34 +1,22 @@ -var _initClass, _x, _A, _a, _m, _B, _temp; +var _initClass, _x, _A, _a, _B, _temp; const dec = () => {}; let hasX, hasA, hasM; let _Foo; -new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#__PURE__*/new WeakMap(), _m = /*#__PURE__*/new WeakSet(), _B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identity { +new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#__PURE__*/new WeakSet(), _B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identity { constructor() { - (super(_Foo), babelHelpers.classPrivateMethodInitSpec(this, _m), babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }), babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }), babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }), babelHelpers.defineProperty(this, "x", void 0), babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: void 0 - }), this), (() => { + (super(_Foo), babelHelpers.classPrivateMethodInitSpec(this, _a), babelHelpers.classPrivateFieldInitSpec(this, _x, void 0), babelHelpers.classPrivateFieldInitSpec(this, _A, void 0), babelHelpers.defineProperty(this, "x", void 0), babelHelpers.classPrivateFieldInitSpec(this, _B, void 0), this), (() => { hasX = o => _x.has(babelHelpers.checkInRHS(o)); hasA = o => _a.has(babelHelpers.checkInRHS(o)); - hasM = o => _m.has(babelHelpers.checkInRHS(o)); + hasM = o => _a.has(babelHelpers.checkInRHS(o)); })(), _initClass(); } }, (_Foo2 => { class Foo { static get a() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } static set a(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } static m() {} } @@ -36,9 +24,9 @@ new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#_ [_Foo, _initClass] = babelHelpers.applyDecs2203R(_Foo2, [], [dec]).c; })(), _temp))(); function _get_a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } function _set_a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } -function _m2() {} +function _m() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/context-name/output.js index eb402a378345..acdc194d986e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/context-name/output.js @@ -13,14 +13,13 @@ _computedKey = babelHelpers.toPropertyKey(f()); class Foo {} _Foo = Foo; [_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs2203R(_Foo, [[dec, 5, "a"], [dec, 5, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _a); + return babelHelpers.assertClassBrand(this, _Foo, _a)._; }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _a, value); + _a._ = babelHelpers.assertClassBrand(this, _Foo, value); }], [dec, 5, "b"], [dec, 5, "c"], [dec, 5, 0], [dec, 5, 1], [dec, 5, 2n], [dec, 5, 3n], [dec, 5, _computedKey]], []).e; babelHelpers.defineProperty(Foo, "a", _init_a(_Foo)); var _a = { - writable: true, - value: _init_a2(_Foo) + _: _init_a2(_Foo) }; babelHelpers.defineProperty(Foo, "b", _init_computedKey(_Foo)); babelHelpers.defineProperty(Foo, "c", _init_computedKey2(_Foo)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/private/output.js index d72abd7b500c..a774638e4537 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/private/output.js @@ -4,23 +4,17 @@ var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: _init_a(this) - }); - babelHelpers.classPrivateFieldInitSpec(this, _b, { - writable: true, - value: _init_b(this, 123) - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, _init_a(this)); + babelHelpers.classPrivateFieldInitSpec(this, _b, _init_b(this, 123)); } } _Foo = Foo; [_init_a, _init_b] = babelHelpers.applyDecs2203R(_Foo, [[dec, 0, "a", function () { - return babelHelpers.classPrivateFieldGet(this, _a); + return babelHelpers.classPrivateFieldGet2(this, _a); }, function (value) { - babelHelpers.classPrivateFieldSet(this, _a, value); + babelHelpers.classPrivateFieldSet2(this, _a, value); }], [dec, 0, "b", function () { - return babelHelpers.classPrivateFieldGet(this, _b); + return babelHelpers.classPrivateFieldGet2(this, _b); }, function (value) { - babelHelpers.classPrivateFieldSet(this, _b, value); + babelHelpers.classPrivateFieldSet2(this, _b, value); }]], []).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-private/output.js index 73d70dbf8c4a..302ef25efdc4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-private/output.js @@ -3,19 +3,17 @@ const dec = () => {}; class Foo {} _Foo = Foo; [_init_a, _init_b] = babelHelpers.applyDecs2203R(_Foo, [[dec, 5, "a", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _a); + return babelHelpers.assertClassBrand(this, _Foo, _a)._; }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _a, value); + _a._ = babelHelpers.assertClassBrand(this, _Foo, value); }], [dec, 5, "b", function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _b); + return babelHelpers.assertClassBrand(this, _Foo, _b)._; }, function (value) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _b, value); + _b._ = babelHelpers.assertClassBrand(this, _Foo, value); }]], []).e; var _a = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _b = { - writable: true, - value: _init_b(_Foo, 123) + _: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/context-name/output.js index db837029c9ed..d8efb8e5ec2b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/context-name/output.js @@ -24,10 +24,6 @@ _Foo = Foo; function _get_a() { return _call_a(this); } -var _a = { - get: _get_a, - set: void 0 -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 8, "a"], [dec, 8, "a", function () {}], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []).e; _initStatic(_Foo); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/private/output.js index 10e25b473b67..eb2d4d441058 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/private/output.js @@ -1,16 +1,13 @@ var _initProto, _call_a, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: void 0 - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } getA() { - return babelHelpers.classPrivateFieldGet(this, _a); + return babelHelpers.classPrivateGetter(this, _a, _get_a); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-private/output.js index b5cc3176a79d..b35239b8d88d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-private/output.js @@ -2,17 +2,13 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static getA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); + return babelHelpers.classPrivateGetter(this, Foo, _get_a); } } _Foo = Foo; function _get_a() { return _call_a(this); } -var _a = { - get: _get_a, - set: void 0 -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 8, "a", function () { return this.value; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/private/output.js index 1f615c6dce0c..93d6fa3023f2 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/private/output.js @@ -1,19 +1,16 @@ var _initProto, _call_a, _call_a2, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } getA() { - return babelHelpers.classPrivateFieldGet(this, _a); + return babelHelpers.classPrivateGetter(this, _a, _get_a); } setA(v) { - babelHelpers.classPrivateFieldSet(this, _a, v); + babelHelpers.classPrivateSetter(this, _a, _set_a, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-private/output.js index a56b5cfb9cb8..4c8d664f9ac9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-private/output.js @@ -2,10 +2,10 @@ var _initStatic, _call_a, _call_a2, _Foo; const dec = () => {}; class Foo { static getA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); + return babelHelpers.classPrivateGetter(this, Foo, _get_a); } static setA(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); + babelHelpers.classPrivateSetter(this, Foo, _set_a, v); } } _Foo = Foo; @@ -15,10 +15,6 @@ function _get_a() { function _set_a(v) { _call_a2(this, v); } -var _a = { - get: _get_a, - set: _set_a -}; (() => { [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 8, "a", function () { return this.value; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/context-name/output.js index 349cdadbd485..fbe1a4aa899e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/context-name/output.js @@ -26,7 +26,6 @@ _Foo = Foo; _initStatic(_Foo); })(); var _a = { - writable: true, - value: _call_a + _: _call_a }; expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/private/output.js index 59059a842798..cd0c6b9811c7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/private/output.js @@ -3,14 +3,11 @@ const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: _call_a - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, _call_a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } callA() { - return babelHelpers.classPrivateFieldGet(this, _a).call(this); + return babelHelpers.classPrivateFieldGet2(this, _a).call(this); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-private/output.js index 4ea12fadd479..7c9a9cecbf04 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-private/output.js @@ -2,7 +2,7 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static callA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a).call(this); + return babelHelpers.assertClassBrand(this, Foo, _a)._.call(this); } } _Foo = Foo; @@ -13,7 +13,6 @@ _Foo = Foo; _initStatic(_Foo); })(); var _a = { - writable: true, - value: _call_a + _: _call_a }; babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/valid-expression-formats/output.js index 79646ee30625..f4e2044cccf9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/valid-expression-formats/output.js @@ -9,15 +9,12 @@ let _Foo; var _a = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: void _initProto(this) - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, void _initProto(this)); } method() {} makeClass() { var _dec5, _init_bar, _Nested; - return _dec5 = babelHelpers.classPrivateFieldGet(this, _a), (_Nested = class Nested { + return _dec5 = babelHelpers.classPrivateFieldGet2(this, _a), (_Nested = class Nested { constructor() { babelHelpers.defineProperty(this, "bar", _init_bar(this)); } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/context-name/output.js index 98956951f5bf..7ed7bb3b261e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/context-name/output.js @@ -24,10 +24,6 @@ _Foo = Foo; function _set_a(v) { _call_a(this, v); } -var _a = { - get: void 0, - set: _set_a -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 9, "a"], [dec, 9, "a", function (v) {}], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []).e; _initStatic(_Foo); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/private/output.js index 11591c0f8c49..48314e44a72e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/private/output.js @@ -1,16 +1,13 @@ var _initProto, _call_a, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: void 0, - set: _set_a - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } setA(v) { - babelHelpers.classPrivateFieldSet(this, _a, v); + babelHelpers.classPrivateSetter(this, _a, _set_a, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-private/output.js index 3a5b6b4b7059..2b1bbcf090c4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-private/output.js @@ -2,17 +2,13 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static setA(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); + babelHelpers.classPrivateSetter(this, Foo, _set_a, v); } } _Foo = Foo; function _set_a(v) { _call_a(this, v); } -var _a = { - get: void 0, - set: _set_a -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2203R(_Foo, [[dec, 9, "a", function (v) { return this.value = v; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/context-name/output.js index 43ac156963be..348f2262ee37 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/context-name/output.js @@ -12,52 +12,52 @@ const f = () => { _computedKey = babelHelpers.toPropertyKey(f()); class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _A); + return babelHelpers.assertClassBrand(this, Foo, _A)._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _A, v); + _A._ = babelHelpers.assertClassBrand(this, Foo, v); } static get "b"() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _C); + return babelHelpers.assertClassBrand(this, Foo, _C)._; } static set "b"(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _C, v); + _C._ = babelHelpers.assertClassBrand(this, Foo, v); } static get ["c"]() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _D); + return babelHelpers.assertClassBrand(this, Foo, _D)._; } static set ["c"](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _D, v); + _D._ = babelHelpers.assertClassBrand(this, Foo, v); } static get 0() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _E); + return babelHelpers.assertClassBrand(this, Foo, _E)._; } static set 0(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _E, v); + _E._ = babelHelpers.assertClassBrand(this, Foo, v); } static get [1]() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _F); + return babelHelpers.assertClassBrand(this, Foo, _F)._; } static set [1](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _F, v); + _F._ = babelHelpers.assertClassBrand(this, Foo, v); } static get 2n() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _G); + return babelHelpers.assertClassBrand(this, Foo, _G)._; } static set 2n(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _G, v); + _G._ = babelHelpers.assertClassBrand(this, Foo, v); } static get [3n]() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _H); + return babelHelpers.assertClassBrand(this, Foo, _H)._; } static set [3n](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _H, v); + _H._ = babelHelpers.assertClassBrand(this, Foo, v); } static get [_computedKey]() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _I); + return babelHelpers.assertClassBrand(this, Foo, _I)._; } static set [_computedKey](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _I, v); + _I._ = babelHelpers.assertClassBrand(this, Foo, v); } } _Foo = Foo; @@ -67,48 +67,35 @@ function _set_a2(v) { function _get_a2() { return _get_a(this); } -var _a = { - get: _get_a2, - set: _set_a2 -}; (() => { - [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 6, "a"], [dec, 6, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _B, v)], [dec, 6, "b"], [dec, 6, "c"], [dec, 6, 0], [dec, 6, 1], [dec, 6, 2n], [dec, 6, 3n], [dec, 6, _computedKey]], []).e; + [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 6, "a"], [dec, 6, "a", o => babelHelpers.assertClassBrand(o, _Foo, _B)._, (o, v) => _B._ = babelHelpers.assertClassBrand(o, _Foo, v)], [dec, 6, "b"], [dec, 6, "c"], [dec, 6, 0], [dec, 6, 1], [dec, 6, 2n], [dec, 6, 3n], [dec, 6, _computedKey]], []).e; _initStatic(_Foo); })(); var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: _init_a2(_Foo) + _: _init_a2(_Foo) }; var _C = { - writable: true, - value: _init_computedKey(_Foo) + _: _init_computedKey(_Foo) }; var _D = { - writable: true, - value: _init_computedKey2(_Foo) + _: _init_computedKey2(_Foo) }; var _E = { - writable: true, - value: _init_computedKey3(_Foo) + _: _init_computedKey3(_Foo) }; var _F = { - writable: true, - value: _init_computedKey4(_Foo) + _: _init_computedKey4(_Foo) }; var _G = { - writable: true, - value: _init_computedKey5(_Foo) + _: _init_computedKey5(_Foo) }; var _H = { - writable: true, - value: _init_computedKey6(_Foo) + _: _init_computedKey6(_Foo) }; var _I = { - writable: true, - value: _init_computedKey7(_Foo) + _: _init_computedKey7(_Foo) }; expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/private/output.js index 04d34110ea49..0f347e6b437e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/private/output.js @@ -1,27 +1,13 @@ var _initProto, _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _Foo; const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); var _B = /*#__PURE__*/new WeakMap(); -var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _b, { - get: _get_b2, - set: _set_b2 - }); - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a2, - set: _set_a2 - }); - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: (_initProto(this), _init_a(this)) - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: _init_b(this, 123) - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); + babelHelpers.classPrivateFieldInitSpec(this, _A, (_initProto(this), _init_a(this))); + babelHelpers.classPrivateFieldInitSpec(this, _B, _init_b(this, 123)); } } _Foo = Foo; @@ -37,4 +23,4 @@ function _set_b2(v) { function _get_b2() { return _get_b(this); } -[_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 1, "a", o => babelHelpers.classPrivateFieldGet(o, _A), (o, v) => babelHelpers.classPrivateFieldSet(o, _A, v)], [dec, 1, "b", o => babelHelpers.classPrivateFieldGet(o, _B), (o, v) => babelHelpers.classPrivateFieldSet(o, _B, v)]], [], _ => _a.has(babelHelpers.checkInRHS(_))).e; +[_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs2301(_Foo, [[dec, 1, "a", o => babelHelpers.classPrivateFieldGet2(o, _A), (o, v) => babelHelpers.classPrivateFieldSet2(o, _A, v)], [dec, 1, "b", o => babelHelpers.classPrivateFieldGet2(o, _B), (o, v) => babelHelpers.classPrivateFieldSet2(o, _B, v)]], [], _ => _a.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/public/output.js index 8c44a4f1b4b9..69ba1aa68d5a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/public/output.js @@ -5,36 +5,27 @@ var _B = /*#__PURE__*/new WeakMap(); var _C = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: (_initProto(this), _init_a(this)) - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: _init_b(this, 123) - }); - babelHelpers.classPrivateFieldInitSpec(this, _C, { - writable: true, - value: _init_computedKey(this, 456) - }); + babelHelpers.classPrivateFieldInitSpec(this, _A, (_initProto(this), _init_a(this))); + babelHelpers.classPrivateFieldInitSpec(this, _B, _init_b(this, 123)); + babelHelpers.classPrivateFieldInitSpec(this, _C, _init_computedKey(this, 456)); } get a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } set a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } get b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } set b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } get ['c']() { - return babelHelpers.classPrivateFieldGet(this, _C); + return babelHelpers.classPrivateFieldGet2(this, _C); } set ['c'](v) { - babelHelpers.classPrivateFieldSet(this, _C, v); + babelHelpers.classPrivateFieldSet2(this, _C, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-private/output.js index b9ee5325bf68..ae341101099b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-private/output.js @@ -14,23 +14,13 @@ function _set_b2(v) { function _get_b2() { return _get_b(this); } -var _b = { - get: _get_b2, - set: _set_b2 -}; -var _a = { - get: _get_a2, - set: _set_a2 -}; (() => { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 6, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _A), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _A, v)], [dec, 6, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _B, v)]], []).e; + [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 6, "a", o => babelHelpers.assertClassBrand(o, _Foo, _A)._, (o, v) => _A._ = babelHelpers.assertClassBrand(o, _Foo, v)], [dec, 6, "b", o => babelHelpers.assertClassBrand(o, _Foo, _B)._, (o, v) => _B._ = babelHelpers.assertClassBrand(o, _Foo, v)]], []).e; _initStatic(_Foo); })(); var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: _init_b(_Foo, 123) + _: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-public/output.js index db79ec237e13..3db4a1b36474 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/static-public/output.js @@ -2,22 +2,22 @@ var _initStatic, _init_a, _init_b, _init_computedKey, _Foo; const dec = () => {}; class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _A); + return babelHelpers.assertClassBrand(this, Foo, _A)._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _A, v); + _A._ = babelHelpers.assertClassBrand(this, Foo, v); } static get b() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _B); + return babelHelpers.assertClassBrand(this, Foo, _B)._; } static set b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _B, v); + _B._ = babelHelpers.assertClassBrand(this, Foo, v); } static get ['c']() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _C); + return babelHelpers.assertClassBrand(this, Foo, _C)._; } static set ['c'](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _C, v); + _C._ = babelHelpers.assertClassBrand(this, Foo, v); } } _Foo = Foo; @@ -26,14 +26,11 @@ _Foo = Foo; _initStatic(_Foo); })(); var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: _init_b(_Foo, 123) + _: _init_b(_Foo, 123) }; var _C = { - writable: true, - value: _init_computedKey(_Foo, 456) + _: _init_computedKey(_Foo, 456) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-private/output.js index 84ce390b7799..7eec69358ee3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-private/output.js @@ -1,37 +1,23 @@ const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); var _B = /*#__PURE__*/new WeakMap(); -var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _b, { - get: _get_b, - set: _set_b - }); - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }); - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: 123 - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); + babelHelpers.classPrivateFieldInitSpec(this, _A, void 0); + babelHelpers.classPrivateFieldInitSpec(this, _B, 123); } } function _get_a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } function _set_a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } function _get_b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } function _set_b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-public/output.js index 070b4006e2e9..74270e9c1588 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-public/output.js @@ -4,35 +4,26 @@ var _B = /*#__PURE__*/new WeakMap(); var _C = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: 123 - }); - babelHelpers.classPrivateFieldInitSpec(this, _C, { - writable: true, - value: 456 - }); + babelHelpers.classPrivateFieldInitSpec(this, _A, void 0); + babelHelpers.classPrivateFieldInitSpec(this, _B, 123); + babelHelpers.classPrivateFieldInitSpec(this, _C, 456); } get a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } set a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } get b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } set b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } get ['c']() { - return babelHelpers.classPrivateFieldGet(this, _C); + return babelHelpers.classPrivateFieldGet2(this, _C); } set ['c'](v) { - babelHelpers.classPrivateFieldSet(this, _C, v); + babelHelpers.classPrivateFieldSet2(this, _C, v); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-static-private/output.js index ae0ff8265ff9..cc3f5fe85c73 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-static-private/output.js @@ -3,30 +3,20 @@ const dec = () => {}; class Foo {} _Foo = Foo; function _get_a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _A); + return babelHelpers.assertClassBrand(this, _Foo, _A)._; } function _set_a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _A, v); + _A._ = babelHelpers.assertClassBrand(this, _Foo, v); } function _get_b() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _B); + return babelHelpers.assertClassBrand(this, _Foo, _B)._; } function _set_b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, _Foo, _B, v); + _B._ = babelHelpers.assertClassBrand(this, _Foo, v); } -var _b = { - get: _get_b, - set: _set_b -}; -var _a = { - get: _get_a, - set: _set_a -}; var _A = { - writable: true, - value: void 0 + _: void 0 }; var _B = { - writable: true, - value: 123 + _: 123 }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-static-public/output.js index 5041e9a95d6e..991a71fe80f8 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-accessors--to-es2015/undecorated-static-public/output.js @@ -1,33 +1,30 @@ const dec = () => {}; class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _A); + return babelHelpers.assertClassBrand(this, Foo, _A)._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _A, v); + _A._ = babelHelpers.assertClassBrand(this, Foo, v); } static get b() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _B); + return babelHelpers.assertClassBrand(this, Foo, _B)._; } static set b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _B, v); + _B._ = babelHelpers.assertClassBrand(this, Foo, v); } static get ['c']() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _C); + return babelHelpers.assertClassBrand(this, Foo, _C)._; } static set ['c'](v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _C, v); + _C._ = babelHelpers.assertClassBrand(this, Foo, v); } } var _A = { - writable: true, - value: void 0 + _: void 0 }; var _B = { - writable: true, - value: 123 + _: 123 }; var _C = { - writable: true, - value: 456 + _: 456 }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-static-installed-on-correct-class/output.js index 75a4e9b8bc90..0449ba4295ce 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-classes--to-es2015/replacement-static-installed-on-correct-class/output.js @@ -1,34 +1,22 @@ -var _initClass, _x, _A, _a, _m, _B, _temp; +var _initClass, _x, _A, _a, _B, _temp; const dec = () => {}; let hasX, hasA, hasM; let _Foo; -new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#__PURE__*/new WeakMap(), _m = /*#__PURE__*/new WeakSet(), _B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identity { +new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#__PURE__*/new WeakSet(), _B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identity { constructor() { - (super(_Foo), babelHelpers.classPrivateMethodInitSpec(this, _m), babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }), babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }), babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }), babelHelpers.defineProperty(this, "x", void 0), babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: void 0 - }), this), (() => { + (super(_Foo), babelHelpers.classPrivateMethodInitSpec(this, _a), babelHelpers.classPrivateFieldInitSpec(this, _x, void 0), babelHelpers.classPrivateFieldInitSpec(this, _A, void 0), babelHelpers.defineProperty(this, "x", void 0), babelHelpers.classPrivateFieldInitSpec(this, _B, void 0), this), (() => { hasX = o => _x.has(babelHelpers.checkInRHS(o)); hasA = o => _a.has(babelHelpers.checkInRHS(o)); - hasM = o => _m.has(babelHelpers.checkInRHS(o)); + hasM = o => _a.has(babelHelpers.checkInRHS(o)); })(), _initClass(); } }, (_Foo2 => { class Foo { static get a() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } static set a(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } static m() {} } @@ -36,9 +24,9 @@ new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#_ [_Foo, _initClass] = babelHelpers.applyDecs2301(_Foo2, [], [dec]).c; })(), _temp))(); function _get_a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } function _set_a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } -function _m2() {} +function _m() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/context-name/output.js index 66b7ae24c225..62beeb5e14e7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/context-name/output.js @@ -12,11 +12,10 @@ const f = () => { _computedKey = babelHelpers.toPropertyKey(f()); class Foo {} _Foo = Foo; -[_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs2301(_Foo, [[dec, 5, "a"], [dec, 5, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _a, v)], [dec, 5, "b"], [dec, 5, "c"], [dec, 5, 0], [dec, 5, 1], [dec, 5, 2n], [dec, 5, 3n], [dec, 5, _computedKey]], []).e; +[_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs2301(_Foo, [[dec, 5, "a"], [dec, 5, "a", o => babelHelpers.assertClassBrand(o, _Foo, _a)._, (o, v) => _a._ = babelHelpers.assertClassBrand(o, _Foo, v)], [dec, 5, "b"], [dec, 5, "c"], [dec, 5, 0], [dec, 5, 1], [dec, 5, 2n], [dec, 5, 3n], [dec, 5, _computedKey]], []).e; babelHelpers.defineProperty(Foo, "a", _init_a(_Foo)); var _a = { - writable: true, - value: _init_a2(_Foo) + _: _init_a2(_Foo) }; babelHelpers.defineProperty(Foo, "b", _init_computedKey(_Foo)); babelHelpers.defineProperty(Foo, "c", _init_computedKey2(_Foo)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/private/output.js index e0434607f25d..f65b8a2f730a 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/private/output.js @@ -4,15 +4,9 @@ var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: _init_a(this) - }); - babelHelpers.classPrivateFieldInitSpec(this, _b, { - writable: true, - value: _init_b(this, 123) - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, _init_a(this)); + babelHelpers.classPrivateFieldInitSpec(this, _b, _init_b(this, 123)); } } _Foo = Foo; -[_init_a, _init_b] = babelHelpers.applyDecs2301(_Foo, [[dec, 0, "a", o => babelHelpers.classPrivateFieldGet(o, _a), (o, v) => babelHelpers.classPrivateFieldSet(o, _a, v)], [dec, 0, "b", o => babelHelpers.classPrivateFieldGet(o, _b), (o, v) => babelHelpers.classPrivateFieldSet(o, _b, v)]], [], _ => _b.has(babelHelpers.checkInRHS(_))).e; +[_init_a, _init_b] = babelHelpers.applyDecs2301(_Foo, [[dec, 0, "a", o => babelHelpers.classPrivateFieldGet2(o, _a), (o, v) => babelHelpers.classPrivateFieldSet2(o, _a, v)], [dec, 0, "b", o => babelHelpers.classPrivateFieldGet2(o, _b), (o, v) => babelHelpers.classPrivateFieldSet2(o, _b, v)]], [], _ => _b.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/static-private/output.js index bf7635495e6a..0248104886ba 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-fields--to-es2015/static-private/output.js @@ -2,12 +2,10 @@ var _init_a, _init_b, _Foo; const dec = () => {}; class Foo {} _Foo = Foo; -[_init_a, _init_b] = babelHelpers.applyDecs2301(_Foo, [[dec, 5, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _a, v)], [dec, 5, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _b), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _b, v)]], []).e; +[_init_a, _init_b] = babelHelpers.applyDecs2301(_Foo, [[dec, 5, "a", o => babelHelpers.assertClassBrand(o, _Foo, _a)._, (o, v) => _a._ = babelHelpers.assertClassBrand(o, _Foo, v)], [dec, 5, "b", o => babelHelpers.assertClassBrand(o, _Foo, _b)._, (o, v) => _b._ = babelHelpers.assertClassBrand(o, _Foo, v)]], []).e; var _a = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _b = { - writable: true, - value: _init_b(_Foo, 123) + _: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/context-name/output.js index 5769afaa88b1..628ba2a9e4fa 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/context-name/output.js @@ -24,10 +24,6 @@ _Foo = Foo; function _get_a() { return _call_a(this); } -var _a = { - get: _get_a, - set: void 0 -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 8, "a"], [dec, 8, "a", function () {}], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []).e; _initStatic(_Foo); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/private/output.js index 58140582ddd6..3e704b4802c9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/private/output.js @@ -1,16 +1,13 @@ var _initProto, _call_a, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: void 0 - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } getA() { - return babelHelpers.classPrivateFieldGet(this, _a); + return babelHelpers.classPrivateGetter(this, _a, _get_a); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/static-private/output.js index 01269ec8e342..12d6f4c9192b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters--to-es2015/static-private/output.js @@ -2,17 +2,13 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static getA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); + return babelHelpers.classPrivateGetter(this, Foo, _get_a); } } _Foo = Foo; function _get_a() { return _call_a(this); } -var _a = { - get: _get_a, - set: void 0 -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 8, "a", function () { return this.value; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/private/output.js index aabb04bc8c9d..a156dc82a828 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/private/output.js @@ -1,19 +1,16 @@ var _initProto, _call_a, _call_a2, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } getA() { - return babelHelpers.classPrivateFieldGet(this, _a); + return babelHelpers.classPrivateGetter(this, _a, _get_a); } setA(v) { - babelHelpers.classPrivateFieldSet(this, _a, v); + babelHelpers.classPrivateSetter(this, _a, _set_a, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/static-private/output.js index 755641b69524..f5df3dd4d251 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-getters-and-setters--to-es2015/static-private/output.js @@ -2,10 +2,10 @@ var _initStatic, _call_a, _call_a2, _Foo; const dec = () => {}; class Foo { static getA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); + return babelHelpers.classPrivateGetter(this, Foo, _get_a); } static setA(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); + babelHelpers.classPrivateSetter(this, Foo, _set_a, v); } } _Foo = Foo; @@ -15,10 +15,6 @@ function _get_a() { function _set_a(v) { _call_a2(this, v); } -var _a = { - get: _get_a, - set: _set_a -}; (() => { [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 8, "a", function () { return this.value; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/context-name/output.js index 666f120bfb0d..dbb85cfad6af 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/context-name/output.js @@ -26,7 +26,6 @@ _Foo = Foo; _initStatic(_Foo); })(); var _a = { - writable: true, - value: _call_a + _: _call_a }; expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/private/output.js index fde408038c56..65aa17a9049d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/private/output.js @@ -3,14 +3,11 @@ const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: _call_a - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, _call_a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } callA() { - return babelHelpers.classPrivateFieldGet(this, _a).call(this); + return babelHelpers.classPrivateFieldGet2(this, _a).call(this); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/static-private/output.js index 7ffa69a79afb..86aaa22b350b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-methods--to-es2015/static-private/output.js @@ -2,7 +2,7 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static callA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a).call(this); + return babelHelpers.assertClassBrand(this, Foo, _a)._.call(this); } } _Foo = Foo; @@ -13,7 +13,6 @@ _Foo = Foo; _initStatic(_Foo); })(); var _a = { - writable: true, - value: _call_a + _: _call_a }; babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc--to-es2015/valid-expression-formats/output.js index 5825e56705dc..8de378d6d077 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-misc--to-es2015/valid-expression-formats/output.js @@ -9,15 +9,12 @@ let _Foo; var _a = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: void _initProto(this) - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, void _initProto(this)); } method() {} makeClass() { var _dec5, _init_bar, _Nested; - return _dec5 = babelHelpers.classPrivateFieldGet(this, _a), (_Nested = class Nested { + return _dec5 = babelHelpers.classPrivateFieldGet2(this, _a), (_Nested = class Nested { constructor() { babelHelpers.defineProperty(this, "bar", _init_bar(this)); } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/context-name/output.js index e450b21f10fa..ea7dc783b2fa 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/context-name/output.js @@ -24,10 +24,6 @@ _Foo = Foo; function _set_a(v) { _call_a(this, v); } -var _a = { - get: void 0, - set: _set_a -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 9, "a"], [dec, 9, "a", function (v) {}], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []).e; _initStatic(_Foo); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/private/output.js index 6482036be740..027743460daf 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/private/output.js @@ -1,16 +1,13 @@ var _initProto, _call_a, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: void 0, - set: _set_a - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } setA(v) { - babelHelpers.classPrivateFieldSet(this, _a, v); + babelHelpers.classPrivateSetter(this, _a, _set_a, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/static-private/output.js index 1ad6ddc6b0bb..83877d75e442 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-01-setters--to-es2015/static-private/output.js @@ -2,17 +2,13 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static setA(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); + babelHelpers.classPrivateSetter(this, Foo, _set_a, v); } } _Foo = Foo; function _set_a(v) { _call_a(this, v); } -var _a = { - get: void 0, - set: _set_a -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2301(_Foo, [[dec, 9, "a", function (v) { return this.value = v; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/context-name/output.js index 48ad86b81e6f..f4c9f4c59733 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/context-name/output.js @@ -12,52 +12,52 @@ const f = () => { _computedKey = babelHelpers.toPropertyKey(f()); class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _A); + return _A._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _A, v); + _A._ = v; } static get "b"() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _C); + return _C._; } static set "b"(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _C, v); + _C._ = v; } static get ["c"]() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _D); + return _D._; } static set ["c"](v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _D, v); + _D._ = v; } static get 0() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _E); + return _E._; } static set 0(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _E, v); + _E._ = v; } static get [1]() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _F); + return _F._; } static set [1](v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _F, v); + _F._ = v; } static get 2n() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _G); + return _G._; } static set 2n(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _G, v); + _G._ = v; } static get [3n]() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _H); + return _H._; } static set [3n](v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _H, v); + _H._ = v; } static get [_computedKey]() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _I); + return _I._; } static set [_computedKey](v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _I, v); + _I._ = v; } } _Foo = Foo; @@ -67,48 +67,35 @@ function _set_a2(v) { function _get_a2() { return _get_a(this); } -var _a = { - get: _get_a2, - set: _set_a2 -}; (() => { - [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 9, "a"], [dec, 9, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _B, v)], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []).e; + [_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 9, "a"], [dec, 9, "a", o => babelHelpers.assertClassBrand(o, _Foo, _B)._, (o, v) => _B._ = babelHelpers.assertClassBrand(o, _Foo, v)], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []).e; _initStatic(_Foo); })(); var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: _init_a2(_Foo) + _: _init_a2(_Foo) }; var _C = { - writable: true, - value: _init_computedKey(_Foo) + _: _init_computedKey(_Foo) }; var _D = { - writable: true, - value: _init_computedKey2(_Foo) + _: _init_computedKey2(_Foo) }; var _E = { - writable: true, - value: _init_computedKey3(_Foo) + _: _init_computedKey3(_Foo) }; var _F = { - writable: true, - value: _init_computedKey4(_Foo) + _: _init_computedKey4(_Foo) }; var _G = { - writable: true, - value: _init_computedKey5(_Foo) + _: _init_computedKey5(_Foo) }; var _H = { - writable: true, - value: _init_computedKey6(_Foo) + _: _init_computedKey6(_Foo) }; var _I = { - writable: true, - value: _init_computedKey7(_Foo) + _: _init_computedKey7(_Foo) }; expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/private/output.js index 30ed1a9683e2..ff1634a0576f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/private/output.js @@ -1,27 +1,13 @@ var _initProto, _init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _Foo; const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); var _B = /*#__PURE__*/new WeakMap(); -var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _b, { - get: _get_b2, - set: _set_b2 - }); - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a2, - set: _set_a2 - }); - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: (_initProto(this), _init_a(this)) - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: _init_b(this, 123) - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); + babelHelpers.classPrivateFieldInitSpec(this, _A, (_initProto(this), _init_a(this))); + babelHelpers.classPrivateFieldInitSpec(this, _B, _init_b(this, 123)); } } _Foo = Foo; @@ -37,4 +23,4 @@ function _set_b2(v) { function _get_b2() { return _get_b(this); } -[_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 1, "a", o => babelHelpers.classPrivateFieldGet(o, _A), (o, v) => babelHelpers.classPrivateFieldSet(o, _A, v)], [dec, 1, "b", o => babelHelpers.classPrivateFieldGet(o, _B), (o, v) => babelHelpers.classPrivateFieldSet(o, _B, v)]], [], 0, _ => _a.has(babelHelpers.checkInRHS(_))).e; +[_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initProto] = babelHelpers.applyDecs2305(_Foo, [[dec, 1, "a", o => babelHelpers.classPrivateFieldGet2(o, _A), (o, v) => babelHelpers.classPrivateFieldSet2(o, _A, v)], [dec, 1, "b", o => babelHelpers.classPrivateFieldGet2(o, _B), (o, v) => babelHelpers.classPrivateFieldSet2(o, _B, v)]], [], 0, _ => _a.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/public/output.js index c223f6bdd95a..3cac972dde80 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/public/output.js @@ -5,36 +5,27 @@ var _B = /*#__PURE__*/new WeakMap(); var _C = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: (_initProto(this), _init_a(this)) - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: _init_b(this, 123) - }); - babelHelpers.classPrivateFieldInitSpec(this, _C, { - writable: true, - value: _init_computedKey(this, 456) - }); + babelHelpers.classPrivateFieldInitSpec(this, _A, (_initProto(this), _init_a(this))); + babelHelpers.classPrivateFieldInitSpec(this, _B, _init_b(this, 123)); + babelHelpers.classPrivateFieldInitSpec(this, _C, _init_computedKey(this, 456)); } get a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } set a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } get b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } set b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } get ['c']() { - return babelHelpers.classPrivateFieldGet(this, _C); + return babelHelpers.classPrivateFieldGet2(this, _C); } set ['c'](v) { - babelHelpers.classPrivateFieldSet(this, _C, v); + babelHelpers.classPrivateFieldSet2(this, _C, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-private/output.js index 563d83d24b30..f9dc3d831448 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-private/output.js @@ -14,23 +14,13 @@ function _set_b2(v) { function _get_b2() { return _get_b(this); } -var _b = { - get: _get_b2, - set: _set_b2 -}; -var _a = { - get: _get_a2, - set: _set_a2 -}; (() => { - [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 9, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _A), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _A, v)], [dec, 9, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _B, v)]], []).e; + [_init_a, _get_a, _set_a, _init_b, _get_b, _set_b, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 9, "a", o => babelHelpers.assertClassBrand(o, _Foo, _A)._, (o, v) => _A._ = babelHelpers.assertClassBrand(o, _Foo, v)], [dec, 9, "b", o => babelHelpers.assertClassBrand(o, _Foo, _B)._, (o, v) => _B._ = babelHelpers.assertClassBrand(o, _Foo, v)]], []).e; _initStatic(_Foo); })(); var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: _init_b(_Foo, 123) + _: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-public/output.js index 45fceff95e2d..cdfbbf2dd023 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/static-public/output.js @@ -2,22 +2,22 @@ var _initStatic, _init_a, _init_b, _init_computedKey, _Foo; const dec = () => {}; class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _A); + return _A._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _A, v); + _A._ = v; } static get b() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _B); + return _B._; } static set b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _B, v); + _B._ = v; } static get ['c']() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _C); + return _C._; } static set ['c'](v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _C, v); + _C._ = v; } } _Foo = Foo; @@ -26,14 +26,11 @@ _Foo = Foo; _initStatic(_Foo); })(); var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: _init_b(_Foo, 123) + _: _init_b(_Foo, 123) }; var _C = { - writable: true, - value: _init_computedKey(_Foo, 456) + _: _init_computedKey(_Foo, 456) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-private/output.js index 84ce390b7799..7eec69358ee3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-private/output.js @@ -1,37 +1,23 @@ const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); var _B = /*#__PURE__*/new WeakMap(); -var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _b, { - get: _get_b, - set: _set_b - }); - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }); - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: 123 - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); + babelHelpers.classPrivateFieldInitSpec(this, _A, void 0); + babelHelpers.classPrivateFieldInitSpec(this, _B, 123); } } function _get_a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } function _set_a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } function _get_b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } function _set_b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-public/output.js index 070b4006e2e9..74270e9c1588 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-public/output.js @@ -4,35 +4,26 @@ var _B = /*#__PURE__*/new WeakMap(); var _C = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: 123 - }); - babelHelpers.classPrivateFieldInitSpec(this, _C, { - writable: true, - value: 456 - }); + babelHelpers.classPrivateFieldInitSpec(this, _A, void 0); + babelHelpers.classPrivateFieldInitSpec(this, _B, 123); + babelHelpers.classPrivateFieldInitSpec(this, _C, 456); } get a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } set a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } get b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } set b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } get ['c']() { - return babelHelpers.classPrivateFieldGet(this, _C); + return babelHelpers.classPrivateFieldGet2(this, _C); } set ['c'](v) { - babelHelpers.classPrivateFieldSet(this, _C, v); + babelHelpers.classPrivateFieldSet2(this, _C, v); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-static-private/output.js index 8f07059b17a4..0b6f049e9e7d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-static-private/output.js @@ -1,32 +1,20 @@ -var _Foo; const dec = () => {}; class Foo {} -_Foo = Foo; function _get_a() { - return babelHelpers.classStaticPrivateFieldSpecGet(_Foo, _Foo, _A); + return _A._; } function _set_a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(_Foo, _Foo, _A, v); + _A._ = v; } function _get_b() { - return babelHelpers.classStaticPrivateFieldSpecGet(_Foo, _Foo, _B); + return _B._; } function _set_b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(_Foo, _Foo, _B, v); + _B._ = v; } -var _b = { - get: _get_b, - set: _set_b -}; -var _a = { - get: _get_a, - set: _set_a -}; var _A = { - writable: true, - value: void 0 + _: void 0 }; var _B = { - writable: true, - value: 123 + _: 123 }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-static-public/output.js index ea1636ad8321..c365830ea547 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-accessors--to-es2015/undecorated-static-public/output.js @@ -1,33 +1,30 @@ const dec = () => {}; class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _A); + return _A._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _A, v); + _A._ = v; } static get b() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _B); + return _B._; } static set b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _B, v); + _B._ = v; } static get ['c']() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _C); + return _C._; } static set ['c'](v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _C, v); + _C._ = v; } } var _A = { - writable: true, - value: void 0 + _: void 0 }; var _B = { - writable: true, - value: 123 + _: 123 }; var _C = { - writable: true, - value: 456 + _: 456 }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-static-installed-on-correct-class/output.js index fe6557e8bec0..b9164a9d417d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-classes--to-es2015/replacement-static-installed-on-correct-class/output.js @@ -1,34 +1,22 @@ -var _initClass, _x, _A, _a, _m, _B, _temp; +var _initClass, _x, _A, _a, _B, _temp; const dec = () => {}; let hasX, hasA, hasM; let _Foo; -new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#__PURE__*/new WeakMap(), _m = /*#__PURE__*/new WeakSet(), _B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identity { +new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#__PURE__*/new WeakSet(), _B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identity { constructor() { - (super(_Foo), babelHelpers.classPrivateMethodInitSpec(this, _m), babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }), babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }), babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }), babelHelpers.defineProperty(this, "x", void 0), babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: void 0 - }), this), (() => { + (super(_Foo), babelHelpers.classPrivateMethodInitSpec(this, _a), babelHelpers.classPrivateFieldInitSpec(this, _x, void 0), babelHelpers.classPrivateFieldInitSpec(this, _A, void 0), babelHelpers.defineProperty(this, "x", void 0), babelHelpers.classPrivateFieldInitSpec(this, _B, void 0), this), (() => { hasX = o => _x.has(babelHelpers.checkInRHS(o)); hasA = o => _a.has(babelHelpers.checkInRHS(o)); - hasM = o => _m.has(babelHelpers.checkInRHS(o)); + hasM = o => _a.has(babelHelpers.checkInRHS(o)); })(), _initClass(); } }, (_Foo2 => { class Foo { static get a() { - return babelHelpers.classPrivateFieldGet(_Foo, _B); + return babelHelpers.classPrivateFieldGet2(_Foo, _B); } static set a(v) { - babelHelpers.classPrivateFieldSet(_Foo, _B, v); + babelHelpers.classPrivateFieldSet2(_Foo, _B, v); } static m() {} } @@ -36,9 +24,9 @@ new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#_ [_Foo, _initClass] = babelHelpers.applyDecs2305(_Foo2, [], [dec]).c; })(), _temp))(); function _get_a() { - return babelHelpers.classPrivateFieldGet(_Foo, _A); + return babelHelpers.classPrivateFieldGet2(_Foo, _A); } function _set_a(v) { - babelHelpers.classPrivateFieldSet(_Foo, _A, v); + babelHelpers.classPrivateFieldSet2(_Foo, _A, v); } -function _m2() {} +function _m() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/context-name/output.js index a57e4639d565..c0fd418d4db7 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/context-name/output.js @@ -12,11 +12,10 @@ const f = () => { _computedKey = babelHelpers.toPropertyKey(f()); class Foo {} _Foo = Foo; -[_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs2305(_Foo, [[dec, 8, "a"], [dec, 8, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _a, v)], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []).e; +[_init_a, _init_a2, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7] = babelHelpers.applyDecs2305(_Foo, [[dec, 8, "a"], [dec, 8, "a", o => babelHelpers.assertClassBrand(o, _Foo, _a)._, (o, v) => _a._ = babelHelpers.assertClassBrand(o, _Foo, v)], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []).e; babelHelpers.defineProperty(Foo, "a", _init_a(_Foo)); var _a = { - writable: true, - value: _init_a2(_Foo) + _: _init_a2(_Foo) }; babelHelpers.defineProperty(Foo, "b", _init_computedKey(_Foo)); babelHelpers.defineProperty(Foo, "c", _init_computedKey2(_Foo)); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/private/output.js index 94d9722e1a58..5bfa296f9b27 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/private/output.js @@ -4,15 +4,9 @@ var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: _init_a(this) - }); - babelHelpers.classPrivateFieldInitSpec(this, _b, { - writable: true, - value: _init_b(this, 123) - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, _init_a(this)); + babelHelpers.classPrivateFieldInitSpec(this, _b, _init_b(this, 123)); } } _Foo = Foo; -[_init_a, _init_b] = babelHelpers.applyDecs2305(_Foo, [[dec, 0, "a", o => babelHelpers.classPrivateFieldGet(o, _a), (o, v) => babelHelpers.classPrivateFieldSet(o, _a, v)], [dec, 0, "b", o => babelHelpers.classPrivateFieldGet(o, _b), (o, v) => babelHelpers.classPrivateFieldSet(o, _b, v)]], [], 0, _ => _b.has(babelHelpers.checkInRHS(_))).e; +[_init_a, _init_b] = babelHelpers.applyDecs2305(_Foo, [[dec, 0, "a", o => babelHelpers.classPrivateFieldGet2(o, _a), (o, v) => babelHelpers.classPrivateFieldSet2(o, _a, v)], [dec, 0, "b", o => babelHelpers.classPrivateFieldGet2(o, _b), (o, v) => babelHelpers.classPrivateFieldSet2(o, _b, v)]], [], 0, _ => _b.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/static-private/output.js index fa49dda1c0fc..b8187969b1d4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-fields--to-es2015/static-private/output.js @@ -2,12 +2,10 @@ var _init_a, _init_b, _Foo; const dec = () => {}; class Foo {} _Foo = Foo; -[_init_a, _init_b] = babelHelpers.applyDecs2305(_Foo, [[dec, 8, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _a, v)], [dec, 8, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _b), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _b, v)]], []).e; +[_init_a, _init_b] = babelHelpers.applyDecs2305(_Foo, [[dec, 8, "a", o => babelHelpers.assertClassBrand(o, _Foo, _a)._, (o, v) => _a._ = babelHelpers.assertClassBrand(o, _Foo, v)], [dec, 8, "b", o => babelHelpers.assertClassBrand(o, _Foo, _b)._, (o, v) => _b._ = babelHelpers.assertClassBrand(o, _Foo, v)]], []).e; var _a = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _b = { - writable: true, - value: _init_b(_Foo, 123) + _: _init_b(_Foo, 123) }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/context-name/output.js index d54014d4517d..9ba55caca9a9 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/context-name/output.js @@ -24,10 +24,6 @@ _Foo = Foo; function _get_a() { return _call_a(this); } -var _a = { - get: _get_a, - set: void 0 -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 11, "a"], [dec, 11, "a", function () {}], [dec, 11, "b"], [dec, 11, "c"], [dec, 11, 0], [dec, 11, 1], [dec, 11, 2n], [dec, 11, 3n], [dec, 11, _computedKey]], []).e; _initStatic(_Foo); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/private/output.js index 6b92ebb68db1..c004bff9a504 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/private/output.js @@ -1,16 +1,13 @@ var _initProto, _call_a, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: void 0 - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } getA() { - return babelHelpers.classPrivateFieldGet(this, _a); + return babelHelpers.classPrivateGetter(this, _a, _get_a); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/static-private/output.js index b8da1a5552b5..e4f782765847 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters--to-es2015/static-private/output.js @@ -2,17 +2,13 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static getA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); + return babelHelpers.classPrivateGetter(this, Foo, _get_a); } } _Foo = Foo; function _get_a() { return _call_a(this); } -var _a = { - get: _get_a, - set: void 0 -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 11, "a", function () { return this.value; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/private/output.js index 7dc8ddc18fc8..2675c9acb426 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/private/output.js @@ -1,19 +1,16 @@ var _initProto, _call_a, _call_a2, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } getA() { - return babelHelpers.classPrivateFieldGet(this, _a); + return babelHelpers.classPrivateGetter(this, _a, _get_a); } setA(v) { - babelHelpers.classPrivateFieldSet(this, _a, v); + babelHelpers.classPrivateSetter(this, _a, _set_a, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/static-private/output.js index 8c8493144f89..8d541926b543 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-getters-and-setters--to-es2015/static-private/output.js @@ -2,10 +2,10 @@ var _initStatic, _call_a, _call_a2, _Foo; const dec = () => {}; class Foo { static getA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); + return babelHelpers.classPrivateGetter(this, Foo, _get_a); } static setA(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); + babelHelpers.classPrivateSetter(this, Foo, _set_a, v); } } _Foo = Foo; @@ -15,10 +15,6 @@ function _get_a() { function _set_a(v) { _call_a2(this, v); } -var _a = { - get: _get_a, - set: _set_a -}; (() => { [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 11, "a", function () { return this.value; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/context-name/output.js index 9e8e5df86e9f..d0da98725861 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/context-name/output.js @@ -26,7 +26,6 @@ _Foo = Foo; _initStatic(_Foo); })(); var _a = { - writable: true, - value: _call_a + _: _call_a }; expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/private/output.js index 906e46ea9d4a..c6f0a4565512 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/private/output.js @@ -3,14 +3,11 @@ const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: _call_a - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, _call_a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } callA() { - return babelHelpers.classPrivateFieldGet(this, _a).call(this); + return babelHelpers.classPrivateFieldGet2(this, _a).call(this); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/static-private/output.js index 10a0e49896a3..5ec2c9ded1d4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-methods--to-es2015/static-private/output.js @@ -2,7 +2,7 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static callA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a).call(this); + return babelHelpers.assertClassBrand(this, Foo, _a)._.call(this); } } _Foo = Foo; @@ -13,7 +13,6 @@ _Foo = Foo; _initStatic(_Foo); })(); var _a = { - writable: true, - value: _call_a + _: _call_a }; babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/valid-expression-formats/output.js index b683996d249a..666041a6a919 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-misc--to-es2015/valid-expression-formats/output.js @@ -10,15 +10,12 @@ let _Foo; var _a = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: void _initProto(this) - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, void _initProto(this)); } method() {} makeClass() { var _dec5, _init_bar, _Nested; - return _dec5 = babelHelpers.classPrivateFieldGet(this, _a), (_Nested = class Nested { + return _dec5 = babelHelpers.classPrivateFieldGet2(this, _a), (_Nested = class Nested { constructor() { babelHelpers.defineProperty(this, "bar", _init_bar(this)); } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-ordering--to-es2015/initializers-and-static-blocks/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-ordering--to-es2015/initializers-and-static-blocks/output.js index 726b294f5450..50b62d05f3dd 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-ordering--to-es2015/initializers-and-static-blocks/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-ordering--to-es2015/initializers-and-static-blocks/output.js @@ -148,10 +148,7 @@ new (_B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identi constructor() { (super(_Foo), babelHelpers.defineProperty(this, "field", ((() => { log.push("static:start"); - })(), _init_field2(this))), babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: _init_accessor2(this) - }), this), (() => { + })(), _init_field2(this))), babelHelpers.classPrivateFieldInitSpec(this, _B, _init_accessor2(this)), this), (() => { log.push("static:end"); })(), _initClass(); } @@ -162,10 +159,7 @@ new (_B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identi log.push("ctor:start"); super(); babelHelpers.defineProperty(this, "field", (_initProto(this), _init_field(this))); - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: _init_accessor(this) - }); + babelHelpers.classPrivateFieldInitSpec(this, _A, _init_accessor(this)); log.push("ctor:end"); } method() {} @@ -179,16 +173,16 @@ new (_B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identi set setter(x) {} static set getter(x) {} get accessor() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } set accessor(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } static get accessor() { - return babelHelpers.classPrivateFieldGet(Foo, _B); + return babelHelpers.classPrivateFieldGet2(Foo, _B); } static set accessor(v) { - babelHelpers.classPrivateFieldSet(Foo, _B, v); + babelHelpers.classPrivateFieldSet2(Foo, _B, v); } } _Foo2 = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/context-name/output.js index a9d229fa349f..4aadea27820f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/context-name/output.js @@ -24,10 +24,6 @@ _Foo = Foo; function _set_a(v) { _call_a(this, v); } -var _a = { - get: void 0, - set: _set_a -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 12, "a"], [dec, 12, "a", function (v) {}], [dec, 12, "b"], [dec, 12, "c"], [dec, 12, 0], [dec, 12, 1], [dec, 12, 2n], [dec, 12, 3n], [dec, 12, _computedKey]], []).e; _initStatic(_Foo); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/private/output.js index 25cb263d580f..82ed031275af 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/private/output.js @@ -1,16 +1,13 @@ var _initProto, _call_a, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: void 0, - set: _set_a - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } setA(v) { - babelHelpers.classPrivateFieldSet(this, _a, v); + babelHelpers.classPrivateSetter(this, _a, _set_a, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/static-private/output.js index 011a52622ee0..d0632bd799fe 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-05-setters--to-es2015/static-private/output.js @@ -2,17 +2,13 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static setA(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); + babelHelpers.classPrivateSetter(this, Foo, _set_a, v); } } _Foo = Foo; function _set_a(v) { _call_a(this, v); } -var _a = { - get: void 0, - set: _set_a -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2305(_Foo, [[dec, 12, "a", function (v) { return this.value = v; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/context-name/output.js index 5c56253fa682..cd1161881363 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/context-name/output.js @@ -12,52 +12,52 @@ const f = () => { _computedKey = babelHelpers.toPropertyKey(f()); class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _A); + return _A._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _A, v); + _A._ = v; } static get "b"() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _C); + return _C._; } static set "b"(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _C, v); + _C._ = v; } static get ["c"]() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _D); + return _D._; } static set ["c"](v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _D, v); + _D._ = v; } static get 0() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _E); + return _E._; } static set 0(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _E, v); + _E._ = v; } static get [1]() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _F); + return _F._; } static set [1](v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _F, v); + _F._ = v; } static get 2n() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _G); + return _G._; } static set 2n(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _G, v); + _G._ = v; } static get [3n]() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _H); + return _H._; } static set [3n](v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _H, v); + _H._ = v; } static get [_computedKey]() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _I); + return _I._; } static set [_computedKey](v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _I, v); + _I._ = v; } } _Foo = Foo; @@ -67,46 +67,33 @@ function _set_a2(v) { function _get_a2() { return _get_a(this); } -var _a = { - get: _get_a2, - set: _set_a2 -}; -[_init_a, _init_extra_a, _init_a2, _get_a, _set_a, _init_extra_a2, _init_computedKey, _init_extra_computedKey, _init_computedKey2, _init_extra_computedKey2, _init_computedKey3, _init_extra_computedKey3, _init_computedKey4, _init_extra_computedKey4, _init_computedKey5, _init_extra_computedKey5, _init_computedKey6, _init_extra_computedKey6, _init_computedKey7, _init_extra_computedKey7] = babelHelpers.applyDecs2311(_Foo, [[dec, 9, "a"], [dec, 9, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _B, v)], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []).e; +[_init_a, _init_extra_a, _init_a2, _get_a, _set_a, _init_extra_a2, _init_computedKey, _init_extra_computedKey, _init_computedKey2, _init_extra_computedKey2, _init_computedKey3, _init_extra_computedKey3, _init_computedKey4, _init_extra_computedKey4, _init_computedKey5, _init_extra_computedKey5, _init_computedKey6, _init_extra_computedKey6, _init_computedKey7, _init_extra_computedKey7] = babelHelpers.applyDecs2311(_Foo, [[dec, 9, "a"], [dec, 9, "a", o => babelHelpers.assertClassBrand(o, _Foo, _B)._, (o, v) => _B._ = babelHelpers.assertClassBrand(o, _Foo, v)], [dec, 9, "b"], [dec, 9, "c"], [dec, 9, 0], [dec, 9, 1], [dec, 9, 2n], [dec, 9, 3n], [dec, 9, _computedKey]], []).e; var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: (_init_extra_a(_Foo), _init_a2(_Foo)) + _: (_init_extra_a(_Foo), _init_a2(_Foo)) }; var _C = { - writable: true, - value: (_init_extra_a2(_Foo), _init_computedKey(_Foo)) + _: (_init_extra_a2(_Foo), _init_computedKey(_Foo)) }; var _D = { - writable: true, - value: (_init_extra_computedKey(_Foo), _init_computedKey2(_Foo)) + _: (_init_extra_computedKey(_Foo), _init_computedKey2(_Foo)) }; var _E = { - writable: true, - value: (_init_extra_computedKey2(_Foo), _init_computedKey3(_Foo)) + _: (_init_extra_computedKey2(_Foo), _init_computedKey3(_Foo)) }; var _F = { - writable: true, - value: (_init_extra_computedKey3(_Foo), _init_computedKey4(_Foo)) + _: (_init_extra_computedKey3(_Foo), _init_computedKey4(_Foo)) }; var _G = { - writable: true, - value: (_init_extra_computedKey4(_Foo), _init_computedKey5(_Foo)) + _: (_init_extra_computedKey4(_Foo), _init_computedKey5(_Foo)) }; var _H = { - writable: true, - value: (_init_extra_computedKey5(_Foo), _init_computedKey6(_Foo)) + _: (_init_extra_computedKey5(_Foo), _init_computedKey6(_Foo)) }; var _I = { - writable: true, - value: (_init_extra_computedKey6(_Foo), _init_computedKey7(_Foo)) + _: (_init_extra_computedKey6(_Foo), _init_computedKey7(_Foo)) }; _init_extra_computedKey7(_Foo); expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/private/output.js index 390841f2d3f5..15cf3b61f426 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/private/output.js @@ -1,27 +1,13 @@ var _init_a, _get_a, _set_a, _init_extra_a, _init_b, _get_b, _set_b, _init_extra_b, _Foo; const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); var _B = /*#__PURE__*/new WeakMap(); -var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _b, { - get: _get_b2, - set: _set_b2 - }); - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a2, - set: _set_a2 - }); - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: _init_a(this) - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: (_init_extra_a(this), _init_b(this, 123)) - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); + babelHelpers.classPrivateFieldInitSpec(this, _A, _init_a(this)); + babelHelpers.classPrivateFieldInitSpec(this, _B, (_init_extra_a(this), _init_b(this, 123))); _init_extra_b(this); } } @@ -38,4 +24,4 @@ function _set_b2(v) { function _get_b2() { return _get_b(this); } -[_init_a, _get_a, _set_a, _init_extra_a, _init_b, _get_b, _set_b, _init_extra_b] = babelHelpers.applyDecs2311(_Foo, [[dec, 1, "a", o => babelHelpers.classPrivateFieldGet(o, _A), (o, v) => babelHelpers.classPrivateFieldSet(o, _A, v)], [dec, 1, "b", o => babelHelpers.classPrivateFieldGet(o, _B), (o, v) => babelHelpers.classPrivateFieldSet(o, _B, v)]], [], 0, _ => _a.has(babelHelpers.checkInRHS(_))).e; +[_init_a, _get_a, _set_a, _init_extra_a, _init_b, _get_b, _set_b, _init_extra_b] = babelHelpers.applyDecs2311(_Foo, [[dec, 1, "a", o => babelHelpers.classPrivateFieldGet2(o, _A), (o, v) => babelHelpers.classPrivateFieldSet2(o, _A, v)], [dec, 1, "b", o => babelHelpers.classPrivateFieldGet2(o, _B), (o, v) => babelHelpers.classPrivateFieldSet2(o, _B, v)]], [], 0, _ => _a.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/public/output.js index 9c2cfa833a10..21cd1d3661d1 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/public/output.js @@ -5,37 +5,28 @@ var _B = /*#__PURE__*/new WeakMap(); var _C = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: _init_a(this) - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: (_init_extra_a(this), _init_b(this, 123)) - }); - babelHelpers.classPrivateFieldInitSpec(this, _C, { - writable: true, - value: (_init_extra_b(this), _init_computedKey(this, 456)) - }); + babelHelpers.classPrivateFieldInitSpec(this, _A, _init_a(this)); + babelHelpers.classPrivateFieldInitSpec(this, _B, (_init_extra_a(this), _init_b(this, 123))); + babelHelpers.classPrivateFieldInitSpec(this, _C, (_init_extra_b(this), _init_computedKey(this, 456))); _init_extra_computedKey(this); } get a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } set a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } get b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } set b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } get ['c']() { - return babelHelpers.classPrivateFieldGet(this, _C); + return babelHelpers.classPrivateFieldGet2(this, _C); } set ['c'](v) { - babelHelpers.classPrivateFieldSet(this, _C, v); + babelHelpers.classPrivateFieldSet2(this, _C, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/static-private/output.js index ed7cc73c732a..d2831d660bda 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/static-private/output.js @@ -14,21 +14,11 @@ function _set_b2(v) { function _get_b2() { return _get_b(this); } -var _b = { - get: _get_b2, - set: _set_b2 -}; -var _a = { - get: _get_a2, - set: _set_a2 -}; -[_init_a, _get_a, _set_a, _init_extra_a, _init_b, _get_b, _set_b, _init_extra_b] = babelHelpers.applyDecs2311(_Foo, [[dec, 9, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _A), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _A, v)], [dec, 9, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _B), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _B, v)]], []).e; +[_init_a, _get_a, _set_a, _init_extra_a, _init_b, _get_b, _set_b, _init_extra_b] = babelHelpers.applyDecs2311(_Foo, [[dec, 9, "a", o => babelHelpers.assertClassBrand(o, _Foo, _A)._, (o, v) => _A._ = babelHelpers.assertClassBrand(o, _Foo, v)], [dec, 9, "b", o => babelHelpers.assertClassBrand(o, _Foo, _B)._, (o, v) => _B._ = babelHelpers.assertClassBrand(o, _Foo, v)]], []).e; var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: (_init_extra_a(_Foo), _init_b(_Foo, 123)) + _: (_init_extra_a(_Foo), _init_b(_Foo, 123)) }; _init_extra_b(_Foo); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/static-public/output.js index 6458989610e8..d601aec19a46 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/static-public/output.js @@ -2,36 +2,33 @@ var _init_a, _init_extra_a, _init_b, _init_extra_b, _init_computedKey, _init_ext const dec = () => {}; class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _A); + return _A._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _A, v); + _A._ = v; } static get b() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _B); + return _B._; } static set b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _B, v); + _B._ = v; } static get ['c']() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _C); + return _C._; } static set ['c'](v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _C, v); + _C._ = v; } } _Foo = Foo; [_init_a, _init_extra_a, _init_b, _init_extra_b, _init_computedKey, _init_extra_computedKey] = babelHelpers.applyDecs2311(_Foo, [[dec, 9, "a"], [dec, 9, "b"], [dec, 9, 'c']], []).e; var _A = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _B = { - writable: true, - value: (_init_extra_a(_Foo), _init_b(_Foo, 123)) + _: (_init_extra_a(_Foo), _init_b(_Foo, 123)) }; var _C = { - writable: true, - value: (_init_extra_b(_Foo), _init_computedKey(_Foo, 456)) + _: (_init_extra_b(_Foo), _init_computedKey(_Foo, 456)) }; _init_extra_computedKey(_Foo); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-private/output.js index 84ce390b7799..7eec69358ee3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-private/output.js @@ -1,37 +1,23 @@ const dec = () => {}; var _A = /*#__PURE__*/new WeakMap(); -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); var _B = /*#__PURE__*/new WeakMap(); -var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _b, { - get: _get_b, - set: _set_b - }); - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }); - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: 123 - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); + babelHelpers.classPrivateFieldInitSpec(this, _A, void 0); + babelHelpers.classPrivateFieldInitSpec(this, _B, 123); } } function _get_a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } function _set_a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } function _get_b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } function _set_b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-public/output.js index 070b4006e2e9..74270e9c1588 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-public/output.js @@ -4,35 +4,26 @@ var _B = /*#__PURE__*/new WeakMap(); var _C = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: 123 - }); - babelHelpers.classPrivateFieldInitSpec(this, _C, { - writable: true, - value: 456 - }); + babelHelpers.classPrivateFieldInitSpec(this, _A, void 0); + babelHelpers.classPrivateFieldInitSpec(this, _B, 123); + babelHelpers.classPrivateFieldInitSpec(this, _C, 456); } get a() { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } set a(v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } get b() { - return babelHelpers.classPrivateFieldGet(this, _B); + return babelHelpers.classPrivateFieldGet2(this, _B); } set b(v) { - babelHelpers.classPrivateFieldSet(this, _B, v); + babelHelpers.classPrivateFieldSet2(this, _B, v); } get ['c']() { - return babelHelpers.classPrivateFieldGet(this, _C); + return babelHelpers.classPrivateFieldGet2(this, _C); } set ['c'](v) { - babelHelpers.classPrivateFieldSet(this, _C, v); + babelHelpers.classPrivateFieldSet2(this, _C, v); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-static-private/output.js index 8f07059b17a4..0b6f049e9e7d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-static-private/output.js @@ -1,32 +1,20 @@ -var _Foo; const dec = () => {}; class Foo {} -_Foo = Foo; function _get_a() { - return babelHelpers.classStaticPrivateFieldSpecGet(_Foo, _Foo, _A); + return _A._; } function _set_a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(_Foo, _Foo, _A, v); + _A._ = v; } function _get_b() { - return babelHelpers.classStaticPrivateFieldSpecGet(_Foo, _Foo, _B); + return _B._; } function _set_b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(_Foo, _Foo, _B, v); + _B._ = v; } -var _b = { - get: _get_b, - set: _set_b -}; -var _a = { - get: _get_a, - set: _set_a -}; var _A = { - writable: true, - value: void 0 + _: void 0 }; var _B = { - writable: true, - value: 123 + _: 123 }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-static-public/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-static-public/output.js index ea1636ad8321..c365830ea547 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-static-public/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-accessors--to-es2015/undecorated-static-public/output.js @@ -1,33 +1,30 @@ const dec = () => {}; class Foo { static get a() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _A); + return _A._; } static set a(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _A, v); + _A._ = v; } static get b() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _B); + return _B._; } static set b(v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _B, v); + _B._ = v; } static get ['c']() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _C); + return _C._; } static set ['c'](v) { - babelHelpers.classStaticPrivateFieldSpecSet(Foo, Foo, _C, v); + _C._ = v; } } var _A = { - writable: true, - value: void 0 + _: void 0 }; var _B = { - writable: true, - value: 123 + _: 123 }; var _C = { - writable: true, - value: 456 + _: 456 }; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-classes--to-es2015/replacement-static-installed-on-correct-class/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-classes--to-es2015/replacement-static-installed-on-correct-class/output.js index c5649e75b7c4..0a63d1f9609e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-classes--to-es2015/replacement-static-installed-on-correct-class/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-classes--to-es2015/replacement-static-installed-on-correct-class/output.js @@ -1,34 +1,22 @@ -var _initClass, _x, _A, _a, _m, _B, _temp; +var _initClass, _x, _A, _a, _B, _temp; const dec = () => {}; let hasX, hasA, hasM; let _Foo; -new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#__PURE__*/new WeakMap(), _m = /*#__PURE__*/new WeakSet(), _B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identity { +new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#__PURE__*/new WeakSet(), _B = /*#__PURE__*/new WeakMap(), (_temp = class extends babelHelpers.identity { constructor() { - (super(_Foo), babelHelpers.classPrivateMethodInitSpec(this, _m), babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }), babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }), babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: void 0 - }), babelHelpers.defineProperty(this, "x", void 0), babelHelpers.classPrivateFieldInitSpec(this, _B, { - writable: true, - value: void 0 - }), this), (() => { + (super(_Foo), babelHelpers.classPrivateMethodInitSpec(this, _a), babelHelpers.classPrivateFieldInitSpec(this, _x, void 0), babelHelpers.classPrivateFieldInitSpec(this, _A, void 0), babelHelpers.defineProperty(this, "x", void 0), babelHelpers.classPrivateFieldInitSpec(this, _B, void 0), this), (() => { hasX = o => _x.has(babelHelpers.checkInRHS(o)); hasA = o => _a.has(babelHelpers.checkInRHS(o)); - hasM = o => _m.has(babelHelpers.checkInRHS(o)); + hasM = o => _a.has(babelHelpers.checkInRHS(o)); })(), _initClass(); } }, (_Foo2 => { class Foo { static get a() { - return babelHelpers.classPrivateFieldGet(_Foo, _B); + return babelHelpers.classPrivateFieldGet2(_Foo, _B); } static set a(v) { - babelHelpers.classPrivateFieldSet(_Foo, _B, v); + babelHelpers.classPrivateFieldSet2(_Foo, _B, v); } static m() {} } @@ -36,9 +24,9 @@ new (_x = /*#__PURE__*/new WeakMap(), _A = /*#__PURE__*/new WeakMap(), _a = /*#_ [_Foo, _initClass] = babelHelpers.applyDecs2311(_Foo2, [], [dec]).c; })(), _temp))(); function _get_a() { - return babelHelpers.classPrivateFieldGet(_Foo, _A); + return babelHelpers.classPrivateFieldGet2(_Foo, _A); } function _set_a(v) { - babelHelpers.classPrivateFieldSet(_Foo, _A, v); + babelHelpers.classPrivateFieldSet2(_Foo, _A, v); } -function _m2() {} +function _m() {} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-fields--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-fields--to-es2015/context-name/output.js index 1b8ff643d88a..f997bb9e4ab4 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-fields--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-fields--to-es2015/context-name/output.js @@ -12,11 +12,10 @@ const f = () => { _computedKey = babelHelpers.toPropertyKey(f()); class Foo {} _Foo = Foo; -[_init_a, _init_extra_a, _init_a2, _init_extra_a2, _init_computedKey, _init_extra_computedKey, _init_computedKey2, _init_extra_computedKey2, _init_computedKey3, _init_extra_computedKey3, _init_computedKey4, _init_extra_computedKey4, _init_computedKey5, _init_extra_computedKey5, _init_computedKey6, _init_extra_computedKey6, _init_computedKey7, _init_extra_computedKey7] = babelHelpers.applyDecs2311(_Foo, [[dec, 8, "a"], [dec, 8, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _a, v)], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []).e; +[_init_a, _init_extra_a, _init_a2, _init_extra_a2, _init_computedKey, _init_extra_computedKey, _init_computedKey2, _init_extra_computedKey2, _init_computedKey3, _init_extra_computedKey3, _init_computedKey4, _init_extra_computedKey4, _init_computedKey5, _init_extra_computedKey5, _init_computedKey6, _init_extra_computedKey6, _init_computedKey7, _init_extra_computedKey7] = babelHelpers.applyDecs2311(_Foo, [[dec, 8, "a"], [dec, 8, "a", o => babelHelpers.assertClassBrand(o, _Foo, _a)._, (o, v) => _a._ = babelHelpers.assertClassBrand(o, _Foo, v)], [dec, 8, "b"], [dec, 8, "c"], [dec, 8, 0], [dec, 8, 1], [dec, 8, 2n], [dec, 8, 3n], [dec, 8, _computedKey]], []).e; babelHelpers.defineProperty(Foo, "a", _init_a(_Foo)); var _a = { - writable: true, - value: (_init_extra_a(_Foo), _init_a2(_Foo)) + _: (_init_extra_a(_Foo), _init_a2(_Foo)) }; babelHelpers.defineProperty(Foo, "b", (_init_extra_a2(_Foo), _init_computedKey(_Foo))); babelHelpers.defineProperty(Foo, "c", (_init_extra_computedKey(_Foo), _init_computedKey2(_Foo))); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-fields--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-fields--to-es2015/private/output.js index cfedcf1b22dd..0fd0b143cbab 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-fields--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-fields--to-es2015/private/output.js @@ -4,16 +4,10 @@ var _a = /*#__PURE__*/new WeakMap(); var _b = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: _init_a(this) - }); - babelHelpers.classPrivateFieldInitSpec(this, _b, { - writable: true, - value: (_init_extra_a(this), _init_b(this, 123)) - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, _init_a(this)); + babelHelpers.classPrivateFieldInitSpec(this, _b, (_init_extra_a(this), _init_b(this, 123))); _init_extra_b(this); } } _Foo = Foo; -[_init_a, _init_extra_a, _init_b, _init_extra_b] = babelHelpers.applyDecs2311(_Foo, [[dec, 0, "a", o => babelHelpers.classPrivateFieldGet(o, _a), (o, v) => babelHelpers.classPrivateFieldSet(o, _a, v)], [dec, 0, "b", o => babelHelpers.classPrivateFieldGet(o, _b), (o, v) => babelHelpers.classPrivateFieldSet(o, _b, v)]], [], 0, _ => _b.has(babelHelpers.checkInRHS(_))).e; +[_init_a, _init_extra_a, _init_b, _init_extra_b] = babelHelpers.applyDecs2311(_Foo, [[dec, 0, "a", o => babelHelpers.classPrivateFieldGet2(o, _a), (o, v) => babelHelpers.classPrivateFieldSet2(o, _a, v)], [dec, 0, "b", o => babelHelpers.classPrivateFieldGet2(o, _b), (o, v) => babelHelpers.classPrivateFieldSet2(o, _b, v)]], [], 0, _ => _b.has(babelHelpers.checkInRHS(_))).e; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-fields--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-fields--to-es2015/static-private/output.js index 655957df6607..69f7c7fc62f3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-fields--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-fields--to-es2015/static-private/output.js @@ -2,13 +2,11 @@ var _init_a, _init_extra_a, _init_b, _init_extra_b, _Foo; const dec = () => {}; class Foo {} _Foo = Foo; -[_init_a, _init_extra_a, _init_b, _init_extra_b] = babelHelpers.applyDecs2311(_Foo, [[dec, 8, "a", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _a), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _a, v)], [dec, 8, "b", o => babelHelpers.classStaticPrivateFieldSpecGet(o, _Foo, _b), (o, v) => babelHelpers.classStaticPrivateFieldSpecSet(o, _Foo, _b, v)]], []).e; +[_init_a, _init_extra_a, _init_b, _init_extra_b] = babelHelpers.applyDecs2311(_Foo, [[dec, 8, "a", o => babelHelpers.assertClassBrand(o, _Foo, _a)._, (o, v) => _a._ = babelHelpers.assertClassBrand(o, _Foo, v)], [dec, 8, "b", o => babelHelpers.assertClassBrand(o, _Foo, _b)._, (o, v) => _b._ = babelHelpers.assertClassBrand(o, _Foo, v)]], []).e; var _a = { - writable: true, - value: _init_a(_Foo) + _: _init_a(_Foo) }; var _b = { - writable: true, - value: (_init_extra_a(_Foo), _init_b(_Foo, 123)) + _: (_init_extra_a(_Foo), _init_b(_Foo, 123)) }; _init_extra_b(_Foo); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters--to-es2015/context-name/output.js index 2713bcce9540..f27b02d24c41 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters--to-es2015/context-name/output.js @@ -24,10 +24,6 @@ _Foo = Foo; function _get_a() { return _call_a(this); } -var _a = { - get: _get_a, - set: void 0 -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2311(_Foo, [[dec, 11, "a"], [dec, 11, "a", function () {}], [dec, 11, "b"], [dec, 11, "c"], [dec, 11, 0], [dec, 11, 1], [dec, 11, 2n], [dec, 11, 3n], [dec, 11, _computedKey]], []).e; _initStatic(_Foo); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters--to-es2015/private/output.js index f5b8831c6f14..d0899cc09e5e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters--to-es2015/private/output.js @@ -1,16 +1,13 @@ var _initProto, _call_a, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: void 0 - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } getA() { - return babelHelpers.classPrivateFieldGet(this, _a); + return babelHelpers.classPrivateGetter(this, _a, _get_a); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters--to-es2015/static-private/output.js index 47a57169462b..ffa2139f59c5 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters--to-es2015/static-private/output.js @@ -2,17 +2,13 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static getA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); + return babelHelpers.classPrivateGetter(this, Foo, _get_a); } } _Foo = Foo; function _get_a() { return _call_a(this); } -var _a = { - get: _get_a, - set: void 0 -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2311(_Foo, [[dec, 11, "a", function () { return this.value; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters-and-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters-and-setters--to-es2015/private/output.js index cd980ae15cf5..30d7f3411d63 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters-and-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters-and-setters--to-es2015/private/output.js @@ -1,19 +1,16 @@ var _initProto, _call_a, _call_a2, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } getA() { - return babelHelpers.classPrivateFieldGet(this, _a); + return babelHelpers.classPrivateGetter(this, _a, _get_a); } setA(v) { - babelHelpers.classPrivateFieldSet(this, _a, v); + babelHelpers.classPrivateSetter(this, _a, _set_a, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters-and-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters-and-setters--to-es2015/static-private/output.js index 90460249863c..c4d98ab03fb5 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters-and-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-getters-and-setters--to-es2015/static-private/output.js @@ -2,10 +2,10 @@ var _initStatic, _call_a, _call_a2, _Foo; const dec = () => {}; class Foo { static getA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a); + return babelHelpers.classPrivateGetter(this, Foo, _get_a); } static setA(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); + babelHelpers.classPrivateSetter(this, Foo, _set_a, v); } } _Foo = Foo; @@ -15,10 +15,6 @@ function _get_a() { function _set_a(v) { _call_a2(this, v); } -var _a = { - get: _get_a, - set: _set_a -}; (() => { [_call_a, _call_a2, _initStatic] = babelHelpers.applyDecs2311(_Foo, [[dec, 11, "a", function () { return this.value; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/context-name/output.js index 5c754b5d7b50..6a85d5f613dd 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/context-name/output.js @@ -26,7 +26,6 @@ _Foo = Foo; _initStatic(_Foo); })(); var _a = { - writable: true, - value: _call_a + _: _call_a }; expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/private-async-and-generator/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/private-async-and-generator/output.js index 1c689c3a2048..c40ab0694662 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/private-async-and-generator/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/private-async-and-generator/output.js @@ -7,18 +7,9 @@ var _g = /*#__PURE__*/new WeakMap(); var _a = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _ag, { - writable: true, - value: _call_ag - }); - babelHelpers.classPrivateFieldInitSpec(this, _g, { - writable: true, - value: _call_g - }); - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: _call_a - }); + babelHelpers.classPrivateFieldInitSpec(this, _ag, _call_ag); + babelHelpers.classPrivateFieldInitSpec(this, _g, _call_g); + babelHelpers.classPrivateFieldInitSpec(this, _a, _call_a); _initProto(this); } } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/private/output.js index e76fee8a446e..ac47565dd432 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/private/output.js @@ -3,14 +3,11 @@ const dec = () => {}; var _a = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: _call_a - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, _call_a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } callA() { - return babelHelpers.classPrivateFieldGet(this, _a).call(this); + return babelHelpers.classPrivateFieldGet2(this, _a).call(this); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/static-private/output.js index 63736887dd74..dd80252f9cd3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-methods--to-es2015/static-private/output.js @@ -2,7 +2,7 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static callA() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _a).call(this); + return babelHelpers.assertClassBrand(this, Foo, _a)._.call(this); } } _Foo = Foo; @@ -13,7 +13,6 @@ _Foo = Foo; _initStatic(_Foo); })(); var _a = { - writable: true, - value: _call_a + _: _call_a }; babelHelpers.defineProperty(Foo, "value", 1); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/valid-expression-formats/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/valid-expression-formats/output.js index 72dee294bfb9..1931d84de711 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/valid-expression-formats/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-misc--to-es2015/valid-expression-formats/output.js @@ -10,15 +10,12 @@ let _Foo; var _a = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: void _initProto(this) - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, void _initProto(this)); } method() {} makeClass() { var _dec5, _init_bar, _init_extra_bar, _Nested; - return _dec5 = babelHelpers.classPrivateFieldGet(this, _a), (_Nested = class Nested { + return _dec5 = babelHelpers.classPrivateFieldGet2(this, _a), (_Nested = class Nested { constructor() { babelHelpers.defineProperty(this, "bar", _init_bar(this)); _init_extra_bar(this); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-setters--to-es2015/context-name/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-setters--to-es2015/context-name/output.js index 75fa1da42520..62b70d6ed907 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-setters--to-es2015/context-name/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-setters--to-es2015/context-name/output.js @@ -24,10 +24,6 @@ _Foo = Foo; function _set_a(v) { _call_a(this, v); } -var _a = { - get: void 0, - set: _set_a -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2311(_Foo, [[dec, 12, "a"], [dec, 12, "a", function (v) {}], [dec, 12, "b"], [dec, 12, "c"], [dec, 12, 0], [dec, 12, 1], [dec, 12, 2n], [dec, 12, 3n], [dec, 12, _computedKey]], []).e; _initStatic(_Foo); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-setters--to-es2015/private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-setters--to-es2015/private/output.js index 241a7a8aaf62..971d3c32569c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-setters--to-es2015/private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-setters--to-es2015/private/output.js @@ -1,16 +1,13 @@ var _initProto, _call_a, _Foo; const dec = () => {}; -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: void 0, - set: _set_a - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); babelHelpers.defineProperty(this, "value", (_initProto(this), 1)); } setA(v) { - babelHelpers.classPrivateFieldSet(this, _a, v); + babelHelpers.classPrivateSetter(this, _a, _set_a, v); } } _Foo = Foo; diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-setters--to-es2015/static-private/output.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-setters--to-es2015/static-private/output.js index a5bb8bbe25de..70f38f3a215e 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-setters--to-es2015/static-private/output.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2023-11-setters--to-es2015/static-private/output.js @@ -2,17 +2,13 @@ var _initStatic, _call_a, _Foo; const dec = () => {}; class Foo { static setA(v) { - babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _a, v); + babelHelpers.classPrivateSetter(this, Foo, _set_a, v); } } _Foo = Foo; function _set_a(v) { _call_a(this, v); } -var _a = { - get: void 0, - set: _set_a -}; (() => { [_call_a, _initStatic] = babelHelpers.applyDecs2311(_Foo, [[dec, 12, "a", function (v) { return this.value = v; diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-destructuring-middle/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-destructuring-middle/output.js index 1e39bb3664e8..1f8d37794d3f 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-destructuring-middle/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-destructuring-middle/output.js @@ -3,8 +3,7 @@ let x, y, z; class C {} _C = C; var _x = { - writable: true, - value: void 0 + _: void 0 }; (() => { var _p, _p2, _m; @@ -12,5 +11,5 @@ var _x = { y }, _p, ..._p2] = [{ y: 1 - }, _C], _m = babelHelpers.classStaticPrivateFieldSpecGet(_p, _C, _x), x = _m === void 0 ? y : _m, z = _p2; + }, _C], _m = babelHelpers.assertClassBrand(_p, _C, _x)._, x = _m === void 0 ? y : _m, z = _p2; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-only/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-only/output.js index 9a4dff4bea85..730ec28ca497 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-only/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest-only/output.js @@ -4,13 +4,12 @@ let result; class C {} _C = C; var _x = { - writable: true, - value: void 0 + _: void 0 }; (() => { var _p, _m; var x, z; - [..._p] = [_C], _m = babelHelpers.classStaticPrivateFieldSpecGet(_p[0], _C, _x), x = _m === void 0 ? 1 : _m, z = babelHelpers.objectWithoutProperties(_p, _excluded); + [..._p] = [_C], _m = babelHelpers.assertClassBrand(_p[0], _C, _x)._, x = _m === void 0 ? 1 : _m, z = babelHelpers.objectWithoutProperties(_p, _excluded); result = { x, z diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest/output.js index af2d1e0d1e5b..5eb4a16e07f9 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/array-rest/output.js @@ -3,10 +3,9 @@ let x, z; class C {} _C = C; var _x = { - writable: true, - value: void 0 + _: void 0 }; (() => { var _p, _p2, _m; - [_p, ..._p2] = [_C], _m = babelHelpers.classStaticPrivateFieldSpecGet(_p, _C, _x), x = _m === void 0 ? 1 : _m, z = _p2; + [_p, ..._p2] = [_C], _m = babelHelpers.assertClassBrand(_p, _C, _x)._, x = _m === void 0 ? 1 : _m, z = _p2; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/basic/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/basic/output.js index 94f8843a8901..561a018626ab 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/basic/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/basic/output.js @@ -3,14 +3,13 @@ let a, x, b; class C {} _C = C; var _x = { - writable: true, - value: void 0 + _: void 0 }; (() => { var _m; ({ a = 1 - } = _C), _m = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), x = _m === void 0 ? 2 : _m, ({ + } = _C), _m = _x._, x = _m === void 0 ? 2 : _m, ({ b = 3 } = _C); })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/completion-do-expression/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/completion-do-expression/output.js index 156fcee37319..60cbbf177669 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/completion-do-expression/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/completion-do-expression/output.js @@ -3,10 +3,9 @@ var result; class C {} _C = C; var _x = { - writable: true, - value: void 0 + _: void 0 }; ((_m, _m2) => { var x; - result = (_m = _C, _m2 = babelHelpers.classStaticPrivateFieldSpecGet(_m, _C, _x), x = _m2 === void 0 ? 2 : _m2, _m); + result = (_m = _C, _m2 = babelHelpers.assertClassBrand(_m, _C, _x)._, x = _m2 === void 0 ? 2 : _m2, _m); })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/member-expression/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/member-expression/output.js index 8a5c095e639b..744f781013d6 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/member-expression/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/member-expression/output.js @@ -3,19 +3,16 @@ let x; class C {} _C = C; var _x = { - writable: true, - value: void 0 + _: void 0 }; var _y = { - writable: true, - value: void 0 + _: void 0 }; var _z = { - writable: true, - value: void 0 + _: void 0 }; (() => { var _p, _p2; let z; - [babelHelpers.classStaticPrivateFieldDestructureSet(_C, _C, _x).value, _p, ..._p2] = [0, _C], x = babelHelpers.classStaticPrivateFieldSpecGet(_p, _C, _x), z = _p2; + [_x._, _p, ..._p2] = [0, _C], x = babelHelpers.assertClassBrand(_p, _C, _x)._, z = _p2; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested-under-array-pattern/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested-under-array-pattern/output.js index dcdb325852db..7449b8b9a17a 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested-under-array-pattern/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested-under-array-pattern/output.js @@ -5,20 +5,17 @@ function _self() { return _C; } var _x = { - writable: true, - value: "x" + _: "x" }; var _y = { - writable: true, - value: [] + _: [] }; var _z = { - writable: true, - value: void 0 + _: void 0 }; babelHelpers.defineProperty(C, "self", _C); (() => { var _p, _p2, _p3, _p4, _m; let x, y, z; - [_p, _p2,, _p3] = [_C, _C], x = babelHelpers.classStaticPrivateFieldSpecGet(_p === void 0 ? _C.self : _p, _C, _x), [, _p4] = babelHelpers.classStaticPrivateFieldSpecGet(_p2, _C, _y), _m = babelHelpers.classStaticPrivateFieldSpecGet(_p4 === void 0 ? _C.self : _p4, _C, _z), y = _m === void 0 ? babelHelpers.classStaticPrivateMethodGet(_C, _C, _self).call(_C) : _m, z = _p3 === void 0 ? babelHelpers.classStaticPrivateFieldSpecGet(y, _C, _y) : _p3; + [_p, _p2,, _p3] = [_C, _C], x = babelHelpers.assertClassBrand(_p === void 0 ? _C.self : _p, _C, _x)._, [, _p4] = babelHelpers.assertClassBrand(_p2, _C, _y)._, _m = babelHelpers.assertClassBrand(_p4 === void 0 ? _C.self : _p4, _C, _z)._, y = _m === void 0 ? _self.call(_C) : _m, z = _p3 === void 0 ? babelHelpers.assertClassBrand(y, _C, _y)._ : _p3; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested/output.js index 1858785cb047..5dd282b6e9f7 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/nested/output.js @@ -2,29 +2,25 @@ var _C; class C {} _C = C; var _y = { - writable: true, - value: "y" + _: "y" }; var _z = { - writable: true, - value: "self" + _: "self" }; var _x = { - writable: true, - value: void 0 + _: void 0 }; babelHelpers.defineProperty(C, "b", "b"); babelHelpers.defineProperty(C, "self", _C); var _self = { - writable: true, - value: _C + _: _C }; (() => { var _m, _m2, _m3, _m4, _m5; let cloned, b, y, yy, yy2; - _m = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), _m2 = _m === void 0 ? babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _self) : _m, _m3 = _m2[babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _z)], ({ + _m = _x._, _m2 = _m === void 0 ? _self._ : _m, _m3 = _m2[_z._], ({ b - } = _m3), _m4 = babelHelpers.classStaticPrivateFieldSpecGet(_m3, _C, _x), y = _m4 === void 0 ? (_C.b = "bb", babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _self), _C, _y)) : _m4, _m5 = babelHelpers.classStaticPrivateFieldSpecGet(_m2, _C, _x), yy = _m5 === void 0 ? (delete _C.self, ({ + } = _m3), _m4 = babelHelpers.assertClassBrand(_m3, _C, _x)._, y = _m4 === void 0 ? (_C.b = "bb", babelHelpers.assertClassBrand(_self._, _C, _y)._) : _m4, _m5 = babelHelpers.assertClassBrand(_m2, _C, _x)._, yy = _m5 === void 0 ? (delete _C.self, ({ ...cloned - } = _C), babelHelpers.classStaticPrivateFieldSpecSet(_C, _C, _y, "yy")) : _m5, yy2 = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y); + } = _C), _y._ = "yy") : _m5, yy2 = _y._; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-keys/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-keys/output.js index 4d5579ca0cd2..6739cc173c02 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-keys/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-keys/output.js @@ -4,19 +4,17 @@ let result; class C {} _C = C; var _x = { - writable: true, - value: "#x" + _: "#x" }; var _y = { - writable: true, - value: "y" + _: "y" }; babelHelpers.defineProperty(C, "a", "a"); babelHelpers.defineProperty(C, "b", "b"); babelHelpers.defineProperty(C, "c", "c"); (_C2 => { let x, y, z; - x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), (_C2 = _C, ({ + x = _x._, (_C2 = _C, ({ y } = _C2), z = babelHelpers.objectWithoutProperties(_C2, _excluded), _C2); result = { diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-private-keys/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-private-keys/output.js index 739d6182c132..ceba58495527 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-private-keys/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-and-private-keys/output.js @@ -3,19 +3,17 @@ let result; class C {} _C = C; var _x = { - writable: true, - value: "#x" + _: "#x" }; var _y = { - writable: true, - value: "#y" + _: "#y" }; babelHelpers.defineProperty(C, "a", "a"); babelHelpers.defineProperty(C, "b", "b"); babelHelpers.defineProperty(C, "c", "c"); (_C2 => { let x, y, z; - x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), y = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y), (_C2 = _C, ({} = _C2), z = Object.assign({}, (babelHelpers.objectDestructuringEmpty(_C2), _C2)), _C2); + x = _x._, y = _y._, (_C2 = _C, ({} = _C2), z = Object.assign({}, (babelHelpers.objectDestructuringEmpty(_C2), _C2)), _C2); result = { x, y, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-under-private/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-under-private/output.js index e54a7d50a238..fe56f0e97fee 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-under-private/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest-under-private/output.js @@ -7,16 +7,15 @@ babelHelpers.defineProperty(C, "x", "x"); babelHelpers.defineProperty(C, "y", "y"); babelHelpers.defineProperty(C, "z", "z"); var _x = { - writable: true, - value: _C + _: _C }; -(_babelHelpers$classSt => { +(_x$_ => { var x, y, z; ({ x - } = _C), (_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), ({ + } = _C), (_x$_ = _x._, ({ y - } = _babelHelpers$classSt), z = babelHelpers.objectWithoutProperties(_babelHelpers$classSt, _excluded), _babelHelpers$classSt); + } = _x$_), z = babelHelpers.objectWithoutProperties(_x$_, _excluded), _x$_); result = { x, y, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest/output.js index 4d748da167c4..69c05fe759c8 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/object-rest/output.js @@ -3,12 +3,10 @@ let result; class C {} _C = C; var _x = { - writable: true, - value: "#x" + _: "#x" }; var _y = { - writable: true, - value: "#y" + _: "#y" }; babelHelpers.defineProperty(C, "a", "a"); babelHelpers.defineProperty(C, "b", "b"); @@ -18,9 +16,9 @@ babelHelpers.defineProperty(C, "c", "c"); var a, b, x, y, z; ({ [_m = _C.a]: a - } = _C), x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), ({ + } = _C), x = _x._, ({ [_m2 = _C.b]: b - } = _C), y = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y), z = babelHelpers.objectWithoutProperties(_C, [_m, _m2].map(babelHelpers.toPropertyKey)); + } = _C), y = _y._, z = babelHelpers.objectWithoutProperties(_C, [_m, _m2].map(babelHelpers.toPropertyKey)); result = { a, b, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/under-param-initializer/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/under-param-initializer/output.js index 5978917a684f..7537c8eaaa4f 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/under-param-initializer/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assignment--es2015/under-param-initializer/output.js @@ -3,12 +3,11 @@ let a; class C { static m(r = (_m2 = C, ({ a - } = babelHelpers.classStaticPrivateFieldSpecGet(_m2, C, _x)), _m2)) {} + } = babelHelpers.assertClassBrand(_m2, C, _x)._), _m2)) {} } _C = C; var _x = { - writable: true, - value: { + _: { a: 1, b: 2 } @@ -18,6 +17,6 @@ var _x = { let b; (function f(r = (_m = _C, ({ b - } = babelHelpers.classStaticPrivateFieldSpecGet(_m, _C, _x)), _m)) {})(); + } = babelHelpers.assertClassBrand(_m, _C, _x)._), _m)) {})(); })(); C.m(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assumption-ignoreFunctionLength/function-params/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assumption-ignoreFunctionLength/function-params/output.js index 641f4c731428..c69bf503c721 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assumption-ignoreFunctionLength/function-params/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assumption-ignoreFunctionLength/function-params/output.js @@ -1,21 +1,20 @@ class C { static 0(..._p) { var [..._p2] = _p, - x = babelHelpers.classStaticPrivateFieldSpecGet(_p2[0], C, _x); + x = babelHelpers.assertClassBrand(_p2[0], C, _x)._; } static 1(a, b = 1, _p3, ..._p4) { - var x = babelHelpers.classStaticPrivateFieldSpecGet(_p3, C, _x), + var x = babelHelpers.assertClassBrand(_p3, C, _x)._, c = _p4; } static 2(a, b, _p5) { - var x = babelHelpers.classStaticPrivateFieldSpecGet(_p5 === void 0 ? C : _p5, C, _x); + var x = babelHelpers.assertClassBrand(_p5 === void 0 ? C : _p5, C, _x)._; } static 3(a, b, _p6, _p7) { - var x = babelHelpers.classStaticPrivateFieldSpecGet(_p6, C, _x), + var x = babelHelpers.assertClassBrand(_p6, C, _x)._, c = _p7 === void 0 ? 1 : _p7; } } var _x = { - writable: true, - value: void 0 + _: void 0 }; diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assumption-objectRestNoSymbols/variable-declaration/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assumption-objectRestNoSymbols/variable-declaration/output.js index 34af591a3ae1..8d0a452d41e4 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assumption-objectRestNoSymbols/variable-declaration/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/assumption-objectRestNoSymbols/variable-declaration/output.js @@ -3,12 +3,10 @@ let result; class C {} _C = C; var _x = { - writable: true, - value: "#x" + _: "#x" }; var _y = { - writable: true, - value: "#y" + _: "#y" }; babelHelpers.defineProperty(C, "a", "a"); babelHelpers.defineProperty(C, "b", "b"); @@ -18,11 +16,11 @@ babelHelpers.defineProperty(C, "c", "c"); var { [_m = _C.a]: a } = _C, - x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), + x = _x._, { [_m2 = _C.b]: b } = _C, - y = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y), + y = _y._, z = babelHelpers.objectWithoutPropertiesLoose(_C, [_m, _m2].map(babelHelpers.toPropertyKey)); result = { a, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/catch-param--es2015/no-shadowed-params/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/catch-param--es2015/no-shadowed-params/output.js index 43a0d20f3416..fd296c23904e 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/catch-param--es2015/no-shadowed-params/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/catch-param--es2015/no-shadowed-params/output.js @@ -3,10 +3,7 @@ var x; var _x = /*#__PURE__*/new WeakMap(); class C { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _x, void 0); } } _C = C; @@ -15,6 +12,6 @@ _C = C; try { throw new _C(); } catch (_e) { - let x = babelHelpers.classPrivateFieldGet(_e, _x); + let x = babelHelpers.classPrivateFieldGet2(_e, _x); } })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs-with-assign/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs-with-assign/output.js index ecae7ab69a0b..384bb76ff663 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs-with-assign/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs-with-assign/output.js @@ -2,12 +2,11 @@ var _C; class C {} _C = C; var _x = { - writable: true, - value: 42 + _: 42 }; (() => { let x, y; - for (_m = (_m2 = _C, y = babelHelpers.classStaticPrivateFieldSpecGet(_m2, _C, _x), _m2), x = babelHelpers.classStaticPrivateFieldSpecGet(_m, _C, _x), _m;;) { + for (_m = (_m2 = _C, y = babelHelpers.assertClassBrand(_m2, _C, _x)._, _m2), x = babelHelpers.assertClassBrand(_m, _C, _x)._, _m;;) { var _m, _m2; break; } diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs/output.js index 70dc9e3d9d44..6a3ae8cd8478 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/lhs/output.js @@ -2,15 +2,12 @@ var _C; var _x = /*#__PURE__*/new WeakMap(); class C { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _x, void 0); } } _C = C; (() => { - for (_m = _C, x = babelHelpers.classPrivateFieldGet(_m, _x), _m;;) { + for (_m = _C, x = babelHelpers.classPrivateFieldGet2(_m, _x), _m;;) { var _m; break; } diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration-with-assign/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration-with-assign/output.js index 68d5beb7c986..fb47a5117e9a 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration-with-assign/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration-with-assign/output.js @@ -2,12 +2,11 @@ var _C; class C {} _C = C; var _x = { - writable: true, - value: 42 + _: 42 }; (() => { let y; - for (let x = babelHelpers.classStaticPrivateFieldSpecGet((_m = _C, y = babelHelpers.classStaticPrivateFieldSpecGet(_m, _C, _x), _m), _C, _x);;) { + for (let x = babelHelpers.assertClassBrand((_m = _C, y = babelHelpers.assertClassBrand(_m, _C, _x)._, _m), _C, _x)._;;) { var _m; break; } diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration/output.js index d9fd6a71f672..a0dcd3347571 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-init--es2015/variable-declaration/output.js @@ -1,12 +1,9 @@ -var _C; class C {} -_C = C; var _x = { - writable: true, - value: void 0 + _: void 0 }; (() => { - for (let x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x);;) { + for (let x = _x._;;) { break; } })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs-with-shadowed-block-scoped/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs-with-shadowed-block-scoped/output.js index 09e9cb369ebc..9ba0adb8c438 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs-with-shadowed-block-scoped/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs-with-shadowed-block-scoped/output.js @@ -3,14 +3,13 @@ class C {} _C = C; babelHelpers.defineProperty(C, "a", "a"); var _x = { - writable: true, - value: void 0 + _: void 0 }; (() => { var x, a = "a"; for (const _ref of [_C]) { - x = babelHelpers.classStaticPrivateFieldSpecGet(_ref, _C, _x), ({ + x = babelHelpers.assertClassBrand(_ref, _C, _x)._, ({ [a]: a } = _ref); { diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs/output.js index 0f8500fc8b38..5f9d4d4d4895 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/lhs/output.js @@ -2,16 +2,13 @@ var _C; var _x = /*#__PURE__*/new WeakMap(); class C { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _x, void 0); } } _C = C; (() => { for (const _ref of [_C]) { - x = babelHelpers.classPrivateFieldGet(_ref, _x); + x = babelHelpers.classPrivateFieldGet2(_ref, _x); ; } })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration-block-scoped/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration-block-scoped/output.js index 0f201356dae5..d2e0ca76918d 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration-block-scoped/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration-block-scoped/output.js @@ -3,13 +3,12 @@ class C {} _C = C; babelHelpers.defineProperty(C, "a", "a"); var _x = { - writable: true, - value: void 0 + _: void 0 }; (() => { const a = "a"; for (const _ref of [_C]) { - const x = babelHelpers.classStaticPrivateFieldSpecGet(_ref, _C, _x), + const x = babelHelpers.assertClassBrand(_ref, _C, _x)._, { [a]: _ } = _ref; diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration/output.js index 746bee5ad847..8e9fae5510cd 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/for-of--es2015/variable-declaration/output.js @@ -2,16 +2,13 @@ var _C; var _x = /*#__PURE__*/new WeakMap(); class C { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _x, void 0); } } _C = C; (() => { for (const _ref of [_C]) { - const x = babelHelpers.classPrivateFieldGet(_ref, _x); + const x = babelHelpers.classPrivateFieldGet2(_ref, _x); ; } })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/function-params--es2015/function-length/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/function-params--es2015/function-length/output.js index 909ec285377d..64e8fc53629f 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/function-params--es2015/function-length/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/function-params--es2015/function-length/output.js @@ -1,21 +1,20 @@ class C { static 0(..._p) { var [..._p2] = _p, - x = babelHelpers.classStaticPrivateFieldSpecGet(_p2[0], C, _x); + x = babelHelpers.assertClassBrand(_p2[0], C, _x)._; } static 1(a, b = 1, _p3, ..._p4) { - var x = babelHelpers.classStaticPrivateFieldSpecGet(_p3, C, _x), + var x = babelHelpers.assertClassBrand(_p3, C, _x)._, c = _p4; } static 2(a, b, _p5 = void 0) { - var x = babelHelpers.classStaticPrivateFieldSpecGet(_p5 === void 0 ? C : _p5, C, _x); + var x = babelHelpers.assertClassBrand(_p5 === void 0 ? C : _p5, C, _x)._; } static 3(a, b, _p6, _p7 = void 0) { - var x = babelHelpers.classStaticPrivateFieldSpecGet(_p6, C, _x), + var x = babelHelpers.assertClassBrand(_p6, C, _x)._, c = _p7 === void 0 ? 1 : _p7; } } var _x = { - writable: true, - value: void 0 + _: void 0 }; diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/function-params--es2015/no-shadowed-params/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/function-params--es2015/no-shadowed-params/output.js index 98b0c8ec7cd6..0f2d374e7dc2 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/function-params--es2015/no-shadowed-params/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/function-params--es2015/no-shadowed-params/output.js @@ -1,13 +1,10 @@ var _x = /*#__PURE__*/new WeakMap(); class C { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _x, void 0); } m(a = 1, _p, _p2, ..._p3) { - var x = babelHelpers.classPrivateFieldGet(_p, _x), + var x = babelHelpers.classPrivateFieldGet2(_p, _x), b = _p2, c = _p3; } diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/function-params--es2015/shadowed-params/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/function-params--es2015/shadowed-params/output.js index 2723c4b92ec4..0867512584f1 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/function-params--es2015/shadowed-params/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/function-params--es2015/shadowed-params/output.js @@ -1,13 +1,10 @@ var _x = /*#__PURE__*/new WeakMap(); class C { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _x, void 0); } m(a = 1, _p, _p2, ..._p3) { - var x = babelHelpers.classPrivateFieldGet(_p, _x), + var x = babelHelpers.classPrivateFieldGet2(_p, _x), b = _p2, c = _p3; return function (b) { diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest-only/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest-only/output.js index 1a78f9a5bc11..8eaec777b4ca 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest-only/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest-only/output.js @@ -4,12 +4,11 @@ let result; class C {} _C = C; var _x = { - writable: true, - value: void 0 + _: void 0 }; (() => { var [..._p] = [_C], - _m = babelHelpers.classStaticPrivateFieldSpecGet(_p[0], _C, _x), + _m = babelHelpers.assertClassBrand(_p[0], _C, _x)._, x = _m === void 0 ? 1 : _m, z = babelHelpers.objectWithoutProperties(_p, _excluded); result = { diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest/output.js index 96ce771b5fb1..fc68682cc8fb 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/array-rest/output.js @@ -2,12 +2,11 @@ var _C; class C {} _C = C; var _x = { - writable: true, - value: void 0 + _: void 0 }; (() => { var [_p, ..._p2] = [_C], - _m = babelHelpers.classStaticPrivateFieldSpecGet(_p, _C, _x), + _m = babelHelpers.assertClassBrand(_p, _C, _x)._, x = _m === void 0 ? 1 : _m, z = _p2; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/basic/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/basic/output.js index a8562edf4b02..03e7e52544a6 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/basic/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/basic/output.js @@ -2,14 +2,13 @@ var _C; class C {} _C = C; var _x = { - writable: true, - value: void 0 + _: void 0 }; (() => { var { a = 1 } = _C, - _m = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), + _m = _x._, x = _m === void 0 ? 2 : _m, { b = 3 diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested-under-array-pattern/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested-under-array-pattern/output.js index b9ef6fd84a3d..c9fbaddd517d 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested-under-array-pattern/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested-under-array-pattern/output.js @@ -5,23 +5,20 @@ function _self() { return _C; } var _x = { - writable: true, - value: "x" + _: "x" }; var _y = { - writable: true, - value: [] + _: [] }; var _z = { - writable: true, - value: void 0 + _: void 0 }; babelHelpers.defineProperty(C, "self", _C); (() => { var [_p, _p2,, _p3] = [_C, _C], - x = babelHelpers.classStaticPrivateFieldSpecGet(_p === void 0 ? _C.self : _p, _C, _x), - [, _p4] = babelHelpers.classStaticPrivateFieldSpecGet(_p2, _C, _y), - _m = babelHelpers.classStaticPrivateFieldSpecGet(_p4 === void 0 ? _C.self : _p4, _C, _z), - y = _m === void 0 ? babelHelpers.classStaticPrivateMethodGet(_C, _C, _self).call(_C) : _m, - z = _p3 === void 0 ? babelHelpers.classStaticPrivateFieldSpecGet(y, _C, _y) : _p3; + x = babelHelpers.assertClassBrand(_p === void 0 ? _C.self : _p, _C, _x)._, + [, _p4] = babelHelpers.assertClassBrand(_p2, _C, _y)._, + _m = babelHelpers.assertClassBrand(_p4 === void 0 ? _C.self : _p4, _C, _z)._, + y = _m === void 0 ? _self.call(_C) : _m, + z = _p3 === void 0 ? babelHelpers.assertClassBrand(y, _C, _y)._ : _p3; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested/output.js index d6ebcfed64ed..1cdeee0902fa 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/nested/output.js @@ -2,36 +2,32 @@ var _C; class C {} _C = C; var _y = { - writable: true, - value: "y" + _: "y" }; var _z = { - writable: true, - value: "self" + _: "self" }; var _x = { - writable: true, - value: void 0 + _: void 0 }; babelHelpers.defineProperty(C, "b", "b"); babelHelpers.defineProperty(C, "self", _C); var _self = { - writable: true, - value: _C + _: _C }; (() => { let cloned; - var _m = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), - _m2 = _m === void 0 ? babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _self) : _m, - _m3 = _m2[babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _z)], + var _m = _x._, + _m2 = _m === void 0 ? _self._ : _m, + _m3 = _m2[_z._], { b } = _m3, - _m4 = babelHelpers.classStaticPrivateFieldSpecGet(_m3, _C, _x), - y = _m4 === void 0 ? (_C.b = "bb", babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _self), _C, _y)) : _m4, - _m5 = babelHelpers.classStaticPrivateFieldSpecGet(_m2, _C, _x), + _m4 = babelHelpers.assertClassBrand(_m3, _C, _x)._, + y = _m4 === void 0 ? (_C.b = "bb", babelHelpers.assertClassBrand(_self._, _C, _y)._) : _m4, + _m5 = babelHelpers.assertClassBrand(_m2, _C, _x)._, yy = _m5 === void 0 ? (delete _C.self, ({ ...cloned - } = _C), babelHelpers.classStaticPrivateFieldSpecSet(_C, _C, _y, "yy")) : _m5, - yy2 = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y); + } = _C), _y._ = "yy") : _m5, + yy2 = _y._; })(); diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-keys/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-keys/output.js index 2316404a3093..b8e461c96d7d 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-keys/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-keys/output.js @@ -4,15 +4,14 @@ let result; class C {} _C = C; var _x = { - writable: true, - value: "#x" + _: "#x" }; babelHelpers.defineProperty(C, "y", "y"); babelHelpers.defineProperty(C, "a", "a"); babelHelpers.defineProperty(C, "b", "b"); babelHelpers.defineProperty(C, "c", "c"); (() => { - var x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), + var x = _x._, { y } = _C, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-private-keys/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-private-keys/output.js index bb56c3313406..60aa6431a78a 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-private-keys/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-and-private-keys/output.js @@ -3,19 +3,17 @@ let result; class C {} _C = C; var _x = { - writable: true, - value: "#x" + _: "#x" }; var _y = { - writable: true, - value: "#y" + _: "#y" }; babelHelpers.defineProperty(C, "a", "a"); babelHelpers.defineProperty(C, "b", "b"); babelHelpers.defineProperty(C, "c", "c"); (() => { - var x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), - y = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y), + var x = _x._, + y = _y._, z = Object.assign({}, (babelHelpers.objectDestructuringEmpty(_C), _C)); result = { x, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-under-private/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-under-private/output.js index d27eb900cee6..d339893ab7a0 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-under-private/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest-under-private/output.js @@ -7,18 +7,17 @@ babelHelpers.defineProperty(C, "x", "x"); babelHelpers.defineProperty(C, "y", "y"); babelHelpers.defineProperty(C, "z", "z"); var _x = { - writable: true, - value: _C + _: _C }; (() => { var { x } = _C, - _babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), + _x$_ = _x._, { y - } = _babelHelpers$classSt, - z = babelHelpers.objectWithoutProperties(_babelHelpers$classSt, _excluded); + } = _x$_, + z = babelHelpers.objectWithoutProperties(_x$_, _excluded); result = { x, y, diff --git a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest/output.js b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest/output.js index 2ae91a53b9d3..e8100109e089 100644 --- a/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest/output.js +++ b/packages/babel-plugin-proposal-destructuring-private/test/fixtures/variable-declaration--es2015/object-rest/output.js @@ -3,12 +3,10 @@ let result; class C {} _C = C; var _x = { - writable: true, - value: "#x" + _: "#x" }; var _y = { - writable: true, - value: "#y" + _: "#y" }; babelHelpers.defineProperty(C, "a", "a"); babelHelpers.defineProperty(C, "b", "b"); @@ -18,11 +16,11 @@ babelHelpers.defineProperty(C, "c", "c"); var { [_m = _C.a]: a } = _C, - x = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _x), + x = _x._, { [_m2 = _C.b]: b } = _C, - y = babelHelpers.classStaticPrivateFieldSpecGet(_C, _C, _y), + y = _y._, z = babelHelpers.objectWithoutProperties(_C, [_m, _m2].map(babelHelpers.toPropertyKey)); result = { a, diff --git a/packages/babel-plugin-proposal-optional-chaining-assign/test/fixtures/assumption-noDocumentAll/private-field-transformed/output.js b/packages/babel-plugin-proposal-optional-chaining-assign/test/fixtures/assumption-noDocumentAll/private-field-transformed/output.js index 3e426f949857..7381edb9857c 100644 --- a/packages/babel-plugin-proposal-optional-chaining-assign/test/fixtures/assumption-noDocumentAll/private-field-transformed/output.js +++ b/packages/babel-plugin-proposal-optional-chaining-assign/test/fixtures/assumption-noDocumentAll/private-field-transformed/output.js @@ -1,18 +1,15 @@ var _x = /*#__PURE__*/new WeakMap(); class A { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _x, void 0); } method() { var _obj, _obj2, _obj3, _obj4, _obj5, _obj6; - (_obj = obj) == null ? void 0 : babelHelpers.classPrivateFieldSet(_obj, _x, 1); - (_obj2 = obj) == null ? void 0 : babelHelpers.classPrivateFieldSet(_obj2, _x, babelHelpers.classPrivateFieldGet(_obj2, _x) + 2); - (_obj3 = obj) == null ? void 0 : babelHelpers.classPrivateFieldGet(_obj3, _x) ?? babelHelpers.classPrivateFieldSet(_obj3, _x, 3); - (_obj4 = obj) == null ? void 0 : babelHelpers.classPrivateFieldGet(_obj4, _x).y = 4; - (_obj5 = obj) == null ? void 0 : babelHelpers.classPrivateFieldGet(_obj5, _x).y += 5; - (_obj6 = obj) == null ? void 0 : babelHelpers.classPrivateFieldGet(_obj6, _x).y ??= 6; + (_obj = obj) == null ? void 0 : babelHelpers.classPrivateFieldSet2(_obj, _x, 1); + (_obj2 = obj) == null ? void 0 : babelHelpers.classPrivateFieldSet2(_obj2, _x, babelHelpers.classPrivateFieldGet2(_obj2, _x) + 2); + (_obj3 = obj) == null ? void 0 : babelHelpers.classPrivateFieldGet2(_obj3, _x) ?? babelHelpers.classPrivateFieldSet2(_obj3, _x, 3); + (_obj4 = obj) == null ? void 0 : babelHelpers.classPrivateFieldGet2(_obj4, _x).y = 4; + (_obj5 = obj) == null ? void 0 : babelHelpers.classPrivateFieldGet2(_obj5, _x).y += 5; + (_obj6 = obj) == null ? void 0 : babelHelpers.classPrivateFieldGet2(_obj6, _x).y ??= 6; } } diff --git a/packages/babel-plugin-proposal-optional-chaining-assign/test/fixtures/general/private-field-transformed/output.js b/packages/babel-plugin-proposal-optional-chaining-assign/test/fixtures/general/private-field-transformed/output.js index b28892554049..1c1e70218886 100644 --- a/packages/babel-plugin-proposal-optional-chaining-assign/test/fixtures/general/private-field-transformed/output.js +++ b/packages/babel-plugin-proposal-optional-chaining-assign/test/fixtures/general/private-field-transformed/output.js @@ -1,18 +1,15 @@ var _x = /*#__PURE__*/new WeakMap(); class A { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _x, void 0); } method() { var _obj, _obj2, _obj3, _obj4, _obj5, _obj6; - (_obj = obj) === null || _obj === void 0 ? void 0 : babelHelpers.classPrivateFieldSet(_obj, _x, 1); - (_obj2 = obj) === null || _obj2 === void 0 ? void 0 : babelHelpers.classPrivateFieldSet(_obj2, _x, babelHelpers.classPrivateFieldGet(_obj2, _x) + 2); - (_obj3 = obj) === null || _obj3 === void 0 ? void 0 : babelHelpers.classPrivateFieldGet(_obj3, _x) ?? babelHelpers.classPrivateFieldSet(_obj3, _x, 3); - (_obj4 = obj) === null || _obj4 === void 0 ? void 0 : babelHelpers.classPrivateFieldGet(_obj4, _x).y = 4; - (_obj5 = obj) === null || _obj5 === void 0 ? void 0 : babelHelpers.classPrivateFieldGet(_obj5, _x).y += 5; - (_obj6 = obj) === null || _obj6 === void 0 ? void 0 : babelHelpers.classPrivateFieldGet(_obj6, _x).y ??= 6; + (_obj = obj) === null || _obj === void 0 ? void 0 : babelHelpers.classPrivateFieldSet2(_obj, _x, 1); + (_obj2 = obj) === null || _obj2 === void 0 ? void 0 : babelHelpers.classPrivateFieldSet2(_obj2, _x, babelHelpers.classPrivateFieldGet2(_obj2, _x) + 2); + (_obj3 = obj) === null || _obj3 === void 0 ? void 0 : babelHelpers.classPrivateFieldGet2(_obj3, _x) ?? babelHelpers.classPrivateFieldSet2(_obj3, _x, 3); + (_obj4 = obj) === null || _obj4 === void 0 ? void 0 : babelHelpers.classPrivateFieldGet2(_obj4, _x).y = 4; + (_obj5 = obj) === null || _obj5 === void 0 ? void 0 : babelHelpers.classPrivateFieldGet2(_obj5, _x).y += 5; + (_obj6 = obj) === null || _obj6 === void 0 ? void 0 : babelHelpers.classPrivateFieldGet2(_obj6, _x).y ??= 6; } } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-before-member-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-before-member-call/output.js index 4f6b717c399a..f02e59f6f4aa 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-before-member-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-before-member-call/output.js @@ -4,7 +4,7 @@ class Foo { return this; } static test() { - var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o, _deep$very$o$Foo, _deep$very$o2, _deep$very$o2$Foo, _deep$very$o3, _deep$very$o3$Foo, _babelHelpers$classSt, _babelHelpers$classSt2, _ref, _ref$self, _ref2, _ref2$self, _self2, _self2$self, _babelHelpers$classSt3, _babelHelpers$classSt4, _ref3, _ref3$call, _ref4, _ref4$getSelf, _getSelf, _ref5, _getSelf$call, _ref6, _ref6$self, _babelHelpers$classSt5, _call, _call$self, _getSelf2, _getSelf2$self, _getSelf3, _getSelf3$self, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o, _fnDeep$very$o$Foo, _fnDeep$very$o2, _fnDeep$very$o2$Foo, _fnDeep$very$o3, _fnDeep$very$o3$Foo, _babelHelpers$classSt6, _babelHelpers$classSt7, _ref7, _ref7$self, _ref8, _ref8$self, _self3, _self3$self, _babelHelpers$classSt8, _babelHelpers$classSt9, _ref9, _ref9$call, _ref10, _ref10$getSelf, _getSelf4, _ref11, _getSelf4$call, _ref12, _ref12$self, _babelHelpers$classSt10, _call2, _call2$self, _getSelf5, _getSelf5$self, _getSelf6, _getSelf6$self; + var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o, _deep$very$o$Foo, _deep$very$o2, _deep$very$o2$Foo, _deep$very$o3, _deep$very$o3$Foo, _babelHelpers$assertC, _babelHelpers$assertC2, _ref, _ref$self, _ref2, _ref2$self, _self2, _self2$self, _babelHelpers$assertC3, _babelHelpers$assertC4, _ref3, _ref3$call, _ref4, _ref4$getSelf, _getSelf, _ref5, _getSelf$call, _ref6, _ref6$self, _babelHelpers$assertC5, _call, _call$self, _getSelf2, _getSelf2$self, _getSelf3, _getSelf3$self, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o, _fnDeep$very$o$Foo, _fnDeep$very$o2, _fnDeep$very$o2$Foo, _fnDeep$very$o3, _fnDeep$very$o3$Foo, _babelHelpers$assertC6, _babelHelpers$assertC7, _ref7, _ref7$self, _ref8, _ref8$self, _self3, _self3$self, _babelHelpers$assertC8, _babelHelpers$assertC9, _ref9, _ref9$call, _ref10, _ref10$getSelf, _getSelf4, _ref11, _getSelf4$call, _ref12, _ref12$self, _babelHelpers$assertC10, _call2, _call2$self, _getSelf5, _getSelf5$self, _getSelf6, _getSelf6$self; const o = { Foo: Foo }; @@ -19,60 +19,57 @@ class Foo { function fnDeep() { return deep; } - o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo = o.Foo, Foo, _m).call(_o$Foo); - o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo2 = o.Foo, Foo, _m).call(_o$Foo2).toString; - o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo3 = o.Foo, Foo, _m).call(_o$Foo3).toString(); - (_deep$very$o = deep?.very.o) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo = _deep$very$o.Foo, Foo, _m).call(_deep$very$o$Foo); - (_deep$very$o2 = deep?.very.o) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o2$Foo = _deep$very$o2.Foo, Foo, _m).call(_deep$very$o2$Foo).toString; - (_deep$very$o3 = deep?.very.o) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o3$Foo = _deep$very$o3.Foo, Foo, _m).call(_deep$very$o3$Foo).toString(); - o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self), Foo, _m).call(_babelHelpers$classSt); - o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt2 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self, Foo, _m).call(_babelHelpers$classSt2); - (_ref = o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref$self = _ref.self, Foo, _m).call(_ref$self); - (_ref2 = o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref2$self = _ref2.self, Foo, _m).call(_ref2$self); - (_self2 = (o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.self) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self2$self = _self2.self, Foo, _m).call(_self2$self); - o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt3 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf(), Foo, _m).call(_babelHelpers$classSt3); - (_ref3 = o == null ? void 0 : (_babelHelpers$classSt4 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref3$call = _ref3.call(_babelHelpers$classSt4), Foo, _m).call(_ref3$call); - (_ref4 = o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref4$getSelf = _ref4.getSelf(), Foo, _m).call(_ref4$getSelf); - (_getSelf = (_ref5 = o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$call = _getSelf.call(_ref5), Foo, _m).call(_getSelf$call); - (_ref6 = o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf()) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref6$self = _ref6.self, Foo, _m).call(_ref6$self); - (_call = (o == null ? void 0 : (_babelHelpers$classSt5 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt5)) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call$self = _call.self, Foo, _m).call(_call$self); - (_getSelf2 = (o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf()) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf2$self = _getSelf2.self, Foo, _m).call(_getSelf2$self); - (_getSelf3 = (o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf?.()) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf3$self = _getSelf3.self, Foo, _m).call(_getSelf3$self); - fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo = fn().Foo, Foo, _m).call(_fn$Foo); - fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo2 = fn().Foo, Foo, _m).call(_fn$Foo2).toString; - fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo3 = fn().Foo, Foo, _m).call(_fn$Foo3).toString(); - (_fnDeep$very$o = fnDeep?.().very.o) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo = _fnDeep$very$o.Foo, Foo, _m).call(_fnDeep$very$o$Foo); - (_fnDeep$very$o2 = fnDeep?.().very.o) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o2$Foo = _fnDeep$very$o2.Foo, Foo, _m).call(_fnDeep$very$o2$Foo).toString; - (_fnDeep$very$o3 = fnDeep?.().very.o) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o3$Foo = _fnDeep$very$o3.Foo, Foo, _m).call(_fnDeep$very$o3$Foo).toString(); - fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt6 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self), Foo, _m).call(_babelHelpers$classSt6); - fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt7 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self, Foo, _m).call(_babelHelpers$classSt7); - (_ref7 = fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref7$self = _ref7.self, Foo, _m).call(_ref7$self); - (_ref8 = fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref8$self = _ref8.self, Foo, _m).call(_ref8$self); - (_self3 = (fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.self) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self3$self = _self3.self, Foo, _m).call(_self3$self); - fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt8 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf(), Foo, _m).call(_babelHelpers$classSt8); - (_ref9 = fn == null ? void 0 : (_babelHelpers$classSt9 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref9$call = _ref9.call(_babelHelpers$classSt9), Foo, _m).call(_ref9$call); - (_ref10 = fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref10$getSelf = _ref10.getSelf(), Foo, _m).call(_ref10$getSelf); - (_getSelf4 = (_ref11 = fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf4$call = _getSelf4.call(_ref11), Foo, _m).call(_getSelf4$call); - (_ref12 = fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf()) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref12$self = _ref12.self, Foo, _m).call(_ref12$self); - (_call2 = (fn == null ? void 0 : (_babelHelpers$classSt10 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt10)) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call2$self = _call2.self, Foo, _m).call(_call2$self); - (_getSelf5 = (fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf()) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf5$self = _getSelf5.self, Foo, _m).call(_getSelf5$self); - (_getSelf6 = (fn == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6$self = _getSelf6.self, Foo, _m).call(_getSelf6$self); + o == null ? void 0 : babelHelpers.assertClassBrand(_o$Foo = o.Foo, Foo, _m)._.call(_o$Foo); + o == null ? void 0 : babelHelpers.assertClassBrand(_o$Foo2 = o.Foo, Foo, _m)._.call(_o$Foo2).toString; + o == null ? void 0 : babelHelpers.assertClassBrand(_o$Foo3 = o.Foo, Foo, _m)._.call(_o$Foo3).toString(); + (_deep$very$o = deep?.very.o) == null ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo = _deep$very$o.Foo, Foo, _m)._.call(_deep$very$o$Foo); + (_deep$very$o2 = deep?.very.o) == null ? void 0 : babelHelpers.assertClassBrand(_deep$very$o2$Foo = _deep$very$o2.Foo, Foo, _m)._.call(_deep$very$o2$Foo).toString; + (_deep$very$o3 = deep?.very.o) == null ? void 0 : babelHelpers.assertClassBrand(_deep$very$o3$Foo = _deep$very$o3.Foo, Foo, _m)._.call(_deep$very$o3$Foo).toString(); + o == null ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._, Foo, _m)._.call(_babelHelpers$assertC); + o == null ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC2 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self, Foo, _m)._.call(_babelHelpers$assertC2); + (_ref = o == null ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) == null ? void 0 : babelHelpers.assertClassBrand(_ref$self = _ref.self, Foo, _m)._.call(_ref$self); + (_ref2 = o == null ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self) == null ? void 0 : babelHelpers.assertClassBrand(_ref2$self = _ref2.self, Foo, _m)._.call(_ref2$self); + (_self2 = (o == null ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.self) == null ? void 0 : babelHelpers.assertClassBrand(_self2$self = _self2.self, Foo, _m)._.call(_self2$self); + o == null ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC3 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf(), Foo, _m)._.call(_babelHelpers$assertC3); + (_ref3 = o == null ? void 0 : (_babelHelpers$assertC4 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) == null ? void 0 : babelHelpers.assertClassBrand(_ref3$call = _ref3.call(_babelHelpers$assertC4), Foo, _m)._.call(_ref3$call); + (_ref4 = o == null ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) == null ? void 0 : babelHelpers.assertClassBrand(_ref4$getSelf = _ref4.getSelf(), Foo, _m)._.call(_ref4$getSelf); + (_getSelf = (_ref5 = o == null ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf) == null ? void 0 : babelHelpers.assertClassBrand(_getSelf$call = _getSelf.call(_ref5), Foo, _m)._.call(_getSelf$call); + (_ref6 = o == null ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf()) == null ? void 0 : babelHelpers.assertClassBrand(_ref6$self = _ref6.self, Foo, _m)._.call(_ref6$self); + (_call = (o == null ? void 0 : (_babelHelpers$assertC5 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC5)) == null ? void 0 : babelHelpers.assertClassBrand(_call$self = _call.self, Foo, _m)._.call(_call$self); + (_getSelf2 = (o == null ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf()) == null ? void 0 : babelHelpers.assertClassBrand(_getSelf2$self = _getSelf2.self, Foo, _m)._.call(_getSelf2$self); + (_getSelf3 = (o == null ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf?.()) == null ? void 0 : babelHelpers.assertClassBrand(_getSelf3$self = _getSelf3.self, Foo, _m)._.call(_getSelf3$self); + fn == null ? void 0 : babelHelpers.assertClassBrand(_fn$Foo = fn().Foo, Foo, _m)._.call(_fn$Foo); + fn == null ? void 0 : babelHelpers.assertClassBrand(_fn$Foo2 = fn().Foo, Foo, _m)._.call(_fn$Foo2).toString; + fn == null ? void 0 : babelHelpers.assertClassBrand(_fn$Foo3 = fn().Foo, Foo, _m)._.call(_fn$Foo3).toString(); + (_fnDeep$very$o = fnDeep?.().very.o) == null ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo = _fnDeep$very$o.Foo, Foo, _m)._.call(_fnDeep$very$o$Foo); + (_fnDeep$very$o2 = fnDeep?.().very.o) == null ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o2$Foo = _fnDeep$very$o2.Foo, Foo, _m)._.call(_fnDeep$very$o2$Foo).toString; + (_fnDeep$very$o3 = fnDeep?.().very.o) == null ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o3$Foo = _fnDeep$very$o3.Foo, Foo, _m)._.call(_fnDeep$very$o3$Foo).toString(); + fn == null ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC6 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._, Foo, _m)._.call(_babelHelpers$assertC6); + fn == null ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC7 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self, Foo, _m)._.call(_babelHelpers$assertC7); + (_ref7 = fn == null ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) == null ? void 0 : babelHelpers.assertClassBrand(_ref7$self = _ref7.self, Foo, _m)._.call(_ref7$self); + (_ref8 = fn == null ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self) == null ? void 0 : babelHelpers.assertClassBrand(_ref8$self = _ref8.self, Foo, _m)._.call(_ref8$self); + (_self3 = (fn == null ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.self) == null ? void 0 : babelHelpers.assertClassBrand(_self3$self = _self3.self, Foo, _m)._.call(_self3$self); + fn == null ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC8 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf(), Foo, _m)._.call(_babelHelpers$assertC8); + (_ref9 = fn == null ? void 0 : (_babelHelpers$assertC9 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) == null ? void 0 : babelHelpers.assertClassBrand(_ref9$call = _ref9.call(_babelHelpers$assertC9), Foo, _m)._.call(_ref9$call); + (_ref10 = fn == null ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) == null ? void 0 : babelHelpers.assertClassBrand(_ref10$getSelf = _ref10.getSelf(), Foo, _m)._.call(_ref10$getSelf); + (_getSelf4 = (_ref11 = fn == null ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf) == null ? void 0 : babelHelpers.assertClassBrand(_getSelf4$call = _getSelf4.call(_ref11), Foo, _m)._.call(_getSelf4$call); + (_ref12 = fn == null ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf()) == null ? void 0 : babelHelpers.assertClassBrand(_ref12$self = _ref12.self, Foo, _m)._.call(_ref12$self); + (_call2 = (fn == null ? void 0 : (_babelHelpers$assertC10 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC10)) == null ? void 0 : babelHelpers.assertClassBrand(_call2$self = _call2.self, Foo, _m)._.call(_call2$self); + (_getSelf5 = (fn == null ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf()) == null ? void 0 : babelHelpers.assertClassBrand(_getSelf5$self = _getSelf5.self, Foo, _m)._.call(_getSelf5$self); + (_getSelf6 = (fn == null ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf?.()) == null ? void 0 : babelHelpers.assertClassBrand(_getSelf6$self = _getSelf6.self, Foo, _m)._.call(_getSelf6$self); } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _m = { - writable: true, - value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); + _: function () { + return babelHelpers.assertClassBrand(this, _Foo, _x)._; } }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-cast-to-boolean/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-cast-to-boolean/output.js index 3986650761fc..bae90736968b 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-cast-to-boolean/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/assumption-noDocumentAll/optional-chain-cast-to-boolean/output.js @@ -1,45 +1,45 @@ class C { static testIf(o) { - if (o != null && babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b.c.d) { + if (o != null && babelHelpers.assertClassBrand(o, C, _a)._.b.c.d) { return true; } return false; } static testConditional(o) { - return (o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d ? true : false; + return (o == null ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d ? true : false; } static testLoop(o) { - while (o != null && babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b.c.d) { - for (; (o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b.c)?.d;) { + while (o != null && babelHelpers.assertClassBrand(o, C, _a)._.b.c.d) { + for (; (o == null ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b.c)?.d;) { let i = 0; do { i++; if (i === 2) { return true; } - } while ((o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d); + } while ((o == null ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d); } } return false; } static testNegate(o) { - return !!(o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d; + return !!(o == null ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d; } static testIfDeep(o) { var _o$obj; - if (((_o$obj = o.obj) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$obj, C, _a).b)?.c.d) { + if (((_o$obj = o.obj) == null ? void 0 : babelHelpers.assertClassBrand(_o$obj, C, _a)._.b)?.c.d) { return true; } return false; } static testConditionalDeep(o) { var _o$obj2; - return ((_o$obj2 = o.obj) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$obj2, C, _a).b)?.c.d ? true : false; + return ((_o$obj2 = o.obj) == null ? void 0 : babelHelpers.assertClassBrand(_o$obj2, C, _a)._.b)?.c.d ? true : false; } static testLoopDeep(o) { - while ((_o$obj3 = o.obj) != null && babelHelpers.classStaticPrivateFieldSpecGet(_o$obj3, C, _a).b.c.d) { + while ((_o$obj3 = o.obj) != null && babelHelpers.assertClassBrand(_o$obj3, C, _a)._.b.c.d) { var _o$obj3; - for (; ((_o$obj4 = o.obj) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$obj4, C, _a).b.c)?.d;) { + for (; ((_o$obj4 = o.obj) == null ? void 0 : babelHelpers.assertClassBrand(_o$obj4, C, _a)._.b.c)?.d;) { var _o$obj4; let i = 0; do { @@ -48,34 +48,33 @@ class C { if (i === 2) { return true; } - } while (((_o$obj5 = o.obj) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$obj5, C, _a).b)?.c.d); + } while (((_o$obj5 = o.obj) == null ? void 0 : babelHelpers.assertClassBrand(_o$obj5, C, _a)._.b)?.c.d); } } return false; } static testNegateDeep(o) { var _o$obj6; - return !!((_o$obj6 = o.obj) == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$obj6, C, _a).b)?.c.d; + return !!((_o$obj6 = o.obj) == null ? void 0 : babelHelpers.assertClassBrand(_o$obj6, C, _a)._.b)?.c.d; } static testLogicalInIf(o) { - if ((o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d && (o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a))?.b.c.d) { + if ((o == null ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d && (o == null ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._)?.b.c.d) { return true; } return false; } static testLogicalInReturn(o) { - return (o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d && (o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a))?.b.c.d; + return (o == null ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d && (o == null ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._)?.b.c.d; } static testNullishCoalescing(o) { - if ((o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.non_existent ?? (o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d) { - return (o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.non_existent ?? (o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d; + if ((o == null ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.non_existent ?? (o == null ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d) { + return (o == null ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.non_existent ?? (o == null ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d; } - return (o == null ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.non_existent ?? o; + return (o == null ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.non_existent ?? o; } } var _a = { - writable: true, - value: { + _: { b: { c: { d: 2 diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/nested-class/super-property-in-accessor-key/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/nested-class/super-property-in-accessor-key/output.js index 78cb8c0fc97b..245f4eb0734b 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/nested-class/super-property-in-accessor-key/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/nested-class/super-property-in-accessor-key/output.js @@ -24,20 +24,17 @@ let Outer = /*#__PURE__*/function (_Hello) { let Inner = /*#__PURE__*/function () { function Inner() { babelHelpers.classCallCheck(this, Inner); - babelHelpers.classPrivateFieldInitSpec(this, _A, { - writable: true, - value: 'hello' - }); + babelHelpers.classPrivateFieldInitSpec(this, _A, 'hello'); } babelHelpers.createClass(Inner, [{ key: _computedKey, get: function () { - return babelHelpers.classPrivateFieldGet(this, _A); + return babelHelpers.classPrivateFieldGet2(this, _A); } }, { key: _computedKey, set: function (v) { - babelHelpers.classPrivateFieldSet(this, _A, v); + babelHelpers.classPrivateFieldSet2(this, _A, v); } }]); return Inner; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/class-shadow-builtins/options.json b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/class-shadow-builtins/options.json index 75d7a294dcae..9b1f6beff4f9 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/class-shadow-builtins/options.json +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/class-shadow-builtins/options.json @@ -1,4 +1,4 @@ { - "plugins": ["transform-class-properties"], + "plugins": [["transform-class-properties", { "loose": true }]], "externalHelpers": false } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/class-shadow-builtins/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/class-shadow-builtins/output.mjs index ed245271f608..be593bedc8b6 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/class-shadow-builtins/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/class-shadow-builtins/output.mjs @@ -1,12 +1,11 @@ -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } -var _message = /*#__PURE__*/new WeakMap(); -class _TypeError2 { +var id = 0; +function _classPrivateFieldLooseKey(name) { return "__private_" + id++ + "_" + name; } +var _message = /*#__PURE__*/_classPrivateFieldLooseKey("message"); +export class TypeError { constructor() { - _classPrivateFieldInitSpec(this, _message, { + Object.defineProperty(this, _message, { writable: true, value: void 0 }); } } -export { _TypeError2 as TypeError }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call/options.json b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call/options.json index 93b4a20894f7..26269050bb27 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call/options.json +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call/options.json @@ -1,4 +1,4 @@ { - "plugins": ["transform-class-properties"], + "plugins": [["transform-class-properties", { "loose": true }]], "minNodeVersion": "14.0.0" } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call/output.js index fc7aacce28eb..7f318e6076ff 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/parenthesized-optional-member-call/output.js @@ -1,38 +1,40 @@ var _Foo; +var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); +var _m = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("m"); class Foo { static getSelf() { return Foo; } test() { - var _o$Foo, _o$Foo2, _o$Foo3, _o$Foo$self$getSelf, _o$Foo$self$getSelf2, _fn$Foo$self$getSelf, _fn$Foo$self$getSelf2; + var _o$Foo$self$getSelf, _o$Foo$self$getSelf2, _fn$Foo$self$getSelf, _fn$Foo$self$getSelf2; const o = { Foo: Foo }; const fn = function () { return o; }; - (Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).bind(Foo))(); - (Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).bind(Foo))().toString; - (Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).bind(Foo))().toString(); - (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo = o.Foo, Foo, _m).bind(_o$Foo))(); - (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo2 = o.Foo, Foo, _m).bind(_o$Foo2))().toString; - (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo3 = o.Foo, Foo, _m).bind(_o$Foo3))().toString(); - ((_o$Foo$self$getSelf = (o.Foo?.self.getSelf)()) === null || _o$Foo$self$getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo$self$getSelf, Foo, _m).bind(_o$Foo$self$getSelf))(); - ((_o$Foo$self$getSelf2 = (o.Foo.self?.getSelf)()) === null || _o$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo$self$getSelf2, Foo, _m).bind(_o$Foo$self$getSelf2))(); - ((_fn$Foo$self$getSelf = (fn()?.Foo?.self.getSelf)()) === null || _fn$Foo$self$getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo$self$getSelf, Foo, _m).bind(_fn$Foo$self$getSelf))(); - ((_fn$Foo$self$getSelf2 = (fn?.().Foo.self?.getSelf)()) === null || _fn$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo$self$getSelf2, Foo, _m).bind(_fn$Foo$self$getSelf2))(); + (Foo === null || Foo === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(Foo, _m)[_m].bind(Foo))(); + (Foo === null || Foo === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(Foo, _m)[_m].bind(Foo))().toString; + (Foo === null || Foo === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(Foo, _m)[_m].bind(Foo))().toString(); + (o === null || o === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(o.Foo, _m)[_m].bind(o.Foo))(); + (o === null || o === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(o.Foo, _m)[_m].bind(o.Foo))().toString; + (o === null || o === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(o.Foo, _m)[_m].bind(o.Foo))().toString(); + ((_o$Foo$self$getSelf = (o.Foo?.self.getSelf)()) === null || _o$Foo$self$getSelf === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_o$Foo$self$getSelf, _m)[_m].bind(_o$Foo$self$getSelf))(); + ((_o$Foo$self$getSelf2 = (o.Foo.self?.getSelf)()) === null || _o$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_o$Foo$self$getSelf2, _m)[_m].bind(_o$Foo$self$getSelf2))(); + ((_fn$Foo$self$getSelf = (fn()?.Foo?.self.getSelf)()) === null || _fn$Foo$self$getSelf === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_fn$Foo$self$getSelf, _m)[_m].bind(_fn$Foo$self$getSelf))(); + ((_fn$Foo$self$getSelf2 = (fn?.().Foo.self?.getSelf)()) === null || _fn$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.classPrivateFieldLooseBase(_fn$Foo$self$getSelf2, _m)[_m].bind(_fn$Foo$self$getSelf2))(); } } _Foo = Foo; -var _x = { +Object.defineProperty(Foo, _x, { writable: true, value: 1 -}; -babelHelpers.defineProperty(Foo, "self", _Foo); -var _m = { +}); +Foo.self = _Foo; +Object.defineProperty(Foo, _m, { writable: true, value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); + return babelHelpers.classPrivateFieldLooseBase(this, _x)[_x]; } -}; +}); new Foo().test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-shadow/options.json b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-shadow/options.json index d8696c74fd9c..c2b376eb1b54 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-shadow/options.json +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-shadow/options.json @@ -1,3 +1,3 @@ { - "plugins": ["transform-class-properties"] + "plugins": [["transform-class-properties", { "loose": true }]] } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-shadow/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-shadow/output.js index 9082231ba230..2493c739702e 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-shadow/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private-loose/static-shadow/output.js @@ -1,14 +1,15 @@ +var _x = /*#__PURE__*/babelHelpers.classPrivateFieldLooseKey("x"); class Test { static method() { - const _Test2 = 2; + const Test = 2; const func = () => { - const _Test = 3; - return babelHelpers.classStaticPrivateFieldSpecGet(this, Test, _x) + _Test; + const Test = 3; + return babelHelpers.classPrivateFieldLooseBase(this, _x)[_x] + Test; }; - return func() + _Test2; + return func() + Test; } } -var _x = { +Object.defineProperty(Test, _x, { writable: true, value: 1 -}; +}); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/1-helpermemberexpressionfunction/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/1-helpermemberexpressionfunction/output.js index 4b826532c38b..7529583f166a 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/1-helpermemberexpressionfunction/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/1-helpermemberexpressionfunction/output.js @@ -1,75 +1,63 @@ var _arr = /*#__PURE__*/new WeakMap(); -var D = /*#__PURE__*/function () { +let D = /*#__PURE__*/function () { "use strict"; function D() { babelHelpers.classCallCheck(this, D); - babelHelpers.classPrivateFieldInitSpec(this, _arr, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _arr, void 0); } babelHelpers.createClass(D, [{ key: "f", value: function f() { - for (var el of babelHelpers.classPrivateFieldGet(this, _arr)); + for (const el of babelHelpers.classPrivateFieldGet2(this, _arr)); } }]); return D; }(); var _p = /*#__PURE__*/new WeakMap(); -var C = /*#__PURE__*/function () { +let C = /*#__PURE__*/function () { "use strict"; function C() { babelHelpers.classCallCheck(this, C); - babelHelpers.classPrivateFieldInitSpec(this, _p, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _p, void 0); } babelHelpers.createClass(C, [{ key: "m", value: function m() { - for (babelHelpers.classPrivateFieldDestructureSet(this, _p).value of []); + for (babelHelpers.toSetter(babelHelpers.classPrivateFieldSet2, null, this, _p)._ of []); } }]); return C; }(); var _arr2 = /*#__PURE__*/new WeakMap(); -var E = /*#__PURE__*/function () { +let E = /*#__PURE__*/function () { "use strict"; function E() { babelHelpers.classCallCheck(this, E); - babelHelpers.classPrivateFieldInitSpec(this, _arr2, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _arr2, void 0); } babelHelpers.createClass(E, [{ key: "f", value: function f() { - for (babelHelpers.classPrivateFieldDestructureSet(this, _arr2).value of [1, 2]); + for (babelHelpers.toSetter(babelHelpers.classPrivateFieldSet2, null, this, _arr2)._ of [1, 2]); } }]); return E; }(); var _ar = /*#__PURE__*/new WeakMap(); -var F = /*#__PURE__*/function () { +let F = /*#__PURE__*/function () { "use strict"; function F() { babelHelpers.classCallCheck(this, F); - babelHelpers.classPrivateFieldInitSpec(this, _ar, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _ar, void 0); } babelHelpers.createClass(F, [{ key: "g", value: function g() { - for (babelHelpers.classPrivateFieldDestructureSet(this, _ar).value in [1, 2, 3]); + for (babelHelpers.toSetter(babelHelpers.classPrivateFieldSet2, null, this, _ar)._ in [1, 2, 3]); } }]); return F; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/access-before-declaration/exec.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/access-before-declaration/exec.js index e5c4a2f5a119..09533605d107 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/access-before-declaration/exec.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/access-before-declaration/exec.js @@ -6,7 +6,7 @@ expect(() => { C.#p; } } -}).toThrow(/attempted to get private static field before its declaration/); +}).toThrow(TypeError); expect(() => { class C { @@ -16,7 +16,7 @@ expect(() => { C.#p = 0; } } -}).toThrow(/attempted to set private static field before its declaration/); +}).toThrow(TypeError); expect(() => { class C { @@ -26,4 +26,4 @@ expect(() => { for (C.#p of [0]); } } -}).toThrow(/attempted to set private static field before its declaration/); +}).toThrow(TypeError); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/assignment/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/assignment/output.js index 317d12e61a1f..2a4682508fae 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/assignment/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/assignment/output.js @@ -1,22 +1,19 @@ var _foo = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function () { +let Foo = /*#__PURE__*/function () { "use strict"; function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, 0); } babelHelpers.createClass(Foo, [{ key: "test", value: function test(other) { var _other$obj; - babelHelpers.classPrivateFieldSet(this, _foo, babelHelpers.classPrivateFieldGet(this, _foo) + 1); - babelHelpers.classPrivateFieldSet(this, _foo, 2); - babelHelpers.classPrivateFieldSet(_other$obj = other.obj, _foo, babelHelpers.classPrivateFieldGet(_other$obj, _foo) + 1); - babelHelpers.classPrivateFieldSet(other.obj, _foo, 2); + babelHelpers.classPrivateFieldSet2(this, _foo, babelHelpers.classPrivateFieldGet2(this, _foo) + 1); + babelHelpers.classPrivateFieldSet2(this, _foo, 2); + babelHelpers.classPrivateFieldSet2(_other$obj = other.obj, _foo, babelHelpers.classPrivateFieldGet2(_other$obj, _foo) + 1); + babelHelpers.classPrivateFieldSet2(other.obj, _foo, 2); } }]); return Foo; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/call/output.js index a954b417275d..3fd280989cd0 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/call/output.js @@ -1,22 +1,19 @@ var _foo = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function () { +let Foo = /*#__PURE__*/function () { "use strict"; function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: function () { - return this; - } + babelHelpers.classPrivateFieldInitSpec(this, _foo, function () { + return this; }); } babelHelpers.createClass(Foo, [{ key: "test", value: function test(other) { var _other$obj; - babelHelpers.classPrivateFieldGet(this, _foo).call(this); - babelHelpers.classPrivateFieldGet(_other$obj = other.obj, _foo).call(_other$obj); + babelHelpers.classPrivateFieldGet2(this, _foo).call(this); + babelHelpers.classPrivateFieldGet2(_other$obj = other.obj, _foo).call(_other$obj); } }]); return Foo; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/canonical/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/canonical/output.js index c14a520727b1..4966034c3177 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/canonical/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/canonical/output.js @@ -1,46 +1,40 @@ var _x = /*#__PURE__*/new WeakMap(); var _y = /*#__PURE__*/new WeakMap(); -var Point = /*#__PURE__*/function () { +let Point = /*#__PURE__*/function () { "use strict"; function Point(x = 0, y = 0) { babelHelpers.classCallCheck(this, Point); - babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _y, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldSet(this, _x, +x); - babelHelpers.classPrivateFieldSet(this, _y, +y); + babelHelpers.classPrivateFieldInitSpec(this, _x, void 0); + babelHelpers.classPrivateFieldInitSpec(this, _y, void 0); + babelHelpers.classPrivateFieldSet2(this, _x, +x); + babelHelpers.classPrivateFieldSet2(this, _y, +y); } babelHelpers.createClass(Point, [{ key: "x", get: function () { - return babelHelpers.classPrivateFieldGet(this, _x); + return babelHelpers.classPrivateFieldGet2(this, _x); }, set: function (value) { - babelHelpers.classPrivateFieldSet(this, _x, +value); + babelHelpers.classPrivateFieldSet2(this, _x, +value); } }, { key: "y", get: function () { - return babelHelpers.classPrivateFieldGet(this, _y); + return babelHelpers.classPrivateFieldGet2(this, _y); }, set: function (value) { - babelHelpers.classPrivateFieldSet(this, _y, +value); + babelHelpers.classPrivateFieldSet2(this, _y, +value); } }, { key: "equals", value: function equals(p) { - return babelHelpers.classPrivateFieldGet(this, _x) === babelHelpers.classPrivateFieldGet(p, _x) && babelHelpers.classPrivateFieldGet(this, _y) === babelHelpers.classPrivateFieldGet(p, _y); + return babelHelpers.classPrivateFieldGet2(this, _x) === babelHelpers.classPrivateFieldGet2(p, _x) && babelHelpers.classPrivateFieldGet2(this, _y) === babelHelpers.classPrivateFieldGet2(p, _y); } }, { key: "toString", value: function toString() { - return `Point<${babelHelpers.classPrivateFieldGet(this, _x)},${babelHelpers.classPrivateFieldGet(this, _y)}>`; + return `Point<${babelHelpers.classPrivateFieldGet2(this, _x)},${babelHelpers.classPrivateFieldGet2(this, _y)}>`; } }]); return Point; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/class-shadow-builtins/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/private/class-shadow-builtins/output.mjs index ed245271f608..25a96911ff9c 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/class-shadow-builtins/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/class-shadow-builtins/output.mjs @@ -3,10 +3,7 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect var _message = /*#__PURE__*/new WeakMap(); class _TypeError2 { constructor() { - _classPrivateFieldInitSpec(this, _message, { - writable: true, - value: void 0 - }); + _classPrivateFieldInitSpec(this, _message, void 0); } } export { _TypeError2 as TypeError }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/constructor-collision/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/constructor-collision/output.js index b30b44f47dde..130f86cddd23 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/constructor-collision/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/constructor-collision/output.js @@ -1,12 +1,9 @@ var foo = "bar"; var _bar = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _bar, { - writable: true, - value: foo - }); + babelHelpers.classPrivateFieldInitSpec(this, _bar, foo); var _foo = "foo"; }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/declaration-order/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/declaration-order/output.js index c47be3973a9d..c427bf68e5dc 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/declaration-order/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/declaration-order/output.js @@ -1,13 +1,10 @@ var _x = /*#__PURE__*/new WeakMap(); -var C = /*#__PURE__*/babelHelpers.createClass(function C() { +let C = /*#__PURE__*/babelHelpers.createClass(function C() { "use strict"; babelHelpers.classCallCheck(this, C); - babelHelpers.defineProperty(this, "y", babelHelpers.classPrivateFieldGet(this, _x)); - babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }); + babelHelpers.defineProperty(this, "y", babelHelpers.classPrivateFieldGet2(this, _x)); + babelHelpers.classPrivateFieldInitSpec(this, _x, void 0); }); expect(() => { new C(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/derived-multiple-supers/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/derived-multiple-supers/output.js index e04525edba73..d94ad6b5bc6d 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/derived-multiple-supers/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/derived-multiple-supers/output.js @@ -1,5 +1,5 @@ var _bar = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function (_Bar) { +let Foo = /*#__PURE__*/function (_Bar) { "use strict"; babelHelpers.inherits(Foo, _Bar); @@ -8,16 +8,10 @@ var Foo = /*#__PURE__*/function (_Bar) { babelHelpers.classCallCheck(this, Foo); if (condition) { _this = babelHelpers.callSuper(this, Foo); - babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _bar, { - writable: true, - value: "foo" - }); + babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _bar, "foo"); } else { _this = babelHelpers.callSuper(this, Foo); - babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _bar, { - writable: true, - value: "foo" - }); + babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _bar, "foo"); } return babelHelpers.possibleConstructorReturn(_this); } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/derived/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/derived/output.js index 9fbc6a4d6046..ab17f41dd5a8 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/derived/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/derived/output.js @@ -1,15 +1,12 @@ var _prop = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _prop, { - writable: true, - value: "foo" - }); + babelHelpers.classPrivateFieldInitSpec(this, _prop, "foo"); }); var _prop2 = /*#__PURE__*/new WeakMap(); -var Bar = /*#__PURE__*/function (_Foo2) { +let Bar = /*#__PURE__*/function (_Foo2) { "use strict"; babelHelpers.inherits(Bar, _Foo2); @@ -17,10 +14,7 @@ var Bar = /*#__PURE__*/function (_Foo2) { var _this; babelHelpers.classCallCheck(this, Bar); _this = babelHelpers.callSuper(this, Bar, [...args]); - babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _prop2, { - writable: true, - value: "bar" - }); + babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _prop2, "bar"); return _this; } return babelHelpers.createClass(Bar); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-1/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-1/output.js index 729ae087dcaa..a0b4eb5c81e0 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-1/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-1/output.js @@ -1,12 +1,9 @@ var _client = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _client, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldSet(this, _client, 1); - [this.x = babelHelpers.classPrivateFieldGet(this, _client), babelHelpers.classPrivateFieldDestructureSet(this, _client).value, this.y = babelHelpers.classPrivateFieldGet(this, _client)] = props; + babelHelpers.classPrivateFieldInitSpec(this, _client, void 0); + babelHelpers.classPrivateFieldSet2(this, _client, 1); + [this.x = babelHelpers.classPrivateFieldGet2(this, _client), babelHelpers.toSetter(babelHelpers.classPrivateFieldSet2, null, this, _client)._, this.y = babelHelpers.classPrivateFieldGet2(this, _client)] = props; }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-2/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-2/output.js index f6beeb55eb8f..8ffc615dd1f5 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-2/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-2/output.js @@ -1,11 +1,8 @@ var _client = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _client, { - writable: true, - value: void 0 - }); - [x, ...babelHelpers.classPrivateFieldDestructureSet(this, _client).value] = props; + babelHelpers.classPrivateFieldInitSpec(this, _client, void 0); + [x, ...babelHelpers.toSetter(babelHelpers.classPrivateFieldSet2, null, this, _client)._] = props; }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-3/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-3/output.js index d08ef7333a7c..ea1dd9f7c09d 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-3/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-3/output.js @@ -1,11 +1,8 @@ var _client = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _client, { - writable: true, - value: void 0 - }); - [babelHelpers.classPrivateFieldDestructureSet(this, _client).value = 5] = props; + babelHelpers.classPrivateFieldInitSpec(this, _client, void 0); + [babelHelpers.toSetter(babelHelpers.classPrivateFieldSet2, null, this, _client)._ = 5] = props; }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-static/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-static/output.js index d1d88a20d198..b10021819575 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-static/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern-static/output.js @@ -1,10 +1,9 @@ -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { "use strict"; babelHelpers.classCallCheck(this, Foo); - [babelHelpers.classStaticPrivateFieldDestructureSet(Foo, Foo, _client).value] = props; + [_client._] = props; }); var _client = { - writable: true, - value: void 0 + _: void 0 }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern/output.js index fa04493ca9b5..3804140a6ae9 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-array-pattern/output.js @@ -1,11 +1,8 @@ var _client = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _client, { - writable: true, - value: void 0 - }); - [babelHelpers.classPrivateFieldDestructureSet(this, _client).value] = props; + babelHelpers.classPrivateFieldInitSpec(this, _client, void 0); + [babelHelpers.toSetter(babelHelpers.classPrivateFieldSet2, null, this, _client)._] = props; }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-1/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-1/output.js index 8c0748c3bbdb..db000b79feee 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-1/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-1/output.js @@ -1,16 +1,13 @@ var _client = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _client, { - writable: true, - value: void 0 - }); - babelHelpers.classPrivateFieldSet(this, _client, 'foo'); + babelHelpers.classPrivateFieldInitSpec(this, _client, void 0); + babelHelpers.classPrivateFieldSet2(this, _client, 'foo'); ({ - x: this.x = babelHelpers.classPrivateFieldGet(this, _client), - y: babelHelpers.classPrivateFieldDestructureSet(this, _client).value, - z: this.z = babelHelpers.classPrivateFieldGet(this, _client) + x: this.x = babelHelpers.classPrivateFieldGet2(this, _client), + y: babelHelpers.toSetter(babelHelpers.classPrivateFieldSet2, null, this, _client)._, + z: this.z = babelHelpers.classPrivateFieldGet2(this, _client) } = props); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-2/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-2/output.js index 3e26f30e9009..136171a5ee59 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-2/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-2/output.js @@ -1,14 +1,11 @@ var _client = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _client, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _client, void 0); ({ x, - ...babelHelpers.classPrivateFieldDestructureSet(this, _client).value + ...babelHelpers.toSetter(babelHelpers.classPrivateFieldSet2, null, this, _client)._ } = props); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-3/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-3/output.js index b7eb542f5b94..c7ae80d1b041 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-3/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-3/output.js @@ -1,13 +1,10 @@ var _client = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _client, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _client, void 0); ({ - x: babelHelpers.classPrivateFieldDestructureSet(this, _client).value = 5 + x: babelHelpers.toSetter(babelHelpers.classPrivateFieldSet2, null, this, _client)._ = 5 } = props); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-static/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-static/output.js index 5de4e192c991..6ce512b8bb31 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-static/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern-static/output.js @@ -1,12 +1,11 @@ -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { "use strict"; babelHelpers.classCallCheck(this, Foo); ({ - client: babelHelpers.classStaticPrivateFieldDestructureSet(Foo, Foo, _client).value + client: _client._ } = props); }); var _client = { - writable: true, - value: void 0 + _: void 0 }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern/output.js index 66c561d6e3a2..20e811570bc4 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/destructuring-object-pattern/output.js @@ -1,13 +1,10 @@ var _client = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(props) { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _client, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _client, void 0); ({ - client: babelHelpers.classPrivateFieldDestructureSet(this, _client).value + client: babelHelpers.toSetter(babelHelpers.classPrivateFieldSet2, null, this, _client)._ } = props); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/extracted-this/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/extracted-this/output.js index b0293e1bdcad..e60404cd1520 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/extracted-this/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/extracted-this/output.js @@ -1,16 +1,10 @@ var foo = "bar"; var _bar = /*#__PURE__*/new WeakMap(); var _baz = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(_foo) { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo(_foo) { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _bar, { - writable: true, - value: this - }); - babelHelpers.classPrivateFieldInitSpec(this, _baz, { - writable: true, - value: foo - }); + babelHelpers.classPrivateFieldInitSpec(this, _bar, this); + babelHelpers.classPrivateFieldInitSpec(this, _baz, foo); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/foobar/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/foobar/output.js index ac62ad7e7ad3..e6d141a8d881 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/foobar/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/foobar/output.js @@ -1,5 +1,5 @@ var _scopedFunctionWithThis = /*#__PURE__*/new WeakMap(); -var Child = /*#__PURE__*/function (_Parent) { +let Child = /*#__PURE__*/function (_Parent) { "use strict"; babelHelpers.inherits(Child, _Parent); @@ -7,11 +7,8 @@ var Child = /*#__PURE__*/function (_Parent) { var _this; babelHelpers.classCallCheck(this, Child); _this = babelHelpers.callSuper(this, Child); - babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _scopedFunctionWithThis, { - writable: true, - value: () => { - _this.name = {}; - } + babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _scopedFunctionWithThis, () => { + _this.name = {}; }); return _this; } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/instance-undefined/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/instance-undefined/output.js index ee71f9c1423e..85ecee2999fb 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/instance-undefined/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/instance-undefined/output.js @@ -1,10 +1,7 @@ var _bar = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _bar, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _bar, void 0); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/instance/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/instance/output.js index 5cba8688eaf7..3ea61b3da7cd 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/instance/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/instance/output.js @@ -3,8 +3,5 @@ var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _bar, { - writable: true, - value: "foo" - }); + babelHelpers.classPrivateFieldInitSpec(this, _bar, "foo"); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/logical-assignment/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/logical-assignment/output.js index baaf46f88a91..6f6d9513e683 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/logical-assignment/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/logical-assignment/output.js @@ -3,27 +3,18 @@ var _and = /*#__PURE__*/new WeakMap(); var _or = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _nullish, { - writable: true, - value: 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _and, { - writable: true, - value: 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _or, { - writable: true, - value: 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _nullish, 0); + babelHelpers.classPrivateFieldInitSpec(this, _and, 0); + babelHelpers.classPrivateFieldInitSpec(this, _or, 0); } self() { return this; } test() { var _this$self; - babelHelpers.classPrivateFieldGet(this, _nullish) ?? babelHelpers.classPrivateFieldSet(this, _nullish, 42); - babelHelpers.classPrivateFieldGet(this, _and) && babelHelpers.classPrivateFieldSet(this, _and, 0); - babelHelpers.classPrivateFieldGet(this, _or) || babelHelpers.classPrivateFieldSet(this, _or, 0); - babelHelpers.classPrivateFieldGet(_this$self = this.self(), _nullish) ?? babelHelpers.classPrivateFieldSet(_this$self, _nullish, 42); + babelHelpers.classPrivateFieldGet2(this, _nullish) ?? babelHelpers.classPrivateFieldSet2(this, _nullish, 42); + babelHelpers.classPrivateFieldGet2(this, _and) && babelHelpers.classPrivateFieldSet2(this, _and, 0); + babelHelpers.classPrivateFieldGet2(this, _or) || babelHelpers.classPrivateFieldSet2(this, _or, 0); + babelHelpers.classPrivateFieldGet2(_this$self = this.self(), _nullish) ?? babelHelpers.classPrivateFieldSet2(_this$self, _nullish, 42); } } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/multiple/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/multiple/output.js index cd85974e3155..d1acd5709e11 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/multiple/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/multiple/output.js @@ -1,15 +1,9 @@ var _x = /*#__PURE__*/new WeakMap(); var _y = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _y, { - writable: true, - value: babelHelpers.classPrivateFieldGet(this, _x) - }); + babelHelpers.classPrivateFieldInitSpec(this, _x, 0); + babelHelpers.classPrivateFieldInitSpec(this, _y, babelHelpers.classPrivateFieldGet2(this, _x)); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/native-classes/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/native-classes/output.js index 77d74ae2dc25..eaaa33d741f9 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/native-classes/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/native-classes/output.js @@ -1,19 +1,15 @@ var _bar = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _bar, { - writable: true, - value: "bar" - }); + babelHelpers.classPrivateFieldInitSpec(this, _bar, "bar"); } static test() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _foo); + return _foo._; } test() { - return babelHelpers.classPrivateFieldGet(this, _bar); + return babelHelpers.classPrivateFieldGet2(this, _bar); } } var _foo = { - writable: true, - value: "foo" + _: "foo" }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-computed-redeclared/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-computed-redeclared/output.js index bba45a1a0003..c52cc20d16bf 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-computed-redeclared/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-computed-redeclared/output.js @@ -1,27 +1,21 @@ var _foo = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function () { +let Foo = /*#__PURE__*/function () { "use strict"; function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: 1 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, 1); } babelHelpers.createClass(Foo, [{ key: "test", value: function test() { - var _babelHelpers$classPr; + let _babelHelpers$classPr; var _foo2 = /*#__PURE__*/new WeakMap(); - _babelHelpers$classPr = babelHelpers.classPrivateFieldGet(this, _foo2); - var Nested = /*#__PURE__*/function () { + _babelHelpers$classPr = babelHelpers.classPrivateFieldGet2(this, _foo2); + let Nested = /*#__PURE__*/function () { function Nested() { babelHelpers.classCallCheck(this, Nested); - babelHelpers.classPrivateFieldInitSpec(this, _foo2, { - writable: true, - value: 2 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo2, 2); } babelHelpers.createClass(Nested, [{ key: _babelHelpers$classPr, @@ -29,7 +23,7 @@ var Foo = /*#__PURE__*/function () { }]); return Nested; }(); - babelHelpers.classPrivateFieldGet(this, _foo); + babelHelpers.classPrivateFieldGet2(this, _foo); } }]); return Foo; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-computed/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-computed/output.js index 20d65d1eb1b6..868ce45ed601 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-computed/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-computed/output.js @@ -1,18 +1,15 @@ var _foo = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function () { +let Foo = /*#__PURE__*/function () { "use strict"; function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: 1 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, 1); } babelHelpers.createClass(Foo, [{ key: "test", value: function test() { - var Nested = /*#__PURE__*/function (_babelHelpers$classPr) { + let Nested = /*#__PURE__*/function (_babelHelpers$classPr) { function Nested() { babelHelpers.classCallCheck(this, Nested); } @@ -21,8 +18,8 @@ var Foo = /*#__PURE__*/function () { value: function () {} }]); return Nested; - }(babelHelpers.classPrivateFieldGet(this, _foo)); - babelHelpers.classPrivateFieldGet(this, _foo); + }(babelHelpers.classPrivateFieldGet2(this, _foo)); + babelHelpers.classPrivateFieldGet2(this, _foo); } }]); return Foo; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed-redeclared/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed-redeclared/output.js index a948b080dcda..7b40a5e48c70 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed-redeclared/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed-redeclared/output.js @@ -1,40 +1,31 @@ var _foo = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function () { +let Foo = /*#__PURE__*/function () { "use strict"; function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: 1 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, 1); } babelHelpers.createClass(Foo, [{ key: "test", value: function test() { var _foo3; - var _babelHelpers$classPr; + let _babelHelpers$classPr; var _foo2 = /*#__PURE__*/new WeakMap(); - var Nested = /*#__PURE__*/function (_ref) { + let Nested = /*#__PURE__*/function (_ref) { babelHelpers.inherits(Nested, _ref); function Nested(...args) { var _this; babelHelpers.classCallCheck(this, Nested); _this = babelHelpers.callSuper(this, Nested, [...args]); - babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _foo2, { - writable: true, - value: 3 - }); + babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _foo2, 3); return _this; } return babelHelpers.createClass(Nested); - }((_foo3 = /*#__PURE__*/new WeakMap(), _babelHelpers$classPr = babelHelpers.classPrivateFieldGet(this, _foo3), /*#__PURE__*/function () { + }((_foo3 = /*#__PURE__*/new WeakMap(), _babelHelpers$classPr = babelHelpers.classPrivateFieldGet2(this, _foo3), /*#__PURE__*/function () { function _class() { babelHelpers.classCallCheck(this, _class); - babelHelpers.classPrivateFieldInitSpec(this, _foo3, { - writable: true, - value: 2 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo3, 2); babelHelpers.defineProperty(this, _babelHelpers$classPr, 2); } return babelHelpers.createClass(_class); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed/output.js index 08c26eb63308..0291433a9d79 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-extends-computed/output.js @@ -1,33 +1,27 @@ var _foo = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function () { +let Foo = /*#__PURE__*/function () { "use strict"; function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: 1 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, 1); } babelHelpers.createClass(Foo, [{ key: "test", value: function test() { - var _babelHelpers$classPr; + let _babelHelpers$classPr; var _foo2 = /*#__PURE__*/new WeakMap(); - var Nested = /*#__PURE__*/function (_ref) { + let Nested = /*#__PURE__*/function (_ref) { babelHelpers.inherits(Nested, _ref); function Nested(...args) { var _this; babelHelpers.classCallCheck(this, Nested); _this = babelHelpers.callSuper(this, Nested, [...args]); - babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _foo2, { - writable: true, - value: 3 - }); + babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _foo2, 3); return _this; } return babelHelpers.createClass(Nested); - }((_babelHelpers$classPr = babelHelpers.classPrivateFieldGet(this, _foo), /*#__PURE__*/function () { + }((_babelHelpers$classPr = babelHelpers.classPrivateFieldGet2(this, _foo), /*#__PURE__*/function () { function _class() { babelHelpers.classCallCheck(this, _class); babelHelpers.defineProperty(this, _babelHelpers$classPr, 2); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-other-redeclared/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-other-redeclared/output.js index b7b3f6ec3883..218f78538164 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-other-redeclared/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-other-redeclared/output.js @@ -1,42 +1,33 @@ var _foo = /*#__PURE__*/new WeakMap(); var _bar = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function () { +let Foo = /*#__PURE__*/function () { "use strict"; function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: 1 - }); - babelHelpers.classPrivateFieldInitSpec(this, _bar, { - writable: true, - value: 1 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, 1); + babelHelpers.classPrivateFieldInitSpec(this, _bar, 1); } babelHelpers.createClass(Foo, [{ key: "test", value: function test() { var _bar2 = /*#__PURE__*/new WeakMap(); - var Nested = /*#__PURE__*/function () { + let Nested = /*#__PURE__*/function () { function Nested() { babelHelpers.classCallCheck(this, Nested); - babelHelpers.classPrivateFieldInitSpec(this, _bar2, { - writable: true, - value: 2 - }); + babelHelpers.classPrivateFieldInitSpec(this, _bar2, 2); } babelHelpers.createClass(Nested, [{ key: "test", value: function test() { - babelHelpers.classPrivateFieldGet(this, _foo); - babelHelpers.classPrivateFieldGet(this, _bar2); + babelHelpers.classPrivateFieldGet2(this, _foo); + babelHelpers.classPrivateFieldGet2(this, _bar2); } }]); return Nested; }(); - babelHelpers.classPrivateFieldGet(this, _foo); - babelHelpers.classPrivateFieldGet(this, _bar); + babelHelpers.classPrivateFieldGet2(this, _foo); + babelHelpers.classPrivateFieldGet2(this, _bar); } }]); return Foo; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-redeclared/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-redeclared/output.js index 6c29f46e2184..c0ecd9a21ecf 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-redeclared/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class-redeclared/output.js @@ -1,35 +1,29 @@ var _foo = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function () { +let Foo = /*#__PURE__*/function () { "use strict"; function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: 1 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, 1); } babelHelpers.createClass(Foo, [{ key: "test", value: function test() { var _foo2 = /*#__PURE__*/new WeakMap(); - var Nested = /*#__PURE__*/function () { + let Nested = /*#__PURE__*/function () { function Nested() { babelHelpers.classCallCheck(this, Nested); - babelHelpers.classPrivateFieldInitSpec(this, _foo2, { - writable: true, - value: 2 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo2, 2); } babelHelpers.createClass(Nested, [{ key: "test", value: function test() { - babelHelpers.classPrivateFieldGet(this, _foo2); + babelHelpers.classPrivateFieldGet2(this, _foo2); } }]); return Nested; }(); - babelHelpers.classPrivateFieldGet(this, _foo); + babelHelpers.classPrivateFieldGet2(this, _foo); } }]); return Foo; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class/output.js index 4c23196e7357..2950b7d8cbf4 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/nested-class/output.js @@ -1,30 +1,27 @@ var _foo = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function () { +let Foo = /*#__PURE__*/function () { "use strict"; function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: 1 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, 1); } babelHelpers.createClass(Foo, [{ key: "test", value: function test() { - var Nested = /*#__PURE__*/function () { + let Nested = /*#__PURE__*/function () { function Nested() { babelHelpers.classCallCheck(this, Nested); } babelHelpers.createClass(Nested, [{ key: "test", value: function test() { - babelHelpers.classPrivateFieldGet(this, _foo); + babelHelpers.classPrivateFieldGet2(this, _foo); } }]); return Nested; }(); - babelHelpers.classPrivateFieldGet(this, _foo); + babelHelpers.classPrivateFieldGet2(this, _foo); } }]); return Foo; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/non-block-arrow-func/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/private/non-block-arrow-func/output.mjs index 45322b3d9212..6880afbafc4b 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/non-block-arrow-func/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/non-block-arrow-func/output.mjs @@ -5,8 +5,7 @@ export default (param => { return param; } }, _props = { - writable: true, - value: { + _: { prop1: 'prop1', prop2: 'prop2' } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call-with-transform/output.js index 8cdb0f349335..e81e792c4c41 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call-with-transform/output.js @@ -4,7 +4,7 @@ class Foo { return this; } static test() { - var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o, _deep$very$o$Foo, _deep$very$o2, _deep$very$o2$Foo, _deep$very$o3, _deep$very$o3$Foo, _babelHelpers$classSt, _babelHelpers$classSt2, _ref, _ref$self, _ref2, _ref2$self, _self2, _self2$self, _babelHelpers$classSt3, _babelHelpers$classSt4, _ref3, _ref3$call, _ref4, _ref4$getSelf, _getSelf, _ref5, _getSelf$call, _ref6, _ref6$self, _babelHelpers$classSt5, _call, _call$self, _getSelf2, _getSelf2$self, _getSelf3, _getSelf3$self, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o, _fnDeep$very$o$Foo, _fnDeep$very$o2, _fnDeep$very$o2$Foo, _fnDeep$very$o3, _fnDeep$very$o3$Foo, _babelHelpers$classSt6, _babelHelpers$classSt7, _ref7, _ref7$self, _ref8, _ref8$self, _self3, _self3$self, _babelHelpers$classSt8, _babelHelpers$classSt9, _ref9, _ref9$call, _ref10, _ref10$getSelf, _getSelf4, _ref11, _getSelf4$call, _ref12, _ref12$self, _babelHelpers$classSt10, _call2, _call2$self, _getSelf5, _getSelf5$self, _getSelf6, _getSelf6$self, _ref13, _ref14, _ref15, _ref16, _ref17, _ref17$getSelf, _ref18, _ref19, _ref20, _ref21, _ref22, _ref22$getSelf; + var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o, _deep$very$o$Foo, _deep$very$o2, _deep$very$o2$Foo, _deep$very$o3, _deep$very$o3$Foo, _babelHelpers$assertC, _babelHelpers$assertC2, _ref, _ref$self, _ref2, _ref2$self, _self2, _self2$self, _babelHelpers$assertC3, _babelHelpers$assertC4, _ref3, _ref3$call, _ref4, _ref4$getSelf, _getSelf, _ref5, _getSelf$call, _ref6, _ref6$self, _babelHelpers$assertC5, _call, _call$self, _getSelf2, _getSelf2$self, _getSelf3, _getSelf3$self, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o, _fnDeep$very$o$Foo, _fnDeep$very$o2, _fnDeep$very$o2$Foo, _fnDeep$very$o3, _fnDeep$very$o3$Foo, _babelHelpers$assertC6, _babelHelpers$assertC7, _ref7, _ref7$self, _ref8, _ref8$self, _self3, _self3$self, _babelHelpers$assertC8, _babelHelpers$assertC9, _ref9, _ref9$call, _ref10, _ref10$getSelf, _getSelf4, _ref11, _getSelf4$call, _ref12, _ref12$self, _babelHelpers$assertC10, _call2, _call2$self, _getSelf5, _getSelf5$self, _getSelf6, _getSelf6$self, _ref13, _ref14, _ref15, _ref16, _ref17, _ref17$getSelf, _ref18, _ref19, _ref20, _ref21, _ref22, _ref22$getSelf; const o = { Foo: Foo }; @@ -19,60 +19,57 @@ class Foo { function fnDeep() { return deep; } - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo = o.Foo, Foo, _m).call(_o$Foo); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo2 = o.Foo, Foo, _m).call(_o$Foo2).toString; - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo3 = o.Foo, Foo, _m).call(_o$Foo3).toString(); - (_deep$very$o = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo = _deep$very$o.Foo, Foo, _m).call(_deep$very$o$Foo); - (_deep$very$o2 = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o2$Foo = _deep$very$o2.Foo, Foo, _m).call(_deep$very$o2$Foo).toString; - (_deep$very$o3 = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o3$Foo = _deep$very$o3.Foo, Foo, _m).call(_deep$very$o3$Foo).toString(); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self), Foo, _m).call(_babelHelpers$classSt); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt2 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self, Foo, _m).call(_babelHelpers$classSt2); - (_ref = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref$self = _ref.self, Foo, _m).call(_ref$self); - (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self) === null || _ref2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref2$self = _ref2.self, Foo, _m).call(_ref2$self); - (_self2 = (_ref13 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref13 === void 0 ? void 0 : _ref13.self) === null || _self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self2$self = _self2.self, Foo, _m).call(_self2$self); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt3 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf(), Foo, _m).call(_babelHelpers$classSt3); - (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt4 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref3$call = _ref3.call(_babelHelpers$classSt4), Foo, _m).call(_ref3$call); - (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref4$getSelf = _ref4.getSelf(), Foo, _m).call(_ref4$getSelf); - (_getSelf = (_ref14 = _ref5 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref14 === void 0 ? void 0 : _ref14.getSelf) === null || _getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$call = _getSelf.call(_ref5), Foo, _m).call(_getSelf$call); - (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref6$self = _ref6.self, Foo, _m).call(_ref6$self); - (_call = (_ref15 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt5 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref15 === void 0 ? void 0 : _ref15.call(_babelHelpers$classSt5)) === null || _call === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call$self = _call.self, Foo, _m).call(_call$self); - (_getSelf2 = (_ref16 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref16 === void 0 ? void 0 : _ref16.getSelf()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf2$self = _getSelf2.self, Foo, _m).call(_getSelf2$self); - (_getSelf3 = (_ref17 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref17 === void 0 || (_ref17$getSelf = _ref17.getSelf) === null || _ref17$getSelf === void 0 ? void 0 : _ref17$getSelf.call(_ref17)) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf3$self = _getSelf3.self, Foo, _m).call(_getSelf3$self); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo = fn().Foo, Foo, _m).call(_fn$Foo); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo2 = fn().Foo, Foo, _m).call(_fn$Foo2).toString; - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo3 = fn().Foo, Foo, _m).call(_fn$Foo3).toString(); - (_fnDeep$very$o = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo = _fnDeep$very$o.Foo, Foo, _m).call(_fnDeep$very$o$Foo); - (_fnDeep$very$o2 = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o2$Foo = _fnDeep$very$o2.Foo, Foo, _m).call(_fnDeep$very$o2$Foo).toString; - (_fnDeep$very$o3 = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o3$Foo = _fnDeep$very$o3.Foo, Foo, _m).call(_fnDeep$very$o3$Foo).toString(); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt6 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self), Foo, _m).call(_babelHelpers$classSt6); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt7 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self, Foo, _m).call(_babelHelpers$classSt7); - (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref7 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref7$self = _ref7.self, Foo, _m).call(_ref7$self); - (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self) === null || _ref8 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref8$self = _ref8.self, Foo, _m).call(_ref8$self); - (_self3 = (_ref18 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref18 === void 0 ? void 0 : _ref18.self) === null || _self3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self3$self = _self3.self, Foo, _m).call(_self3$self); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt8 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf(), Foo, _m).call(_babelHelpers$classSt8); - (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt9 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref9 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref9$call = _ref9.call(_babelHelpers$classSt9), Foo, _m).call(_ref9$call); - (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref10 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref10$getSelf = _ref10.getSelf(), Foo, _m).call(_ref10$getSelf); - (_getSelf4 = (_ref19 = _ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref19 === void 0 ? void 0 : _ref19.getSelf) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf4$call = _getSelf4.call(_ref11), Foo, _m).call(_getSelf4$call); - (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf()) === null || _ref12 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref12$self = _ref12.self, Foo, _m).call(_ref12$self); - (_call2 = (_ref20 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt10 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref20 === void 0 ? void 0 : _ref20.call(_babelHelpers$classSt10)) === null || _call2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call2$self = _call2.self, Foo, _m).call(_call2$self); - (_getSelf5 = (_ref21 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref21 === void 0 ? void 0 : _ref21.getSelf()) === null || _getSelf5 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf5$self = _getSelf5.self, Foo, _m).call(_getSelf5$self); - (_getSelf6 = (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref22 === void 0 || (_ref22$getSelf = _ref22.getSelf) === null || _ref22$getSelf === void 0 ? void 0 : _ref22$getSelf.call(_ref22)) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6$self = _getSelf6.self, Foo, _m).call(_getSelf6$self); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo = o.Foo, Foo, _m)._.call(_o$Foo); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo2 = o.Foo, Foo, _m)._.call(_o$Foo2).toString; + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo3 = o.Foo, Foo, _m)._.call(_o$Foo3).toString(); + (_deep$very$o = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo = _deep$very$o.Foo, Foo, _m)._.call(_deep$very$o$Foo); + (_deep$very$o2 = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o2$Foo = _deep$very$o2.Foo, Foo, _m)._.call(_deep$very$o2$Foo).toString; + (_deep$very$o3 = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o3$Foo = _deep$very$o3.Foo, Foo, _m)._.call(_deep$very$o3$Foo).toString(); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._, Foo, _m)._.call(_babelHelpers$assertC); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC2 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self, Foo, _m)._.call(_babelHelpers$assertC2); + (_ref = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref$self = _ref.self, Foo, _m)._.call(_ref$self); + (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self) === null || _ref2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref2$self = _ref2.self, Foo, _m)._.call(_ref2$self); + (_self2 = (_ref13 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref13 === void 0 ? void 0 : _ref13.self) === null || _self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self2$self = _self2.self, Foo, _m)._.call(_self2$self); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC3 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf(), Foo, _m)._.call(_babelHelpers$assertC3); + (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC4 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref3$call = _ref3.call(_babelHelpers$assertC4), Foo, _m)._.call(_ref3$call); + (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref4$getSelf = _ref4.getSelf(), Foo, _m)._.call(_ref4$getSelf); + (_getSelf = (_ref14 = _ref5 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref14 === void 0 ? void 0 : _ref14.getSelf) === null || _getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$call = _getSelf.call(_ref5), Foo, _m)._.call(_getSelf$call); + (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref6$self = _ref6.self, Foo, _m)._.call(_ref6$self); + (_call = (_ref15 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC5 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref15 === void 0 ? void 0 : _ref15.call(_babelHelpers$assertC5)) === null || _call === void 0 ? void 0 : babelHelpers.assertClassBrand(_call$self = _call.self, Foo, _m)._.call(_call$self); + (_getSelf2 = (_ref16 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref16 === void 0 ? void 0 : _ref16.getSelf()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf2$self = _getSelf2.self, Foo, _m)._.call(_getSelf2$self); + (_getSelf3 = (_ref17 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref17 === void 0 || (_ref17$getSelf = _ref17.getSelf) === null || _ref17$getSelf === void 0 ? void 0 : _ref17$getSelf.call(_ref17)) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf3$self = _getSelf3.self, Foo, _m)._.call(_getSelf3$self); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo = fn().Foo, Foo, _m)._.call(_fn$Foo); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo2 = fn().Foo, Foo, _m)._.call(_fn$Foo2).toString; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo3 = fn().Foo, Foo, _m)._.call(_fn$Foo3).toString(); + (_fnDeep$very$o = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo = _fnDeep$very$o.Foo, Foo, _m)._.call(_fnDeep$very$o$Foo); + (_fnDeep$very$o2 = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o2$Foo = _fnDeep$very$o2.Foo, Foo, _m)._.call(_fnDeep$very$o2$Foo).toString; + (_fnDeep$very$o3 = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o3$Foo = _fnDeep$very$o3.Foo, Foo, _m)._.call(_fnDeep$very$o3$Foo).toString(); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC6 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._, Foo, _m)._.call(_babelHelpers$assertC6); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC7 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self, Foo, _m)._.call(_babelHelpers$assertC7); + (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref7 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref7$self = _ref7.self, Foo, _m)._.call(_ref7$self); + (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self) === null || _ref8 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref8$self = _ref8.self, Foo, _m)._.call(_ref8$self); + (_self3 = (_ref18 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref18 === void 0 ? void 0 : _ref18.self) === null || _self3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self3$self = _self3.self, Foo, _m)._.call(_self3$self); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC8 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf(), Foo, _m)._.call(_babelHelpers$assertC8); + (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC9 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref9 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref9$call = _ref9.call(_babelHelpers$assertC9), Foo, _m)._.call(_ref9$call); + (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref10 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref10$getSelf = _ref10.getSelf(), Foo, _m)._.call(_ref10$getSelf); + (_getSelf4 = (_ref19 = _ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref19 === void 0 ? void 0 : _ref19.getSelf) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf4$call = _getSelf4.call(_ref11), Foo, _m)._.call(_getSelf4$call); + (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf()) === null || _ref12 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref12$self = _ref12.self, Foo, _m)._.call(_ref12$self); + (_call2 = (_ref20 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC10 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref20 === void 0 ? void 0 : _ref20.call(_babelHelpers$assertC10)) === null || _call2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_call2$self = _call2.self, Foo, _m)._.call(_call2$self); + (_getSelf5 = (_ref21 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref21 === void 0 ? void 0 : _ref21.getSelf()) === null || _getSelf5 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf5$self = _getSelf5.self, Foo, _m)._.call(_getSelf5$self); + (_getSelf6 = (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref22 === void 0 || (_ref22$getSelf = _ref22.getSelf) === null || _ref22$getSelf === void 0 ? void 0 : _ref22$getSelf.call(_ref22)) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf6$self = _getSelf6.self, Foo, _m)._.call(_getSelf6$self); } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _m = { - writable: true, - value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); + _: function () { + return babelHelpers.assertClassBrand(this, _Foo, _x)._; } }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call/output.js index 455614306529..04e6fa43bd03 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-member-call/output.js @@ -4,7 +4,7 @@ class Foo { return this; } static test() { - var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o, _deep$very$o$Foo, _deep$very$o2, _deep$very$o2$Foo, _deep$very$o3, _deep$very$o3$Foo, _babelHelpers$classSt, _babelHelpers$classSt2, _ref, _ref$self, _ref2, _ref2$self, _self2, _self2$self, _babelHelpers$classSt3, _babelHelpers$classSt4, _ref3, _ref3$call, _ref4, _ref4$getSelf, _getSelf, _ref5, _getSelf$call, _ref6, _ref6$self, _babelHelpers$classSt5, _call, _call$self, _getSelf2, _getSelf2$self, _getSelf3, _getSelf3$self, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o, _fnDeep$very$o$Foo, _fnDeep$very$o2, _fnDeep$very$o2$Foo, _fnDeep$very$o3, _fnDeep$very$o3$Foo, _babelHelpers$classSt6, _babelHelpers$classSt7, _ref7, _ref7$self, _ref8, _ref8$self, _self3, _self3$self, _babelHelpers$classSt8, _babelHelpers$classSt9, _ref9, _ref9$call, _ref10, _ref10$getSelf, _getSelf4, _ref11, _getSelf4$call, _ref12, _ref12$self, _babelHelpers$classSt10, _call2, _call2$self, _getSelf5, _getSelf5$self, _getSelf6, _getSelf6$self; + var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o, _deep$very$o$Foo, _deep$very$o2, _deep$very$o2$Foo, _deep$very$o3, _deep$very$o3$Foo, _babelHelpers$assertC, _babelHelpers$assertC2, _ref, _ref$self, _ref2, _ref2$self, _self2, _self2$self, _babelHelpers$assertC3, _babelHelpers$assertC4, _ref3, _ref3$call, _ref4, _ref4$getSelf, _getSelf, _ref5, _getSelf$call, _ref6, _ref6$self, _babelHelpers$assertC5, _call, _call$self, _getSelf2, _getSelf2$self, _getSelf3, _getSelf3$self, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o, _fnDeep$very$o$Foo, _fnDeep$very$o2, _fnDeep$very$o2$Foo, _fnDeep$very$o3, _fnDeep$very$o3$Foo, _babelHelpers$assertC6, _babelHelpers$assertC7, _ref7, _ref7$self, _ref8, _ref8$self, _self3, _self3$self, _babelHelpers$assertC8, _babelHelpers$assertC9, _ref9, _ref9$call, _ref10, _ref10$getSelf, _getSelf4, _ref11, _getSelf4$call, _ref12, _ref12$self, _babelHelpers$assertC10, _call2, _call2$self, _getSelf5, _getSelf5$self, _getSelf6, _getSelf6$self; const o = { Foo: Foo }; @@ -19,60 +19,57 @@ class Foo { function fnDeep() { return deep; } - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo = o.Foo, Foo, _m).call(_o$Foo); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo2 = o.Foo, Foo, _m).call(_o$Foo2).toString; - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo3 = o.Foo, Foo, _m).call(_o$Foo3).toString(); - (_deep$very$o = deep?.very.o) === null || _deep$very$o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo = _deep$very$o.Foo, Foo, _m).call(_deep$very$o$Foo); - (_deep$very$o2 = deep?.very.o) === null || _deep$very$o2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o2$Foo = _deep$very$o2.Foo, Foo, _m).call(_deep$very$o2$Foo).toString; - (_deep$very$o3 = deep?.very.o) === null || _deep$very$o3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o3$Foo = _deep$very$o3.Foo, Foo, _m).call(_deep$very$o3$Foo).toString(); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self), Foo, _m).call(_babelHelpers$classSt); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt2 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self, Foo, _m).call(_babelHelpers$classSt2); - (_ref = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref$self = _ref.self, Foo, _m).call(_ref$self); - (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self) === null || _ref2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref2$self = _ref2.self, Foo, _m).call(_ref2$self); - (_self2 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.self) === null || _self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self2$self = _self2.self, Foo, _m).call(_self2$self); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt3 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf(), Foo, _m).call(_babelHelpers$classSt3); - (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt4 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref3$call = _ref3.call(_babelHelpers$classSt4), Foo, _m).call(_ref3$call); - (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref4$getSelf = _ref4.getSelf(), Foo, _m).call(_ref4$getSelf); - (_getSelf = (_ref5 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf) === null || _getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$call = _getSelf.call(_ref5), Foo, _m).call(_getSelf$call); - (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref6$self = _ref6.self, Foo, _m).call(_ref6$self); - (_call = (o === null || o === void 0 ? void 0 : (_babelHelpers$classSt5 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt5)) === null || _call === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call$self = _call.self, Foo, _m).call(_call$self); - (_getSelf2 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf2$self = _getSelf2.self, Foo, _m).call(_getSelf2$self); - (_getSelf3 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf?.()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf3$self = _getSelf3.self, Foo, _m).call(_getSelf3$self); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo = fn().Foo, Foo, _m).call(_fn$Foo); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo2 = fn().Foo, Foo, _m).call(_fn$Foo2).toString; - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo3 = fn().Foo, Foo, _m).call(_fn$Foo3).toString(); - (_fnDeep$very$o = fnDeep?.().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo = _fnDeep$very$o.Foo, Foo, _m).call(_fnDeep$very$o$Foo); - (_fnDeep$very$o2 = fnDeep?.().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o2$Foo = _fnDeep$very$o2.Foo, Foo, _m).call(_fnDeep$very$o2$Foo).toString; - (_fnDeep$very$o3 = fnDeep?.().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o3$Foo = _fnDeep$very$o3.Foo, Foo, _m).call(_fnDeep$very$o3$Foo).toString(); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt6 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self), Foo, _m).call(_babelHelpers$classSt6); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt7 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self, Foo, _m).call(_babelHelpers$classSt7); - (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref7 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref7$self = _ref7.self, Foo, _m).call(_ref7$self); - (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self) === null || _ref8 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref8$self = _ref8.self, Foo, _m).call(_ref8$self); - (_self3 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.self) === null || _self3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self3$self = _self3.self, Foo, _m).call(_self3$self); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt8 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf(), Foo, _m).call(_babelHelpers$classSt8); - (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt9 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref9 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref9$call = _ref9.call(_babelHelpers$classSt9), Foo, _m).call(_ref9$call); - (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref10 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref10$getSelf = _ref10.getSelf(), Foo, _m).call(_ref10$getSelf); - (_getSelf4 = (_ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf4$call = _getSelf4.call(_ref11), Foo, _m).call(_getSelf4$call); - (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf()) === null || _ref12 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref12$self = _ref12.self, Foo, _m).call(_ref12$self); - (_call2 = (fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt10 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt10)) === null || _call2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call2$self = _call2.self, Foo, _m).call(_call2$self); - (_getSelf5 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf()) === null || _getSelf5 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf5$self = _getSelf5.self, Foo, _m).call(_getSelf5$self); - (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6$self = _getSelf6.self, Foo, _m).call(_getSelf6$self); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo = o.Foo, Foo, _m)._.call(_o$Foo); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo2 = o.Foo, Foo, _m)._.call(_o$Foo2).toString; + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo3 = o.Foo, Foo, _m)._.call(_o$Foo3).toString(); + (_deep$very$o = deep?.very.o) === null || _deep$very$o === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo = _deep$very$o.Foo, Foo, _m)._.call(_deep$very$o$Foo); + (_deep$very$o2 = deep?.very.o) === null || _deep$very$o2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o2$Foo = _deep$very$o2.Foo, Foo, _m)._.call(_deep$very$o2$Foo).toString; + (_deep$very$o3 = deep?.very.o) === null || _deep$very$o3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o3$Foo = _deep$very$o3.Foo, Foo, _m)._.call(_deep$very$o3$Foo).toString(); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._, Foo, _m)._.call(_babelHelpers$assertC); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC2 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self, Foo, _m)._.call(_babelHelpers$assertC2); + (_ref = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref$self = _ref.self, Foo, _m)._.call(_ref$self); + (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self) === null || _ref2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref2$self = _ref2.self, Foo, _m)._.call(_ref2$self); + (_self2 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.self) === null || _self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self2$self = _self2.self, Foo, _m)._.call(_self2$self); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC3 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf(), Foo, _m)._.call(_babelHelpers$assertC3); + (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC4 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref3$call = _ref3.call(_babelHelpers$assertC4), Foo, _m)._.call(_ref3$call); + (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref4$getSelf = _ref4.getSelf(), Foo, _m)._.call(_ref4$getSelf); + (_getSelf = (_ref5 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf) === null || _getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$call = _getSelf.call(_ref5), Foo, _m)._.call(_getSelf$call); + (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref6$self = _ref6.self, Foo, _m)._.call(_ref6$self); + (_call = (o === null || o === void 0 ? void 0 : (_babelHelpers$assertC5 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC5)) === null || _call === void 0 ? void 0 : babelHelpers.assertClassBrand(_call$self = _call.self, Foo, _m)._.call(_call$self); + (_getSelf2 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf2$self = _getSelf2.self, Foo, _m)._.call(_getSelf2$self); + (_getSelf3 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf?.()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf3$self = _getSelf3.self, Foo, _m)._.call(_getSelf3$self); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo = fn().Foo, Foo, _m)._.call(_fn$Foo); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo2 = fn().Foo, Foo, _m)._.call(_fn$Foo2).toString; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo3 = fn().Foo, Foo, _m)._.call(_fn$Foo3).toString(); + (_fnDeep$very$o = fnDeep?.().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo = _fnDeep$very$o.Foo, Foo, _m)._.call(_fnDeep$very$o$Foo); + (_fnDeep$very$o2 = fnDeep?.().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o2$Foo = _fnDeep$very$o2.Foo, Foo, _m)._.call(_fnDeep$very$o2$Foo).toString; + (_fnDeep$very$o3 = fnDeep?.().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o3$Foo = _fnDeep$very$o3.Foo, Foo, _m)._.call(_fnDeep$very$o3$Foo).toString(); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC6 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._, Foo, _m)._.call(_babelHelpers$assertC6); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC7 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self, Foo, _m)._.call(_babelHelpers$assertC7); + (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref7 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref7$self = _ref7.self, Foo, _m)._.call(_ref7$self); + (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self) === null || _ref8 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref8$self = _ref8.self, Foo, _m)._.call(_ref8$self); + (_self3 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.self) === null || _self3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self3$self = _self3.self, Foo, _m)._.call(_self3$self); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC8 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf(), Foo, _m)._.call(_babelHelpers$assertC8); + (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC9 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref9 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref9$call = _ref9.call(_babelHelpers$assertC9), Foo, _m)._.call(_ref9$call); + (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref10 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref10$getSelf = _ref10.getSelf(), Foo, _m)._.call(_ref10$getSelf); + (_getSelf4 = (_ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf4$call = _getSelf4.call(_ref11), Foo, _m)._.call(_getSelf4$call); + (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf()) === null || _ref12 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref12$self = _ref12.self, Foo, _m)._.call(_ref12$self); + (_call2 = (fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC10 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC10)) === null || _call2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_call2$self = _call2.self, Foo, _m)._.call(_call2$self); + (_getSelf5 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf()) === null || _getSelf5 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf5$self = _getSelf5.self, Foo, _m)._.call(_getSelf5$self); + (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf6$self = _getSelf6.self, Foo, _m)._.call(_getSelf6$self); } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _m = { - writable: true, - value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); + _: function () { + return babelHelpers.assertClassBrand(this, _Foo, _x)._; } }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property-with-transform/output.js index 6dcf301ec31e..6eadeab34e1a 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property-with-transform/output.js @@ -4,7 +4,7 @@ class Foo { return this; } static test() { - var _deep$very$o, _deep$very$o2, _deep$very$o3, _ref, _ref2, _self2, _babelHelpers$classSt, _ref3, _ref4, _getSelf, _ref5, _ref6, _babelHelpers$classSt2, _call, _getSelf2, _getSelf3, _fnDeep$very$o, _fnDeep$very$o2, _fnDeep$very$o3, _ref7, _ref8, _self3, _babelHelpers$classSt3, _ref9, _ref10, _getSelf4, _ref11, _ref12, _babelHelpers$classSt4, _call2, _getSelf5, _getSelf6, _ref13, _ref14, _ref15, _ref16, _ref17, _ref17$getSelf, _ref18, _ref19, _ref20, _ref21, _ref22, _ref22$getSelf; + var _deep$very$o, _deep$very$o2, _deep$very$o3, _ref, _ref2, _self2, _babelHelpers$assertC, _ref3, _ref4, _getSelf, _ref5, _ref6, _babelHelpers$assertC2, _call, _getSelf2, _getSelf3, _fnDeep$very$o, _fnDeep$very$o2, _fnDeep$very$o3, _ref7, _ref8, _self3, _babelHelpers$assertC3, _ref9, _ref10, _getSelf4, _ref11, _ref12, _babelHelpers$assertC4, _call2, _getSelf5, _getSelf6, _ref13, _ref14, _ref15, _ref16, _ref17, _ref17$getSelf, _ref18, _ref19, _ref20, _ref21, _ref22, _ref22$getSelf; const o = { Foo: Foo }; @@ -19,54 +19,52 @@ class Foo { function fnDeep() { return deep; } - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _x); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _x).toString; - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _x).toString(); - (_deep$very$o = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o.Foo, Foo, _x); - (_deep$very$o2 = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o2.Foo, Foo, _x).toString; - (_deep$very$o3 = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o3.Foo, Foo, _x).toString(); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self), Foo, _x); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self, Foo, _x); - (_ref = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref.self, Foo, _x); - (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self) === null || _ref2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref2.self, Foo, _x); - (_self2 = (_ref13 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref13 === void 0 ? void 0 : _ref13.self) === null || _self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self2.self, Foo, _x); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf(), Foo, _x); - (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref3.call(_babelHelpers$classSt), Foo, _x); - (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref4.getSelf(), Foo, _x); - (_getSelf = (_ref14 = _ref5 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref14 === void 0 ? void 0 : _ref14.getSelf) === null || _getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf.call(_ref5), Foo, _x); - (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref6.self, Foo, _x); - (_call = (_ref15 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt2 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref15 === void 0 ? void 0 : _ref15.call(_babelHelpers$classSt2)) === null || _call === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call.self, Foo, _x); - (_getSelf2 = (_ref16 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref16 === void 0 ? void 0 : _ref16.getSelf()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf2.self, Foo, _x); - (_getSelf3 = (_ref17 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref17 === void 0 || (_ref17$getSelf = _ref17.getSelf) === null || _ref17$getSelf === void 0 ? void 0 : _ref17$getSelf.call(_ref17)) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf3.self, Foo, _x); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _x); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _x).toString; - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _x).toString(); - (_fnDeep$very$o = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o.Foo, Foo, _x); - (_fnDeep$very$o2 = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o2.Foo, Foo, _x).toString; - (_fnDeep$very$o3 = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o3.Foo, Foo, _x).toString(); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self), Foo, _x); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self, Foo, _x); - (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref7 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref7.self, Foo, _x); - (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self) === null || _ref8 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref8.self, Foo, _x); - (_self3 = (_ref18 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref18 === void 0 ? void 0 : _ref18.self) === null || _self3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self3.self, Foo, _x); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf(), Foo, _x); - (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt3 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref9 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref9.call(_babelHelpers$classSt3), Foo, _x); - (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref10 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref10.getSelf(), Foo, _x); - (_getSelf4 = (_ref19 = _ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref19 === void 0 ? void 0 : _ref19.getSelf) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf4.call(_ref11), Foo, _x); - (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf()) === null || _ref12 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref12.self, Foo, _x); - (_call2 = (_ref20 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt4 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref20 === void 0 ? void 0 : _ref20.call(_babelHelpers$classSt4)) === null || _call2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call2.self, Foo, _x); - (_getSelf5 = (_ref21 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref21 === void 0 ? void 0 : _ref21.getSelf()) === null || _getSelf5 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf5.self, Foo, _x); - (_getSelf6 = (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref22 === void 0 || (_ref22$getSelf = _ref22.getSelf) === null || _ref22$getSelf === void 0 ? void 0 : _ref22$getSelf.call(_ref22)) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6.self, Foo, _x); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _x)._; + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _x)._.toString; + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _x)._.toString(); + (_deep$very$o = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o.Foo, Foo, _x)._; + (_deep$very$o2 = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o2.Foo, Foo, _x)._.toString; + (_deep$very$o3 = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o3.Foo, Foo, _x)._.toString(); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(o.Foo, Foo, _self)._, Foo, _x)._; + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self, Foo, _x)._; + (_ref = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref.self, Foo, _x)._; + (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self) === null || _ref2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref2.self, Foo, _x)._; + (_self2 = (_ref13 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref13 === void 0 ? void 0 : _ref13.self) === null || _self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self2.self, Foo, _x)._; + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf(), Foo, _x)._; + (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref3.call(_babelHelpers$assertC), Foo, _x)._; + (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref4.getSelf(), Foo, _x)._; + (_getSelf = (_ref14 = _ref5 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref14 === void 0 ? void 0 : _ref14.getSelf) === null || _getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf.call(_ref5), Foo, _x)._; + (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref6.self, Foo, _x)._; + (_call = (_ref15 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC2 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref15 === void 0 ? void 0 : _ref15.call(_babelHelpers$assertC2)) === null || _call === void 0 ? void 0 : babelHelpers.assertClassBrand(_call.self, Foo, _x)._; + (_getSelf2 = (_ref16 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref16 === void 0 ? void 0 : _ref16.getSelf()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf2.self, Foo, _x)._; + (_getSelf3 = (_ref17 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref17 === void 0 || (_ref17$getSelf = _ref17.getSelf) === null || _ref17$getSelf === void 0 ? void 0 : _ref17$getSelf.call(_ref17)) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf3.self, Foo, _x)._; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _x)._; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _x)._.toString; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _x)._.toString(); + (_fnDeep$very$o = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o.Foo, Foo, _x)._; + (_fnDeep$very$o2 = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o2.Foo, Foo, _x)._.toString; + (_fnDeep$very$o3 = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o3.Foo, Foo, _x)._.toString(); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._, Foo, _x)._; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self, Foo, _x)._; + (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref7 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref7.self, Foo, _x)._; + (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self) === null || _ref8 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref8.self, Foo, _x)._; + (_self3 = (_ref18 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref18 === void 0 ? void 0 : _ref18.self) === null || _self3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self3.self, Foo, _x)._; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf(), Foo, _x)._; + (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC3 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref9 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref9.call(_babelHelpers$assertC3), Foo, _x)._; + (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref10 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref10.getSelf(), Foo, _x)._; + (_getSelf4 = (_ref19 = _ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref19 === void 0 ? void 0 : _ref19.getSelf) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf4.call(_ref11), Foo, _x)._; + (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf()) === null || _ref12 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref12.self, Foo, _x)._; + (_call2 = (_ref20 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC4 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref20 === void 0 ? void 0 : _ref20.call(_babelHelpers$assertC4)) === null || _call2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_call2.self, Foo, _x)._; + (_getSelf5 = (_ref21 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref21 === void 0 ? void 0 : _ref21.getSelf()) === null || _getSelf5 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf5.self, Foo, _x)._; + (_getSelf6 = (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref22 === void 0 || (_ref22$getSelf = _ref22.getSelf) === null || _ref22$getSelf === void 0 ? void 0 : _ref22$getSelf.call(_ref22)) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf6.self, Foo, _x)._; } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property/output.js index 8f8335995f81..1dcb80df9cce 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-before-property/output.js @@ -4,7 +4,7 @@ class Foo { return this; } static test() { - var _deep$very$o, _deep$very$o2, _deep$very$o3, _ref, _ref2, _self2, _babelHelpers$classSt, _ref3, _ref4, _getSelf, _ref5, _ref6, _babelHelpers$classSt2, _call, _getSelf2, _getSelf3, _fnDeep$very$o, _fnDeep$very$o2, _fnDeep$very$o3, _ref7, _ref8, _self3, _babelHelpers$classSt3, _ref9, _ref10, _getSelf4, _ref11, _ref12, _babelHelpers$classSt4, _call2, _getSelf5, _getSelf6; + var _deep$very$o, _deep$very$o2, _deep$very$o3, _ref, _ref2, _self2, _babelHelpers$assertC, _ref3, _ref4, _getSelf, _ref5, _ref6, _babelHelpers$assertC2, _call, _getSelf2, _getSelf3, _fnDeep$very$o, _fnDeep$very$o2, _fnDeep$very$o3, _ref7, _ref8, _self3, _babelHelpers$assertC3, _ref9, _ref10, _getSelf4, _ref11, _ref12, _babelHelpers$assertC4, _call2, _getSelf5, _getSelf6; const o = { Foo: Foo }; @@ -19,54 +19,52 @@ class Foo { function fnDeep() { return deep; } - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _x); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _x).toString; - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _x).toString(); - (_deep$very$o = deep?.very.o) === null || _deep$very$o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o.Foo, Foo, _x); - (_deep$very$o2 = deep?.very.o) === null || _deep$very$o2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o2.Foo, Foo, _x).toString; - (_deep$very$o3 = deep?.very.o) === null || _deep$very$o3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o3.Foo, Foo, _x).toString(); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self), Foo, _x); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self, Foo, _x); - (_ref = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref.self, Foo, _x); - (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self) === null || _ref2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref2.self, Foo, _x); - (_self2 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.self) === null || _self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self2.self, Foo, _x); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf(), Foo, _x); - (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref3.call(_babelHelpers$classSt), Foo, _x); - (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref4.getSelf(), Foo, _x); - (_getSelf = (_ref5 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf) === null || _getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf.call(_ref5), Foo, _x); - (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref6.self, Foo, _x); - (_call = (o === null || o === void 0 ? void 0 : (_babelHelpers$classSt2 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt2)) === null || _call === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call.self, Foo, _x); - (_getSelf2 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf2.self, Foo, _x); - (_getSelf3 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf?.()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf3.self, Foo, _x); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _x); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _x).toString; - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _x).toString(); - (_fnDeep$very$o = fnDeep?.().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o.Foo, Foo, _x); - (_fnDeep$very$o2 = fnDeep?.().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o2.Foo, Foo, _x).toString; - (_fnDeep$very$o3 = fnDeep?.().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o3.Foo, Foo, _x).toString(); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self), Foo, _x); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self, Foo, _x); - (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref7 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref7.self, Foo, _x); - (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self) === null || _ref8 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref8.self, Foo, _x); - (_self3 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.self) === null || _self3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self3.self, Foo, _x); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf(), Foo, _x); - (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt3 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref9 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref9.call(_babelHelpers$classSt3), Foo, _x); - (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref10 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref10.getSelf(), Foo, _x); - (_getSelf4 = (_ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf4.call(_ref11), Foo, _x); - (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf()) === null || _ref12 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref12.self, Foo, _x); - (_call2 = (fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt4 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt4)) === null || _call2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call2.self, Foo, _x); - (_getSelf5 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf()) === null || _getSelf5 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf5.self, Foo, _x); - (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6.self, Foo, _x); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _x)._; + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _x)._.toString; + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _x)._.toString(); + (_deep$very$o = deep?.very.o) === null || _deep$very$o === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o.Foo, Foo, _x)._; + (_deep$very$o2 = deep?.very.o) === null || _deep$very$o2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o2.Foo, Foo, _x)._.toString; + (_deep$very$o3 = deep?.very.o) === null || _deep$very$o3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o3.Foo, Foo, _x)._.toString(); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(o.Foo, Foo, _self)._, Foo, _x)._; + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self, Foo, _x)._; + (_ref = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref.self, Foo, _x)._; + (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self) === null || _ref2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref2.self, Foo, _x)._; + (_self2 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.self) === null || _self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self2.self, Foo, _x)._; + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf(), Foo, _x)._; + (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref3.call(_babelHelpers$assertC), Foo, _x)._; + (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref4.getSelf(), Foo, _x)._; + (_getSelf = (_ref5 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf) === null || _getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf.call(_ref5), Foo, _x)._; + (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref6.self, Foo, _x)._; + (_call = (o === null || o === void 0 ? void 0 : (_babelHelpers$assertC2 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC2)) === null || _call === void 0 ? void 0 : babelHelpers.assertClassBrand(_call.self, Foo, _x)._; + (_getSelf2 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf2.self, Foo, _x)._; + (_getSelf3 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf?.()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf3.self, Foo, _x)._; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _x)._; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _x)._.toString; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _x)._.toString(); + (_fnDeep$very$o = fnDeep?.().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o.Foo, Foo, _x)._; + (_fnDeep$very$o2 = fnDeep?.().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o2.Foo, Foo, _x)._.toString; + (_fnDeep$very$o3 = fnDeep?.().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o3.Foo, Foo, _x)._.toString(); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._, Foo, _x)._; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self, Foo, _x)._; + (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref7 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref7.self, Foo, _x)._; + (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self) === null || _ref8 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref8.self, Foo, _x)._; + (_self3 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.self) === null || _self3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self3.self, Foo, _x)._; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf(), Foo, _x)._; + (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC3 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref9 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref9.call(_babelHelpers$assertC3), Foo, _x)._; + (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref10 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref10.getSelf(), Foo, _x)._; + (_getSelf4 = (_ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf4.call(_ref11), Foo, _x)._; + (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf()) === null || _ref12 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref12.self, Foo, _x)._; + (_call2 = (fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC4 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC4)) === null || _call2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_call2.self, Foo, _x)._; + (_getSelf5 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf()) === null || _getSelf5 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf5.self, Foo, _x)._; + (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf6.self, Foo, _x)._; } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-cast-to-boolean/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-cast-to-boolean/output.js index f759dfe26dbb..daf1af98eb15 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-cast-to-boolean/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-cast-to-boolean/output.js @@ -1,45 +1,45 @@ class C { static testIf(o) { - if (o !== null && o !== void 0 && babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b.c.d) { + if (o !== null && o !== void 0 && babelHelpers.assertClassBrand(o, C, _a)._.b.c.d) { return true; } return false; } static testConditional(o) { - return (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d ? true : false; + return (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d ? true : false; } static testLoop(o) { - while (o !== null && o !== void 0 && babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b.c.d) { - for (; (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b.c)?.d;) { + while (o !== null && o !== void 0 && babelHelpers.assertClassBrand(o, C, _a)._.b.c.d) { + for (; (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b.c)?.d;) { let i = 0; do { i++; if (i === 2) { return true; } - } while ((o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d); + } while ((o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d); } } return false; } static testNegate(o) { - return !!(o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d; + return !!(o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d; } static testIfDeep(o) { var _o$obj; - if (((_o$obj = o.obj) === null || _o$obj === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$obj, C, _a).b)?.c.d) { + if (((_o$obj = o.obj) === null || _o$obj === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$obj, C, _a)._.b)?.c.d) { return true; } return false; } static testConditionalDeep(o) { var _o$obj2; - return ((_o$obj2 = o.obj) === null || _o$obj2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$obj2, C, _a).b)?.c.d ? true : false; + return ((_o$obj2 = o.obj) === null || _o$obj2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$obj2, C, _a)._.b)?.c.d ? true : false; } static testLoopDeep(o) { - while ((_o$obj3 = o.obj) !== null && _o$obj3 !== void 0 && babelHelpers.classStaticPrivateFieldSpecGet(_o$obj3, C, _a).b.c.d) { + while ((_o$obj3 = o.obj) !== null && _o$obj3 !== void 0 && babelHelpers.assertClassBrand(_o$obj3, C, _a)._.b.c.d) { var _o$obj3; - for (; ((_o$obj4 = o.obj) === null || _o$obj4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$obj4, C, _a).b.c)?.d;) { + for (; ((_o$obj4 = o.obj) === null || _o$obj4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$obj4, C, _a)._.b.c)?.d;) { var _o$obj4; let i = 0; do { @@ -48,34 +48,33 @@ class C { if (i === 2) { return true; } - } while (((_o$obj5 = o.obj) === null || _o$obj5 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$obj5, C, _a).b)?.c.d); + } while (((_o$obj5 = o.obj) === null || _o$obj5 === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$obj5, C, _a)._.b)?.c.d); } } return false; } static testNegateDeep(o) { var _o$obj6; - return !!((_o$obj6 = o.obj) === null || _o$obj6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$obj6, C, _a).b)?.c.d; + return !!((_o$obj6 = o.obj) === null || _o$obj6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$obj6, C, _a)._.b)?.c.d; } static testLogicalInIf(o) { - if ((o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d && (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a))?.b.c.d) { + if ((o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d && (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._)?.b.c.d) { return true; } return false; } static testLogicalInReturn(o) { - return (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d && (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a))?.b.c.d; + return (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d && (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._)?.b.c.d; } static testNullishCoalescing(o) { - if ((o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.non_existent ?? (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d) { - return (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.non_existent ?? (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.d; + if ((o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.non_existent ?? (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d) { + return (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.non_existent ?? (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.d; } - return (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o, C, _a).b)?.c.non_existent ?? o; + return (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o, C, _a)._.b)?.c.non_existent ?? o; } } var _a = { - writable: true, - value: { + _: { b: { c: { d: 2 diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-delete-property/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-delete-property/output.js index 9e27a3421ae5..b14389d1436b 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-delete-property/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-delete-property/output.js @@ -4,7 +4,7 @@ class Foo { return this; } static test() { - var _deep$very$o, _babelHelpers$classSt, _babelHelpers$classSt2, _fnDeep$very$o, _babelHelpers$classSt3, _babelHelpers$classSt4; + var _deep$very$o, _babelHelpers$assertC, _babelHelpers$assertC2, _fnDeep$very$o, _babelHelpers$assertC3, _babelHelpers$assertC4; const o = { Foo: Foo }; @@ -19,46 +19,44 @@ class Foo { function fnDeep() { return deep; } - Foo === null || Foo === void 0 ? true : delete babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _self).unicorn; - (_deep$very$o = deep?.very.o) === null || _deep$very$o === void 0 ? true : delete babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o.Foo, Foo, _self).unicorn; - o === null || o === void 0 ? true : delete babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).unicorn; - o === null || o === void 0 ? true : delete babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self.unicorn; - delete (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.self.unicorn; - delete (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self)?.self.unicorn; - delete (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.self?.self.unicorn; - o === null || o === void 0 ? true : delete babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf().unicorn; - delete (o === null || o === void 0 ? void 0 : (_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt).unicorn; - delete (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf().unicorn; - delete (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf?.().unicorn; - delete (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf())?.self.unicorn; - delete (o === null || o === void 0 ? void 0 : (_babelHelpers$classSt2 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt2)?.self.unicorn; - delete (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf()?.self.unicorn; - delete (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf?.()?.self.unicorn; - fn === null || fn === void 0 ? true : delete babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).unicorn; - (_fnDeep$very$o = fnDeep?.().very.o) === null || _fnDeep$very$o === void 0 ? true : delete babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o.Foo, Foo, _self).unicorn; - fn === null || fn === void 0 ? true : delete babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).unicorn; - fn === null || fn === void 0 ? true : delete babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self.unicorn; - delete (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.self.unicorn; - delete (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self)?.self.unicorn; - delete (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.self?.self.unicorn; - fn === null || fn === void 0 ? true : delete babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf().unicorn; - delete (fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt3 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt3).unicorn; - delete (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf().unicorn; - delete (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.().unicorn; - delete (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf())?.self.unicorn; - delete (fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt4 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt4)?.self.unicorn; - delete (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf()?.self.unicorn; - delete (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()?.self.unicorn; + Foo === null || Foo === void 0 ? true : delete _self._.unicorn; + (_deep$very$o = deep?.very.o) === null || _deep$very$o === void 0 ? true : delete babelHelpers.assertClassBrand(_deep$very$o.Foo, Foo, _self)._.unicorn; + o === null || o === void 0 ? true : delete babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.unicorn; + o === null || o === void 0 ? true : delete babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self.unicorn; + delete (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.self.unicorn; + delete (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self)?.self.unicorn; + delete (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.self?.self.unicorn; + o === null || o === void 0 ? true : delete babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf().unicorn; + delete (o === null || o === void 0 ? void 0 : (_babelHelpers$assertC = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC).unicorn; + delete (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf().unicorn; + delete (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf?.().unicorn; + delete (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf())?.self.unicorn; + delete (o === null || o === void 0 ? void 0 : (_babelHelpers$assertC2 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC2)?.self.unicorn; + delete (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf()?.self.unicorn; + delete (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf?.()?.self.unicorn; + fn === null || fn === void 0 ? true : delete babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.unicorn; + (_fnDeep$very$o = fnDeep?.().very.o) === null || _fnDeep$very$o === void 0 ? true : delete babelHelpers.assertClassBrand(_fnDeep$very$o.Foo, Foo, _self)._.unicorn; + fn === null || fn === void 0 ? true : delete babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.unicorn; + fn === null || fn === void 0 ? true : delete babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self.unicorn; + delete (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.self.unicorn; + delete (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self)?.self.unicorn; + delete (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.self?.self.unicorn; + fn === null || fn === void 0 ? true : delete babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf().unicorn; + delete (fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC3 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC3).unicorn; + delete (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf().unicorn; + delete (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf?.().unicorn; + delete (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf())?.self.unicorn; + delete (fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC4 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC4)?.self.unicorn; + delete (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf()?.self.unicorn; + delete (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf?.()?.self.unicorn; } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param-with-transform/output.js index e0c1b2177a63..2840211b9c08 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param-with-transform/output.js @@ -18,19 +18,19 @@ class Foo { function fnDeep() { return deep; } - function f(o, r = (_o$Foo => o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo = o.Foo, Foo, _m).call(_o$Foo))()) { + function f(o, r = (_o$Foo => o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo = o.Foo, Foo, _m)._.call(_o$Foo))()) { return r; } - function g(o, r = (_ref => (_ref = (() => o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf(), Foo, _m))()) === null || _ref === void 0 ? void 0 : _ref())()) { + function g(o, r = (_ref => (_ref = (() => o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf(), Foo, _m)._)()) === null || _ref === void 0 ? void 0 : _ref())()) { return r; } - function h(fnDeep, r = ((_fnDeep$very$o$Foo, _fnDeep$very$o) => (_fnDeep$very$o$Foo = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o = fnDeep().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : _fnDeep$very$o.Foo) === null || _fnDeep$very$o$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo, Foo, _m).call(_fnDeep$very$o$Foo))()) { + function h(fnDeep, r = ((_fnDeep$very$o$Foo, _fnDeep$very$o) => (_fnDeep$very$o$Foo = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o = fnDeep().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : _fnDeep$very$o.Foo) === null || _fnDeep$very$o$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo, Foo, _m)._.call(_fnDeep$very$o$Foo))()) { return r; } - function i(fn, r = ((_getSelf, _getSelf$self, _ref2) => (_getSelf = (_ref2 = (() => fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))()) === null || _ref2 === void 0 ? void 0 : _ref2.getSelf()) === null || _getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self = _getSelf.self, Foo, _m).call(_getSelf$self))()) { + function i(fn, r = ((_getSelf, _getSelf$self, _ref2) => (_getSelf = (_ref2 = (() => fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)()) === null || _ref2 === void 0 ? void 0 : _ref2.getSelf()) === null || _getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self = _getSelf.self, Foo, _m)._.call(_getSelf$self))()) { return r; } - function j(fn, r = ((_babelHelpers$classSt, _babelHelpers$classSt2) => (_babelHelpers$classSt2 = babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf().self, Foo, _m)) === null || _babelHelpers$classSt2 === void 0 ? void 0 : _babelHelpers$classSt2.call(_babelHelpers$classSt))()) { + function j(fn, r = ((_babelHelpers$assertC, _babelHelpers$assertC2) => (_babelHelpers$assertC2 = babelHelpers.assertClassBrand(_babelHelpers$assertC = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf().self, Foo, _m)._) === null || _babelHelpers$assertC2 === void 0 ? void 0 : _babelHelpers$assertC2.call(_babelHelpers$assertC))()) { return r; } f(o); @@ -42,18 +42,15 @@ class Foo { } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _m = { - writable: true, - value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); + _: function () { + return babelHelpers.assertClassBrand(this, _Foo, _x)._; } }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param/output.js index 594b00d5ef50..ecd4aa8e192d 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-in-function-param/output.js @@ -18,19 +18,19 @@ class Foo { function fnDeep() { return deep; } - function f(o, r = (_o$Foo => o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo = o.Foo, Foo, _m).call(_o$Foo))()) { + function f(o, r = (_o$Foo => o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo = o.Foo, Foo, _m)._.call(_o$Foo))()) { return r; } - function g(o, r = (() => o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf(), Foo, _m))()?.()) { + function g(o, r = (() => o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf(), Foo, _m)._)()?.()) { return r; } - function h(fnDeep, r = (_fnDeep$very$o$Foo => (_fnDeep$very$o$Foo = fnDeep?.().very.o?.Foo) === null || _fnDeep$very$o$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo, Foo, _m).call(_fnDeep$very$o$Foo))()) { + function h(fnDeep, r = (_fnDeep$very$o$Foo => (_fnDeep$very$o$Foo = fnDeep?.().very.o?.Foo) === null || _fnDeep$very$o$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo, Foo, _m)._.call(_fnDeep$very$o$Foo))()) { return r; } - function i(fn, r = ((_getSelf, _getSelf$self) => (_getSelf = (() => fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))()?.getSelf()) === null || _getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self = _getSelf.self, Foo, _m).call(_getSelf$self))()) { + function i(fn, r = ((_getSelf, _getSelf$self) => (_getSelf = (() => fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)()?.getSelf()) === null || _getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self = _getSelf.self, Foo, _m)._.call(_getSelf$self))()) { return r; } - function j(fn, r = (_babelHelpers$classSt => babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf().self, Foo, _m)?.call(_babelHelpers$classSt))()) { + function j(fn, r = (_babelHelpers$assertC => babelHelpers.assertClassBrand(_babelHelpers$assertC = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf().self, Foo, _m)._?.call(_babelHelpers$assertC))()) { return r; } f(o); @@ -42,18 +42,15 @@ class Foo { } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _m = { - writable: true, - value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); + _: function () { + return babelHelpers.assertClassBrand(this, _Foo, _x)._; } }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call-spread-arguments/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call-spread-arguments/output.js index 8cbceb847049..13c006b6164d 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call-spread-arguments/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call-spread-arguments/output.js @@ -1,21 +1,18 @@ var _m = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _m, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _m, void 0); } init() { - babelHelpers.classPrivateFieldSet(this, _m, (...args) => args); + babelHelpers.classPrivateFieldSet2(this, _m, (...args) => args); } static test() { const f = new Foo(); f.init(); - return babelHelpers.classPrivateFieldGet(f, _m)?.apply(f, arguments); + return babelHelpers.classPrivateFieldGet2(f, _m)?.apply(f, arguments); } static testNull() { const f = new Foo(); - return babelHelpers.classPrivateFieldGet(f, _m)?.apply(f, arguments); + return babelHelpers.classPrivateFieldGet2(f, _m)?.apply(f, arguments); } } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call-with-transform/output.js index eaa7a5bc7981..9b95b58ba99a 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call-with-transform/output.js @@ -4,7 +4,7 @@ class Foo { return this; } static test() { - var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o, _deep$very$o$Foo, _deep$very$o2, _deep$very$o2$Foo, _deep$very$o3, _deep$very$o3$Foo, _babelHelpers$classSt, _babelHelpers$classSt2, _ref, _ref$self, _ref2, _ref2$self, _self2, _self2$self, _babelHelpers$classSt3, _babelHelpers$classSt4, _ref3, _ref3$call, _ref4, _ref4$getSelf, _getSelf, _ref5, _getSelf$call, _ref6, _ref6$self, _babelHelpers$classSt5, _call, _call$self, _getSelf2, _getSelf2$self, _getSelf3, _getSelf3$self, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o, _fnDeep$very$o$Foo, _fnDeep$very$o2, _fnDeep$very$o2$Foo, _fnDeep$very$o3, _fnDeep$very$o3$Foo, _babelHelpers$classSt6, _babelHelpers$classSt7, _ref7, _ref7$self, _ref8, _ref8$self, _self3, _self3$self, _babelHelpers$classSt8, _babelHelpers$classSt9, _ref9, _ref9$call, _ref10, _ref10$getSelf, _getSelf4, _ref11, _getSelf4$call, _ref12, _ref12$self, _babelHelpers$classSt10, _call2, _call2$self, _getSelf5, _getSelf5$self, _getSelf6, _getSelf6$self, _babelHelpers$classSt11, _babelHelpers$classSt12, _babelHelpers$classSt13, _babelHelpers$classSt14, _babelHelpers$classSt15, _babelHelpers$classSt16, _babelHelpers$classSt17, _babelHelpers$classSt18, _babelHelpers$classSt19, _ref13, _ref14, _babelHelpers$classSt20, _babelHelpers$classSt21, _ref15, _babelHelpers$classSt22, _ref16, _babelHelpers$classSt23, _babelHelpers$classSt24, _ref17, _babelHelpers$classSt25, _babelHelpers$classSt26, _ref18, _babelHelpers$classSt27, _ref19, _babelHelpers$classSt28, _ref20, _ref20$getSelf, _babelHelpers$classSt29, _babelHelpers$classSt30, _babelHelpers$classSt31, _babelHelpers$classSt32, _babelHelpers$classSt33, _babelHelpers$classSt34, _babelHelpers$classSt35, _ref21, _ref22, _babelHelpers$classSt36, _babelHelpers$classSt37, _ref23, _babelHelpers$classSt38, _ref24, _babelHelpers$classSt39, _babelHelpers$classSt40, _ref25, _babelHelpers$classSt41, _babelHelpers$classSt42, _ref26, _babelHelpers$classSt43, _ref27, _babelHelpers$classSt44, _ref28, _ref28$getSelf, _babelHelpers$classSt45; + var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o, _deep$very$o$Foo, _deep$very$o2, _deep$very$o2$Foo, _deep$very$o3, _deep$very$o3$Foo, _babelHelpers$assertC, _babelHelpers$assertC2, _ref, _ref$self, _ref2, _ref2$self, _self2, _self2$self, _babelHelpers$assertC3, _babelHelpers$assertC4, _ref3, _ref3$call, _ref4, _ref4$getSelf, _getSelf, _ref5, _getSelf$call, _ref6, _ref6$self, _babelHelpers$assertC5, _call, _call$self, _getSelf2, _getSelf2$self, _getSelf3, _getSelf3$self, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o, _fnDeep$very$o$Foo, _fnDeep$very$o2, _fnDeep$very$o2$Foo, _fnDeep$very$o3, _fnDeep$very$o3$Foo, _babelHelpers$assertC6, _babelHelpers$assertC7, _ref7, _ref7$self, _ref8, _ref8$self, _self3, _self3$self, _babelHelpers$assertC8, _babelHelpers$assertC9, _ref9, _ref9$call, _ref10, _ref10$getSelf, _getSelf4, _ref11, _getSelf4$call, _ref12, _ref12$self, _babelHelpers$assertC10, _call2, _call2$self, _getSelf5, _getSelf5$self, _getSelf6, _getSelf6$self, _m$_, _m$_2, _m$_3, _babelHelpers$assertC11, _babelHelpers$assertC12, _babelHelpers$assertC13, _babelHelpers$assertC14, _babelHelpers$assertC15, _babelHelpers$assertC16, _ref13, _ref14, _babelHelpers$assertC17, _babelHelpers$assertC18, _ref15, _babelHelpers$assertC19, _ref16, _babelHelpers$assertC20, _babelHelpers$assertC21, _ref17, _babelHelpers$assertC22, _babelHelpers$assertC23, _ref18, _babelHelpers$assertC24, _ref19, _babelHelpers$assertC25, _ref20, _ref20$getSelf, _babelHelpers$assertC26, _babelHelpers$assertC27, _babelHelpers$assertC28, _babelHelpers$assertC29, _babelHelpers$assertC30, _babelHelpers$assertC31, _babelHelpers$assertC32, _ref21, _ref22, _babelHelpers$assertC33, _babelHelpers$assertC34, _ref23, _babelHelpers$assertC35, _ref24, _babelHelpers$assertC36, _babelHelpers$assertC37, _ref25, _babelHelpers$assertC38, _babelHelpers$assertC39, _ref26, _babelHelpers$assertC40, _ref27, _babelHelpers$assertC41, _ref28, _ref28$getSelf, _babelHelpers$assertC42; const o = { Foo: Foo }; @@ -19,63 +19,60 @@ class Foo { function fnDeep() { return deep; } - (_babelHelpers$classSt11 = babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m)) === null || _babelHelpers$classSt11 === void 0 || _babelHelpers$classSt11.call(Foo); - (_babelHelpers$classSt12 = babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m)) === null || _babelHelpers$classSt12 === void 0 || _babelHelpers$classSt12.call(Foo).toString; - (_babelHelpers$classSt13 = babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m)) === null || _babelHelpers$classSt13 === void 0 || _babelHelpers$classSt13.call(Foo).toString(); - o === null || o === void 0 ? void 0 : (_babelHelpers$classSt14 = babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo = o.Foo, Foo, _m)) === null || _babelHelpers$classSt14 === void 0 ? void 0 : _babelHelpers$classSt14.call(_o$Foo); - o === null || o === void 0 ? void 0 : (_babelHelpers$classSt15 = babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo2 = o.Foo, Foo, _m)) === null || _babelHelpers$classSt15 === void 0 ? void 0 : _babelHelpers$classSt15.call(_o$Foo2).toString; - o === null || o === void 0 ? void 0 : (_babelHelpers$classSt16 = babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo3 = o.Foo, Foo, _m)) === null || _babelHelpers$classSt16 === void 0 ? void 0 : _babelHelpers$classSt16.call(_o$Foo3).toString(); - (_deep$very$o = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o === void 0 ? void 0 : (_babelHelpers$classSt17 = babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo = _deep$very$o.Foo, Foo, _m)) === null || _babelHelpers$classSt17 === void 0 ? void 0 : _babelHelpers$classSt17.call(_deep$very$o$Foo); - (_deep$very$o2 = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o2 === void 0 ? void 0 : (_babelHelpers$classSt18 = babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o2$Foo = _deep$very$o2.Foo, Foo, _m)) === null || _babelHelpers$classSt18 === void 0 ? void 0 : _babelHelpers$classSt18.call(_deep$very$o2$Foo).toString; - (_deep$very$o3 = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o3 === void 0 ? void 0 : (_babelHelpers$classSt19 = babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o3$Foo = _deep$very$o3.Foo, Foo, _m)) === null || _babelHelpers$classSt19 === void 0 ? void 0 : _babelHelpers$classSt19.call(_deep$very$o3$Foo).toString(); - (_ref13 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self), Foo, _m)) === null || _ref13 === void 0 || _ref13.call(_babelHelpers$classSt); - (_ref14 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt2 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self, Foo, _m)) === null || _ref14 === void 0 || _ref14.call(_babelHelpers$classSt2); - (_ref = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref === void 0 ? void 0 : (_babelHelpers$classSt20 = babelHelpers.classStaticPrivateFieldSpecGet(_ref$self = _ref.self, Foo, _m)) === null || _babelHelpers$classSt20 === void 0 ? void 0 : _babelHelpers$classSt20.call(_ref$self); - (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self) === null || _ref2 === void 0 ? void 0 : (_babelHelpers$classSt21 = babelHelpers.classStaticPrivateFieldSpecGet(_ref2$self = _ref2.self, Foo, _m)) === null || _babelHelpers$classSt21 === void 0 ? void 0 : _babelHelpers$classSt21.call(_ref2$self); - (_self2 = (_ref15 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref15 === void 0 ? void 0 : _ref15.self) === null || _self2 === void 0 ? void 0 : (_babelHelpers$classSt22 = babelHelpers.classStaticPrivateFieldSpecGet(_self2$self = _self2.self, Foo, _m)) === null || _babelHelpers$classSt22 === void 0 ? void 0 : _babelHelpers$classSt22.call(_self2$self); - (_ref16 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt3 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf(), Foo, _m)) === null || _ref16 === void 0 || _ref16.call(_babelHelpers$classSt3); - (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt4 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref3 === void 0 ? void 0 : (_babelHelpers$classSt23 = babelHelpers.classStaticPrivateFieldSpecGet(_ref3$call = _ref3.call(_babelHelpers$classSt4), Foo, _m)) === null || _babelHelpers$classSt23 === void 0 ? void 0 : _babelHelpers$classSt23.call(_ref3$call); - (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref4 === void 0 ? void 0 : (_babelHelpers$classSt24 = babelHelpers.classStaticPrivateFieldSpecGet(_ref4$getSelf = _ref4.getSelf(), Foo, _m)) === null || _babelHelpers$classSt24 === void 0 ? void 0 : _babelHelpers$classSt24.call(_ref4$getSelf); - (_getSelf = (_ref17 = _ref5 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref17 === void 0 ? void 0 : _ref17.getSelf) === null || _getSelf === void 0 ? void 0 : (_babelHelpers$classSt25 = babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$call = _getSelf.call(_ref5), Foo, _m)) === null || _babelHelpers$classSt25 === void 0 ? void 0 : _babelHelpers$classSt25.call(_getSelf$call); - (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf()) === null || _ref6 === void 0 ? void 0 : (_babelHelpers$classSt26 = babelHelpers.classStaticPrivateFieldSpecGet(_ref6$self = _ref6.self, Foo, _m)) === null || _babelHelpers$classSt26 === void 0 ? void 0 : _babelHelpers$classSt26.call(_ref6$self); - (_call = (_ref18 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt5 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref18 === void 0 ? void 0 : _ref18.call(_babelHelpers$classSt5)) === null || _call === void 0 ? void 0 : (_babelHelpers$classSt27 = babelHelpers.classStaticPrivateFieldSpecGet(_call$self = _call.self, Foo, _m)) === null || _babelHelpers$classSt27 === void 0 ? void 0 : _babelHelpers$classSt27.call(_call$self); - (_getSelf2 = (_ref19 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref19 === void 0 ? void 0 : _ref19.getSelf()) === null || _getSelf2 === void 0 ? void 0 : (_babelHelpers$classSt28 = babelHelpers.classStaticPrivateFieldSpecGet(_getSelf2$self = _getSelf2.self, Foo, _m)) === null || _babelHelpers$classSt28 === void 0 ? void 0 : _babelHelpers$classSt28.call(_getSelf2$self); - (_getSelf3 = (_ref20 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref20 === void 0 || (_ref20$getSelf = _ref20.getSelf) === null || _ref20$getSelf === void 0 ? void 0 : _ref20$getSelf.call(_ref20)) === null || _getSelf3 === void 0 ? void 0 : (_babelHelpers$classSt29 = babelHelpers.classStaticPrivateFieldSpecGet(_getSelf3$self = _getSelf3.self, Foo, _m)) === null || _babelHelpers$classSt29 === void 0 ? void 0 : _babelHelpers$classSt29.call(_getSelf3$self); - fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt30 = babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo = fn().Foo, Foo, _m)) === null || _babelHelpers$classSt30 === void 0 ? void 0 : _babelHelpers$classSt30.call(_fn$Foo); - fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt31 = babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo2 = fn().Foo, Foo, _m)) === null || _babelHelpers$classSt31 === void 0 ? void 0 : _babelHelpers$classSt31.call(_fn$Foo2).toString; - fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt32 = babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo3 = fn().Foo, Foo, _m)) === null || _babelHelpers$classSt32 === void 0 ? void 0 : _babelHelpers$classSt32.call(_fn$Foo3).toString(); - (_fnDeep$very$o = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : (_babelHelpers$classSt33 = babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo = _fnDeep$very$o.Foo, Foo, _m)) === null || _babelHelpers$classSt33 === void 0 ? void 0 : _babelHelpers$classSt33.call(_fnDeep$very$o$Foo); - (_fnDeep$very$o2 = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : (_babelHelpers$classSt34 = babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o2$Foo = _fnDeep$very$o2.Foo, Foo, _m)) === null || _babelHelpers$classSt34 === void 0 ? void 0 : _babelHelpers$classSt34.call(_fnDeep$very$o2$Foo).toString; - (_fnDeep$very$o3 = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : (_babelHelpers$classSt35 = babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o3$Foo = _fnDeep$very$o3.Foo, Foo, _m)) === null || _babelHelpers$classSt35 === void 0 ? void 0 : _babelHelpers$classSt35.call(_fnDeep$very$o3$Foo).toString(); - (_ref21 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt6 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self), Foo, _m)) === null || _ref21 === void 0 || _ref21.call(_babelHelpers$classSt6); - (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt7 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self, Foo, _m)) === null || _ref22 === void 0 || _ref22.call(_babelHelpers$classSt7); - (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref7 === void 0 ? void 0 : (_babelHelpers$classSt36 = babelHelpers.classStaticPrivateFieldSpecGet(_ref7$self = _ref7.self, Foo, _m)) === null || _babelHelpers$classSt36 === void 0 ? void 0 : _babelHelpers$classSt36.call(_ref7$self); - (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self) === null || _ref8 === void 0 ? void 0 : (_babelHelpers$classSt37 = babelHelpers.classStaticPrivateFieldSpecGet(_ref8$self = _ref8.self, Foo, _m)) === null || _babelHelpers$classSt37 === void 0 ? void 0 : _babelHelpers$classSt37.call(_ref8$self); - (_self3 = (_ref23 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref23 === void 0 ? void 0 : _ref23.self) === null || _self3 === void 0 ? void 0 : (_babelHelpers$classSt38 = babelHelpers.classStaticPrivateFieldSpecGet(_self3$self = _self3.self, Foo, _m)) === null || _babelHelpers$classSt38 === void 0 ? void 0 : _babelHelpers$classSt38.call(_self3$self); - (_ref24 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt8 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf(), Foo, _m)) === null || _ref24 === void 0 || _ref24.call(_babelHelpers$classSt8); - (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt9 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref9 === void 0 ? void 0 : (_babelHelpers$classSt39 = babelHelpers.classStaticPrivateFieldSpecGet(_ref9$call = _ref9.call(_babelHelpers$classSt9), Foo, _m)) === null || _babelHelpers$classSt39 === void 0 ? void 0 : _babelHelpers$classSt39.call(_ref9$call); - (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref10 === void 0 ? void 0 : (_babelHelpers$classSt40 = babelHelpers.classStaticPrivateFieldSpecGet(_ref10$getSelf = _ref10.getSelf(), Foo, _m)) === null || _babelHelpers$classSt40 === void 0 ? void 0 : _babelHelpers$classSt40.call(_ref10$getSelf); - (_getSelf4 = (_ref25 = _ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref25 === void 0 ? void 0 : _ref25.getSelf) === null || _getSelf4 === void 0 ? void 0 : (_babelHelpers$classSt41 = babelHelpers.classStaticPrivateFieldSpecGet(_getSelf4$call = _getSelf4.call(_ref11), Foo, _m)) === null || _babelHelpers$classSt41 === void 0 ? void 0 : _babelHelpers$classSt41.call(_getSelf4$call); - (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf()) === null || _ref12 === void 0 ? void 0 : (_babelHelpers$classSt42 = babelHelpers.classStaticPrivateFieldSpecGet(_ref12$self = _ref12.self, Foo, _m)) === null || _babelHelpers$classSt42 === void 0 ? void 0 : _babelHelpers$classSt42.call(_ref12$self); - (_call2 = (_ref26 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt10 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref26 === void 0 ? void 0 : _ref26.call(_babelHelpers$classSt10)) === null || _call2 === void 0 ? void 0 : (_babelHelpers$classSt43 = babelHelpers.classStaticPrivateFieldSpecGet(_call2$self = _call2.self, Foo, _m)) === null || _babelHelpers$classSt43 === void 0 ? void 0 : _babelHelpers$classSt43.call(_call2$self); - (_getSelf5 = (_ref27 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref27 === void 0 ? void 0 : _ref27.getSelf()) === null || _getSelf5 === void 0 ? void 0 : (_babelHelpers$classSt44 = babelHelpers.classStaticPrivateFieldSpecGet(_getSelf5$self = _getSelf5.self, Foo, _m)) === null || _babelHelpers$classSt44 === void 0 ? void 0 : _babelHelpers$classSt44.call(_getSelf5$self); - (_getSelf6 = (_ref28 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref28 === void 0 || (_ref28$getSelf = _ref28.getSelf) === null || _ref28$getSelf === void 0 ? void 0 : _ref28$getSelf.call(_ref28)) === null || _getSelf6 === void 0 ? void 0 : (_babelHelpers$classSt45 = babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6$self = _getSelf6.self, Foo, _m)) === null || _babelHelpers$classSt45 === void 0 ? void 0 : _babelHelpers$classSt45.call(_getSelf6$self); + (_m$_ = _m._) === null || _m$_ === void 0 || _m$_.call(Foo); + (_m$_2 = _m._) === null || _m$_2 === void 0 || _m$_2.call(Foo).toString; + (_m$_3 = _m._) === null || _m$_3 === void 0 || _m$_3.call(Foo).toString(); + o === null || o === void 0 ? void 0 : (_babelHelpers$assertC11 = babelHelpers.assertClassBrand(_o$Foo = o.Foo, Foo, _m)._) === null || _babelHelpers$assertC11 === void 0 ? void 0 : _babelHelpers$assertC11.call(_o$Foo); + o === null || o === void 0 ? void 0 : (_babelHelpers$assertC12 = babelHelpers.assertClassBrand(_o$Foo2 = o.Foo, Foo, _m)._) === null || _babelHelpers$assertC12 === void 0 ? void 0 : _babelHelpers$assertC12.call(_o$Foo2).toString; + o === null || o === void 0 ? void 0 : (_babelHelpers$assertC13 = babelHelpers.assertClassBrand(_o$Foo3 = o.Foo, Foo, _m)._) === null || _babelHelpers$assertC13 === void 0 ? void 0 : _babelHelpers$assertC13.call(_o$Foo3).toString(); + (_deep$very$o = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o === void 0 ? void 0 : (_babelHelpers$assertC14 = babelHelpers.assertClassBrand(_deep$very$o$Foo = _deep$very$o.Foo, Foo, _m)._) === null || _babelHelpers$assertC14 === void 0 ? void 0 : _babelHelpers$assertC14.call(_deep$very$o$Foo); + (_deep$very$o2 = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o2 === void 0 ? void 0 : (_babelHelpers$assertC15 = babelHelpers.assertClassBrand(_deep$very$o2$Foo = _deep$very$o2.Foo, Foo, _m)._) === null || _babelHelpers$assertC15 === void 0 ? void 0 : _babelHelpers$assertC15.call(_deep$very$o2$Foo).toString; + (_deep$very$o3 = deep === null || deep === void 0 ? void 0 : deep.very.o) === null || _deep$very$o3 === void 0 ? void 0 : (_babelHelpers$assertC16 = babelHelpers.assertClassBrand(_deep$very$o3$Foo = _deep$very$o3.Foo, Foo, _m)._) === null || _babelHelpers$assertC16 === void 0 ? void 0 : _babelHelpers$assertC16.call(_deep$very$o3$Foo).toString(); + (_ref13 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._, Foo, _m)._) === null || _ref13 === void 0 || _ref13.call(_babelHelpers$assertC); + (_ref14 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC2 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self, Foo, _m)._) === null || _ref14 === void 0 || _ref14.call(_babelHelpers$assertC2); + (_ref = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref === void 0 ? void 0 : (_babelHelpers$assertC17 = babelHelpers.assertClassBrand(_ref$self = _ref.self, Foo, _m)._) === null || _babelHelpers$assertC17 === void 0 ? void 0 : _babelHelpers$assertC17.call(_ref$self); + (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self) === null || _ref2 === void 0 ? void 0 : (_babelHelpers$assertC18 = babelHelpers.assertClassBrand(_ref2$self = _ref2.self, Foo, _m)._) === null || _babelHelpers$assertC18 === void 0 ? void 0 : _babelHelpers$assertC18.call(_ref2$self); + (_self2 = (_ref15 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref15 === void 0 ? void 0 : _ref15.self) === null || _self2 === void 0 ? void 0 : (_babelHelpers$assertC19 = babelHelpers.assertClassBrand(_self2$self = _self2.self, Foo, _m)._) === null || _babelHelpers$assertC19 === void 0 ? void 0 : _babelHelpers$assertC19.call(_self2$self); + (_ref16 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC3 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf(), Foo, _m)._) === null || _ref16 === void 0 || _ref16.call(_babelHelpers$assertC3); + (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC4 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref3 === void 0 ? void 0 : (_babelHelpers$assertC20 = babelHelpers.assertClassBrand(_ref3$call = _ref3.call(_babelHelpers$assertC4), Foo, _m)._) === null || _babelHelpers$assertC20 === void 0 ? void 0 : _babelHelpers$assertC20.call(_ref3$call); + (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref4 === void 0 ? void 0 : (_babelHelpers$assertC21 = babelHelpers.assertClassBrand(_ref4$getSelf = _ref4.getSelf(), Foo, _m)._) === null || _babelHelpers$assertC21 === void 0 ? void 0 : _babelHelpers$assertC21.call(_ref4$getSelf); + (_getSelf = (_ref17 = _ref5 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref17 === void 0 ? void 0 : _ref17.getSelf) === null || _getSelf === void 0 ? void 0 : (_babelHelpers$assertC22 = babelHelpers.assertClassBrand(_getSelf$call = _getSelf.call(_ref5), Foo, _m)._) === null || _babelHelpers$assertC22 === void 0 ? void 0 : _babelHelpers$assertC22.call(_getSelf$call); + (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf()) === null || _ref6 === void 0 ? void 0 : (_babelHelpers$assertC23 = babelHelpers.assertClassBrand(_ref6$self = _ref6.self, Foo, _m)._) === null || _babelHelpers$assertC23 === void 0 ? void 0 : _babelHelpers$assertC23.call(_ref6$self); + (_call = (_ref18 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC5 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref18 === void 0 ? void 0 : _ref18.call(_babelHelpers$assertC5)) === null || _call === void 0 ? void 0 : (_babelHelpers$assertC24 = babelHelpers.assertClassBrand(_call$self = _call.self, Foo, _m)._) === null || _babelHelpers$assertC24 === void 0 ? void 0 : _babelHelpers$assertC24.call(_call$self); + (_getSelf2 = (_ref19 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref19 === void 0 ? void 0 : _ref19.getSelf()) === null || _getSelf2 === void 0 ? void 0 : (_babelHelpers$assertC25 = babelHelpers.assertClassBrand(_getSelf2$self = _getSelf2.self, Foo, _m)._) === null || _babelHelpers$assertC25 === void 0 ? void 0 : _babelHelpers$assertC25.call(_getSelf2$self); + (_getSelf3 = (_ref20 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref20 === void 0 || (_ref20$getSelf = _ref20.getSelf) === null || _ref20$getSelf === void 0 ? void 0 : _ref20$getSelf.call(_ref20)) === null || _getSelf3 === void 0 ? void 0 : (_babelHelpers$assertC26 = babelHelpers.assertClassBrand(_getSelf3$self = _getSelf3.self, Foo, _m)._) === null || _babelHelpers$assertC26 === void 0 ? void 0 : _babelHelpers$assertC26.call(_getSelf3$self); + fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC27 = babelHelpers.assertClassBrand(_fn$Foo = fn().Foo, Foo, _m)._) === null || _babelHelpers$assertC27 === void 0 ? void 0 : _babelHelpers$assertC27.call(_fn$Foo); + fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC28 = babelHelpers.assertClassBrand(_fn$Foo2 = fn().Foo, Foo, _m)._) === null || _babelHelpers$assertC28 === void 0 ? void 0 : _babelHelpers$assertC28.call(_fn$Foo2).toString; + fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC29 = babelHelpers.assertClassBrand(_fn$Foo3 = fn().Foo, Foo, _m)._) === null || _babelHelpers$assertC29 === void 0 ? void 0 : _babelHelpers$assertC29.call(_fn$Foo3).toString(); + (_fnDeep$very$o = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : (_babelHelpers$assertC30 = babelHelpers.assertClassBrand(_fnDeep$very$o$Foo = _fnDeep$very$o.Foo, Foo, _m)._) === null || _babelHelpers$assertC30 === void 0 ? void 0 : _babelHelpers$assertC30.call(_fnDeep$very$o$Foo); + (_fnDeep$very$o2 = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : (_babelHelpers$assertC31 = babelHelpers.assertClassBrand(_fnDeep$very$o2$Foo = _fnDeep$very$o2.Foo, Foo, _m)._) === null || _babelHelpers$assertC31 === void 0 ? void 0 : _babelHelpers$assertC31.call(_fnDeep$very$o2$Foo).toString; + (_fnDeep$very$o3 = fnDeep === null || fnDeep === void 0 ? void 0 : fnDeep().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : (_babelHelpers$assertC32 = babelHelpers.assertClassBrand(_fnDeep$very$o3$Foo = _fnDeep$very$o3.Foo, Foo, _m)._) === null || _babelHelpers$assertC32 === void 0 ? void 0 : _babelHelpers$assertC32.call(_fnDeep$very$o3$Foo).toString(); + (_ref21 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC6 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._, Foo, _m)._) === null || _ref21 === void 0 || _ref21.call(_babelHelpers$assertC6); + (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC7 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self, Foo, _m)._) === null || _ref22 === void 0 || _ref22.call(_babelHelpers$assertC7); + (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref7 === void 0 ? void 0 : (_babelHelpers$assertC33 = babelHelpers.assertClassBrand(_ref7$self = _ref7.self, Foo, _m)._) === null || _babelHelpers$assertC33 === void 0 ? void 0 : _babelHelpers$assertC33.call(_ref7$self); + (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self) === null || _ref8 === void 0 ? void 0 : (_babelHelpers$assertC34 = babelHelpers.assertClassBrand(_ref8$self = _ref8.self, Foo, _m)._) === null || _babelHelpers$assertC34 === void 0 ? void 0 : _babelHelpers$assertC34.call(_ref8$self); + (_self3 = (_ref23 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref23 === void 0 ? void 0 : _ref23.self) === null || _self3 === void 0 ? void 0 : (_babelHelpers$assertC35 = babelHelpers.assertClassBrand(_self3$self = _self3.self, Foo, _m)._) === null || _babelHelpers$assertC35 === void 0 ? void 0 : _babelHelpers$assertC35.call(_self3$self); + (_ref24 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC8 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf(), Foo, _m)._) === null || _ref24 === void 0 || _ref24.call(_babelHelpers$assertC8); + (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC9 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref9 === void 0 ? void 0 : (_babelHelpers$assertC36 = babelHelpers.assertClassBrand(_ref9$call = _ref9.call(_babelHelpers$assertC9), Foo, _m)._) === null || _babelHelpers$assertC36 === void 0 ? void 0 : _babelHelpers$assertC36.call(_ref9$call); + (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref10 === void 0 ? void 0 : (_babelHelpers$assertC37 = babelHelpers.assertClassBrand(_ref10$getSelf = _ref10.getSelf(), Foo, _m)._) === null || _babelHelpers$assertC37 === void 0 ? void 0 : _babelHelpers$assertC37.call(_ref10$getSelf); + (_getSelf4 = (_ref25 = _ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref25 === void 0 ? void 0 : _ref25.getSelf) === null || _getSelf4 === void 0 ? void 0 : (_babelHelpers$assertC38 = babelHelpers.assertClassBrand(_getSelf4$call = _getSelf4.call(_ref11), Foo, _m)._) === null || _babelHelpers$assertC38 === void 0 ? void 0 : _babelHelpers$assertC38.call(_getSelf4$call); + (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf()) === null || _ref12 === void 0 ? void 0 : (_babelHelpers$assertC39 = babelHelpers.assertClassBrand(_ref12$self = _ref12.self, Foo, _m)._) === null || _babelHelpers$assertC39 === void 0 ? void 0 : _babelHelpers$assertC39.call(_ref12$self); + (_call2 = (_ref26 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC10 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref26 === void 0 ? void 0 : _ref26.call(_babelHelpers$assertC10)) === null || _call2 === void 0 ? void 0 : (_babelHelpers$assertC40 = babelHelpers.assertClassBrand(_call2$self = _call2.self, Foo, _m)._) === null || _babelHelpers$assertC40 === void 0 ? void 0 : _babelHelpers$assertC40.call(_call2$self); + (_getSelf5 = (_ref27 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref27 === void 0 ? void 0 : _ref27.getSelf()) === null || _getSelf5 === void 0 ? void 0 : (_babelHelpers$assertC41 = babelHelpers.assertClassBrand(_getSelf5$self = _getSelf5.self, Foo, _m)._) === null || _babelHelpers$assertC41 === void 0 ? void 0 : _babelHelpers$assertC41.call(_getSelf5$self); + (_getSelf6 = (_ref28 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref28 === void 0 || (_ref28$getSelf = _ref28.getSelf) === null || _ref28$getSelf === void 0 ? void 0 : _ref28$getSelf.call(_ref28)) === null || _getSelf6 === void 0 ? void 0 : (_babelHelpers$assertC42 = babelHelpers.assertClassBrand(_getSelf6$self = _getSelf6.self, Foo, _m)._) === null || _babelHelpers$assertC42 === void 0 ? void 0 : _babelHelpers$assertC42.call(_getSelf6$self); } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _m = { - writable: true, - value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); + _: function () { + return babelHelpers.assertClassBrand(this, _Foo, _x)._; } }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call/output.js index e078940f2ef7..ee2d08399c72 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-member-optional-call/output.js @@ -4,7 +4,7 @@ class Foo { return this; } static test() { - var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o, _deep$very$o$Foo, _deep$very$o2, _deep$very$o2$Foo, _deep$very$o3, _deep$very$o3$Foo, _babelHelpers$classSt, _babelHelpers$classSt2, _ref, _ref$self, _ref2, _ref2$self, _self2, _self2$self, _babelHelpers$classSt3, _babelHelpers$classSt4, _ref3, _ref3$call, _ref4, _ref4$getSelf, _getSelf, _ref5, _getSelf$call, _ref6, _ref6$self, _babelHelpers$classSt5, _call, _call$self, _getSelf2, _getSelf2$self, _getSelf3, _getSelf3$self, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o, _fnDeep$very$o$Foo, _fnDeep$very$o2, _fnDeep$very$o2$Foo, _fnDeep$very$o3, _fnDeep$very$o3$Foo, _babelHelpers$classSt6, _babelHelpers$classSt7, _ref7, _ref7$self, _ref8, _ref8$self, _self3, _self3$self, _babelHelpers$classSt8, _babelHelpers$classSt9, _ref9, _ref9$call, _ref10, _ref10$getSelf, _getSelf4, _ref11, _getSelf4$call, _ref12, _ref12$self, _babelHelpers$classSt10, _call2, _call2$self, _getSelf5, _getSelf5$self, _getSelf6, _getSelf6$self; + var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o, _deep$very$o$Foo, _deep$very$o2, _deep$very$o2$Foo, _deep$very$o3, _deep$very$o3$Foo, _babelHelpers$assertC, _babelHelpers$assertC2, _ref, _ref$self, _ref2, _ref2$self, _self2, _self2$self, _babelHelpers$assertC3, _babelHelpers$assertC4, _ref3, _ref3$call, _ref4, _ref4$getSelf, _getSelf, _ref5, _getSelf$call, _ref6, _ref6$self, _babelHelpers$assertC5, _call, _call$self, _getSelf2, _getSelf2$self, _getSelf3, _getSelf3$self, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o, _fnDeep$very$o$Foo, _fnDeep$very$o2, _fnDeep$very$o2$Foo, _fnDeep$very$o3, _fnDeep$very$o3$Foo, _babelHelpers$assertC6, _babelHelpers$assertC7, _ref7, _ref7$self, _ref8, _ref8$self, _self3, _self3$self, _babelHelpers$assertC8, _babelHelpers$assertC9, _ref9, _ref9$call, _ref10, _ref10$getSelf, _getSelf4, _ref11, _getSelf4$call, _ref12, _ref12$self, _babelHelpers$assertC10, _call2, _call2$self, _getSelf5, _getSelf5$self, _getSelf6, _getSelf6$self; const o = { Foo: Foo }; @@ -19,63 +19,60 @@ class Foo { function fnDeep() { return deep; } - babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m)?.call(Foo); - babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m)?.call(Foo).toString; - babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m)?.call(Foo).toString(); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo = o.Foo, Foo, _m)?.call(_o$Foo); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo2 = o.Foo, Foo, _m)?.call(_o$Foo2).toString; - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo3 = o.Foo, Foo, _m)?.call(_o$Foo3).toString(); - (_deep$very$o = deep?.very.o) === null || _deep$very$o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo = _deep$very$o.Foo, Foo, _m)?.call(_deep$very$o$Foo); - (_deep$very$o2 = deep?.very.o) === null || _deep$very$o2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o2$Foo = _deep$very$o2.Foo, Foo, _m)?.call(_deep$very$o2$Foo).toString; - (_deep$very$o3 = deep?.very.o) === null || _deep$very$o3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o3$Foo = _deep$very$o3.Foo, Foo, _m)?.call(_deep$very$o3$Foo).toString(); - (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self), Foo, _m))?.call(_babelHelpers$classSt); - (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt2 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self, Foo, _m))?.call(_babelHelpers$classSt2); - (_ref = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref$self = _ref.self, Foo, _m)?.call(_ref$self); - (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self) === null || _ref2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref2$self = _ref2.self, Foo, _m)?.call(_ref2$self); - (_self2 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.self) === null || _self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self2$self = _self2.self, Foo, _m)?.call(_self2$self); - (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt3 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf(), Foo, _m))?.call(_babelHelpers$classSt3); - (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt4 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref3$call = _ref3.call(_babelHelpers$classSt4), Foo, _m)?.call(_ref3$call); - (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref4$getSelf = _ref4.getSelf(), Foo, _m)?.call(_ref4$getSelf); - (_getSelf = (_ref5 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf) === null || _getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$call = _getSelf.call(_ref5), Foo, _m)?.call(_getSelf$call); - (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref6$self = _ref6.self, Foo, _m)?.call(_ref6$self); - (_call = (o === null || o === void 0 ? void 0 : (_babelHelpers$classSt5 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt5)) === null || _call === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call$self = _call.self, Foo, _m)?.call(_call$self); - (_getSelf2 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf2$self = _getSelf2.self, Foo, _m)?.call(_getSelf2$self); - (_getSelf3 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf?.()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf3$self = _getSelf3.self, Foo, _m)?.call(_getSelf3$self); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo = fn().Foo, Foo, _m)?.call(_fn$Foo); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo2 = fn().Foo, Foo, _m)?.call(_fn$Foo2).toString; - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo3 = fn().Foo, Foo, _m)?.call(_fn$Foo3).toString(); - (_fnDeep$very$o = fnDeep?.().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo = _fnDeep$very$o.Foo, Foo, _m)?.call(_fnDeep$very$o$Foo); - (_fnDeep$very$o2 = fnDeep?.().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o2$Foo = _fnDeep$very$o2.Foo, Foo, _m)?.call(_fnDeep$very$o2$Foo).toString; - (_fnDeep$very$o3 = fnDeep?.().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o3$Foo = _fnDeep$very$o3.Foo, Foo, _m)?.call(_fnDeep$very$o3$Foo).toString(); - (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt6 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self), Foo, _m))?.call(_babelHelpers$classSt6); - (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt7 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self, Foo, _m))?.call(_babelHelpers$classSt7); - (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref7 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref7$self = _ref7.self, Foo, _m)?.call(_ref7$self); - (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self) === null || _ref8 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref8$self = _ref8.self, Foo, _m)?.call(_ref8$self); - (_self3 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.self) === null || _self3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self3$self = _self3.self, Foo, _m)?.call(_self3$self); - (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt8 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf(), Foo, _m))?.call(_babelHelpers$classSt8); - (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt9 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref9 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref9$call = _ref9.call(_babelHelpers$classSt9), Foo, _m)?.call(_ref9$call); - (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref10 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref10$getSelf = _ref10.getSelf(), Foo, _m)?.call(_ref10$getSelf); - (_getSelf4 = (_ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf4$call = _getSelf4.call(_ref11), Foo, _m)?.call(_getSelf4$call); - (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf()) === null || _ref12 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref12$self = _ref12.self, Foo, _m)?.call(_ref12$self); - (_call2 = (fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt10 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt10)) === null || _call2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call2$self = _call2.self, Foo, _m)?.call(_call2$self); - (_getSelf5 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf()) === null || _getSelf5 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf5$self = _getSelf5.self, Foo, _m)?.call(_getSelf5$self); - (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6$self = _getSelf6.self, Foo, _m)?.call(_getSelf6$self); + _m._?.call(Foo); + _m._?.call(Foo).toString; + _m._?.call(Foo).toString(); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo = o.Foo, Foo, _m)._?.call(_o$Foo); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo2 = o.Foo, Foo, _m)._?.call(_o$Foo2).toString; + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo3 = o.Foo, Foo, _m)._?.call(_o$Foo3).toString(); + (_deep$very$o = deep?.very.o) === null || _deep$very$o === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo = _deep$very$o.Foo, Foo, _m)._?.call(_deep$very$o$Foo); + (_deep$very$o2 = deep?.very.o) === null || _deep$very$o2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o2$Foo = _deep$very$o2.Foo, Foo, _m)._?.call(_deep$very$o2$Foo).toString; + (_deep$very$o3 = deep?.very.o) === null || _deep$very$o3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o3$Foo = _deep$very$o3.Foo, Foo, _m)._?.call(_deep$very$o3$Foo).toString(); + (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._, Foo, _m)._)?.call(_babelHelpers$assertC); + (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC2 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self, Foo, _m)._)?.call(_babelHelpers$assertC2); + (_ref = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref$self = _ref.self, Foo, _m)._?.call(_ref$self); + (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self) === null || _ref2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref2$self = _ref2.self, Foo, _m)._?.call(_ref2$self); + (_self2 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.self) === null || _self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self2$self = _self2.self, Foo, _m)._?.call(_self2$self); + (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC3 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf(), Foo, _m)._)?.call(_babelHelpers$assertC3); + (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC4 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref3$call = _ref3.call(_babelHelpers$assertC4), Foo, _m)._?.call(_ref3$call); + (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref4$getSelf = _ref4.getSelf(), Foo, _m)._?.call(_ref4$getSelf); + (_getSelf = (_ref5 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf) === null || _getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$call = _getSelf.call(_ref5), Foo, _m)._?.call(_getSelf$call); + (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref6$self = _ref6.self, Foo, _m)._?.call(_ref6$self); + (_call = (o === null || o === void 0 ? void 0 : (_babelHelpers$assertC5 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC5)) === null || _call === void 0 ? void 0 : babelHelpers.assertClassBrand(_call$self = _call.self, Foo, _m)._?.call(_call$self); + (_getSelf2 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf2$self = _getSelf2.self, Foo, _m)._?.call(_getSelf2$self); + (_getSelf3 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf?.()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf3$self = _getSelf3.self, Foo, _m)._?.call(_getSelf3$self); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo = fn().Foo, Foo, _m)._?.call(_fn$Foo); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo2 = fn().Foo, Foo, _m)._?.call(_fn$Foo2).toString; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo3 = fn().Foo, Foo, _m)._?.call(_fn$Foo3).toString(); + (_fnDeep$very$o = fnDeep?.().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo = _fnDeep$very$o.Foo, Foo, _m)._?.call(_fnDeep$very$o$Foo); + (_fnDeep$very$o2 = fnDeep?.().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o2$Foo = _fnDeep$very$o2.Foo, Foo, _m)._?.call(_fnDeep$very$o2$Foo).toString; + (_fnDeep$very$o3 = fnDeep?.().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o3$Foo = _fnDeep$very$o3.Foo, Foo, _m)._?.call(_fnDeep$very$o3$Foo).toString(); + (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC6 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._, Foo, _m)._)?.call(_babelHelpers$assertC6); + (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC7 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self, Foo, _m)._)?.call(_babelHelpers$assertC7); + (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref7 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref7$self = _ref7.self, Foo, _m)._?.call(_ref7$self); + (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self) === null || _ref8 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref8$self = _ref8.self, Foo, _m)._?.call(_ref8$self); + (_self3 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.self) === null || _self3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self3$self = _self3.self, Foo, _m)._?.call(_self3$self); + (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC8 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf(), Foo, _m)._)?.call(_babelHelpers$assertC8); + (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC9 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref9 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref9$call = _ref9.call(_babelHelpers$assertC9), Foo, _m)._?.call(_ref9$call); + (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref10 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref10$getSelf = _ref10.getSelf(), Foo, _m)._?.call(_ref10$getSelf); + (_getSelf4 = (_ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf4$call = _getSelf4.call(_ref11), Foo, _m)._?.call(_getSelf4$call); + (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf()) === null || _ref12 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref12$self = _ref12.self, Foo, _m)._?.call(_ref12$self); + (_call2 = (fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC10 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC10)) === null || _call2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_call2$self = _call2.self, Foo, _m)._?.call(_call2$self); + (_getSelf5 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf()) === null || _getSelf5 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf5$self = _getSelf5.self, Foo, _m)._?.call(_getSelf5$self); + (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf6$self = _getSelf6.self, Foo, _m)._?.call(_getSelf6$self); } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _m = { - writable: true, - value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); + _: function () { + return babelHelpers.assertClassBrand(this, _Foo, _x)._; } }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call-with-transform/output.js index f3cd8eb3fbd0..98864a8194d8 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call-with-transform/output.js @@ -4,7 +4,7 @@ class Foo { return this; } static test() { - var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o$Foo, _deep$very$o$Foo2, _deep$very$o$Foo3, _ref, _ref2, _self2, _self3, _self$self, _ref3, _babelHelpers$classSt, _call, _getSelf, _getSelf2, _self4, _babelHelpers$classSt2, _call$self, _getSelf$self, _getSelf$self2, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o$Foo, _fnDeep$very$o$Foo2, _fnDeep$very$o$Foo3, _ref4, _ref5, _self5, _self6, _self$self2, _ref6, _babelHelpers$classSt3, _call2, _getSelf3, _getSelf4, _self7, _babelHelpers$classSt4, _call$self2, _getSelf$self3, _getSelf$self4, _deep$very$o, _deep$very$o2, _deep$very$o3, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref12$getSelf, _ref13, _ref14, _ref15, _ref16, _ref16$getSelf, _fnDeep$very$o, _fnDeep$very$o2, _fnDeep$very$o3, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref22$getSelf, _ref23, _ref24, _ref25, _ref26, _ref26$getSelf; + var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o$Foo, _deep$very$o$Foo2, _deep$very$o$Foo3, _ref, _ref2, _self2, _self3, _self$self, _ref3, _babelHelpers$assertC, _call, _getSelf, _getSelf2, _self4, _babelHelpers$assertC2, _call$self, _getSelf$self, _getSelf$self2, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o$Foo, _fnDeep$very$o$Foo2, _fnDeep$very$o$Foo3, _ref4, _ref5, _self5, _self6, _self$self2, _ref6, _babelHelpers$assertC3, _call2, _getSelf3, _getSelf4, _self7, _babelHelpers$assertC4, _call$self2, _getSelf$self3, _getSelf$self4, _deep$very$o, _deep$very$o2, _deep$very$o3, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref12$getSelf, _ref13, _ref14, _ref15, _ref16, _ref16$getSelf, _fnDeep$very$o, _fnDeep$very$o2, _fnDeep$very$o3, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref22$getSelf, _ref23, _ref24, _ref25, _ref26, _ref26$getSelf; const o = { Foo: Foo }; @@ -19,63 +19,60 @@ class Foo { function fnDeep() { return deep; } - Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).call(Foo); - Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).call(Foo).toString; - Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).call(Foo).toString(); - (_o$Foo = o === null || o === void 0 ? void 0 : o.Foo) === null || _o$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo, Foo, _m).call(_o$Foo); - (_o$Foo2 = o === null || o === void 0 ? void 0 : o.Foo) === null || _o$Foo2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo2, Foo, _m).call(_o$Foo2).toString; - (_o$Foo3 = o === null || o === void 0 ? void 0 : o.Foo) === null || _o$Foo3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo3, Foo, _m).call(_o$Foo3).toString(); - (_deep$very$o$Foo = deep === null || deep === void 0 || (_deep$very$o = deep.very.o) === null || _deep$very$o === void 0 ? void 0 : _deep$very$o.Foo) === null || _deep$very$o$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo, Foo, _m).call(_deep$very$o$Foo); - (_deep$very$o$Foo2 = deep === null || deep === void 0 || (_deep$very$o2 = deep.very.o) === null || _deep$very$o2 === void 0 ? void 0 : _deep$very$o2.Foo) === null || _deep$very$o$Foo2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo2, Foo, _m).call(_deep$very$o$Foo2).toString; - (_deep$very$o$Foo3 = deep === null || deep === void 0 || (_deep$very$o3 = deep.very.o) === null || _deep$very$o3 === void 0 ? void 0 : _deep$very$o3.Foo) === null || _deep$very$o$Foo3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo3, Foo, _m).call(_deep$very$o$Foo3).toString(); - (_ref = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref, Foo, _m).call(_ref); - (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self) === null || _ref2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref2, Foo, _m).call(_ref2); - (_self2 = (_ref7 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref7 === void 0 ? void 0 : _ref7.self) === null || _self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self2, Foo, _m).call(_self2); - (_self3 = (_ref8 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self) === null || _ref8 === void 0 ? void 0 : _ref8.self) === null || _self3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self3, Foo, _m).call(_self3); - (_self$self = (_ref9 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref9 === void 0 || (_ref9 = _ref9.self) === null || _ref9 === void 0 ? void 0 : _ref9.self) === null || _self$self === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self$self, Foo, _m).call(_self$self); - (_ref3 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf()) === null || _ref3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref3, Foo, _m).call(_ref3); - (_call = (_ref10 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref10 === void 0 ? void 0 : _ref10.call(_babelHelpers$classSt)) === null || _call === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call, Foo, _m).call(_call); - (_getSelf = (_ref11 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref11 === void 0 ? void 0 : _ref11.getSelf()) === null || _getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf, Foo, _m).call(_getSelf); - (_getSelf2 = (_ref12 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref12 === void 0 || (_ref12$getSelf = _ref12.getSelf) === null || _ref12$getSelf === void 0 ? void 0 : _ref12$getSelf.call(_ref12)) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf2, Foo, _m).call(_getSelf2); - (_self4 = (_ref13 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf()) === null || _ref13 === void 0 ? void 0 : _ref13.self) === null || _self4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self4, Foo, _m).call(_self4); - (_call$self = (_ref14 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt2 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref14 === void 0 || (_ref14 = _ref14.call(_babelHelpers$classSt2)) === null || _ref14 === void 0 ? void 0 : _ref14.self) === null || _call$self === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call$self, Foo, _m).call(_call$self); - (_getSelf$self = (_ref15 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref15 === void 0 || (_ref15 = _ref15.getSelf()) === null || _ref15 === void 0 ? void 0 : _ref15.self) === null || _getSelf$self === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self, Foo, _m).call(_getSelf$self); - (_getSelf$self2 = (_ref16 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref16 === void 0 || (_ref16$getSelf = _ref16.getSelf) === null || _ref16$getSelf === void 0 || (_ref16$getSelf = _ref16$getSelf.call(_ref16)) === null || _ref16$getSelf === void 0 ? void 0 : _ref16$getSelf.self) === null || _getSelf$self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self2, Foo, _m).call(_getSelf$self2); - (_fn$Foo = fn === null || fn === void 0 ? void 0 : fn().Foo) === null || _fn$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo, Foo, _m).call(_fn$Foo); - (_fn$Foo2 = fn === null || fn === void 0 ? void 0 : fn().Foo) === null || _fn$Foo2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo2, Foo, _m).call(_fn$Foo2).toString; - (_fn$Foo3 = fn === null || fn === void 0 ? void 0 : fn().Foo) === null || _fn$Foo3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo3, Foo, _m).call(_fn$Foo3).toString(); - (_fnDeep$very$o$Foo = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o = fnDeep().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : _fnDeep$very$o.Foo) === null || _fnDeep$very$o$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo, Foo, _m).call(_fnDeep$very$o$Foo); - (_fnDeep$very$o$Foo2 = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o2 = fnDeep().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : _fnDeep$very$o2.Foo) === null || _fnDeep$very$o$Foo2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo2, Foo, _m).call(_fnDeep$very$o$Foo2).toString; - (_fnDeep$very$o$Foo3 = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o3 = fnDeep().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : _fnDeep$very$o3.Foo) === null || _fnDeep$very$o$Foo3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo3, Foo, _m).call(_fnDeep$very$o$Foo3).toString(); - (_ref4 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref4, Foo, _m).call(_ref4); - (_ref5 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self) === null || _ref5 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref5, Foo, _m).call(_ref5); - (_self5 = (_ref17 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref17 === void 0 ? void 0 : _ref17.self) === null || _self5 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self5, Foo, _m).call(_self5); - (_self6 = (_ref18 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self) === null || _ref18 === void 0 ? void 0 : _ref18.self) === null || _self6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self6, Foo, _m).call(_self6); - (_self$self2 = (_ref19 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref19 === void 0 || (_ref19 = _ref19.self) === null || _ref19 === void 0 ? void 0 : _ref19.self) === null || _self$self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self$self2, Foo, _m).call(_self$self2); - (_ref6 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref6, Foo, _m).call(_ref6); - (_call2 = (_ref20 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt3 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref20 === void 0 ? void 0 : _ref20.call(_babelHelpers$classSt3)) === null || _call2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call2, Foo, _m).call(_call2); - (_getSelf3 = (_ref21 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref21 === void 0 ? void 0 : _ref21.getSelf()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf3, Foo, _m).call(_getSelf3); - (_getSelf4 = (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref22 === void 0 || (_ref22$getSelf = _ref22.getSelf) === null || _ref22$getSelf === void 0 ? void 0 : _ref22$getSelf.call(_ref22)) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf4, Foo, _m).call(_getSelf4); - (_self7 = (_ref23 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf()) === null || _ref23 === void 0 ? void 0 : _ref23.self) === null || _self7 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self7, Foo, _m).call(_self7); - (_call$self2 = (_ref24 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt4 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref24 === void 0 || (_ref24 = _ref24.call(_babelHelpers$classSt4)) === null || _ref24 === void 0 ? void 0 : _ref24.self) === null || _call$self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call$self2, Foo, _m).call(_call$self2); - (_getSelf$self3 = (_ref25 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref25 === void 0 || (_ref25 = _ref25.getSelf()) === null || _ref25 === void 0 ? void 0 : _ref25.self) === null || _getSelf$self3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self3, Foo, _m).call(_getSelf$self3); - (_getSelf$self4 = (_ref26 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref26 === void 0 || (_ref26$getSelf = _ref26.getSelf) === null || _ref26$getSelf === void 0 || (_ref26$getSelf = _ref26$getSelf.call(_ref26)) === null || _ref26$getSelf === void 0 ? void 0 : _ref26$getSelf.self) === null || _getSelf$self4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self4, Foo, _m).call(_getSelf$self4); + Foo === null || Foo === void 0 ? void 0 : _m._.call(Foo); + Foo === null || Foo === void 0 ? void 0 : _m._.call(Foo).toString; + Foo === null || Foo === void 0 ? void 0 : _m._.call(Foo).toString(); + (_o$Foo = o === null || o === void 0 ? void 0 : o.Foo) === null || _o$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo, Foo, _m)._.call(_o$Foo); + (_o$Foo2 = o === null || o === void 0 ? void 0 : o.Foo) === null || _o$Foo2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo2, Foo, _m)._.call(_o$Foo2).toString; + (_o$Foo3 = o === null || o === void 0 ? void 0 : o.Foo) === null || _o$Foo3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo3, Foo, _m)._.call(_o$Foo3).toString(); + (_deep$very$o$Foo = deep === null || deep === void 0 || (_deep$very$o = deep.very.o) === null || _deep$very$o === void 0 ? void 0 : _deep$very$o.Foo) === null || _deep$very$o$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo, Foo, _m)._.call(_deep$very$o$Foo); + (_deep$very$o$Foo2 = deep === null || deep === void 0 || (_deep$very$o2 = deep.very.o) === null || _deep$very$o2 === void 0 ? void 0 : _deep$very$o2.Foo) === null || _deep$very$o$Foo2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo2, Foo, _m)._.call(_deep$very$o$Foo2).toString; + (_deep$very$o$Foo3 = deep === null || deep === void 0 || (_deep$very$o3 = deep.very.o) === null || _deep$very$o3 === void 0 ? void 0 : _deep$very$o3.Foo) === null || _deep$very$o$Foo3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo3, Foo, _m)._.call(_deep$very$o$Foo3).toString(); + (_ref = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref, Foo, _m)._.call(_ref); + (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self) === null || _ref2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref2, Foo, _m)._.call(_ref2); + (_self2 = (_ref7 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref7 === void 0 ? void 0 : _ref7.self) === null || _self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self2, Foo, _m)._.call(_self2); + (_self3 = (_ref8 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self) === null || _ref8 === void 0 ? void 0 : _ref8.self) === null || _self3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self3, Foo, _m)._.call(_self3); + (_self$self = (_ref9 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref9 === void 0 || (_ref9 = _ref9.self) === null || _ref9 === void 0 ? void 0 : _ref9.self) === null || _self$self === void 0 ? void 0 : babelHelpers.assertClassBrand(_self$self, Foo, _m)._.call(_self$self); + (_ref3 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf()) === null || _ref3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref3, Foo, _m)._.call(_ref3); + (_call = (_ref10 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref10 === void 0 ? void 0 : _ref10.call(_babelHelpers$assertC)) === null || _call === void 0 ? void 0 : babelHelpers.assertClassBrand(_call, Foo, _m)._.call(_call); + (_getSelf = (_ref11 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref11 === void 0 ? void 0 : _ref11.getSelf()) === null || _getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf, Foo, _m)._.call(_getSelf); + (_getSelf2 = (_ref12 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref12 === void 0 || (_ref12$getSelf = _ref12.getSelf) === null || _ref12$getSelf === void 0 ? void 0 : _ref12$getSelf.call(_ref12)) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf2, Foo, _m)._.call(_getSelf2); + (_self4 = (_ref13 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf()) === null || _ref13 === void 0 ? void 0 : _ref13.self) === null || _self4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self4, Foo, _m)._.call(_self4); + (_call$self = (_ref14 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC2 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref14 === void 0 || (_ref14 = _ref14.call(_babelHelpers$assertC2)) === null || _ref14 === void 0 ? void 0 : _ref14.self) === null || _call$self === void 0 ? void 0 : babelHelpers.assertClassBrand(_call$self, Foo, _m)._.call(_call$self); + (_getSelf$self = (_ref15 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref15 === void 0 || (_ref15 = _ref15.getSelf()) === null || _ref15 === void 0 ? void 0 : _ref15.self) === null || _getSelf$self === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self, Foo, _m)._.call(_getSelf$self); + (_getSelf$self2 = (_ref16 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref16 === void 0 || (_ref16$getSelf = _ref16.getSelf) === null || _ref16$getSelf === void 0 || (_ref16$getSelf = _ref16$getSelf.call(_ref16)) === null || _ref16$getSelf === void 0 ? void 0 : _ref16$getSelf.self) === null || _getSelf$self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self2, Foo, _m)._.call(_getSelf$self2); + (_fn$Foo = fn === null || fn === void 0 ? void 0 : fn().Foo) === null || _fn$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo, Foo, _m)._.call(_fn$Foo); + (_fn$Foo2 = fn === null || fn === void 0 ? void 0 : fn().Foo) === null || _fn$Foo2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo2, Foo, _m)._.call(_fn$Foo2).toString; + (_fn$Foo3 = fn === null || fn === void 0 ? void 0 : fn().Foo) === null || _fn$Foo3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo3, Foo, _m)._.call(_fn$Foo3).toString(); + (_fnDeep$very$o$Foo = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o = fnDeep().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : _fnDeep$very$o.Foo) === null || _fnDeep$very$o$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo, Foo, _m)._.call(_fnDeep$very$o$Foo); + (_fnDeep$very$o$Foo2 = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o2 = fnDeep().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : _fnDeep$very$o2.Foo) === null || _fnDeep$very$o$Foo2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo2, Foo, _m)._.call(_fnDeep$very$o$Foo2).toString; + (_fnDeep$very$o$Foo3 = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o3 = fnDeep().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : _fnDeep$very$o3.Foo) === null || _fnDeep$very$o$Foo3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo3, Foo, _m)._.call(_fnDeep$very$o$Foo3).toString(); + (_ref4 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref4, Foo, _m)._.call(_ref4); + (_ref5 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self) === null || _ref5 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref5, Foo, _m)._.call(_ref5); + (_self5 = (_ref17 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref17 === void 0 ? void 0 : _ref17.self) === null || _self5 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self5, Foo, _m)._.call(_self5); + (_self6 = (_ref18 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self) === null || _ref18 === void 0 ? void 0 : _ref18.self) === null || _self6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self6, Foo, _m)._.call(_self6); + (_self$self2 = (_ref19 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref19 === void 0 || (_ref19 = _ref19.self) === null || _ref19 === void 0 ? void 0 : _ref19.self) === null || _self$self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self$self2, Foo, _m)._.call(_self$self2); + (_ref6 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref6, Foo, _m)._.call(_ref6); + (_call2 = (_ref20 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC3 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref20 === void 0 ? void 0 : _ref20.call(_babelHelpers$assertC3)) === null || _call2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_call2, Foo, _m)._.call(_call2); + (_getSelf3 = (_ref21 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref21 === void 0 ? void 0 : _ref21.getSelf()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf3, Foo, _m)._.call(_getSelf3); + (_getSelf4 = (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref22 === void 0 || (_ref22$getSelf = _ref22.getSelf) === null || _ref22$getSelf === void 0 ? void 0 : _ref22$getSelf.call(_ref22)) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf4, Foo, _m)._.call(_getSelf4); + (_self7 = (_ref23 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf()) === null || _ref23 === void 0 ? void 0 : _ref23.self) === null || _self7 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self7, Foo, _m)._.call(_self7); + (_call$self2 = (_ref24 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC4 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref24 === void 0 || (_ref24 = _ref24.call(_babelHelpers$assertC4)) === null || _ref24 === void 0 ? void 0 : _ref24.self) === null || _call$self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_call$self2, Foo, _m)._.call(_call$self2); + (_getSelf$self3 = (_ref25 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref25 === void 0 || (_ref25 = _ref25.getSelf()) === null || _ref25 === void 0 ? void 0 : _ref25.self) === null || _getSelf$self3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self3, Foo, _m)._.call(_getSelf$self3); + (_getSelf$self4 = (_ref26 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref26 === void 0 || (_ref26$getSelf = _ref26.getSelf) === null || _ref26$getSelf === void 0 || (_ref26$getSelf = _ref26$getSelf.call(_ref26)) === null || _ref26$getSelf === void 0 ? void 0 : _ref26$getSelf.self) === null || _getSelf$self4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self4, Foo, _m)._.call(_getSelf$self4); } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _m = { - writable: true, - value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); + _: function () { + return babelHelpers.assertClassBrand(this, _Foo, _x)._; } }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call/output.js index ae7668491b76..088cd0fa2f50 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-member-call/output.js @@ -4,7 +4,7 @@ class Foo { return this; } static test() { - var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o, _deep$very$o$Foo, _deep$very$o2, _deep$very$o2$Foo, _deep$very$o3, _deep$very$o3$Foo, _babelHelpers$classSt, _babelHelpers$classSt2, _ref, _ref$self, _ref2, _ref2$self, _self2, _self2$self, _babelHelpers$classSt3, _babelHelpers$classSt4, _ref3, _ref3$call, _ref4, _ref4$getSelf, _getSelf, _ref5, _getSelf$call, _ref6, _ref6$self, _babelHelpers$classSt5, _call, _call$self, _getSelf2, _getSelf2$self, _getSelf3, _getSelf3$self, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o, _fnDeep$very$o$Foo, _fnDeep$very$o2, _fnDeep$very$o2$Foo, _fnDeep$very$o3, _fnDeep$very$o3$Foo, _babelHelpers$classSt6, _babelHelpers$classSt7, _ref7, _ref7$self, _ref8, _ref8$self, _self3, _self3$self, _babelHelpers$classSt8, _babelHelpers$classSt9, _ref9, _ref9$call, _ref10, _ref10$getSelf, _getSelf4, _ref11, _getSelf4$call, _ref12, _ref12$self, _babelHelpers$classSt10, _call2, _call2$self, _getSelf5, _getSelf5$self, _getSelf6, _getSelf6$self; + var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o, _deep$very$o$Foo, _deep$very$o2, _deep$very$o2$Foo, _deep$very$o3, _deep$very$o3$Foo, _babelHelpers$assertC, _babelHelpers$assertC2, _ref, _ref$self, _ref2, _ref2$self, _self2, _self2$self, _babelHelpers$assertC3, _babelHelpers$assertC4, _ref3, _ref3$call, _ref4, _ref4$getSelf, _getSelf, _ref5, _getSelf$call, _ref6, _ref6$self, _babelHelpers$assertC5, _call, _call$self, _getSelf2, _getSelf2$self, _getSelf3, _getSelf3$self, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o, _fnDeep$very$o$Foo, _fnDeep$very$o2, _fnDeep$very$o2$Foo, _fnDeep$very$o3, _fnDeep$very$o3$Foo, _babelHelpers$assertC6, _babelHelpers$assertC7, _ref7, _ref7$self, _ref8, _ref8$self, _self3, _self3$self, _babelHelpers$assertC8, _babelHelpers$assertC9, _ref9, _ref9$call, _ref10, _ref10$getSelf, _getSelf4, _ref11, _getSelf4$call, _ref12, _ref12$self, _babelHelpers$assertC10, _call2, _call2$self, _getSelf5, _getSelf5$self, _getSelf6, _getSelf6$self; const o = { Foo: Foo }; @@ -19,63 +19,60 @@ class Foo { function fnDeep() { return deep; } - Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).call(Foo); - Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).call(Foo).toString; - Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).call(Foo).toString(); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo = o.Foo, Foo, _m).call(_o$Foo); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo2 = o.Foo, Foo, _m).call(_o$Foo2).toString; - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo3 = o.Foo, Foo, _m).call(_o$Foo3).toString(); - (_deep$very$o = deep?.very.o) === null || _deep$very$o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo = _deep$very$o.Foo, Foo, _m).call(_deep$very$o$Foo); - (_deep$very$o2 = deep?.very.o) === null || _deep$very$o2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o2$Foo = _deep$very$o2.Foo, Foo, _m).call(_deep$very$o2$Foo).toString; - (_deep$very$o3 = deep?.very.o) === null || _deep$very$o3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o3$Foo = _deep$very$o3.Foo, Foo, _m).call(_deep$very$o3$Foo).toString(); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self), Foo, _m).call(_babelHelpers$classSt); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt2 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self, Foo, _m).call(_babelHelpers$classSt2); - (_ref = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref$self = _ref.self, Foo, _m).call(_ref$self); - (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self) === null || _ref2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref2$self = _ref2.self, Foo, _m).call(_ref2$self); - (_self2 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.self) === null || _self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self2$self = _self2.self, Foo, _m).call(_self2$self); - o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt3 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf(), Foo, _m).call(_babelHelpers$classSt3); - (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt4 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref3$call = _ref3.call(_babelHelpers$classSt4), Foo, _m).call(_ref3$call); - (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref4$getSelf = _ref4.getSelf(), Foo, _m).call(_ref4$getSelf); - (_getSelf = (_ref5 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf) === null || _getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$call = _getSelf.call(_ref5), Foo, _m).call(_getSelf$call); - (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref6$self = _ref6.self, Foo, _m).call(_ref6$self); - (_call = (o === null || o === void 0 ? void 0 : (_babelHelpers$classSt5 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt5)) === null || _call === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call$self = _call.self, Foo, _m).call(_call$self); - (_getSelf2 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf2$self = _getSelf2.self, Foo, _m).call(_getSelf2$self); - (_getSelf3 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf?.()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf3$self = _getSelf3.self, Foo, _m).call(_getSelf3$self); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo = fn().Foo, Foo, _m).call(_fn$Foo); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo2 = fn().Foo, Foo, _m).call(_fn$Foo2).toString; - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo3 = fn().Foo, Foo, _m).call(_fn$Foo3).toString(); - (_fnDeep$very$o = fnDeep?.().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo = _fnDeep$very$o.Foo, Foo, _m).call(_fnDeep$very$o$Foo); - (_fnDeep$very$o2 = fnDeep?.().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o2$Foo = _fnDeep$very$o2.Foo, Foo, _m).call(_fnDeep$very$o2$Foo).toString; - (_fnDeep$very$o3 = fnDeep?.().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o3$Foo = _fnDeep$very$o3.Foo, Foo, _m).call(_fnDeep$very$o3$Foo).toString(); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt6 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self), Foo, _m).call(_babelHelpers$classSt6); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt7 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self, Foo, _m).call(_babelHelpers$classSt7); - (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref7 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref7$self = _ref7.self, Foo, _m).call(_ref7$self); - (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self) === null || _ref8 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref8$self = _ref8.self, Foo, _m).call(_ref8$self); - (_self3 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.self) === null || _self3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self3$self = _self3.self, Foo, _m).call(_self3$self); - fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_babelHelpers$classSt8 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf(), Foo, _m).call(_babelHelpers$classSt8); - (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt9 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref9 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref9$call = _ref9.call(_babelHelpers$classSt9), Foo, _m).call(_ref9$call); - (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref10 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref10$getSelf = _ref10.getSelf(), Foo, _m).call(_ref10$getSelf); - (_getSelf4 = (_ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf4$call = _getSelf4.call(_ref11), Foo, _m).call(_getSelf4$call); - (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf()) === null || _ref12 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref12$self = _ref12.self, Foo, _m).call(_ref12$self); - (_call2 = (fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt10 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt10)) === null || _call2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call2$self = _call2.self, Foo, _m).call(_call2$self); - (_getSelf5 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf()) === null || _getSelf5 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf5$self = _getSelf5.self, Foo, _m).call(_getSelf5$self); - (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf6$self = _getSelf6.self, Foo, _m).call(_getSelf6$self); + Foo === null || Foo === void 0 ? void 0 : _m._.call(Foo); + Foo === null || Foo === void 0 ? void 0 : _m._.call(Foo).toString; + Foo === null || Foo === void 0 ? void 0 : _m._.call(Foo).toString(); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo = o.Foo, Foo, _m)._.call(_o$Foo); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo2 = o.Foo, Foo, _m)._.call(_o$Foo2).toString; + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo3 = o.Foo, Foo, _m)._.call(_o$Foo3).toString(); + (_deep$very$o = deep?.very.o) === null || _deep$very$o === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo = _deep$very$o.Foo, Foo, _m)._.call(_deep$very$o$Foo); + (_deep$very$o2 = deep?.very.o) === null || _deep$very$o2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o2$Foo = _deep$very$o2.Foo, Foo, _m)._.call(_deep$very$o2$Foo).toString; + (_deep$very$o3 = deep?.very.o) === null || _deep$very$o3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o3$Foo = _deep$very$o3.Foo, Foo, _m)._.call(_deep$very$o3$Foo).toString(); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._, Foo, _m)._.call(_babelHelpers$assertC); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC2 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self, Foo, _m)._.call(_babelHelpers$assertC2); + (_ref = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref$self = _ref.self, Foo, _m)._.call(_ref$self); + (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self) === null || _ref2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref2$self = _ref2.self, Foo, _m)._.call(_ref2$self); + (_self2 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.self) === null || _self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self2$self = _self2.self, Foo, _m)._.call(_self2$self); + o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC3 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf(), Foo, _m)._.call(_babelHelpers$assertC3); + (_ref3 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC4 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref3$call = _ref3.call(_babelHelpers$assertC4), Foo, _m)._.call(_ref3$call); + (_ref4 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref4$getSelf = _ref4.getSelf(), Foo, _m)._.call(_ref4$getSelf); + (_getSelf = (_ref5 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf) === null || _getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$call = _getSelf.call(_ref5), Foo, _m)._.call(_getSelf$call); + (_ref6 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref6$self = _ref6.self, Foo, _m)._.call(_ref6$self); + (_call = (o === null || o === void 0 ? void 0 : (_babelHelpers$assertC5 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC5)) === null || _call === void 0 ? void 0 : babelHelpers.assertClassBrand(_call$self = _call.self, Foo, _m)._.call(_call$self); + (_getSelf2 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf2$self = _getSelf2.self, Foo, _m)._.call(_getSelf2$self); + (_getSelf3 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf?.()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf3$self = _getSelf3.self, Foo, _m)._.call(_getSelf3$self); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo = fn().Foo, Foo, _m)._.call(_fn$Foo); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo2 = fn().Foo, Foo, _m)._.call(_fn$Foo2).toString; + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo3 = fn().Foo, Foo, _m)._.call(_fn$Foo3).toString(); + (_fnDeep$very$o = fnDeep?.().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo = _fnDeep$very$o.Foo, Foo, _m)._.call(_fnDeep$very$o$Foo); + (_fnDeep$very$o2 = fnDeep?.().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o2$Foo = _fnDeep$very$o2.Foo, Foo, _m)._.call(_fnDeep$very$o2$Foo).toString; + (_fnDeep$very$o3 = fnDeep?.().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o3$Foo = _fnDeep$very$o3.Foo, Foo, _m)._.call(_fnDeep$very$o3$Foo).toString(); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC6 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._, Foo, _m)._.call(_babelHelpers$assertC6); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC7 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self, Foo, _m)._.call(_babelHelpers$assertC7); + (_ref7 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref7 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref7$self = _ref7.self, Foo, _m)._.call(_ref7$self); + (_ref8 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self) === null || _ref8 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref8$self = _ref8.self, Foo, _m)._.call(_ref8$self); + (_self3 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.self) === null || _self3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self3$self = _self3.self, Foo, _m)._.call(_self3$self); + fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(_babelHelpers$assertC8 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf(), Foo, _m)._.call(_babelHelpers$assertC8); + (_ref9 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC9 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref9 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref9$call = _ref9.call(_babelHelpers$assertC9), Foo, _m)._.call(_ref9$call); + (_ref10 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref10 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref10$getSelf = _ref10.getSelf(), Foo, _m)._.call(_ref10$getSelf); + (_getSelf4 = (_ref11 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf4$call = _getSelf4.call(_ref11), Foo, _m)._.call(_getSelf4$call); + (_ref12 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf()) === null || _ref12 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref12$self = _ref12.self, Foo, _m)._.call(_ref12$self); + (_call2 = (fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC10 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC10)) === null || _call2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_call2$self = _call2.self, Foo, _m)._.call(_call2$self); + (_getSelf5 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf()) === null || _getSelf5 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf5$self = _getSelf5.self, Foo, _m)._.call(_getSelf5$self); + (_getSelf6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf?.()) === null || _getSelf6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf6$self = _getSelf6.self, Foo, _m)._.call(_getSelf6$self); } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _m = { - writable: true, - value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); + _: function () { + return babelHelpers.assertClassBrand(this, _Foo, _x)._; } }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property-with-transform/output.js index 8261ff8e1997..1095f29d151d 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property-with-transform/output.js @@ -4,7 +4,7 @@ class Foo { return this; } static test() { - var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o$Foo, _deep$very$o$Foo2, _deep$very$o$Foo3, _ref, _ref2, _self2, _self3, _self$self, _ref3, _babelHelpers$classSt, _call, _getSelf, _getSelf2, _self4, _babelHelpers$classSt2, _call$self, _getSelf$self, _getSelf$self2, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o$Foo, _fnDeep$very$o$Foo2, _fnDeep$very$o$Foo3, _ref4, _ref5, _self5, _self6, _self$self2, _ref6, _babelHelpers$classSt3, _call2, _getSelf3, _getSelf4, _self7, _babelHelpers$classSt4, _call$self2, _getSelf$self3, _getSelf$self4, _deep$very$o, _deep$very$o2, _deep$very$o3, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref12$getSelf, _ref13, _ref14, _ref15, _ref16, _ref16$getSelf, _fnDeep$very$o, _fnDeep$very$o2, _fnDeep$very$o3, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref22$getSelf, _ref23, _ref24, _ref25, _ref26, _ref26$getSelf; + var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o$Foo, _deep$very$o$Foo2, _deep$very$o$Foo3, _ref, _ref2, _self2, _self3, _self$self, _ref3, _babelHelpers$assertC, _call, _getSelf, _getSelf2, _self4, _babelHelpers$assertC2, _call$self, _getSelf$self, _getSelf$self2, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o$Foo, _fnDeep$very$o$Foo2, _fnDeep$very$o$Foo3, _ref4, _ref5, _self5, _self6, _self$self2, _ref6, _babelHelpers$assertC3, _call2, _getSelf3, _getSelf4, _self7, _babelHelpers$assertC4, _call$self2, _getSelf$self3, _getSelf$self4, _deep$very$o, _deep$very$o2, _deep$very$o3, _ref7, _ref8, _ref9, _ref10, _ref11, _ref12, _ref12$getSelf, _ref13, _ref14, _ref15, _ref16, _ref16$getSelf, _fnDeep$very$o, _fnDeep$very$o2, _fnDeep$very$o3, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _ref22$getSelf, _ref23, _ref24, _ref25, _ref26, _ref26$getSelf; const o = { Foo: Foo }; @@ -19,57 +19,55 @@ class Foo { function fnDeep() { return deep; } - Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _x); - Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _x).toString; - Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _x).toString(); - (_o$Foo = o === null || o === void 0 ? void 0 : o.Foo) === null || _o$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo, Foo, _x); - (_o$Foo2 = o === null || o === void 0 ? void 0 : o.Foo) === null || _o$Foo2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo2, Foo, _x).toString; - (_o$Foo3 = o === null || o === void 0 ? void 0 : o.Foo) === null || _o$Foo3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo3, Foo, _x).toString(); - (_deep$very$o$Foo = deep === null || deep === void 0 || (_deep$very$o = deep.very.o) === null || _deep$very$o === void 0 ? void 0 : _deep$very$o.Foo) === null || _deep$very$o$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo, Foo, _x); - (_deep$very$o$Foo2 = deep === null || deep === void 0 || (_deep$very$o2 = deep.very.o) === null || _deep$very$o2 === void 0 ? void 0 : _deep$very$o2.Foo) === null || _deep$very$o$Foo2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo2, Foo, _x).toString; - (_deep$very$o$Foo3 = deep === null || deep === void 0 || (_deep$very$o3 = deep.very.o) === null || _deep$very$o3 === void 0 ? void 0 : _deep$very$o3.Foo) === null || _deep$very$o$Foo3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo3, Foo, _x).toString(); - (_ref = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref, Foo, _x); - (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self) === null || _ref2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref2, Foo, _x); - (_self2 = (_ref7 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref7 === void 0 ? void 0 : _ref7.self) === null || _self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self2, Foo, _x); - (_self3 = (_ref8 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self) === null || _ref8 === void 0 ? void 0 : _ref8.self) === null || _self3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self3, Foo, _x); - (_self$self = (_ref9 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref9 === void 0 || (_ref9 = _ref9.self) === null || _ref9 === void 0 ? void 0 : _ref9.self) === null || _self$self === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self$self, Foo, _x); - (_ref3 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf()) === null || _ref3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref3, Foo, _x); - (_call = (_ref10 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref10 === void 0 ? void 0 : _ref10.call(_babelHelpers$classSt)) === null || _call === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call, Foo, _x); - (_getSelf = (_ref11 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref11 === void 0 ? void 0 : _ref11.getSelf()) === null || _getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf, Foo, _x); - (_getSelf2 = (_ref12 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref12 === void 0 || (_ref12$getSelf = _ref12.getSelf) === null || _ref12$getSelf === void 0 ? void 0 : _ref12$getSelf.call(_ref12)) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf2, Foo, _x); - (_self4 = (_ref13 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf()) === null || _ref13 === void 0 ? void 0 : _ref13.self) === null || _self4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self4, Foo, _x); - (_call$self = (_ref14 = o === null || o === void 0 ? void 0 : (_babelHelpers$classSt2 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf) === null || _ref14 === void 0 || (_ref14 = _ref14.call(_babelHelpers$classSt2)) === null || _ref14 === void 0 ? void 0 : _ref14.self) === null || _call$self === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call$self, Foo, _x); - (_getSelf$self = (_ref15 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref15 === void 0 || (_ref15 = _ref15.getSelf()) === null || _ref15 === void 0 ? void 0 : _ref15.self) === null || _getSelf$self === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self, Foo, _x); - (_getSelf$self2 = (_ref16 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref16 === void 0 || (_ref16$getSelf = _ref16.getSelf) === null || _ref16$getSelf === void 0 || (_ref16$getSelf = _ref16$getSelf.call(_ref16)) === null || _ref16$getSelf === void 0 ? void 0 : _ref16$getSelf.self) === null || _getSelf$self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self2, Foo, _x); - (_fn$Foo = fn === null || fn === void 0 ? void 0 : fn().Foo) === null || _fn$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo, Foo, _x); - (_fn$Foo2 = fn === null || fn === void 0 ? void 0 : fn().Foo) === null || _fn$Foo2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo2, Foo, _x).toString; - (_fn$Foo3 = fn === null || fn === void 0 ? void 0 : fn().Foo) === null || _fn$Foo3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo3, Foo, _x).toString(); - (_fnDeep$very$o$Foo = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o = fnDeep().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : _fnDeep$very$o.Foo) === null || _fnDeep$very$o$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo, Foo, _x); - (_fnDeep$very$o$Foo2 = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o2 = fnDeep().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : _fnDeep$very$o2.Foo) === null || _fnDeep$very$o$Foo2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo2, Foo, _x).toString; - (_fnDeep$very$o$Foo3 = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o3 = fnDeep().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : _fnDeep$very$o3.Foo) === null || _fnDeep$very$o$Foo3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo3, Foo, _x).toString(); - (_ref4 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref4, Foo, _x); - (_ref5 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self) === null || _ref5 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref5, Foo, _x); - (_self5 = (_ref17 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref17 === void 0 ? void 0 : _ref17.self) === null || _self5 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self5, Foo, _x); - (_self6 = (_ref18 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self) === null || _ref18 === void 0 ? void 0 : _ref18.self) === null || _self6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self6, Foo, _x); - (_self$self2 = (_ref19 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref19 === void 0 || (_ref19 = _ref19.self) === null || _ref19 === void 0 ? void 0 : _ref19.self) === null || _self$self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self$self2, Foo, _x); - (_ref6 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref6, Foo, _x); - (_call2 = (_ref20 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt3 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref20 === void 0 ? void 0 : _ref20.call(_babelHelpers$classSt3)) === null || _call2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call2, Foo, _x); - (_getSelf3 = (_ref21 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref21 === void 0 ? void 0 : _ref21.getSelf()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf3, Foo, _x); - (_getSelf4 = (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref22 === void 0 || (_ref22$getSelf = _ref22.getSelf) === null || _ref22$getSelf === void 0 ? void 0 : _ref22$getSelf.call(_ref22)) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf4, Foo, _x); - (_self7 = (_ref23 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf()) === null || _ref23 === void 0 ? void 0 : _ref23.self) === null || _self7 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self7, Foo, _x); - (_call$self2 = (_ref24 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt4 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf) === null || _ref24 === void 0 || (_ref24 = _ref24.call(_babelHelpers$classSt4)) === null || _ref24 === void 0 ? void 0 : _ref24.self) === null || _call$self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call$self2, Foo, _x); - (_getSelf$self3 = (_ref25 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref25 === void 0 || (_ref25 = _ref25.getSelf()) === null || _ref25 === void 0 ? void 0 : _ref25.self) === null || _getSelf$self3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self3, Foo, _x); - (_getSelf$self4 = (_ref26 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref26 === void 0 || (_ref26$getSelf = _ref26.getSelf) === null || _ref26$getSelf === void 0 || (_ref26$getSelf = _ref26$getSelf.call(_ref26)) === null || _ref26$getSelf === void 0 ? void 0 : _ref26$getSelf.self) === null || _getSelf$self4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self4, Foo, _x); + Foo === null || Foo === void 0 ? void 0 : _x._; + Foo === null || Foo === void 0 ? void 0 : _x._.toString; + Foo === null || Foo === void 0 ? void 0 : _x._.toString(); + (_o$Foo = o === null || o === void 0 ? void 0 : o.Foo) === null || _o$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo, Foo, _x)._; + (_o$Foo2 = o === null || o === void 0 ? void 0 : o.Foo) === null || _o$Foo2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo2, Foo, _x)._.toString; + (_o$Foo3 = o === null || o === void 0 ? void 0 : o.Foo) === null || _o$Foo3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo3, Foo, _x)._.toString(); + (_deep$very$o$Foo = deep === null || deep === void 0 || (_deep$very$o = deep.very.o) === null || _deep$very$o === void 0 ? void 0 : _deep$very$o.Foo) === null || _deep$very$o$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo, Foo, _x)._; + (_deep$very$o$Foo2 = deep === null || deep === void 0 || (_deep$very$o2 = deep.very.o) === null || _deep$very$o2 === void 0 ? void 0 : _deep$very$o2.Foo) === null || _deep$very$o$Foo2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo2, Foo, _x)._.toString; + (_deep$very$o$Foo3 = deep === null || deep === void 0 || (_deep$very$o3 = deep.very.o) === null || _deep$very$o3 === void 0 ? void 0 : _deep$very$o3.Foo) === null || _deep$very$o$Foo3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo3, Foo, _x)._.toString(); + (_ref = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref, Foo, _x)._; + (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self) === null || _ref2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref2, Foo, _x)._; + (_self2 = (_ref7 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref7 === void 0 ? void 0 : _ref7.self) === null || _self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self2, Foo, _x)._; + (_self3 = (_ref8 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self) === null || _ref8 === void 0 ? void 0 : _ref8.self) === null || _self3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self3, Foo, _x)._; + (_self$self = (_ref9 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref9 === void 0 || (_ref9 = _ref9.self) === null || _ref9 === void 0 ? void 0 : _ref9.self) === null || _self$self === void 0 ? void 0 : babelHelpers.assertClassBrand(_self$self, Foo, _x)._; + (_ref3 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf()) === null || _ref3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref3, Foo, _x)._; + (_call = (_ref10 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref10 === void 0 ? void 0 : _ref10.call(_babelHelpers$assertC)) === null || _call === void 0 ? void 0 : babelHelpers.assertClassBrand(_call, Foo, _x)._; + (_getSelf = (_ref11 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref11 === void 0 ? void 0 : _ref11.getSelf()) === null || _getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf, Foo, _x)._; + (_getSelf2 = (_ref12 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref12 === void 0 || (_ref12$getSelf = _ref12.getSelf) === null || _ref12$getSelf === void 0 ? void 0 : _ref12$getSelf.call(_ref12)) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf2, Foo, _x)._; + (_self4 = (_ref13 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf()) === null || _ref13 === void 0 ? void 0 : _ref13.self) === null || _self4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self4, Foo, _x)._; + (_call$self = (_ref14 = o === null || o === void 0 ? void 0 : (_babelHelpers$assertC2 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf) === null || _ref14 === void 0 || (_ref14 = _ref14.call(_babelHelpers$assertC2)) === null || _ref14 === void 0 ? void 0 : _ref14.self) === null || _call$self === void 0 ? void 0 : babelHelpers.assertClassBrand(_call$self, Foo, _x)._; + (_getSelf$self = (_ref15 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref15 === void 0 || (_ref15 = _ref15.getSelf()) === null || _ref15 === void 0 ? void 0 : _ref15.self) === null || _getSelf$self === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self, Foo, _x)._; + (_getSelf$self2 = (_ref16 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref16 === void 0 || (_ref16$getSelf = _ref16.getSelf) === null || _ref16$getSelf === void 0 || (_ref16$getSelf = _ref16$getSelf.call(_ref16)) === null || _ref16$getSelf === void 0 ? void 0 : _ref16$getSelf.self) === null || _getSelf$self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self2, Foo, _x)._; + (_fn$Foo = fn === null || fn === void 0 ? void 0 : fn().Foo) === null || _fn$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo, Foo, _x)._; + (_fn$Foo2 = fn === null || fn === void 0 ? void 0 : fn().Foo) === null || _fn$Foo2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo2, Foo, _x)._.toString; + (_fn$Foo3 = fn === null || fn === void 0 ? void 0 : fn().Foo) === null || _fn$Foo3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo3, Foo, _x)._.toString(); + (_fnDeep$very$o$Foo = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o = fnDeep().very.o) === null || _fnDeep$very$o === void 0 ? void 0 : _fnDeep$very$o.Foo) === null || _fnDeep$very$o$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo, Foo, _x)._; + (_fnDeep$very$o$Foo2 = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o2 = fnDeep().very.o) === null || _fnDeep$very$o2 === void 0 ? void 0 : _fnDeep$very$o2.Foo) === null || _fnDeep$very$o$Foo2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo2, Foo, _x)._.toString; + (_fnDeep$very$o$Foo3 = fnDeep === null || fnDeep === void 0 || (_fnDeep$very$o3 = fnDeep().very.o) === null || _fnDeep$very$o3 === void 0 ? void 0 : _fnDeep$very$o3.Foo) === null || _fnDeep$very$o$Foo3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo3, Foo, _x)._.toString(); + (_ref4 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref4, Foo, _x)._; + (_ref5 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self) === null || _ref5 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref5, Foo, _x)._; + (_self5 = (_ref17 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref17 === void 0 ? void 0 : _ref17.self) === null || _self5 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self5, Foo, _x)._; + (_self6 = (_ref18 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self) === null || _ref18 === void 0 ? void 0 : _ref18.self) === null || _self6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self6, Foo, _x)._; + (_self$self2 = (_ref19 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref19 === void 0 || (_ref19 = _ref19.self) === null || _ref19 === void 0 ? void 0 : _ref19.self) === null || _self$self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self$self2, Foo, _x)._; + (_ref6 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref6, Foo, _x)._; + (_call2 = (_ref20 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC3 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref20 === void 0 ? void 0 : _ref20.call(_babelHelpers$assertC3)) === null || _call2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_call2, Foo, _x)._; + (_getSelf3 = (_ref21 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref21 === void 0 ? void 0 : _ref21.getSelf()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf3, Foo, _x)._; + (_getSelf4 = (_ref22 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref22 === void 0 || (_ref22$getSelf = _ref22.getSelf) === null || _ref22$getSelf === void 0 ? void 0 : _ref22$getSelf.call(_ref22)) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf4, Foo, _x)._; + (_self7 = (_ref23 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf()) === null || _ref23 === void 0 ? void 0 : _ref23.self) === null || _self7 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self7, Foo, _x)._; + (_call$self2 = (_ref24 = fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC4 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf) === null || _ref24 === void 0 || (_ref24 = _ref24.call(_babelHelpers$assertC4)) === null || _ref24 === void 0 ? void 0 : _ref24.self) === null || _call$self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_call$self2, Foo, _x)._; + (_getSelf$self3 = (_ref25 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref25 === void 0 || (_ref25 = _ref25.getSelf()) === null || _ref25 === void 0 ? void 0 : _ref25.self) === null || _getSelf$self3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self3, Foo, _x)._; + (_getSelf$self4 = (_ref26 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref26 === void 0 || (_ref26$getSelf = _ref26.getSelf) === null || _ref26$getSelf === void 0 || (_ref26$getSelf = _ref26$getSelf.call(_ref26)) === null || _ref26$getSelf === void 0 ? void 0 : _ref26$getSelf.self) === null || _getSelf$self4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self4, Foo, _x)._; } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property/output.js index feb200a7d891..2bc4eeab7c1f 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/optional-chain-optional-property/output.js @@ -4,7 +4,7 @@ class Foo { return this; } static test() { - var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o$Foo, _deep$very$o$Foo2, _deep$very$o$Foo3, _ref, _ref2, _self2, _self3, _self$self, _ref3, _babelHelpers$classSt, _call, _getSelf, _getSelf2, _self4, _babelHelpers$classSt2, _call$self, _getSelf$self, _getSelf$self2, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o$Foo, _fnDeep$very$o$Foo2, _fnDeep$very$o$Foo3, _ref4, _ref5, _self5, _self6, _self$self2, _ref6, _babelHelpers$classSt3, _call2, _getSelf3, _getSelf4, _self7, _babelHelpers$classSt4, _call$self2, _getSelf$self3, _getSelf$self4; + var _o$Foo, _o$Foo2, _o$Foo3, _deep$very$o$Foo, _deep$very$o$Foo2, _deep$very$o$Foo3, _ref, _ref2, _self2, _self3, _self$self, _ref3, _babelHelpers$assertC, _call, _getSelf, _getSelf2, _self4, _babelHelpers$assertC2, _call$self, _getSelf$self, _getSelf$self2, _fn$Foo, _fn$Foo2, _fn$Foo3, _fnDeep$very$o$Foo, _fnDeep$very$o$Foo2, _fnDeep$very$o$Foo3, _ref4, _ref5, _self5, _self6, _self$self2, _ref6, _babelHelpers$assertC3, _call2, _getSelf3, _getSelf4, _self7, _babelHelpers$assertC4, _call$self2, _getSelf$self3, _getSelf$self4; const o = { Foo: Foo }; @@ -19,57 +19,55 @@ class Foo { function fnDeep() { return deep; } - Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _x); - Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _x).toString; - Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _x).toString(); - (_o$Foo = o?.Foo) === null || _o$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo, Foo, _x); - (_o$Foo2 = o?.Foo) === null || _o$Foo2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo2, Foo, _x).toString; - (_o$Foo3 = o?.Foo) === null || _o$Foo3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo3, Foo, _x).toString(); - (_deep$very$o$Foo = deep?.very.o?.Foo) === null || _deep$very$o$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo, Foo, _x); - (_deep$very$o$Foo2 = deep?.very.o?.Foo) === null || _deep$very$o$Foo2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo2, Foo, _x).toString; - (_deep$very$o$Foo3 = deep?.very.o?.Foo) === null || _deep$very$o$Foo3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_deep$very$o$Foo3, Foo, _x).toString(); - (_ref = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)) === null || _ref === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref, Foo, _x); - (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self) === null || _ref2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref2, Foo, _x); - (_self2 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.self) === null || _self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self2, Foo, _x); - (_self3 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).self)?.self) === null || _self3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self3, Foo, _x); - (_self$self = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.self?.self) === null || _self$self === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self$self, Foo, _x); - (_ref3 = o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf()) === null || _ref3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref3, Foo, _x); - (_call = (o === null || o === void 0 ? void 0 : (_babelHelpers$classSt = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt)) === null || _call === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call, Foo, _x); - (_getSelf = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf()) === null || _getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf, Foo, _x); - (_getSelf2 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf?.()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf2, Foo, _x); - (_self4 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self).getSelf())?.self) === null || _self4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self4, Foo, _x); - (_call$self = (o === null || o === void 0 ? void 0 : (_babelHelpers$classSt2 = babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt2)?.self) === null || _call$self === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call$self, Foo, _x); - (_getSelf$self = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf()?.self) === null || _getSelf$self === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self, Foo, _x); - (_getSelf$self2 = (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(o.Foo, Foo, _self))?.getSelf?.()?.self) === null || _getSelf$self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self2, Foo, _x); - (_fn$Foo = fn?.().Foo) === null || _fn$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo, Foo, _x); - (_fn$Foo2 = fn?.().Foo) === null || _fn$Foo2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo2, Foo, _x).toString; - (_fn$Foo3 = fn?.().Foo) === null || _fn$Foo3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo3, Foo, _x).toString(); - (_fnDeep$very$o$Foo = fnDeep?.().very.o?.Foo) === null || _fnDeep$very$o$Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo, Foo, _x); - (_fnDeep$very$o$Foo2 = fnDeep?.().very.o?.Foo) === null || _fnDeep$very$o$Foo2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo2, Foo, _x).toString; - (_fnDeep$very$o$Foo3 = fnDeep?.().very.o?.Foo) === null || _fnDeep$very$o$Foo3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fnDeep$very$o$Foo3, Foo, _x).toString(); - (_ref4 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)) === null || _ref4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref4, Foo, _x); - (_ref5 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self) === null || _ref5 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref5, Foo, _x); - (_self5 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.self) === null || _self5 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self5, Foo, _x); - (_self6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).self)?.self) === null || _self6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self6, Foo, _x); - (_self$self2 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.self?.self) === null || _self$self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self$self2, Foo, _x); - (_ref6 = fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_ref6, Foo, _x); - (_call2 = (fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt3 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt3)) === null || _call2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call2, Foo, _x); - (_getSelf3 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf3, Foo, _x); - (_getSelf4 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf4, Foo, _x); - (_self7 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self).getSelf())?.self) === null || _self7 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_self7, Foo, _x); - (_call$self2 = (fn === null || fn === void 0 ? void 0 : (_babelHelpers$classSt4 = babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self)).getSelf)?.call(_babelHelpers$classSt4)?.self) === null || _call$self2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_call$self2, Foo, _x); - (_getSelf$self3 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf()?.self) === null || _getSelf$self3 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self3, Foo, _x); - (_getSelf$self4 = (fn === null || fn === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(fn().Foo, Foo, _self))?.getSelf?.()?.self) === null || _getSelf$self4 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_getSelf$self4, Foo, _x); + Foo === null || Foo === void 0 ? void 0 : _x._; + Foo === null || Foo === void 0 ? void 0 : _x._.toString; + Foo === null || Foo === void 0 ? void 0 : _x._.toString(); + (_o$Foo = o?.Foo) === null || _o$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo, Foo, _x)._; + (_o$Foo2 = o?.Foo) === null || _o$Foo2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo2, Foo, _x)._.toString; + (_o$Foo3 = o?.Foo) === null || _o$Foo3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo3, Foo, _x)._.toString(); + (_deep$very$o$Foo = deep?.very.o?.Foo) === null || _deep$very$o$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo, Foo, _x)._; + (_deep$very$o$Foo2 = deep?.very.o?.Foo) === null || _deep$very$o$Foo2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo2, Foo, _x)._.toString; + (_deep$very$o$Foo3 = deep?.very.o?.Foo) === null || _deep$very$o$Foo3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_deep$very$o$Foo3, Foo, _x)._.toString(); + (_ref = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._) === null || _ref === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref, Foo, _x)._; + (_ref2 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self) === null || _ref2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref2, Foo, _x)._; + (_self2 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.self) === null || _self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self2, Foo, _x)._; + (_self3 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.self)?.self) === null || _self3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self3, Foo, _x)._; + (_self$self = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.self?.self) === null || _self$self === void 0 ? void 0 : babelHelpers.assertClassBrand(_self$self, Foo, _x)._; + (_ref3 = o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf()) === null || _ref3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref3, Foo, _x)._; + (_call = (o === null || o === void 0 ? void 0 : (_babelHelpers$assertC = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC)) === null || _call === void 0 ? void 0 : babelHelpers.assertClassBrand(_call, Foo, _x)._; + (_getSelf = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf()) === null || _getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf, Foo, _x)._; + (_getSelf2 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf?.()) === null || _getSelf2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf2, Foo, _x)._; + (_self4 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._.getSelf())?.self) === null || _self4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self4, Foo, _x)._; + (_call$self = (o === null || o === void 0 ? void 0 : (_babelHelpers$assertC2 = babelHelpers.assertClassBrand(o.Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC2)?.self) === null || _call$self === void 0 ? void 0 : babelHelpers.assertClassBrand(_call$self, Foo, _x)._; + (_getSelf$self = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf()?.self) === null || _getSelf$self === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self, Foo, _x)._; + (_getSelf$self2 = (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(o.Foo, Foo, _self)._)?.getSelf?.()?.self) === null || _getSelf$self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self2, Foo, _x)._; + (_fn$Foo = fn?.().Foo) === null || _fn$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo, Foo, _x)._; + (_fn$Foo2 = fn?.().Foo) === null || _fn$Foo2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo2, Foo, _x)._.toString; + (_fn$Foo3 = fn?.().Foo) === null || _fn$Foo3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo3, Foo, _x)._.toString(); + (_fnDeep$very$o$Foo = fnDeep?.().very.o?.Foo) === null || _fnDeep$very$o$Foo === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo, Foo, _x)._; + (_fnDeep$very$o$Foo2 = fnDeep?.().very.o?.Foo) === null || _fnDeep$very$o$Foo2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo2, Foo, _x)._.toString; + (_fnDeep$very$o$Foo3 = fnDeep?.().very.o?.Foo) === null || _fnDeep$very$o$Foo3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fnDeep$very$o$Foo3, Foo, _x)._.toString(); + (_ref4 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._) === null || _ref4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref4, Foo, _x)._; + (_ref5 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self) === null || _ref5 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref5, Foo, _x)._; + (_self5 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.self) === null || _self5 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self5, Foo, _x)._; + (_self6 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.self)?.self) === null || _self6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self6, Foo, _x)._; + (_self$self2 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.self?.self) === null || _self$self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self$self2, Foo, _x)._; + (_ref6 = fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf()) === null || _ref6 === void 0 ? void 0 : babelHelpers.assertClassBrand(_ref6, Foo, _x)._; + (_call2 = (fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC3 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC3)) === null || _call2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_call2, Foo, _x)._; + (_getSelf3 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf()) === null || _getSelf3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf3, Foo, _x)._; + (_getSelf4 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf?.()) === null || _getSelf4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf4, Foo, _x)._; + (_self7 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._.getSelf())?.self) === null || _self7 === void 0 ? void 0 : babelHelpers.assertClassBrand(_self7, Foo, _x)._; + (_call$self2 = (fn === null || fn === void 0 ? void 0 : (_babelHelpers$assertC4 = babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._).getSelf)?.call(_babelHelpers$assertC4)?.self) === null || _call$self2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_call$self2, Foo, _x)._; + (_getSelf$self3 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf()?.self) === null || _getSelf$self3 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self3, Foo, _x)._; + (_getSelf$self4 = (fn === null || fn === void 0 ? void 0 : babelHelpers.assertClassBrand(fn().Foo, Foo, _self)._)?.getSelf?.()?.self) === null || _getSelf$self4 === void 0 ? void 0 : babelHelpers.assertClassBrand(_getSelf$self4, Foo, _x)._; } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; var _self = { - writable: true, - value: _Foo + _: _Foo }; babelHelpers.defineProperty(Foo, "self", _Foo); Foo.test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/options.json b/packages/babel-plugin-transform-class-properties/test/fixtures/private/options.json index 6f87b52fa96b..717efc6a1bea 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/options.json +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/options.json @@ -1,7 +1,3 @@ { - "plugins": [ - "transform-class-properties", - "transform-classes", - "transform-block-scoping" - ] + "plugins": ["transform-class-properties", "transform-classes"] } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call-with-transform/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call-with-transform/output.js index 512bf77b4889..525ffb16c98b 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call-with-transform/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call-with-transform/output.js @@ -11,28 +11,26 @@ class Foo { const fn = function () { return o; }; - (Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).bind(Foo))(); - (Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).bind(Foo))().toString; - (Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).bind(Foo))().toString(); - (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo = o.Foo, Foo, _m).bind(_o$Foo))(); - (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo2 = o.Foo, Foo, _m).bind(_o$Foo2))().toString; - (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo3 = o.Foo, Foo, _m).bind(_o$Foo3))().toString(); - ((_o$Foo$self$getSelf = ((_o$Foo4 = o.Foo) === null || _o$Foo4 === void 0 ? void 0 : (_o$Foo4$self = _o$Foo4.self).getSelf.bind(_o$Foo4$self))()) === null || _o$Foo$self$getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo$self$getSelf, Foo, _m).bind(_o$Foo$self$getSelf))(); - ((_o$Foo$self$getSelf2 = ((_o$Foo$self = o.Foo.self) === null || _o$Foo$self === void 0 ? void 0 : _o$Foo$self.getSelf.bind(_o$Foo$self))()) === null || _o$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo$self$getSelf2, Foo, _m).bind(_o$Foo$self$getSelf2))(); - ((_fn$Foo$self$getSelf = ((_fn = fn()) === null || _fn === void 0 || (_fn = _fn.Foo) === null || _fn === void 0 ? void 0 : (_fn$self = _fn.self).getSelf.bind(_fn$self))()) === null || _fn$Foo$self$getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo$self$getSelf, Foo, _m).bind(_fn$Foo$self$getSelf))(); - ((_fn$Foo$self$getSelf2 = (fn === null || fn === void 0 || (_fn$Foo$self = fn().Foo.self) === null || _fn$Foo$self === void 0 ? void 0 : _fn$Foo$self.getSelf.bind(_fn$Foo$self))()) === null || _fn$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo$self$getSelf2, Foo, _m).bind(_fn$Foo$self$getSelf2))(); + (Foo === null || Foo === void 0 ? void 0 : _m._.bind(Foo))(); + (Foo === null || Foo === void 0 ? void 0 : _m._.bind(Foo))().toString; + (Foo === null || Foo === void 0 ? void 0 : _m._.bind(Foo))().toString(); + (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo = o.Foo, Foo, _m)._.bind(_o$Foo))(); + (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo2 = o.Foo, Foo, _m)._.bind(_o$Foo2))().toString; + (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo3 = o.Foo, Foo, _m)._.bind(_o$Foo3))().toString(); + ((_o$Foo$self$getSelf = ((_o$Foo4 = o.Foo) === null || _o$Foo4 === void 0 ? void 0 : (_o$Foo4$self = _o$Foo4.self).getSelf.bind(_o$Foo4$self))()) === null || _o$Foo$self$getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo$self$getSelf, Foo, _m)._.bind(_o$Foo$self$getSelf))(); + ((_o$Foo$self$getSelf2 = ((_o$Foo$self = o.Foo.self) === null || _o$Foo$self === void 0 ? void 0 : _o$Foo$self.getSelf.bind(_o$Foo$self))()) === null || _o$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo$self$getSelf2, Foo, _m)._.bind(_o$Foo$self$getSelf2))(); + ((_fn$Foo$self$getSelf = ((_fn = fn()) === null || _fn === void 0 || (_fn = _fn.Foo) === null || _fn === void 0 ? void 0 : (_fn$self = _fn.self).getSelf.bind(_fn$self))()) === null || _fn$Foo$self$getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo$self$getSelf, Foo, _m)._.bind(_fn$Foo$self$getSelf))(); + ((_fn$Foo$self$getSelf2 = (fn === null || fn === void 0 || (_fn$Foo$self = fn().Foo.self) === null || _fn$Foo$self === void 0 ? void 0 : _fn$Foo$self.getSelf.bind(_fn$Foo$self))()) === null || _fn$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo$self$getSelf2, Foo, _m)._.bind(_fn$Foo$self$getSelf2))(); } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; babelHelpers.defineProperty(Foo, "self", _Foo); var _m = { - writable: true, - value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); + _: function () { + return babelHelpers.assertClassBrand(this, _Foo, _x)._; } }; new Foo().test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call/output.js index fc7aacce28eb..d85958d09925 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/parenthesized-optional-member-call/output.js @@ -11,28 +11,26 @@ class Foo { const fn = function () { return o; }; - (Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).bind(Foo))(); - (Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).bind(Foo))().toString; - (Foo === null || Foo === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _m).bind(Foo))().toString(); - (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo = o.Foo, Foo, _m).bind(_o$Foo))(); - (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo2 = o.Foo, Foo, _m).bind(_o$Foo2))().toString; - (o === null || o === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo3 = o.Foo, Foo, _m).bind(_o$Foo3))().toString(); - ((_o$Foo$self$getSelf = (o.Foo?.self.getSelf)()) === null || _o$Foo$self$getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo$self$getSelf, Foo, _m).bind(_o$Foo$self$getSelf))(); - ((_o$Foo$self$getSelf2 = (o.Foo.self?.getSelf)()) === null || _o$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_o$Foo$self$getSelf2, Foo, _m).bind(_o$Foo$self$getSelf2))(); - ((_fn$Foo$self$getSelf = (fn()?.Foo?.self.getSelf)()) === null || _fn$Foo$self$getSelf === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo$self$getSelf, Foo, _m).bind(_fn$Foo$self$getSelf))(); - ((_fn$Foo$self$getSelf2 = (fn?.().Foo.self?.getSelf)()) === null || _fn$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.classStaticPrivateFieldSpecGet(_fn$Foo$self$getSelf2, Foo, _m).bind(_fn$Foo$self$getSelf2))(); + (Foo === null || Foo === void 0 ? void 0 : _m._.bind(Foo))(); + (Foo === null || Foo === void 0 ? void 0 : _m._.bind(Foo))().toString; + (Foo === null || Foo === void 0 ? void 0 : _m._.bind(Foo))().toString(); + (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo = o.Foo, Foo, _m)._.bind(_o$Foo))(); + (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo2 = o.Foo, Foo, _m)._.bind(_o$Foo2))().toString; + (o === null || o === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo3 = o.Foo, Foo, _m)._.bind(_o$Foo3))().toString(); + ((_o$Foo$self$getSelf = (o.Foo?.self.getSelf)()) === null || _o$Foo$self$getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo$self$getSelf, Foo, _m)._.bind(_o$Foo$self$getSelf))(); + ((_o$Foo$self$getSelf2 = (o.Foo.self?.getSelf)()) === null || _o$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_o$Foo$self$getSelf2, Foo, _m)._.bind(_o$Foo$self$getSelf2))(); + ((_fn$Foo$self$getSelf = (fn()?.Foo?.self.getSelf)()) === null || _fn$Foo$self$getSelf === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo$self$getSelf, Foo, _m)._.bind(_fn$Foo$self$getSelf))(); + ((_fn$Foo$self$getSelf2 = (fn?.().Foo.self?.getSelf)()) === null || _fn$Foo$self$getSelf2 === void 0 ? void 0 : babelHelpers.assertClassBrand(_fn$Foo$self$getSelf2, Foo, _m)._.bind(_fn$Foo$self$getSelf2))(); } } _Foo = Foo; var _x = { - writable: true, - value: 1 + _: 1 }; babelHelpers.defineProperty(Foo, "self", _Foo); var _m = { - writable: true, - value: function () { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Foo, _x); + _: function () { + return babelHelpers.assertClassBrand(this, _Foo, _x)._; } }; new Foo().test(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/preserve-comments/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/preserve-comments/output.js index c589d07101d4..dd0706141403 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/preserve-comments/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/preserve-comments/output.js @@ -1,17 +1,13 @@ var _a = /*#__PURE__*/new WeakMap(); -var C = /*#__PURE__*/babelHelpers.createClass(function C() { +let C = /*#__PURE__*/babelHelpers.createClass(function C() { "use strict"; babelHelpers.classCallCheck(this, C); /* before a */ - babelHelpers.classPrivateFieldInitSpec(this, _a, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _a, void 0); } /* after b */); /* after a */ /* before b */ var _b = { - writable: true, - value: void 0 + _: void 0 }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/private-in-derived/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/private-in-derived/output.js index 0599050446d9..c794d9a3ebf3 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/private-in-derived/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/private-in-derived/output.js @@ -1,18 +1,15 @@ var _outer = /*#__PURE__*/new WeakMap(); -var Outer = /*#__PURE__*/babelHelpers.createClass(function Outer() { +let Outer = /*#__PURE__*/babelHelpers.createClass(function Outer() { "use strict"; babelHelpers.classCallCheck(this, Outer); - babelHelpers.classPrivateFieldInitSpec(this, _outer, { - writable: true, - value: void 0 - }); - var Test = /*#__PURE__*/function (_babelHelpers$classPr) { + babelHelpers.classPrivateFieldInitSpec(this, _outer, void 0); + let Test = /*#__PURE__*/function (_babelHelpers$classPr) { babelHelpers.inherits(Test, _babelHelpers$classPr); function Test() { babelHelpers.classCallCheck(this, Test); return babelHelpers.callSuper(this, Test, arguments); } return babelHelpers.createClass(Test); - }(babelHelpers.classPrivateFieldGet(this, _outer)); + }(babelHelpers.classPrivateFieldGet2(this, _outer)); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/reevaluated/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/reevaluated/output.js index 38ccd0f77493..e78184fde825 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/reevaluated/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/reevaluated/output.js @@ -2,25 +2,21 @@ function classFactory() { var _Foo, _foo, _bar; return _foo = /*#__PURE__*/new WeakMap(), (_Foo = class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: "foo" - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, "foo"); } instance() { - return babelHelpers.classPrivateFieldGet(this, _foo); + return babelHelpers.classPrivateFieldGet2(this, _foo); } static() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, _Foo, _bar); + return babelHelpers.assertClassBrand(Foo, _Foo, _bar)._; } static instance(inst) { - return babelHelpers.classPrivateFieldGet(inst, _foo); + return babelHelpers.classPrivateFieldGet2(inst, _foo); } static static() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, _Foo, _bar); + return babelHelpers.assertClassBrand(Foo, _Foo, _bar)._; } }, _bar = { - writable: true, - value: "bar" + _: "bar" }, _Foo); } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/reference-in-other-property/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/reference-in-other-property/output.js index dc9ea7d6a15a..1121d10ef446 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/reference-in-other-property/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/reference-in-other-property/output.js @@ -1,22 +1,13 @@ var _two = /*#__PURE__*/new WeakMap(); var _private = /*#__PURE__*/new WeakMap(); var _four = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() { +let Foo = /*#__PURE__*/babelHelpers.createClass(function Foo() { "use strict"; babelHelpers.classCallCheck(this, Foo); - babelHelpers.defineProperty(this, "one", babelHelpers.classPrivateFieldGet(this, _private)); - babelHelpers.classPrivateFieldInitSpec(this, _two, { - writable: true, - value: babelHelpers.classPrivateFieldGet(this, _private) - }); - babelHelpers.classPrivateFieldInitSpec(this, _private, { - writable: true, - value: 0 - }); - babelHelpers.defineProperty(this, "three", babelHelpers.classPrivateFieldGet(this, _private)); - babelHelpers.classPrivateFieldInitSpec(this, _four, { - writable: true, - value: babelHelpers.classPrivateFieldGet(this, _private) - }); + babelHelpers.defineProperty(this, "one", babelHelpers.classPrivateFieldGet2(this, _private)); + babelHelpers.classPrivateFieldInitSpec(this, _two, babelHelpers.classPrivateFieldGet2(this, _private)); + babelHelpers.classPrivateFieldInitSpec(this, _private, 0); + babelHelpers.defineProperty(this, "three", babelHelpers.classPrivateFieldGet2(this, _private)); + babelHelpers.classPrivateFieldInitSpec(this, _four, babelHelpers.classPrivateFieldGet2(this, _private)); }); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T2983/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T2983/output.mjs index 8e71294e9e74..bc123d79809a 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T2983/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T2983/output.mjs @@ -1,11 +1,9 @@ var _Class, _test; call((_Class = class {}, _test = { - writable: true, - value: true + _: true }, _Class)); export default class _Class2 {} var _test2 = { - writable: true, - value: true + _: true }; ; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T6719/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T6719/output.js index cd7eb6f2fa27..39f329ba558b 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T6719/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T6719/output.js @@ -1,8 +1,7 @@ function withContext(ComposedComponent) { var _WithContext, _propTypes; return _WithContext = class WithContext extends Component {}, _propTypes = { - writable: true, - value: { + _: { context: PropTypes.shape({ addCss: PropTypes.func, setTitle: PropTypes.func, diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T7364/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T7364/output.mjs index 7b1d3cdef1f0..2154d44f0b43 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T7364/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/regression-T7364/output.mjs @@ -2,50 +2,26 @@ var _myAsyncMethod = /*#__PURE__*/new WeakMap(); class MyClass { constructor() { var _this = this; - babelHelpers.classPrivateFieldInitSpec(this, _myAsyncMethod, { - writable: true, - value: function () { - var _ref = babelHelpers.asyncToGenerator(function* () { - console.log(_this); - }); - return function value() { - return _ref.apply(this, arguments); - }; - }() - }); + babelHelpers.classPrivateFieldInitSpec(this, _myAsyncMethod, /*#__PURE__*/babelHelpers.asyncToGenerator(function* () { + console.log(_this); + })); } } var _myAsyncMethod2 = /*#__PURE__*/new WeakMap(); (class MyClass2 { constructor() { var _this2 = this; - babelHelpers.classPrivateFieldInitSpec(this, _myAsyncMethod2, { - writable: true, - value: function () { - var _ref2 = babelHelpers.asyncToGenerator(function* () { - console.log(_this2); - }); - return function value() { - return _ref2.apply(this, arguments); - }; - }() - }); + babelHelpers.classPrivateFieldInitSpec(this, _myAsyncMethod2, /*#__PURE__*/babelHelpers.asyncToGenerator(function* () { + console.log(_this2); + })); } }); var _myAsyncMethod3 = /*#__PURE__*/new WeakMap(); export default class MyClass3 { constructor() { var _this3 = this; - babelHelpers.classPrivateFieldInitSpec(this, _myAsyncMethod3, { - writable: true, - value: function () { - var _ref3 = babelHelpers.asyncToGenerator(function* () { - console.log(_this3); - }); - return function value() { - return _ref3.apply(this, arguments); - }; - }() - }); + babelHelpers.classPrivateFieldInitSpec(this, _myAsyncMethod3, /*#__PURE__*/babelHelpers.asyncToGenerator(function* () { + console.log(_this3); + })); } } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-call/output.js index d2df9947f8fb..ef3e7f8c9f62 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-call/output.js @@ -1,4 +1,4 @@ -var Foo = /*#__PURE__*/function () { +let Foo = /*#__PURE__*/function () { "use strict"; function Foo() { @@ -7,14 +7,13 @@ var Foo = /*#__PURE__*/function () { babelHelpers.createClass(Foo, [{ key: "test", value: function test(x) { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _foo).call(Foo, x); + return _foo._.call(Foo, x); } }]); return Foo; }(); var _foo = { - writable: true, - value: function (x) { + _: function (x) { return x; } }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-class-binding/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-class-binding/output.js index 6d16dccce1b1..8017596108db 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-class-binding/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-class-binding/output.js @@ -1,15 +1,13 @@ var _A; -var A = /*#__PURE__*/babelHelpers.createClass(function A() { +let A = /*#__PURE__*/babelHelpers.createClass(function A() { "use strict"; babelHelpers.classCallCheck(this, A); }); _A = A; var _self = { - writable: true, - value: _A + _: _A }; var _getA = { - writable: true, - value: () => _A + _: () => _A }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-export/output.mjs b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-export/output.mjs index cc34988585f5..b52e0e2d112d 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-export/output.mjs +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-export/output.mjs @@ -1,10 +1,8 @@ export class MyClass {} var _property = { - writable: true, - value: value + _: value }; export default class MyClass2 {} var _property2 = { - writable: true, - value: value + _: value }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-infer-name/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-infer-name/output.js index 41ab84325295..b7427c8c44ac 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-infer-name/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-infer-name/output.js @@ -1,5 +1,4 @@ var _Class, _num; var Foo = (_Class = class Foo {}, _num = { - writable: true, - value: 0 + _: 0 }, _Class); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-inherited/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-inherited/output.js index 41002e832752..a55c2b8b550e 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-inherited/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-inherited/output.js @@ -1,28 +1,26 @@ class Base { static getThis() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Base, _foo); + return babelHelpers.assertClassBrand(this, Base, _foo)._; } static updateThis(val) { - return babelHelpers.classStaticPrivateFieldSpecSet(this, Base, _foo, val); + return _foo._ = babelHelpers.assertClassBrand(this, Base, val); } static getClass() { - return babelHelpers.classStaticPrivateFieldSpecGet(Base, Base, _foo); + return _foo._; } static updateClass(val) { - return babelHelpers.classStaticPrivateFieldSpecSet(Base, Base, _foo, val); + return _foo._ = val; } } var _foo = { - writable: true, - value: 1 + _: 1 }; class Sub1 extends Base { static update(val) { - return babelHelpers.classStaticPrivateFieldSpecSet(this, Sub1, _foo2, val); + return _foo2._ = babelHelpers.assertClassBrand(this, Sub1, val); } } var _foo2 = { - writable: true, - value: 2 + _: 2 }; class Sub2 extends Base {} diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-self-field/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-self-field/output.js index be90a9ed60cb..b2e644051225 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-self-field/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-self-field/output.js @@ -1,5 +1,4 @@ var _Foo, _x; var f = (_Foo = class Foo {}, _x = { - writable: true, - value: _Foo + _: _Foo }, babelHelpers.defineProperty(_Foo, "y", _Foo), _Foo); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-shadow/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-shadow/output.js index 9082231ba230..1fb9caf23969 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-shadow/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-shadow/output.js @@ -3,12 +3,11 @@ class Test { const _Test2 = 2; const func = () => { const _Test = 3; - return babelHelpers.classStaticPrivateFieldSpecGet(this, Test, _x) + _Test; + return babelHelpers.assertClassBrand(this, Test, _x)._ + _Test; }; return func() + _Test2; } } var _x = { - writable: true, - value: 1 + _: 1 }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-this/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-this/output.js index 6d16dccce1b1..8017596108db 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-this/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-this/output.js @@ -1,15 +1,13 @@ var _A; -var A = /*#__PURE__*/babelHelpers.createClass(function A() { +let A = /*#__PURE__*/babelHelpers.createClass(function A() { "use strict"; babelHelpers.classCallCheck(this, A); }); _A = A; var _self = { - writable: true, - value: _A + _: _A }; var _getA = { - writable: true, - value: () => _A + _: () => _A }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-undefined/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-undefined/output.js index 6dbfad44fa90..91090be46440 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-undefined/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static-undefined/output.js @@ -1,12 +1,11 @@ class Foo { static test() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _bar); + return _bar._; } test() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _bar); + return _bar._; } } var _bar = { - writable: true, - value: void 0 + _: void 0 }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static/output.js index fb3acd3a00a1..18b3aee7eb65 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/static/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/static/output.js @@ -1,14 +1,13 @@ class Foo { static test() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _bar); + return _bar._; } test() { - return babelHelpers.classStaticPrivateFieldSpecGet(Foo, Foo, _bar); + return _bar._; } } var _bar = { - writable: true, - value: "foo" + _: "foo" }; expect("bar" in Foo).toBe(false); expect(Foo.test()).toBe("foo"); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/super-call/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/super-call/output.js index 5a0eaf3e1d86..1b40dcb0b80e 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/super-call/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/super-call/output.js @@ -1,4 +1,4 @@ -var A = /*#__PURE__*/function () { +let A = /*#__PURE__*/function () { "use strict"; function A() { @@ -13,7 +13,7 @@ var A = /*#__PURE__*/function () { return A; }(); var _foo = /*#__PURE__*/new WeakMap(); -var B = /*#__PURE__*/function (_A) { +let B = /*#__PURE__*/function (_A) { "use strict"; babelHelpers.inherits(B, _A); @@ -21,10 +21,7 @@ var B = /*#__PURE__*/function (_A) { var _thisSuper, _this; babelHelpers.classCallCheck(this, B); _this = babelHelpers.callSuper(this, B, [...args]); - babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _foo, { - writable: true, - value: babelHelpers.get((_thisSuper = babelHelpers.assertThisInitialized(_this), babelHelpers.getPrototypeOf(B.prototype)), "foo", _thisSuper).call(_thisSuper) - }); + babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _foo, babelHelpers.get((_thisSuper = babelHelpers.assertThisInitialized(_this), babelHelpers.getPrototypeOf(B.prototype)), "foo", _thisSuper).call(_thisSuper)); return _this; } return babelHelpers.createClass(B); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/super-expression/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/super-expression/output.js index 13530909b7d6..7e6249c61d27 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/super-expression/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/super-expression/output.js @@ -1,15 +1,12 @@ var _bar = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function (_Bar) { +let Foo = /*#__PURE__*/function (_Bar) { "use strict"; babelHelpers.inherits(Foo, _Bar); function Foo() { var _this; babelHelpers.classCallCheck(this, Foo); - foo((_this = babelHelpers.callSuper(this, Foo), babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _bar, { - writable: true, - value: "foo" - }), babelHelpers.assertThisInitialized(_this))); + foo((_this = babelHelpers.callSuper(this, Foo), babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _bar, "foo"), babelHelpers.assertThisInitialized(_this))); return _this; } return babelHelpers.createClass(Foo); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/super-statement/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/super-statement/output.js index 7ed3ad4e99fa..3a60a5dbe384 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/super-statement/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/super-statement/output.js @@ -1,5 +1,5 @@ var _bar = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function (_Bar) { +let Foo = /*#__PURE__*/function (_Bar) { "use strict"; babelHelpers.inherits(Foo, _Bar); @@ -7,10 +7,7 @@ var Foo = /*#__PURE__*/function (_Bar) { var _this; babelHelpers.classCallCheck(this, Foo); _this = babelHelpers.callSuper(this, Foo); - babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _bar, { - writable: true, - value: "foo" - }); + babelHelpers.classPrivateFieldInitSpec(babelHelpers.assertThisInitialized(_this), _bar, "foo"); return _this; } return babelHelpers.createClass(Foo); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/tagged-template-static/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/tagged-template-static/output.js index 037fd2ef9571..ad0dcdae15d7 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/tagged-template-static/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/tagged-template-static/output.js @@ -1,11 +1,10 @@ class Foo { static getReceiver() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _tag).bind(this)``; + return babelHelpers.assertClassBrand(this, Foo, _tag)._.bind(this)``; } } var _tag = { - writable: true, - value: function () { + _: function () { return this; } }; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/tagged-template/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/tagged-template/output.js index 932f679ec51f..74d6a41f7df6 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/tagged-template/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/tagged-template/output.js @@ -1,18 +1,15 @@ var _tag = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function () { +let Foo = /*#__PURE__*/function () { "use strict"; function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _tag, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _tag, void 0); } babelHelpers.createClass(Foo, [{ key: "test", value: function test() { - babelHelpers.classPrivateFieldGet(this, _tag).bind(this)``; + babelHelpers.classPrivateFieldGet2(this, _tag).bind(this)``; } }]); return Foo; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/private/update/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/private/update/output.js index 978ac8af8ff9..06112c0fdad1 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/private/update/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/private/update/output.js @@ -1,22 +1,19 @@ var _foo = /*#__PURE__*/new WeakMap(); -var Foo = /*#__PURE__*/function () { +let Foo = /*#__PURE__*/function () { "use strict"; function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, 0); } babelHelpers.createClass(Foo, [{ key: "test", value: function test(other) { var _this$foo, _this$foo2, _this$foo3, _other$obj, _other$obj$foo, _other$obj$foo2, _other$obj2, _other$obj$foo3; - babelHelpers.classPrivateFieldSet(this, _foo, (_this$foo = babelHelpers.classPrivateFieldGet(this, _foo), _this$foo2 = _this$foo++, _this$foo)), _this$foo2; - babelHelpers.classPrivateFieldSet(this, _foo, (_this$foo3 = babelHelpers.classPrivateFieldGet(this, _foo), ++_this$foo3)); - babelHelpers.classPrivateFieldSet(_other$obj = other.obj, _foo, (_other$obj$foo = babelHelpers.classPrivateFieldGet(_other$obj, _foo), _other$obj$foo2 = _other$obj$foo++, _other$obj$foo)), _other$obj$foo2; - babelHelpers.classPrivateFieldSet(_other$obj2 = other.obj, _foo, (_other$obj$foo3 = babelHelpers.classPrivateFieldGet(_other$obj2, _foo), ++_other$obj$foo3)); + babelHelpers.classPrivateFieldSet2(this, _foo, (_this$foo = babelHelpers.classPrivateFieldGet2(this, _foo), _this$foo2 = _this$foo++, _this$foo)), _this$foo2; + babelHelpers.classPrivateFieldSet2(this, _foo, (_this$foo3 = babelHelpers.classPrivateFieldGet2(this, _foo), ++_this$foo3)); + babelHelpers.classPrivateFieldSet2(_other$obj = other.obj, _foo, (_other$obj$foo = babelHelpers.classPrivateFieldGet2(_other$obj, _foo), _other$obj$foo2 = _other$obj$foo++, _other$obj$foo)), _other$obj$foo2; + babelHelpers.classPrivateFieldSet2(_other$obj2 = other.obj, _foo, (_other$obj$foo3 = babelHelpers.classPrivateFieldGet2(_other$obj2, _foo), ++_other$obj$foo3)); } }]); return Foo; diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/8882/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/8882/output.js index 5db74a9d0042..3a1a8ff0ece0 100644 --- a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/8882/output.js +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/8882/output.js @@ -5,13 +5,10 @@ for (let i = 0; i <= 10; ++i) { classes.push((_bar = /*#__PURE__*/new WeakMap(), _i = i, (_A = class A { constructor() { babelHelpers.defineProperty(this, _i, `computed field ${i}`); - babelHelpers.classPrivateFieldInitSpec(this, _bar, { - writable: true, - value: `private field ${i}` - }); + babelHelpers.classPrivateFieldInitSpec(this, _bar, `private field ${i}`); } getBar() { - return babelHelpers.classPrivateFieldGet(this, _bar); + return babelHelpers.classPrivateFieldGet2(this, _bar); } }, babelHelpers.defineProperty(_A, "foo", `static field ${i}`), _A))); } diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/exec.js b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/exec.js new file mode 100644 index 000000000000..daf3cb157cc9 --- /dev/null +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/exec.js @@ -0,0 +1,68 @@ +// @force-old-private-helpers + +let s_s, s_gs, i_s, i_gs; + +class A { + static #s_f = 0; + static #s_m() { return 1 } + static get #s_g() { return 2 } + static set #s_s(v) { s_s = v } + static get #s_gs() { return 3 } + static set #s_gs(v) { s_gs = v } + + #i_f = 4; + #i_m() { return 5 } + get #i_g() { return 6 } + set #i_s(v) { i_s = v } + get #i_gs() { return 7 } + set #i_gs(v) { i_gs = v } + + static read() { + expect(A.#s_f).toBe(0); + expect(A.#s_m()).toBe(1); + expect(A.#s_g).toBe(2); + // expect(() => A.#s_s).toThrow(TypeError); -- This was never implemented properly + expect(A.#s_gs).toBe(3); + + const a = new A(); + expect(a.#i_f).toBe(4); + expect(a.#i_m()).toBe(5); + expect(a.#i_g).toBe(6); + expect(() => a.#i_s).toThrow(TypeError); + expect(a.#i_gs).toBe(7); + } + + static write() { + A.#s_f = 8; expect(A.#s_f).toBe(8); + expect(() => A.#s_m = 0).toThrow(TypeError); expect(A.#s_m()).toBe(1); + expect(() => A.#s_g = 0).toThrow(TypeError); expect(A.#s_g).toBe(2); + A.#s_s = 9; expect(s_s).toBe(9); + A.#s_gs = 10; expect(s_gs).toBe(10); + + const a = new A(); + a.#i_f = 11; expect(a.#i_f).toBe(11); + expect(() => a.#i_m = 0).toThrow(TypeError); expect(a.#i_m()).toBe(5); + expect(() => a.#i_g = 0).toThrow(TypeError); expect(a.#i_g).toBe(6); + a.#i_s = 12; expect(i_s).toBe(12); + a.#i_gs = 13; expect(i_gs).toBe(13); + } + + static write_destructuring() { + [A.#s_f] = [14]; expect(A.#s_f).toBe(14); + expect(() => [A.#s_m] = [0]).toThrow(TypeError); expect(A.#s_m()).toBe(1); + expect(() => [A.#s_g] = [0]).toThrow(TypeError); expect(A.#s_g).toBe(2); + [A.#s_s] = [15]; expect(s_s).toBe(15); + [A.#s_gs] = [16]; expect(s_gs).toBe(16); + + const a = new A(); + [a.#i_f] = [17]; expect(a.#i_f).toBe(17); + expect(() => [a.#i_m] = [0]).toThrow(TypeError); expect(a.#i_m()).toBe(5); + expect(() => [a.#i_g] = [0]).toThrow(TypeError); expect(a.#i_g).toBe(6); + [a.#i_s] = [18]; expect(i_s).toBe(18); + [a.#i_gs] = [19]; expect(i_gs).toBe(19); + } +} + +A.read(); +A.write(); +A.write_destructuring(); diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/input.js b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/input.js new file mode 100644 index 000000000000..8f9f16f69d98 --- /dev/null +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/input.js @@ -0,0 +1,62 @@ +// @force-old-private-helpers + +class A { + static #s_f = 0; + static #s_m() {} + static get #s_g() {} + static set #s_s(v) {} + static get #s_gs() {} + static set #s_gs(v) {} + + #i_f = 0; + #i_m() {} + get #i_g() {} + set #i_s(v) {} + get #i_gs() {} + set #i_gs(v) {} + + static read() { + A.#s_f; + A.#s_m; + A.#s_g; + A.#s_s; + A.#s_gs; + + const a = new A(); + a.#i_f; + a.#i_m; + a.#i_g; + a.#i_s; + a.#i_gs; + } + + static write() { + A.#s_f = 1; + A.#s_m = 2; + A.#s_g = 3; + A.#s_s = 4; + A.#s_gs = 5; + + const a = new A(); + a.#i_f = 6; + a.#i_m = 7; + a.#i_g = 8; + a.#i_s = 9; + a.#i_gs = 10; + } + + static write_destructuring() { + [A.#s_f] = [1]; + [A.#s_m] = [2]; + [A.#s_g] = [3]; + [A.#s_s] = [4]; + [A.#s_gs] = [5]; + + const a = new A(); + [a.#i_f] = [6]; + [a.#i_m] = [7]; + [a.#i_g] = [8]; + [a.#i_s] = [9]; + [a.#i_gs] = [10]; + } +} diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/options.json b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/options.json new file mode 100644 index 000000000000..8879f8dc785b --- /dev/null +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/options.json @@ -0,0 +1,6 @@ +{ + "BABEL_8_BREAKING": false, + "SKIP_ON_PUBLISH": true, + "plugins": ["transform-class-properties", "transform-private-methods"], + "minNodeVersion": "16.0.0" +} diff --git a/packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/output.js b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/output.js new file mode 100644 index 000000000000..48260816877f --- /dev/null +++ b/packages/babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers/output.js @@ -0,0 +1,93 @@ +var _i_f = /*#__PURE__*/new WeakMap(); +var _i_m = /*#__PURE__*/new WeakSet(); +var _i_g = /*#__PURE__*/new WeakMap(); +var _i_s = /*#__PURE__*/new WeakMap(); +var _i_gs = /*#__PURE__*/new WeakMap(); +// @force-old-private-helpers + +class A { + constructor() { + babelHelpers.classPrivateFieldInitSpec(this, _i_gs, { + get: _get_i_gs, + set: _set_i_gs + }); + babelHelpers.classPrivateFieldInitSpec(this, _i_s, { + get: void 0, + set: _set_i_s + }); + babelHelpers.classPrivateFieldInitSpec(this, _i_g, { + get: _get_i_g, + set: void 0 + }); + babelHelpers.classPrivateMethodInitSpec(this, _i_m); + babelHelpers.classPrivateFieldInitSpec(this, _i_f, { + writable: true, + value: 0 + }); + } + static read() { + babelHelpers.classStaticPrivateFieldSpecGet(A, A, _s_f); + babelHelpers.classStaticPrivateMethodGet(A, A, _s_m); + babelHelpers.classStaticPrivateFieldSpecGet(A, A, _s_g); + babelHelpers.classStaticPrivateFieldSpecGet(A, A, _s_s); + babelHelpers.classStaticPrivateFieldSpecGet(A, A, _s_gs); + const a = new A(); + babelHelpers.classPrivateFieldGet(a, _i_f); + babelHelpers.classPrivateMethodGet(a, _i_m, _i_m2); + babelHelpers.classPrivateFieldGet(a, _i_g); + a, babelHelpers.writeOnlyError("#i_s"); + babelHelpers.classPrivateFieldGet(a, _i_gs); + } + static write() { + babelHelpers.classStaticPrivateFieldSpecSet(A, A, _s_f, 1); + babelHelpers.classStaticPrivateMethodSet(A, A, _s_m, 2); + babelHelpers.classStaticPrivateFieldSpecSet(A, A, _s_g, 3); + babelHelpers.classStaticPrivateFieldSpecSet(A, A, _s_s, 4); + babelHelpers.classStaticPrivateFieldSpecSet(A, A, _s_gs, 5); + const a = new A(); + babelHelpers.classPrivateFieldSet(a, _i_f, 6); + a, 7, babelHelpers.readOnlyError("#i_m"); + a, 8, babelHelpers.readOnlyError("#i_g"); + babelHelpers.classPrivateFieldSet(a, _i_s, 9); + babelHelpers.classPrivateFieldSet(a, _i_gs, 10); + } + static write_destructuring() { + [babelHelpers.classStaticPrivateFieldDestructureSet(A, A, _s_f).value] = [1]; + [babelHelpers.classStaticPrivateFieldDestructureSet(A, A, _s_m).value] = [2]; + [babelHelpers.classStaticPrivateFieldDestructureSet(A, A, _s_g).value] = [3]; + [babelHelpers.classStaticPrivateFieldDestructureSet(A, A, _s_s).value] = [4]; + [babelHelpers.classStaticPrivateFieldDestructureSet(A, A, _s_gs).value] = [5]; + const a = new A(); + [babelHelpers.classPrivateFieldDestructureSet(a, _i_f).value] = [6]; + [babelHelpers.classPrivateFieldDestructureSet(a, _i_m).value] = [7]; + [babelHelpers.classPrivateFieldDestructureSet(a, _i_g).value] = [8]; + [babelHelpers.classPrivateFieldDestructureSet(a, _i_s).value] = [9]; + [babelHelpers.classPrivateFieldDestructureSet(a, _i_gs).value] = [10]; + } +} +function _s_m() {} +function _get_s_g() {} +function _set_s_s(v) {} +function _get_s_gs() {} +function _set_s_gs(v) {} +function _i_m2() {} +function _get_i_g() {} +function _set_i_s(v) {} +function _get_i_gs() {} +function _set_i_gs(v) {} +var _s_gs = { + get: _get_s_gs, + set: _set_s_gs +}; +var _s_s = { + get: void 0, + set: _set_s_s +}; +var _s_g = { + get: _get_s_g, + set: void 0 +}; +var _s_f = { + writable: true, + value: 0 +}; diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/multiple-static-initializers/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/multiple-static-initializers/output.js index b4773b70a1c5..125a42a67e78 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/multiple-static-initializers/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/multiple-static-initializers/output.js @@ -2,11 +2,10 @@ var _Foo; class Foo {} _Foo = Foo; var _bar = { - writable: true, - value: 21 + _: 21 }; (() => { - _Foo.foo = babelHelpers.classStaticPrivateFieldSpecGet(_Foo, _Foo, _bar); + _Foo.foo = babelHelpers.assertClassBrand(_Foo, _Foo, _bar)._; _Foo.qux1 = _Foo.qux; })(); babelHelpers.defineProperty(Foo, "qux", 21); diff --git a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/name-conflict/output.js b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/name-conflict/output.js index 5b06cac37120..9e32967ac2d1 100644 --- a/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/name-conflict/output.js +++ b/packages/babel-plugin-transform-class-static-block/test/fixtures/integration/name-conflict/output.js @@ -2,10 +2,9 @@ var _Foo; class Foo {} _Foo = Foo; var _ = { - writable: true, - value: 42 + _: 42 }; // static block can not be transformed as `#_` here -_Foo.foo = babelHelpers.classStaticPrivateFieldSpecGet(_Foo, _Foo, _); +_Foo.foo = babelHelpers.assertClassBrand(_Foo, _Foo, _)._; expect(Foo.foo).toBe(42); diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/basic/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/basic/output.js index 987dbf3a1fd6..6d09147132cd 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/basic/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/basic/output.js @@ -1,27 +1,21 @@ var _privateField = /*#__PURE__*/new WeakMap(); -var _privateFieldValue = /*#__PURE__*/new WeakMap(); +var _privateFieldValue = /*#__PURE__*/new WeakSet(); class Cl { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _privateFieldValue, { - get: _get_privateFieldValue, - set: _set_privateFieldValue - }); - babelHelpers.classPrivateFieldInitSpec(this, _privateField, { - writable: true, - value: "top secret string" - }); + babelHelpers.classPrivateMethodInitSpec(this, _privateFieldValue); + babelHelpers.classPrivateFieldInitSpec(this, _privateField, "top secret string"); this.publicField = "not secret string"; } publicGetPrivateField() { - return babelHelpers.classPrivateFieldGet(this, _privateFieldValue); + return babelHelpers.classPrivateGetter(this, _privateFieldValue, _get_privateFieldValue); } publicSetPrivateField(newValue) { - babelHelpers.classPrivateFieldSet(this, _privateFieldValue, newValue); + babelHelpers.classPrivateSetter(this, _privateFieldValue, _set_privateFieldValue, newValue); } } function _get_privateFieldValue() { - return babelHelpers.classPrivateFieldGet(this, _privateField); + return babelHelpers.classPrivateFieldGet2(this, _privateField); } function _set_privateFieldValue(newValue) { - babelHelpers.classPrivateFieldSet(this, _privateField, newValue); + babelHelpers.classPrivateFieldSet2(this, _privateField, newValue); } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/class-binding/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/class-binding/output.js index 4b97010cad95..a243eeb993ca 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/class-binding/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/class-binding/output.js @@ -1,11 +1,8 @@ var _A; -var _getA = /*#__PURE__*/new WeakMap(); +var _getA = /*#__PURE__*/new WeakSet(); class A { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _getA, { - get: _get_getA, - set: void 0 - }); + babelHelpers.classPrivateMethodInitSpec(this, _getA); } } _A = A; diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/destructuring/input.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/destructuring/input.js new file mode 100644 index 000000000000..d8b04b22d8b3 --- /dev/null +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/destructuring/input.js @@ -0,0 +1,9 @@ +class A { + set #setter(v) {} + get #getter() {} + + m() { + [this.#setter] = [1]; + [this.#getter] = [1]; + } +} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/destructuring/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/destructuring/output.js new file mode 100644 index 000000000000..b552107122b8 --- /dev/null +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/destructuring/output.js @@ -0,0 +1,12 @@ +var _setter = /*#__PURE__*/new WeakSet(); +class A { + constructor() { + babelHelpers.classPrivateMethodInitSpec(this, _setter); + } + m() { + [babelHelpers.toSetter(babelHelpers.classPrivateSetter, null, this, _setter, _set_setter)._] = [1]; + [(this, babelHelpers.readOnlyError("#getter"))._] = [1]; + } +} +function _set_setter(v) {} +function _get_getter() {} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/get-only-setter/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/get-only-setter/output.js index b35cae83239d..c7be0a97e9fb 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/get-only-setter/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/get-only-setter/output.js @@ -1,18 +1,12 @@ var _privateField = /*#__PURE__*/new WeakMap(); -var _privateFieldValue = /*#__PURE__*/new WeakMap(); +var _privateFieldValue = /*#__PURE__*/new WeakSet(); class Cl { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _privateFieldValue, { - get: void 0, - set: _set_privateFieldValue - }); - babelHelpers.classPrivateFieldInitSpec(this, _privateField, { - writable: true, - value: 0 - }); + babelHelpers.classPrivateMethodInitSpec(this, _privateFieldValue); + babelHelpers.classPrivateFieldInitSpec(this, _privateField, 0); this.publicField = (this, babelHelpers.writeOnlyError("#privateFieldValue")); } } function _set_privateFieldValue(newValue) { - babelHelpers.classPrivateFieldSet(this, _privateField, newValue); + babelHelpers.classPrivateFieldSet2(this, _privateField, newValue); } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/preserve-comments/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/preserve-comments/output.js index eeefea967bfc..7ebcc61a018c 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/preserve-comments/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/preserve-comments/output.js @@ -1,11 +1,8 @@ -var _a = /*#__PURE__*/new WeakMap(); +var _a = /*#__PURE__*/new WeakSet(); class C { constructor() { /* before get a */ - babelHelpers.classPrivateFieldInitSpec(this, _a, { - get: _get_a, - set: _set_a - }); + babelHelpers.classPrivateMethodInitSpec(this, _a); } /* after set a */ } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/reassignment/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/reassignment/output.js index bbb8debe76cd..b4ddc6de5878 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/reassignment/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/reassignment/output.js @@ -1,11 +1,8 @@ var results = []; -var _privateFieldValue = /*#__PURE__*/new WeakMap(); +var _privateFieldValue = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _privateFieldValue, { - get: _get_privateFieldValue, - set: void 0 - }); + babelHelpers.classPrivateMethodInitSpec(this, _privateFieldValue); this.self, results.push(2), babelHelpers.readOnlyError("#privateFieldValue"); } get self() { diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/set-only-getter/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/set-only-getter/output.js index 713c90cee9d2..a0396db04a01 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/set-only-getter/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/set-only-getter/output.js @@ -1,24 +1,18 @@ var _privateField = /*#__PURE__*/new WeakMap(); -var _privateFieldValue = /*#__PURE__*/new WeakMap(); +var _privateFieldValue = /*#__PURE__*/new WeakSet(); class Cl { get self() { this.counter++; return this; } constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _privateFieldValue, { - get: _get_privateFieldValue, - set: void 0 - }); - babelHelpers.classPrivateFieldInitSpec(this, _privateField, { - writable: true, - value: 0 - }); + babelHelpers.classPrivateMethodInitSpec(this, _privateFieldValue); + babelHelpers.classPrivateFieldInitSpec(this, _privateField, 0); babelHelpers.defineProperty(this, "counter", 0); - this.self, 1([babelHelpers.classPrivateFieldDestructureSet(this.self, _privateFieldValue).value] = [1]), babelHelpers.readOnlyError("#privateFieldValue"); + this.self, 1([(this.self, babelHelpers.readOnlyError("#privateFieldValue"))._] = [1]), babelHelpers.readOnlyError("#privateFieldValue"); } } function _get_privateFieldValue() { - return babelHelpers.classPrivateFieldGet(this, _privateField); + return babelHelpers.classPrivateFieldGet2(this, _privateField); } var cl = new Cl(); diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/tagged-template/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/tagged-template/output.js index 7a87a3591884..6f47dc7238d6 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/tagged-template/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/tagged-template/output.js @@ -1,11 +1,8 @@ -var _tag = /*#__PURE__*/new WeakMap(); +var _tag = /*#__PURE__*/new WeakSet(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _tag, { - get: _get_tag, - set: void 0 - }); - babelHelpers.classPrivateFieldGet(this, _tag).bind(this)``; + babelHelpers.classPrivateMethodInitSpec(this, _tag); + babelHelpers.classPrivateGetter(this, _tag, _get_tag).bind(this)``; } } function _get_tag() { diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/updates-bigint/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/updates-bigint/output.js index 50fd493a6d18..bee00806d640 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/updates-bigint/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/updates-bigint/output.js @@ -1,22 +1,16 @@ var _privateField = /*#__PURE__*/new WeakMap(); -var _privateFieldValue = /*#__PURE__*/new WeakMap(); +var _privateFieldValue = /*#__PURE__*/new WeakSet(); class Cl { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _privateFieldValue, { - get: _get_privateFieldValue, - set: _set_privateFieldValue - }); - babelHelpers.classPrivateFieldInitSpec(this, _privateField, { - writable: true, - value: "top secret string" - }); + babelHelpers.classPrivateMethodInitSpec(this, _privateFieldValue); + babelHelpers.classPrivateFieldInitSpec(this, _privateField, "top secret string"); this.publicField = "not secret string"; } publicGetPrivateField() { - return babelHelpers.classPrivateFieldGet(this, _privateFieldValue); + return babelHelpers.classPrivateGetter(this, _privateFieldValue, _get_privateFieldValue); } publicSetPrivateField(newValue) { - babelHelpers.classPrivateFieldSet(this, _privateFieldValue, newValue); + babelHelpers.classPrivateSetter(this, _privateFieldValue, _set_privateFieldValue, newValue); } get publicFieldValue() { return this.publicField; @@ -26,21 +20,21 @@ class Cl { } testUpdates() { var _this$privateFieldVal, _this$privateFieldVal2, _this$privateFieldVal3, _this$privateFieldVal4, _this$privateFieldVal5; - babelHelpers.classPrivateFieldSet(this, _privateField, 0n); + babelHelpers.classPrivateFieldSet2(this, _privateField, 0n); this.publicField = 0n; - babelHelpers.classPrivateFieldSet(this, _privateFieldValue, (babelHelpers.classPrivateFieldSet(this, _privateFieldValue, (_this$privateFieldVal3 = babelHelpers.classPrivateFieldGet(this, _privateFieldValue), _this$privateFieldVal4 = _this$privateFieldVal3++, _this$privateFieldVal3)), _this$privateFieldVal4)); + babelHelpers.classPrivateSetter(this, _privateFieldValue, _set_privateFieldValue, (babelHelpers.classPrivateSetter(this, _privateFieldValue, _set_privateFieldValue, (_this$privateFieldVal3 = babelHelpers.classPrivateGetter(this, _privateFieldValue, _get_privateFieldValue), _this$privateFieldVal4 = _this$privateFieldVal3++, _this$privateFieldVal3)), _this$privateFieldVal4)); this.publicFieldValue = this.publicFieldValue++; - babelHelpers.classPrivateFieldSet(this, _privateFieldValue, (_this$privateFieldVal5 = babelHelpers.classPrivateFieldGet(this, _privateFieldValue), ++_this$privateFieldVal5)); + babelHelpers.classPrivateSetter(this, _privateFieldValue, _set_privateFieldValue, (_this$privateFieldVal5 = babelHelpers.classPrivateGetter(this, _privateFieldValue, _get_privateFieldValue), ++_this$privateFieldVal5)); ++this.publicFieldValue; - babelHelpers.classPrivateFieldSet(this, _privateFieldValue, babelHelpers.classPrivateFieldGet(this, _privateFieldValue) + 1n); + babelHelpers.classPrivateSetter(this, _privateFieldValue, _set_privateFieldValue, babelHelpers.classPrivateGetter(this, _privateFieldValue, _get_privateFieldValue) + 1n); this.publicFieldValue += 1n; - babelHelpers.classPrivateFieldSet(this, _privateFieldValue, -(babelHelpers.classPrivateFieldGet(this, _privateFieldValue) ** babelHelpers.classPrivateFieldGet(this, _privateFieldValue))); + babelHelpers.classPrivateSetter(this, _privateFieldValue, _set_privateFieldValue, -(babelHelpers.classPrivateGetter(this, _privateFieldValue, _get_privateFieldValue) ** babelHelpers.classPrivateGetter(this, _privateFieldValue, _get_privateFieldValue))); this.publicFieldValue = -(this.publicFieldValue ** this.publicFieldValue); } } function _get_privateFieldValue() { - return babelHelpers.classPrivateFieldGet(this, _privateField); + return babelHelpers.classPrivateFieldGet2(this, _privateField); } function _set_privateFieldValue(newValue) { - babelHelpers.classPrivateFieldSet(this, _privateField, newValue); + babelHelpers.classPrivateFieldSet2(this, _privateField, newValue); } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/updates/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/updates/output.js index 5a22c43eea43..f9c76e215ce8 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/updates/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/accessors/updates/output.js @@ -1,22 +1,16 @@ var _privateField = /*#__PURE__*/new WeakMap(); -var _privateFieldValue = /*#__PURE__*/new WeakMap(); +var _privateFieldValue = /*#__PURE__*/new WeakSet(); class Cl { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _privateFieldValue, { - get: _get_privateFieldValue, - set: _set_privateFieldValue - }); - babelHelpers.classPrivateFieldInitSpec(this, _privateField, { - writable: true, - value: "top secret string" - }); + babelHelpers.classPrivateMethodInitSpec(this, _privateFieldValue); + babelHelpers.classPrivateFieldInitSpec(this, _privateField, "top secret string"); this.publicField = "not secret string"; } publicGetPrivateField() { - return babelHelpers.classPrivateFieldGet(this, _privateFieldValue); + return babelHelpers.classPrivateGetter(this, _privateFieldValue, _get_privateFieldValue); } publicSetPrivateField(newValue) { - babelHelpers.classPrivateFieldSet(this, _privateFieldValue, newValue); + babelHelpers.classPrivateSetter(this, _privateFieldValue, _set_privateFieldValue, newValue); } get publicFieldValue() { return this.publicField; @@ -26,21 +20,21 @@ class Cl { } testUpdates() { var _this$privateFieldVal, _this$privateFieldVal2, _this$privateFieldVal3, _this$privateFieldVal4, _this$privateFieldVal5; - babelHelpers.classPrivateFieldSet(this, _privateField, 0); + babelHelpers.classPrivateFieldSet2(this, _privateField, 0); this.publicField = 0; - babelHelpers.classPrivateFieldSet(this, _privateFieldValue, (babelHelpers.classPrivateFieldSet(this, _privateFieldValue, (_this$privateFieldVal3 = babelHelpers.classPrivateFieldGet(this, _privateFieldValue), _this$privateFieldVal4 = _this$privateFieldVal3++, _this$privateFieldVal3)), _this$privateFieldVal4)); + babelHelpers.classPrivateSetter(this, _privateFieldValue, _set_privateFieldValue, (babelHelpers.classPrivateSetter(this, _privateFieldValue, _set_privateFieldValue, (_this$privateFieldVal3 = babelHelpers.classPrivateGetter(this, _privateFieldValue, _get_privateFieldValue), _this$privateFieldVal4 = _this$privateFieldVal3++, _this$privateFieldVal3)), _this$privateFieldVal4)); this.publicFieldValue = this.publicFieldValue++; - babelHelpers.classPrivateFieldSet(this, _privateFieldValue, (_this$privateFieldVal5 = babelHelpers.classPrivateFieldGet(this, _privateFieldValue), ++_this$privateFieldVal5)); + babelHelpers.classPrivateSetter(this, _privateFieldValue, _set_privateFieldValue, (_this$privateFieldVal5 = babelHelpers.classPrivateGetter(this, _privateFieldValue, _get_privateFieldValue), ++_this$privateFieldVal5)); ++this.publicFieldValue; - babelHelpers.classPrivateFieldSet(this, _privateFieldValue, babelHelpers.classPrivateFieldGet(this, _privateFieldValue) + 1); + babelHelpers.classPrivateSetter(this, _privateFieldValue, _set_privateFieldValue, babelHelpers.classPrivateGetter(this, _privateFieldValue, _get_privateFieldValue) + 1); this.publicFieldValue += 1; - babelHelpers.classPrivateFieldSet(this, _privateFieldValue, -(babelHelpers.classPrivateFieldGet(this, _privateFieldValue) ** babelHelpers.classPrivateFieldGet(this, _privateFieldValue))); + babelHelpers.classPrivateSetter(this, _privateFieldValue, _set_privateFieldValue, -(babelHelpers.classPrivateGetter(this, _privateFieldValue, _get_privateFieldValue) ** babelHelpers.classPrivateGetter(this, _privateFieldValue, _get_privateFieldValue))); this.publicFieldValue = -(this.publicFieldValue ** this.publicFieldValue); } } function _get_privateFieldValue() { - return babelHelpers.classPrivateFieldGet(this, _privateField); + return babelHelpers.classPrivateFieldGet2(this, _privateField); } function _set_privateFieldValue(newValue) { - babelHelpers.classPrivateFieldSet(this, _privateField, newValue); + babelHelpers.classPrivateFieldSet2(this, _privateField, newValue); } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/duplicated-names/get-set/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/duplicated-names/get-set/output.js index 446eaa0219e5..4f10642d3848 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/duplicated-names/get-set/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/duplicated-names/get-set/output.js @@ -1,20 +1,14 @@ var _privateField = /*#__PURE__*/new WeakMap(); -var _getSet = /*#__PURE__*/new WeakMap(); +var _getSet = /*#__PURE__*/new WeakSet(); class Cl { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _getSet, { - get: _get_getSet, - set: _set_getSet - }); - babelHelpers.classPrivateFieldInitSpec(this, _privateField, { - writable: true, - value: 0 - }); + babelHelpers.classPrivateMethodInitSpec(this, _getSet); + babelHelpers.classPrivateFieldInitSpec(this, _privateField, 0); } } function _get_getSet() { - return babelHelpers.classPrivateFieldGet(this, _privateField); + return babelHelpers.classPrivateFieldGet2(this, _privateField); } function _set_getSet(newValue) { - babelHelpers.classPrivateFieldSet(this, _privateField, newValue); + babelHelpers.classPrivateFieldSet2(this, _privateField, newValue); } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/duplicated-names/set-get/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/duplicated-names/set-get/output.js index e5589c9e79c4..b2252b59192b 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/duplicated-names/set-get/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/duplicated-names/set-get/output.js @@ -1,20 +1,14 @@ var _privateField = /*#__PURE__*/new WeakMap(); -var _getSet = /*#__PURE__*/new WeakMap(); +var _getSet = /*#__PURE__*/new WeakSet(); class Cl { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _getSet, { - get: _get_getSet, - set: _set_getSet - }); - babelHelpers.classPrivateFieldInitSpec(this, _privateField, { - writable: true, - value: 0 - }); + babelHelpers.classPrivateMethodInitSpec(this, _getSet); + babelHelpers.classPrivateFieldInitSpec(this, _privateField, 0); } } function _set_getSet(newValue) { - babelHelpers.classPrivateFieldSet(this, _privateField, newValue); + babelHelpers.classPrivateFieldSet2(this, _privateField, newValue); } function _get_getSet() { - return babelHelpers.classPrivateFieldGet(this, _privateField); + return babelHelpers.classPrivateFieldGet2(this, _privateField); } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/misc/multiple/input.js b/packages/babel-plugin-transform-private-methods/test/fixtures/misc/multiple/input.js new file mode 100644 index 000000000000..923189b82bb6 --- /dev/null +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/misc/multiple/input.js @@ -0,0 +1,18 @@ +class A { + #method() {} + + get #getter() {} + + set #setter(v) {} + + get #getset() {} + set #getset(v) {} + + constructor() { + this.#method(); + this.#getter; + this.#setter = 1; + this.#getset; + this.#getset = 2; + } +} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/misc/multiple/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/misc/multiple/output.js new file mode 100644 index 000000000000..1194936cddf3 --- /dev/null +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/misc/multiple/output.js @@ -0,0 +1,16 @@ +var _method = /*#__PURE__*/new WeakSet(); +class A { + constructor() { + babelHelpers.classPrivateMethodInitSpec(this, _method); + babelHelpers.classPrivateMethodGet(this, _method, _method2).call(this); + babelHelpers.classPrivateGetter(this, _method, _get_getter); + babelHelpers.classPrivateSetter(this, _method, _set_setter, 1); + babelHelpers.classPrivateGetter(this, _method, _get_getset); + babelHelpers.classPrivateSetter(this, _method, _set_getset, 2); + } +} +function _method2() {} +function _get_getter() {} +function _set_setter(v) {} +function _get_getset() {} +function _set_getset(v) {} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/misc/options.json b/packages/babel-plugin-transform-private-methods/test/fixtures/misc/options.json new file mode 100644 index 000000000000..815656a57081 --- /dev/null +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/misc/options.json @@ -0,0 +1,7 @@ +{ + "plugins": [ + "transform-private-methods", + "transform-class-properties", + "transform-block-scoping" + ] +} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/before-fields/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/before-fields/output.js index bc838501cbd2..a22676deaf1a 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/before-fields/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/before-fields/output.js @@ -4,13 +4,10 @@ class Cl { constructor() { babelHelpers.classPrivateMethodInitSpec(this, _method); babelHelpers.defineProperty(this, "prop", babelHelpers.classPrivateMethodGet(this, _method, _method2).call(this, 1)); - babelHelpers.classPrivateFieldInitSpec(this, _priv, { - writable: true, - value: babelHelpers.classPrivateMethodGet(this, _method, _method2).call(this, 2) - }); + babelHelpers.classPrivateFieldInitSpec(this, _priv, babelHelpers.classPrivateMethodGet(this, _method, _method2).call(this, 2)); } getPriv() { - return babelHelpers.classPrivateFieldGet(this, _priv); + return babelHelpers.classPrivateFieldGet2(this, _priv); } } function _method2(x) { diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/destructuring/input.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/destructuring/input.js new file mode 100644 index 000000000000..a5cfbd1bcc24 --- /dev/null +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/destructuring/input.js @@ -0,0 +1,7 @@ +class A { + #method() {} + + m() { + [this.#method] = [1]; + } +} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/destructuring/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/destructuring/output.js new file mode 100644 index 000000000000..105ad7d94665 --- /dev/null +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/destructuring/output.js @@ -0,0 +1,10 @@ +var _method = /*#__PURE__*/new WeakSet(); +class A { + constructor() { + babelHelpers.classPrivateMethodInitSpec(this, _method); + } + m() { + [(this, babelHelpers.readOnlyError("#method"))._] = [1]; + } +} +function _method2() {} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/read-only/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/read-only/output.js index 31668270d224..3c2f34e50860 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/read-only/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-method/read-only/output.js @@ -8,7 +8,7 @@ class A { babelHelpers.classPrivateMethodInitSpec(this, _method); babelHelpers.defineProperty(this, "counter", 0); this.self(), 2, babelHelpers.readOnlyError("#method"); - [babelHelpers.classPrivateFieldDestructureSet(this, _method).value] = [2]; + [(this, babelHelpers.readOnlyError("#method"))._] = [2]; } } function _method2() {} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-loose/async/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-loose/async/output.js index d7fad66c11af..6020a94ae543 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-loose/async/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method-loose/async/output.js @@ -1,6 +1,6 @@ class Cl { test() { - return babelHelpers.classStaticPrivateMethodGet(Cl, Cl, _privateStaticMethod).call(Cl); + return _privateStaticMethod.call(Cl); } } async function _privateStaticMethod() { diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/async/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/async/output.js index d7fad66c11af..6020a94ae543 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/async/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/async/output.js @@ -1,6 +1,6 @@ class Cl { test() { - return babelHelpers.classStaticPrivateMethodGet(Cl, Cl, _privateStaticMethod).call(Cl); + return _privateStaticMethod.call(Cl); } } async function _privateStaticMethod() { diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/basic/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/basic/output.js index 4356e0980bd5..5505db070f6d 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/basic/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/basic/output.js @@ -1,18 +1,18 @@ class Cl { static staticMethod2() { - return babelHelpers.classStaticPrivateMethodGet(Cl, Cl, _privateStaticMethod).call(Cl); + return _privateStaticMethod.call(Cl); } static staticMethod() { - return babelHelpers.classStaticPrivateMethodGet(Cl, Cl, _privateStaticMethod).call(Cl); + return _privateStaticMethod.call(Cl); } static privateStaticMethod() { - return babelHelpers.classStaticPrivateMethodGet(Cl, Cl, _privateStaticMethod).call(Cl); + return _privateStaticMethod.call(Cl); } publicMethod() { - return babelHelpers.classStaticPrivateMethodGet(Cl, Cl, _privateStaticMethod).call(Cl); + return _privateStaticMethod.call(Cl); } constructor() { - this.instanceField = babelHelpers.classStaticPrivateMethodGet(Cl, Cl, _privateStaticMethod).call(Cl); + this.instanceField = _privateStaticMethod.call(Cl); } } function _privateStaticMethod() { diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/class-check/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/class-check/output.js index 157bfe7faacb..64d384ba37f7 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/class-check/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/class-check/output.js @@ -1,6 +1,6 @@ class Cl { publicMethod(checked) { - return babelHelpers.classStaticPrivateMethodGet(checked, Cl, _privateStaticMethod).call(checked); + return babelHelpers.assertClassBrand(checked, Cl, _privateStaticMethod).call(checked); } } function _privateStaticMethod() {} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/class-expression/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/class-expression/output.js index 691f8c0f8453..f5359a17a326 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/class-expression/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/class-expression/output.js @@ -1,7 +1,7 @@ var _A; console.log(_A = class A { method() { - babelHelpers.classStaticPrivateMethodGet(this, _A, _foo).call(this); + babelHelpers.assertClassBrand(this, _A, _foo).call(this); } }); function _foo() {} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/exfiltrated/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/exfiltrated/output.js index da28ce6be03a..1159494ee68a 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/exfiltrated/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/exfiltrated/output.js @@ -2,7 +2,7 @@ var exfiltrated; class Cl { constructor() { if (exfiltrated === undefined) { - exfiltrated = babelHelpers.classStaticPrivateMethodGet(Cl, Cl, _privateStaticMethod); + exfiltrated = _privateStaticMethod; } } } diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/generator/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/generator/output.js index f91cc3b95d05..4348c1716551 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/generator/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/generator/output.js @@ -1,6 +1,6 @@ class Cl { test() { - return babelHelpers.classStaticPrivateMethodGet(Cl, Cl, _foo).call(Cl); + return _foo.call(Cl); } } function* _foo() { diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/read-only/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/read-only/output.js index 83be0e964280..52c73115e0f0 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/read-only/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/read-only/output.js @@ -1,7 +1,7 @@ class A { run() { - babelHelpers.classStaticPrivateMethodSet(A, A, _method, 2); - [babelHelpers.classStaticPrivateFieldDestructureSet(A, A, _method).value] = [2]; + 2, babelHelpers.readOnlyError("#method"); + [(A, babelHelpers.readOnlyError("#method"))._] = [2]; } } function _method() {} diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/super/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/super/output.js index 883461364be6..719011719d92 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/super/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/super/output.js @@ -9,7 +9,7 @@ class Sub extends Base { return 'bad'; } static check() { - babelHelpers.classStaticPrivateMethodGet(Sub, Sub, _subStaticPrivateMethod).call(Sub); + _subStaticPrivateMethod.call(Sub); } } _Sub = Sub; diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/tagged-template/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/tagged-template/output.js index 10171603af7e..284a83b86f35 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/tagged-template/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/tagged-template/output.js @@ -2,6 +2,6 @@ var _Foo; class Foo {} _Foo = Foo; function _tag() { - babelHelpers.classStaticPrivateMethodGet(this, _Foo, _tag).bind(this)``; + babelHelpers.assertClassBrand(this, _Foo, _tag).bind(this)``; } new Foo(); diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/this/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/this/output.js index 8871cf7c9177..98812791f288 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/this/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/private-static-method/this/output.js @@ -9,7 +9,7 @@ class B extends A { return 2; } static extract() { - return [babelHelpers.classStaticPrivateMethodGet(this, B, _getA), babelHelpers.classStaticPrivateMethodGet(this, B, _getB)]; + return [babelHelpers.assertClassBrand(this, B, _getA), babelHelpers.assertClassBrand(this, B, _getB)]; } } _B = B; diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/basic/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/basic/output.js index 7681b43bd515..d4257de871cd 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/basic/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/basic/output.js @@ -1,24 +1,17 @@ -var _Cl; class Cl { static getValue() { - return babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateStaticFieldValue); + return _get_privateStaticFieldValue.call(Cl); } static setValue() { - babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateStaticFieldValue, "dank"); + _set_privateStaticFieldValue.call(Cl, "dank"); } } -_Cl = Cl; function _get_privateStaticFieldValue() { - return babelHelpers.classStaticPrivateFieldSpecGet(_Cl, _Cl, _PRIVATE_STATIC_FIELD); + return _PRIVATE_STATIC_FIELD._; } function _set_privateStaticFieldValue(newValue) { - babelHelpers.classStaticPrivateFieldSpecSet(_Cl, _Cl, _PRIVATE_STATIC_FIELD, `Updated: ${newValue}`); + _PRIVATE_STATIC_FIELD._ = `Updated: ${newValue}`; } -var _privateStaticFieldValue = { - get: _get_privateStaticFieldValue, - set: _set_privateStaticFieldValue -}; var _PRIVATE_STATIC_FIELD = { - writable: true, - value: "top secret string" + _: "top secret string" }; diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/destructure-set/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/destructure-set/output.js index e8f95994bc87..3de8927d927a 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/destructure-set/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/destructure-set/output.js @@ -1,19 +1,12 @@ -var _C; class C { constructor() { - [babelHelpers.classStaticPrivateFieldDestructureSet(C, C, _p).value] = [0]; + [babelHelpers.toSetter(_set_p, C)._] = [0]; } } -_C = C; function _set_p(v) { - babelHelpers.classStaticPrivateFieldSpecSet(_C, _C, _q, v); + _q._ = v; } -var _p = { - get: void 0, - set: _set_p -}; var _q = { - writable: true, - value: void 0 + _: void 0 }; new C(); diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/get-only-setter/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/get-only-setter/output.js index 3f69c5911d45..196c22b46771 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/get-only-setter/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/get-only-setter/output.js @@ -1,18 +1,11 @@ -var _Cl; class Cl { static getPrivateStaticFieldValue() { - return babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateStaticFieldValue); + return void 0; } } -_Cl = Cl; function _set_privateStaticFieldValue(newValue) { - babelHelpers.classStaticPrivateFieldSpecSet(_Cl, _Cl, _PRIVATE_STATIC_FIELD, newValue); + _PRIVATE_STATIC_FIELD._ = newValue; } -var _privateStaticFieldValue = { - get: void 0, - set: _set_privateStaticFieldValue -}; var _PRIVATE_STATIC_FIELD = { - writable: true, - value: 0 + _: 0 }; diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/preserve-comments/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/preserve-comments/output.js index 599408838ffd..de196a85d060 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/preserve-comments/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/preserve-comments/output.js @@ -6,7 +6,3 @@ function _get_a() { /* after get a */ /* before set a */ function _set_a(v) {} -var _a = { - get: _get_a, - set: _set_a -}; diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/set-only-getter/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/set-only-getter/output.js index 2704eb2d0902..a29ccfd2a343 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/set-only-getter/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/set-only-getter/output.js @@ -1,20 +1,15 @@ var _Cl; class Cl { constructor() { - babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, 1); - [babelHelpers.classStaticPrivateFieldDestructureSet(Cl, Cl, _privateFieldValue).value] = [1]; + 1, babelHelpers.readOnlyError("#privateFieldValue"); + [(Cl, babelHelpers.readOnlyError("#privateFieldValue"))._] = [1]; } } _Cl = Cl; function _get_privateFieldValue() { - return babelHelpers.classStaticPrivateFieldSpecGet(this, _Cl, _privateField); + return babelHelpers.assertClassBrand(this, _Cl, _privateField)._; } -var _privateFieldValue = { - get: _get_privateFieldValue, - set: void 0 -}; var _privateField = { - writable: true, - value: 0 + _: 0 }; var cl = new Cl(); diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/tagged-template/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/tagged-template/output.js index ec205b745ae4..f60ee7ccd953 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/tagged-template/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/tagged-template/output.js @@ -1,6 +1,6 @@ class Foo { static test() { - var receiver = babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _tag).bind(this)``; + var receiver = babelHelpers.classPrivateGetter(this, Foo, _get_tag).bind(this)``; expect(receiver).toBe(this); } } @@ -9,7 +9,3 @@ function _get_tag() { return this; }; } -var _tag = { - get: _get_tag, - set: void 0 -}; diff --git a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/updates/output.js b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/updates/output.js index e7058c8d0fe5..b320915a6069 100644 --- a/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/updates/output.js +++ b/packages/babel-plugin-transform-private-methods/test/fixtures/static-accessors/updates/output.js @@ -1,10 +1,9 @@ -var _Cl; class Cl { static publicGetPrivateField() { - return babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateFieldValue); + return _get_privateFieldValue.call(Cl); } static publicSetPrivateField(newValue) { - babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, newValue); + _set_privateFieldValue.call(Cl, newValue); } static get publicFieldValue() { return Cl.publicField; @@ -14,31 +13,25 @@ class Cl { } static testUpdates() { var _Cl$privateFieldValue, _Cl$privateFieldValue2, _Cl$privateFieldValue3, _Cl$privateFieldValue4, _Cl$privateFieldValue5; - babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateField, 0); + _privateField._ = 0; Cl.publicField = 0; - babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, (babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, (_Cl$privateFieldValue3 = babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateFieldValue), _Cl$privateFieldValue4 = _Cl$privateFieldValue3++, _Cl$privateFieldValue3)), _Cl$privateFieldValue4)); + _set_privateFieldValue.call(Cl, (_set_privateFieldValue.call(Cl, (_Cl$privateFieldValue3 = _get_privateFieldValue.call(Cl), _Cl$privateFieldValue4 = _Cl$privateFieldValue3++, _Cl$privateFieldValue3)), _Cl$privateFieldValue4)); Cl.publicFieldValue = Cl.publicFieldValue++; - babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, (_Cl$privateFieldValue5 = babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateFieldValue), ++_Cl$privateFieldValue5)); + _set_privateFieldValue.call(Cl, (_Cl$privateFieldValue5 = _get_privateFieldValue.call(Cl), ++_Cl$privateFieldValue5)); ++Cl.publicFieldValue; - babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateFieldValue) + 1); + _set_privateFieldValue.call(Cl, _get_privateFieldValue.call(Cl) + 1); Cl.publicFieldValue += 1; - babelHelpers.classStaticPrivateFieldSpecSet(Cl, Cl, _privateFieldValue, -(babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateFieldValue) ** babelHelpers.classStaticPrivateFieldSpecGet(Cl, Cl, _privateFieldValue))); + _set_privateFieldValue.call(Cl, -(_get_privateFieldValue.call(Cl) ** _get_privateFieldValue.call(Cl))); Cl.publicFieldValue = -(Cl.publicFieldValue ** Cl.publicFieldValue); } } -_Cl = Cl; function _get_privateFieldValue() { - return babelHelpers.classStaticPrivateFieldSpecGet(_Cl, _Cl, _privateField); + return _privateField._; } function _set_privateFieldValue(newValue) { - babelHelpers.classStaticPrivateFieldSpecSet(_Cl, _Cl, _privateField, newValue); + _privateField._ = newValue; } -var _privateFieldValue = { - get: _get_privateFieldValue, - set: _set_privateFieldValue -}; var _privateField = { - writable: true, - value: "top secret string" + _: "top secret string" }; babelHelpers.defineProperty(Cl, "publicField", "not secret string"); diff --git a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private-loose/native-classes/output.js b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private-loose/native-classes/output.js index 596332f31431..4d280b6c6328 100644 --- a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private-loose/native-classes/output.js +++ b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private-loose/native-classes/output.js @@ -1,10 +1,7 @@ var _bar = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _bar, { - writable: true, - value: "bar" - }); + babelHelpers.classPrivateFieldInitSpec(this, _bar, "bar"); } static test() { return babelHelpers.checkInRHS(Foo) === Foo; @@ -14,6 +11,5 @@ class Foo { } } var _foo = { - writable: true, - value: "foo" + _: "foo" }; diff --git a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private-loose/static-shadow/output.js b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private-loose/static-shadow/output.js index ae4aa620ac05..88f1ecf81070 100644 --- a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private-loose/static-shadow/output.js +++ b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private-loose/static-shadow/output.js @@ -9,6 +9,5 @@ class Test { } } var _x = { - writable: true, - value: 1 + _: 1 }; diff --git a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/accessor/output.js b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/accessor/output.js index 2ddcb76181b9..e360a234e5a4 100644 --- a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/accessor/output.js +++ b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/accessor/output.js @@ -1,13 +1,10 @@ -var _foo = /*#__PURE__*/new WeakMap(); +var _foo = /*#__PURE__*/new WeakSet(); let Foo = /*#__PURE__*/function () { "use strict"; function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - get: _get_foo, - set: void 0 - }); + babelHelpers.classPrivateMethodInitSpec(this, _foo); } babelHelpers.createClass(Foo, [{ key: "test", diff --git a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/field/output.js b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/field/output.js index a632933ac604..4f5e444e3d73 100644 --- a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/field/output.js +++ b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/field/output.js @@ -4,10 +4,7 @@ let Foo = /*#__PURE__*/function () { function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: 1 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, 1); } babelHelpers.createClass(Foo, [{ key: "test", diff --git a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/native-classes/output.js b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/native-classes/output.js index 596332f31431..4d280b6c6328 100644 --- a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/native-classes/output.js +++ b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/native-classes/output.js @@ -1,10 +1,7 @@ var _bar = /*#__PURE__*/new WeakMap(); class Foo { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _bar, { - writable: true, - value: "bar" - }); + babelHelpers.classPrivateFieldInitSpec(this, _bar, "bar"); } static test() { return babelHelpers.checkInRHS(Foo) === Foo; @@ -14,6 +11,5 @@ class Foo { } } var _foo = { - writable: true, - value: "foo" + _: "foo" }; diff --git a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/nested-class-other-redeclared/output.js b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/nested-class-other-redeclared/output.js index e67fc1769a46..87acf7048526 100644 --- a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/nested-class-other-redeclared/output.js +++ b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/nested-class-other-redeclared/output.js @@ -5,14 +5,8 @@ let Foo = /*#__PURE__*/function () { function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: 1 - }); - babelHelpers.classPrivateFieldInitSpec(this, _bar, { - writable: true, - value: 1 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, 1); + babelHelpers.classPrivateFieldInitSpec(this, _bar, 1); } babelHelpers.createClass(Foo, [{ key: "test", @@ -21,10 +15,7 @@ let Foo = /*#__PURE__*/function () { let Nested = /*#__PURE__*/function () { function Nested() { babelHelpers.classCallCheck(this, Nested); - babelHelpers.classPrivateFieldInitSpec(this, _bar2, { - writable: true, - value: 2 - }); + babelHelpers.classPrivateFieldInitSpec(this, _bar2, 2); } babelHelpers.createClass(Nested, [{ key: "test", diff --git a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/nested-class-redeclared/output.js b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/nested-class-redeclared/output.js index faacad85de43..1cd565dffd15 100644 --- a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/nested-class-redeclared/output.js +++ b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/nested-class-redeclared/output.js @@ -4,10 +4,7 @@ let Foo = /*#__PURE__*/function () { function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: 1 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, 1); } babelHelpers.createClass(Foo, [{ key: "test", @@ -16,10 +13,7 @@ let Foo = /*#__PURE__*/function () { let Nested = /*#__PURE__*/function () { function Nested() { babelHelpers.classCallCheck(this, Nested); - babelHelpers.classPrivateFieldInitSpec(this, _foo2, { - writable: true, - value: 2 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo2, 2); } babelHelpers.createClass(Nested, [{ key: "test", diff --git a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/nested-class/output.js b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/nested-class/output.js index d0bb08ff47f3..7784c123ff65 100644 --- a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/nested-class/output.js +++ b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/nested-class/output.js @@ -4,10 +4,7 @@ let Foo = /*#__PURE__*/function () { function Foo() { babelHelpers.classCallCheck(this, Foo); - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: 1 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, 1); } babelHelpers.createClass(Foo, [{ key: "test", diff --git a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/static-accessor/output.js b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/static-accessor/output.js index e1dddc3e9c71..1dde7eca70ea 100644 --- a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/static-accessor/output.js +++ b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/static-accessor/output.js @@ -13,7 +13,3 @@ let Foo = /*#__PURE__*/function () { return Foo; }(); function _get_foo() {} -var _foo = { - get: _get_foo, - set: void 0 -}; diff --git a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/static-field/output.js b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/static-field/output.js index 9c65a222b8b2..74597479528d 100644 --- a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/static-field/output.js +++ b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/static-field/output.js @@ -13,6 +13,5 @@ let Foo = /*#__PURE__*/function () { return Foo; }(); var _foo = { - writable: true, - value: 1 + _: 1 }; diff --git a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/static-shadow/output.js b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/static-shadow/output.js index ae4aa620ac05..88f1ecf81070 100644 --- a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/static-shadow/output.js +++ b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/private/static-shadow/output.js @@ -9,6 +9,5 @@ class Test { } } var _x = { - writable: true, - value: 1 + _: 1 }; diff --git a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/to-native-fields/static-shadow/output.js b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/to-native-fields/static-shadow/output.js index ae4aa620ac05..88f1ecf81070 100644 --- a/packages/babel-plugin-transform-private-property-in-object/test/fixtures/to-native-fields/static-shadow/output.js +++ b/packages/babel-plugin-transform-private-property-in-object/test/fixtures/to-native-fields/static-shadow/output.js @@ -9,6 +9,5 @@ class Test { } } var _x = { - writable: true, - value: 1 + _: 1 }; diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/class-features-node-12-babel-7/output.js b/packages/babel-preset-env/test/fixtures/plugins-integration/class-features-node-12-babel-7/output.js index 68229c2a108c..cca805573ab9 100644 --- a/packages/babel-preset-env/test/fixtures/plugins-integration/class-features-node-12-babel-7/output.js +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/class-features-node-12-babel-7/output.js @@ -6,12 +6,9 @@ var _y = /*#__PURE__*/new WeakSet(); class B { constructor() { babelHelpers.classPrivateMethodInitSpec(this, _y); - babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _x, void 0); } } function _y2() { - babelHelpers.classPrivateFieldGet(this, _x); + babelHelpers.classPrivateFieldGet2(this, _x); } diff --git a/packages/babel-preset-env/test/fixtures/plugins-integration/class-features-node-12/output.js b/packages/babel-preset-env/test/fixtures/plugins-integration/class-features-node-12/output.js index 68229c2a108c..cca805573ab9 100644 --- a/packages/babel-preset-env/test/fixtures/plugins-integration/class-features-node-12/output.js +++ b/packages/babel-preset-env/test/fixtures/plugins-integration/class-features-node-12/output.js @@ -6,12 +6,9 @@ var _y = /*#__PURE__*/new WeakSet(); class B { constructor() { babelHelpers.classPrivateMethodInitSpec(this, _y); - babelHelpers.classPrivateFieldInitSpec(this, _x, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _x, void 0); } } function _y2() { - babelHelpers.classPrivateFieldGet(this, _x); + babelHelpers.classPrivateFieldGet2(this, _x); } diff --git a/packages/babel-preset-env/test/fixtures/shipped-proposals/new-class-features-firefox-70/output.js b/packages/babel-preset-env/test/fixtures/shipped-proposals/new-class-features-firefox-70/output.js index 76dd8dc967cb..7c89b238c3bd 100644 --- a/packages/babel-preset-env/test/fixtures/shipped-proposals/new-class-features-firefox-70/output.js +++ b/packages/babel-preset-env/test/fixtures/shipped-proposals/new-class-features-firefox-70/output.js @@ -2,10 +2,7 @@ var _A; var _foo = /*#__PURE__*/new WeakMap(); class A { constructor() { - babelHelpers.classPrivateFieldInitSpec(this, _foo, { - writable: true, - value: void 0 - }); + babelHelpers.classPrivateFieldInitSpec(this, _foo, void 0); } } _A = A; diff --git a/packages/babel-runtime-corejs2/package.json b/packages/babel-runtime-corejs2/package.json index 687670d7e7ec..c3b9279b1ad1 100644 --- a/packages/babel-runtime-corejs2/package.json +++ b/packages/babel-runtime-corejs2/package.json @@ -90,6 +90,15 @@ "./helpers/applyDecs2311.js" ], "./helpers/esm/applyDecs2311": "./helpers/esm/applyDecs2311.js", + "./helpers/assertClassBrand": [ + { + "node": "./helpers/assertClassBrand.js", + "import": "./helpers/esm/assertClassBrand.js", + "default": "./helpers/assertClassBrand.js" + }, + "./helpers/assertClassBrand.js" + ], + "./helpers/esm/assertClassBrand": "./helpers/esm/assertClassBrand.js", "./helpers/asyncGeneratorDelegate": [ { "node": "./helpers/asyncGeneratorDelegate.js", @@ -135,6 +144,42 @@ "./helpers/checkInRHS.js" ], "./helpers/esm/checkInRHS": "./helpers/esm/checkInRHS.js", + "./helpers/classPrivateFieldGet2": [ + { + "node": "./helpers/classPrivateFieldGet2.js", + "import": "./helpers/esm/classPrivateFieldGet2.js", + "default": "./helpers/classPrivateFieldGet2.js" + }, + "./helpers/classPrivateFieldGet2.js" + ], + "./helpers/esm/classPrivateFieldGet2": "./helpers/esm/classPrivateFieldGet2.js", + "./helpers/classPrivateFieldSet2": [ + { + "node": "./helpers/classPrivateFieldSet2.js", + "import": "./helpers/esm/classPrivateFieldSet2.js", + "default": "./helpers/classPrivateFieldSet2.js" + }, + "./helpers/classPrivateFieldSet2.js" + ], + "./helpers/esm/classPrivateFieldSet2": "./helpers/esm/classPrivateFieldSet2.js", + "./helpers/classPrivateGetter": [ + { + "node": "./helpers/classPrivateGetter.js", + "import": "./helpers/esm/classPrivateGetter.js", + "default": "./helpers/classPrivateGetter.js" + }, + "./helpers/classPrivateGetter.js" + ], + "./helpers/esm/classPrivateGetter": "./helpers/esm/classPrivateGetter.js", + "./helpers/classPrivateSetter": [ + { + "node": "./helpers/classPrivateSetter.js", + "import": "./helpers/esm/classPrivateSetter.js", + "default": "./helpers/classPrivateSetter.js" + }, + "./helpers/classPrivateSetter.js" + ], + "./helpers/esm/classPrivateSetter": "./helpers/esm/classPrivateSetter.js", "./helpers/construct": [ { "node": "./helpers/construct.js", @@ -261,6 +306,15 @@ "./helpers/toPropertyKey.js" ], "./helpers/esm/toPropertyKey": "./helpers/esm/toPropertyKey.js", + "./helpers/toSetter": [ + { + "node": "./helpers/toSetter.js", + "import": "./helpers/esm/toSetter.js", + "default": "./helpers/toSetter.js" + }, + "./helpers/toSetter.js" + ], + "./helpers/esm/toSetter": "./helpers/esm/toSetter.js", "./helpers/typeof": [ { "node": "./helpers/typeof.js", diff --git a/packages/babel-runtime-corejs3/package.json b/packages/babel-runtime-corejs3/package.json index 2a237a8c5234..c9bd47625dd7 100644 --- a/packages/babel-runtime-corejs3/package.json +++ b/packages/babel-runtime-corejs3/package.json @@ -89,6 +89,15 @@ "./helpers/applyDecs2311.js" ], "./helpers/esm/applyDecs2311": "./helpers/esm/applyDecs2311.js", + "./helpers/assertClassBrand": [ + { + "node": "./helpers/assertClassBrand.js", + "import": "./helpers/esm/assertClassBrand.js", + "default": "./helpers/assertClassBrand.js" + }, + "./helpers/assertClassBrand.js" + ], + "./helpers/esm/assertClassBrand": "./helpers/esm/assertClassBrand.js", "./helpers/asyncGeneratorDelegate": [ { "node": "./helpers/asyncGeneratorDelegate.js", @@ -134,6 +143,42 @@ "./helpers/checkInRHS.js" ], "./helpers/esm/checkInRHS": "./helpers/esm/checkInRHS.js", + "./helpers/classPrivateFieldGet2": [ + { + "node": "./helpers/classPrivateFieldGet2.js", + "import": "./helpers/esm/classPrivateFieldGet2.js", + "default": "./helpers/classPrivateFieldGet2.js" + }, + "./helpers/classPrivateFieldGet2.js" + ], + "./helpers/esm/classPrivateFieldGet2": "./helpers/esm/classPrivateFieldGet2.js", + "./helpers/classPrivateFieldSet2": [ + { + "node": "./helpers/classPrivateFieldSet2.js", + "import": "./helpers/esm/classPrivateFieldSet2.js", + "default": "./helpers/classPrivateFieldSet2.js" + }, + "./helpers/classPrivateFieldSet2.js" + ], + "./helpers/esm/classPrivateFieldSet2": "./helpers/esm/classPrivateFieldSet2.js", + "./helpers/classPrivateGetter": [ + { + "node": "./helpers/classPrivateGetter.js", + "import": "./helpers/esm/classPrivateGetter.js", + "default": "./helpers/classPrivateGetter.js" + }, + "./helpers/classPrivateGetter.js" + ], + "./helpers/esm/classPrivateGetter": "./helpers/esm/classPrivateGetter.js", + "./helpers/classPrivateSetter": [ + { + "node": "./helpers/classPrivateSetter.js", + "import": "./helpers/esm/classPrivateSetter.js", + "default": "./helpers/classPrivateSetter.js" + }, + "./helpers/classPrivateSetter.js" + ], + "./helpers/esm/classPrivateSetter": "./helpers/esm/classPrivateSetter.js", "./helpers/construct": [ { "node": "./helpers/construct.js", @@ -260,6 +305,15 @@ "./helpers/toPropertyKey.js" ], "./helpers/esm/toPropertyKey": "./helpers/esm/toPropertyKey.js", + "./helpers/toSetter": [ + { + "node": "./helpers/toSetter.js", + "import": "./helpers/esm/toSetter.js", + "default": "./helpers/toSetter.js" + }, + "./helpers/toSetter.js" + ], + "./helpers/esm/toSetter": "./helpers/esm/toSetter.js", "./helpers/typeof": [ { "node": "./helpers/typeof.js", diff --git a/packages/babel-runtime/package.json b/packages/babel-runtime/package.json index 5467b1cde496..0d55089b71c9 100644 --- a/packages/babel-runtime/package.json +++ b/packages/babel-runtime/package.json @@ -89,6 +89,15 @@ "./helpers/applyDecs2311.js" ], "./helpers/esm/applyDecs2311": "./helpers/esm/applyDecs2311.js", + "./helpers/assertClassBrand": [ + { + "node": "./helpers/assertClassBrand.js", + "import": "./helpers/esm/assertClassBrand.js", + "default": "./helpers/assertClassBrand.js" + }, + "./helpers/assertClassBrand.js" + ], + "./helpers/esm/assertClassBrand": "./helpers/esm/assertClassBrand.js", "./helpers/asyncGeneratorDelegate": [ { "node": "./helpers/asyncGeneratorDelegate.js", @@ -134,6 +143,42 @@ "./helpers/checkInRHS.js" ], "./helpers/esm/checkInRHS": "./helpers/esm/checkInRHS.js", + "./helpers/classPrivateFieldGet2": [ + { + "node": "./helpers/classPrivateFieldGet2.js", + "import": "./helpers/esm/classPrivateFieldGet2.js", + "default": "./helpers/classPrivateFieldGet2.js" + }, + "./helpers/classPrivateFieldGet2.js" + ], + "./helpers/esm/classPrivateFieldGet2": "./helpers/esm/classPrivateFieldGet2.js", + "./helpers/classPrivateFieldSet2": [ + { + "node": "./helpers/classPrivateFieldSet2.js", + "import": "./helpers/esm/classPrivateFieldSet2.js", + "default": "./helpers/classPrivateFieldSet2.js" + }, + "./helpers/classPrivateFieldSet2.js" + ], + "./helpers/esm/classPrivateFieldSet2": "./helpers/esm/classPrivateFieldSet2.js", + "./helpers/classPrivateGetter": [ + { + "node": "./helpers/classPrivateGetter.js", + "import": "./helpers/esm/classPrivateGetter.js", + "default": "./helpers/classPrivateGetter.js" + }, + "./helpers/classPrivateGetter.js" + ], + "./helpers/esm/classPrivateGetter": "./helpers/esm/classPrivateGetter.js", + "./helpers/classPrivateSetter": [ + { + "node": "./helpers/classPrivateSetter.js", + "import": "./helpers/esm/classPrivateSetter.js", + "default": "./helpers/classPrivateSetter.js" + }, + "./helpers/classPrivateSetter.js" + ], + "./helpers/esm/classPrivateSetter": "./helpers/esm/classPrivateSetter.js", "./helpers/construct": [ { "node": "./helpers/construct.js", @@ -260,6 +305,15 @@ "./helpers/toPropertyKey.js" ], "./helpers/esm/toPropertyKey": "./helpers/esm/toPropertyKey.js", + "./helpers/toSetter": [ + { + "node": "./helpers/toSetter.js", + "import": "./helpers/esm/toSetter.js", + "default": "./helpers/toSetter.js" + }, + "./helpers/toSetter.js" + ], + "./helpers/esm/toSetter": "./helpers/esm/toSetter.js", "./helpers/typeof": [ { "node": "./helpers/typeof.js",