From cda1cec65397e7480d1b111ee9a9a05e65fa113b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 8 Aug 2022 19:08:59 +0200 Subject: [PATCH] Remove `getMetadata`/`setMetadata` --- .../babel-helpers/src/helpers-generated.ts | 2 +- .../src/helpers/applyDecs2203.js | 195 ++---------------- .../private/exec.js | 4 - .../public/exec.js | 6 - .../static-private/exec.js | 4 - .../static-public/exec.js | 6 - .../2022-03-fields--to-es2015/private/exec.js | 4 - .../2022-03-fields--to-es2015/public/exec.js | 6 - .../static-private/exec.js | 4 - .../static-public/exec.js | 6 - .../private/exec.js | 2 - .../2022-03-getters--to-es2015/public/exec.js | 4 - .../static-private/exec.js | 2 - .../static-public/exec.js | 4 - .../private/exec.js | 4 - .../public/exec.js | 8 - .../static-private/exec.js | 4 - .../static-public/exec.js | 8 - .../2022-03-metadata--to-es2015/class/exec.js | 10 - .../getting-previously-set-metadata/exec.js | 30 --- .../inheritance-private/exec.js | 16 -- .../inheritance-public/exec.js | 18 -- .../non-symbol-keys/exec.js | 10 - .../2022-03-metadata--to-es2015/options.json | 8 - .../proto-private/exec.js | 11 - .../proto-public/exec.js | 11 - .../static-private/exec.js | 11 - .../static-public/exec.js | 11 - .../private-with-initializers/exec.js | 2 - .../public-with-initializers/exec.js | 4 - .../static-private-with-initializers/exec.js | 2 - .../static-public-with-initializers/exec.js | 4 - .../leaked-context-get-metadata-throw/exec.js | 18 -- .../leaked-context-get-metadata/exec.js | 19 -- .../leaked-context-set-metadata-throw/exec.js | 18 -- .../leaked-context-set-metadata/exec.js | 19 -- .../private/exec.js | 2 - .../2022-03-setters--to-es2015/public/exec.js | 4 - .../static-private/exec.js | 2 - .../static-public/exec.js | 4 - 40 files changed, 13 insertions(+), 494 deletions(-) delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/class/exec.js delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/getting-previously-set-metadata/exec.js delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/inheritance-private/exec.js delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/inheritance-public/exec.js delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/non-symbol-keys/exec.js delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/options.json delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/proto-private/exec.js delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/proto-public/exec.js delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/static-private/exec.js delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/static-public/exec.js delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-get-metadata-throw/exec.js delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-get-metadata/exec.js delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-set-metadata-throw/exec.js delete mode 100644 packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-set-metadata/exec.js diff --git a/packages/babel-helpers/src/helpers-generated.ts b/packages/babel-helpers/src/helpers-generated.ts index 8fd516319e48..42ba73f1aaa0 100644 --- a/packages/babel-helpers/src/helpers-generated.ts +++ b/packages/babel-helpers/src/helpers-generated.ts @@ -19,7 +19,7 @@ export default Object.freeze({ ), applyDecs2203: helper( "7.17.8", - 'function createMetadataMethodsForProperty(metadataMap,kind,property,decoratorFinishedRef){return{getMetadata:function(key){assertNotFinished(decoratorFinishedRef,"getMetadata"),assertMetadataKey(key);var metadataForKey=metadataMap[key];if(void 0!==metadataForKey)if(1===kind){var pub=metadataForKey.public;if(void 0!==pub)return pub[property]}else if(2===kind){var priv=metadataForKey.private;if(void 0!==priv)return priv.get(property)}else if(Object.hasOwnProperty.call(metadataForKey,"constructor"))return metadataForKey.constructor},setMetadata:function(key,value){assertNotFinished(decoratorFinishedRef,"setMetadata"),assertMetadataKey(key);var metadataForKey=metadataMap[key];if(void 0===metadataForKey&&(metadataForKey=metadataMap[key]={}),1===kind){var pub=metadataForKey.public;void 0===pub&&(pub=metadataForKey.public={}),pub[property]=value}else if(2===kind){var priv=metadataForKey.priv;void 0===priv&&(priv=metadataForKey.private=new Map),priv.set(property,value)}else metadataForKey.constructor=value}}}function convertMetadataMapToFinal(obj,metadataMap){var parentMetadataMap=obj[Symbol.metadata||Symbol.for("Symbol.metadata")],metadataKeys=Object.getOwnPropertySymbols(metadataMap);if(0!==metadataKeys.length){for(var i=0;i=0;i--){var newInit;if(void 0!==(newValue=memberDec(decs[i],name,desc,metadataMap,initializers,kind,isStatic,isPrivate,value)))assertValidReturnValue(kind,newValue),0===kind?newInit=newValue:1===kind?(newInit=newValue.init,get=newValue.get||value.get,set=newValue.set||value.set,value={get:get,set:set}):value=newValue,void 0!==newInit&&(void 0===init?init=newInit:"function"==typeof init?init=[init,newInit]:init.push(newInit))}if(0===kind||1===kind){if(void 0===init)init=function(instance,init){return init};else if("function"!=typeof init){var ownInitializers=init;init=function(instance,init){for(var value=init,i=0;i3,isStatic=kind>=5;if(isStatic?(base=Class,metadataMap=staticMetadataMap,0!==(kind-=5)&&(initializers=staticInitializers=staticInitializers||[])):(base=Class.prototype,metadataMap=protoMetadataMap,0!==kind&&(initializers=protoInitializers=protoInitializers||[])),0!==kind&&!isPrivate){var existingNonFields=isStatic?existingStaticNonFields:existingProtoNonFields,existingKind=existingNonFields.get(name)||0;if(!0===existingKind||3===existingKind&&4!==kind||4===existingKind&&3!==kind)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+name);!existingKind&&kind>2?existingNonFields.set(name,kind):existingNonFields.set(name,!0)}applyMemberDec(ret,base,decInfo,name,kind,isStatic,isPrivate,metadataMap,initializers)}}pushInitializers(ret,protoInitializers),pushInitializers(ret,staticInitializers)}function pushInitializers(ret,initializers){initializers&&ret.push((function(instance){for(var i=0;i0){for(var initializers=[],newClass=targetClass,name=targetClass.name,i=classDecs.length-1;i>=0;i--){var decoratorFinishedRef={v:!1};try{var ctx=Object.assign({kind:"class",name:name,addInitializer:createAddInitializerMethod(initializers,decoratorFinishedRef)},createMetadataMethodsForProperty(metadataMap,0,name,decoratorFinishedRef)),nextNewClass=classDecs[i](newClass,ctx)}finally{decoratorFinishedRef.v=!0}void 0!==nextNewClass&&(assertValidReturnValue(10,nextNewClass),newClass=nextNewClass)}ret.push(newClass,(function(){for(var i=0;i=0;i--){var newInit;if(void 0!==(newValue=memberDec(decs[i],name,desc,initializers,kind,isStatic,isPrivate,value)))assertValidReturnValue(kind,newValue),0===kind?newInit=newValue:1===kind?(newInit=newValue.init,get=newValue.get||value.get,set=newValue.set||value.set,value={get:get,set:set}):value=newValue,void 0!==newInit&&(void 0===init?init=newInit:"function"==typeof init?init=[init,newInit]:init.push(newInit))}if(0===kind||1===kind){if(void 0===init)init=function(instance,init){return init};else if("function"!=typeof init){var ownInitializers=init;init=function(instance,init){for(var value=init,i=0;i3,isStatic=kind>=5;if(isStatic?(base=Class,0!==(kind-=5)&&(initializers=staticInitializers=staticInitializers||[])):(base=Class.prototype,0!==kind&&(initializers=protoInitializers=protoInitializers||[])),0!==kind&&!isPrivate){var existingNonFields=isStatic?existingStaticNonFields:existingProtoNonFields,existingKind=existingNonFields.get(name)||0;if(!0===existingKind||3===existingKind&&4!==kind||4===existingKind&&3!==kind)throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: "+name);!existingKind&&kind>2?existingNonFields.set(name,kind):existingNonFields.set(name,!0)}applyMemberDec(ret,base,decInfo,name,kind,isStatic,isPrivate,initializers)}}pushInitializers(ret,protoInitializers),pushInitializers(ret,staticInitializers)}function pushInitializers(ret,initializers){initializers&&ret.push((function(instance){for(var i=0;i0){for(var initializers=[],newClass=targetClass,name=targetClass.name,i=classDecs.length-1;i>=0;i--){var decoratorFinishedRef={v:!1};try{var nextNewClass=classDecs[i](newClass,{kind:"class",name:name,addInitializer:createAddInitializerMethod(initializers,decoratorFinishedRef)})}finally{decoratorFinishedRef.v=!0}void 0!==nextNewClass&&(assertValidReturnValue(10,nextNewClass),newClass=nextNewClass)}ret.push(newClass,(function(){for(var i=0;i= 5; /* STATIC */ var base; - var metadataMap; var initializers; if (isStatic) { base = Class; - metadataMap = staticMetadataMap; kind = kind - 5 /* STATIC */; // initialize staticInitializers when we see a non-field static member if (kind !== 0 /* FIELD */) { @@ -517,7 +373,6 @@ function applyMemberDecs( } } else { base = Class.prototype; - metadataMap = protoMetadataMap; // initialize protoInitializers when we see a non-field member if (kind !== 0 /* FIELD */) { protoInitializers = protoInitializers || []; @@ -556,7 +411,6 @@ function applyMemberDecs( kind, isStatic, isPrivate, - metadataMap, initializers ); } @@ -576,7 +430,7 @@ function pushInitializers(ret, initializers) { } } -function applyClassDecs(ret, targetClass, metadataMap, classDecs) { +function applyClassDecs(ret, targetClass, classDecs) { if (classDecs.length > 0) { var initializers = []; var newClass = targetClass; @@ -586,23 +440,14 @@ function applyClassDecs(ret, targetClass, metadataMap, classDecs) { var decoratorFinishedRef = { v: false }; try { - var ctx = Object.assign( - { - kind: "class", - name: name, - addInitializer: createAddInitializerMethod( - initializers, - decoratorFinishedRef - ), - }, - createMetadataMethodsForProperty( - metadataMap, - 0 /* CONSTRUCTOR */, - name, + var nextNewClass = classDecs[i](newClass, { + kind: "class", + name: name, + addInitializer: createAddInitializerMethod( + initializers, decoratorFinishedRef - ) - ); - var nextNewClass = classDecs[i](newClass, ctx); + ), + }); } finally { decoratorFinishedRef.v = true; } @@ -768,23 +613,7 @@ function applyClassDecs(ret, targetClass, metadataMap, classDecs) { */ export default function applyDecs2203(targetClass, memberDecs, classDecs) { var ret = []; - var staticMetadataMap = {}; - - var protoMetadataMap = {}; - - applyMemberDecs( - ret, - targetClass, - protoMetadataMap, - staticMetadataMap, - memberDecs - ); - - convertMetadataMapToFinal(targetClass.prototype, protoMetadataMap); - - applyClassDecs(ret, targetClass, staticMetadataMap, classDecs); - - convertMetadataMapToFinal(targetClass, staticMetadataMap); - + applyMemberDecs(ret, targetClass, memberDecs); + applyClassDecs(ret, targetClass, classDecs); return ret; } diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/private/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/private/exec.js index 97ab79367bc4..278b5bc4c5ac 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/private/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/private/exec.js @@ -39,8 +39,6 @@ expect(aContext.kind).toBe('accessor'); expect(aContext.static).toBe(false); expect(aContext.private).toBe(true); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(bContext.access.get.call(foo)).toBe(124); bContext.access.set.call(foo, 123); @@ -50,5 +48,3 @@ expect(bContext.kind).toBe('accessor'); expect(bContext.static).toBe(false); expect(bContext.private).toBe(true); expect(typeof bContext.addInitializer).toBe('function'); -expect(typeof bContext.setMetadata).toBe('function'); -expect(typeof bContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/public/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/public/exec.js index afa447c3ed17..ca549f75b729 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/public/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/public/exec.js @@ -48,8 +48,6 @@ expect(aContext.kind).toBe('accessor'); expect(aContext.static).toBe(false); expect(aContext.private).toBe(false); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(foo.hasOwnProperty('a')).toBe(false); expect(Foo.prototype.hasOwnProperty('a')).toBe(true); @@ -61,8 +59,6 @@ expect(bContext.kind).toBe('accessor'); expect(bContext.static).toBe(false); expect(bContext.private).toBe(false); expect(typeof bContext.addInitializer).toBe('function'); -expect(typeof bContext.setMetadata).toBe('function'); -expect(typeof bContext.getMetadata).toBe('function'); expect(foo.hasOwnProperty('b')).toBe(false); expect(Foo.prototype.hasOwnProperty('b')).toBe(true); @@ -74,7 +70,5 @@ expect(cContext.kind).toBe('accessor'); expect(cContext.static).toBe(false); expect(cContext.private).toBe(false); expect(typeof cContext.addInitializer).toBe('function'); -expect(typeof cContext.setMetadata).toBe('function'); -expect(typeof cContext.getMetadata).toBe('function'); expect(foo.hasOwnProperty('c')).toBe(false); expect(Foo.prototype.hasOwnProperty('c')).toBe(true); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-private/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-private/exec.js index ffccd149c252..60d34c7ceea2 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-private/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-private/exec.js @@ -37,8 +37,6 @@ expect(aContext.kind).toBe('accessor'); expect(aContext.static).toBe(true); expect(aContext.private).toBe(true); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(bContext.access.get.call(Foo)).toBe(124); bContext.access.set.call(Foo, 123); @@ -48,5 +46,3 @@ expect(bContext.kind).toBe('accessor'); expect(bContext.static).toBe(true); expect(bContext.private).toBe(true); expect(typeof bContext.addInitializer).toBe('function'); -expect(typeof bContext.setMetadata).toBe('function'); -expect(typeof bContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-public/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-public/exec.js index 98755c037ec2..fc23b83e8563 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-public/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-accessors--to-es2015/static-public/exec.js @@ -46,8 +46,6 @@ expect(aContext.kind).toBe('accessor'); expect(aContext.static).toBe(true); expect(aContext.private).toBe(false); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(Foo.hasOwnProperty('a')).toBe(true); expect(Foo.b).toBe(124); @@ -58,8 +56,6 @@ expect(bContext.kind).toBe('accessor'); expect(bContext.static).toBe(true); expect(bContext.private).toBe(false); expect(typeof bContext.addInitializer).toBe('function'); -expect(typeof bContext.setMetadata).toBe('function'); -expect(typeof bContext.getMetadata).toBe('function'); expect(Foo.hasOwnProperty('b')).toBe(true); expect(Foo.c).toBe(457); @@ -70,6 +66,4 @@ expect(cContext.kind).toBe('accessor'); expect(cContext.static).toBe(true); expect(cContext.private).toBe(false); expect(typeof cContext.addInitializer).toBe('function'); -expect(typeof cContext.setMetadata).toBe('function'); -expect(typeof cContext.getMetadata).toBe('function'); expect(Foo.hasOwnProperty('c')).toBe(true); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/private/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/private/exec.js index d73f40d45a13..a2f8421a7a08 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/private/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/private/exec.js @@ -26,8 +26,6 @@ expect(aContext.kind).toBe('field'); expect(aContext.static).toBe(false); expect(aContext.private).toBe(true); expect(typeof aContext.addInitializer).toBe('undefined'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(bContext.access.get.call(foo)).toBe(124); bContext.access.set.call(foo, 123); @@ -37,5 +35,3 @@ expect(bContext.kind).toBe('field'); expect(bContext.static).toBe(false); expect(bContext.private).toBe(true); expect(typeof aContext.addInitializer).toBe('undefined'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/public/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/public/exec.js index df3f456094de..70883de50493 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/public/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/public/exec.js @@ -35,8 +35,6 @@ expect(aContext.kind).toBe('field'); expect(aContext.static).toBe(false); expect(aContext.private).toBe(false); expect(typeof aContext.addInitializer).toBe('undefined'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(foo.hasOwnProperty('a')).toBe(true); expect(Foo.prototype.hasOwnProperty('a')).toBe(false); @@ -48,8 +46,6 @@ expect(bContext.kind).toBe('field'); expect(bContext.static).toBe(false); expect(bContext.private).toBe(false); expect(typeof bContext.addInitializer).toBe('undefined'); -expect(typeof bContext.setMetadata).toBe('function'); -expect(typeof bContext.getMetadata).toBe('function'); expect(foo.hasOwnProperty('b')).toBe(true); expect(Foo.prototype.hasOwnProperty('b')).toBe(false); @@ -61,7 +57,5 @@ expect(cContext.kind).toBe('field'); expect(cContext.static).toBe(false); expect(cContext.private).toBe(false); expect(typeof cContext.addInitializer).toBe('undefined'); -expect(typeof cContext.setMetadata).toBe('function'); -expect(typeof cContext.getMetadata).toBe('function'); expect(foo.hasOwnProperty('c')).toBe(true); expect(Foo.prototype.hasOwnProperty('c')).toBe(false); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-private/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-private/exec.js index 7a6777e75916..586dc935111d 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-private/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-private/exec.js @@ -24,8 +24,6 @@ expect(aContext.kind).toBe('field'); expect(aContext.static).toBe(true); expect(aContext.private).toBe(true); expect(typeof aContext.addInitializer).toBe('undefined'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(bContext.access.get.call(Foo)).toBe(124); bContext.access.set.call(Foo, 123); @@ -35,5 +33,3 @@ expect(bContext.kind).toBe('field'); expect(bContext.static).toBe(true); expect(bContext.private).toBe(true); expect(typeof aContext.addInitializer).toBe('undefined'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-public/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-public/exec.js index 360269c73f58..534fb5d049c2 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-public/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-fields--to-es2015/static-public/exec.js @@ -33,8 +33,6 @@ expect(aContext.kind).toBe('field'); expect(aContext.static).toBe(true); expect(aContext.private).toBe(false); expect(typeof aContext.addInitializer).toBe('undefined'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(Foo.hasOwnProperty('a')).toBe(true); expect(Foo.b).toBe(124); @@ -45,8 +43,6 @@ expect(bContext.kind).toBe('field'); expect(bContext.static).toBe(true); expect(bContext.private).toBe(false); expect(typeof bContext.addInitializer).toBe('undefined'); -expect(typeof bContext.setMetadata).toBe('function'); -expect(typeof bContext.getMetadata).toBe('function'); expect(Foo.hasOwnProperty('b')).toBe(true); expect(Foo.c).toBe(457); @@ -57,6 +53,4 @@ expect(cContext.kind).toBe('field'); expect(cContext.static).toBe(true); expect(cContext.private).toBe(false); expect(typeof cContext.addInitializer).toBe('undefined'); -expect(typeof cContext.setMetadata).toBe('function'); -expect(typeof cContext.getMetadata).toBe('function'); expect(Foo.hasOwnProperty('c')).toBe(true); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/private/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/private/exec.js index 8f1f6e6ffda3..a7ffbd9d4ee6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/private/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/private/exec.js @@ -35,5 +35,3 @@ expect(aContext.kind).toBe('getter'); expect(aContext.static).toBe(false); expect(aContext.private).toBe(true); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/public/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/public/exec.js index 8a9b42b48917..470b37f23c94 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/public/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/public/exec.js @@ -42,13 +42,9 @@ expect(aContext.kind).toBe('getter'); expect(aContext.static).toBe(false); expect(aContext.private).toBe(false); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(bContext.name).toBe('b'); expect(bContext.kind).toBe('getter'); expect(bContext.static).toBe(false); expect(bContext.private).toBe(false); expect(typeof bContext.addInitializer).toBe('function'); -expect(typeof bContext.setMetadata).toBe('function'); -expect(typeof bContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-private/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-private/exec.js index c39e08c481cb..6d4ea7f3a294 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-private/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-private/exec.js @@ -34,5 +34,3 @@ expect(aContext.kind).toBe('getter'); expect(aContext.static).toBe(true); expect(aContext.private).toBe(true); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-public/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-public/exec.js index b54f514b69ee..5bb0aa12f675 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-public/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters--to-es2015/static-public/exec.js @@ -40,13 +40,9 @@ expect(aContext.kind).toBe('getter'); expect(aContext.static).toBe(true); expect(aContext.private).toBe(false); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(bContext.name).toBe('b'); expect(bContext.kind).toBe('getter'); expect(bContext.static).toBe(true); expect(bContext.private).toBe(false); expect(typeof bContext.addInitializer).toBe('function'); -expect(typeof bContext.setMetadata).toBe('function'); -expect(typeof bContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/private/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/private/exec.js index e4649ba322e6..27218da84ab3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/private/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/private/exec.js @@ -55,13 +55,9 @@ expect(a_getterContext.kind).toBe('getter'); expect(a_getterContext.static).toBe(false); expect(a_getterContext.private).toBe(true); expect(typeof a_getterContext.addInitializer).toBe('function'); -expect(typeof a_getterContext.setMetadata).toBe('function'); -expect(typeof a_getterContext.getMetadata).toBe('function'); expect(a_setterContext.name).toBe('#a'); expect(a_setterContext.kind).toBe('setter'); expect(a_setterContext.static).toBe(false); expect(a_setterContext.private).toBe(true); expect(typeof a_setterContext.addInitializer).toBe('function'); -expect(typeof a_setterContext.setMetadata).toBe('function'); -expect(typeof a_setterContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/public/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/public/exec.js index 451b26cf5496..9f6c5b8ae575 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/public/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/public/exec.js @@ -71,29 +71,21 @@ expect(a_getterContext.kind).toBe('getter'); expect(a_getterContext.static).toBe(false); expect(a_getterContext.private).toBe(false); expect(typeof a_getterContext.addInitializer).toBe('function'); -expect(typeof a_getterContext.setMetadata).toBe('function'); -expect(typeof a_getterContext.getMetadata).toBe('function'); expect(a_setterContext.name).toBe('a'); expect(a_setterContext.kind).toBe('setter'); expect(a_setterContext.static).toBe(false); expect(a_setterContext.private).toBe(false); expect(typeof a_setterContext.addInitializer).toBe('function'); -expect(typeof a_setterContext.setMetadata).toBe('function'); -expect(typeof a_setterContext.getMetadata).toBe('function'); expect(b_getterContext.name).toBe('b'); expect(b_getterContext.kind).toBe('getter'); expect(b_getterContext.static).toBe(false); expect(b_getterContext.private).toBe(false); expect(typeof b_getterContext.addInitializer).toBe('function'); -expect(typeof b_getterContext.setMetadata).toBe('function'); -expect(typeof b_getterContext.getMetadata).toBe('function'); expect(b_setterContext.name).toBe('b'); expect(b_setterContext.kind).toBe('setter'); expect(b_setterContext.static).toBe(false); expect(b_setterContext.private).toBe(false); expect(typeof b_setterContext.addInitializer).toBe('function'); -expect(typeof b_setterContext.setMetadata).toBe('function'); -expect(typeof b_setterContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-private/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-private/exec.js index 5221db1185d8..eb5bca4c7996 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-private/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-private/exec.js @@ -53,13 +53,9 @@ expect(a_getterContext.kind).toBe('getter'); expect(a_getterContext.static).toBe(true); expect(a_getterContext.private).toBe(true); expect(typeof a_getterContext.addInitializer).toBe('function'); -expect(typeof a_getterContext.setMetadata).toBe('function'); -expect(typeof a_getterContext.getMetadata).toBe('function'); expect(a_setterContext.name).toBe('#a'); expect(a_setterContext.kind).toBe('setter'); expect(a_setterContext.static).toBe(true); expect(a_setterContext.private).toBe(true); expect(typeof a_setterContext.addInitializer).toBe('function'); -expect(typeof a_setterContext.setMetadata).toBe('function'); -expect(typeof a_setterContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-public/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-public/exec.js index ed5f38d37e5e..6abca4f5c5d6 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-public/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-getters-and-setters--to-es2015/static-public/exec.js @@ -69,30 +69,22 @@ expect(a_getterContext.kind).toBe('getter'); expect(a_getterContext.static).toBe(true); expect(a_getterContext.private).toBe(false); expect(typeof a_getterContext.addInitializer).toBe('function'); -expect(typeof a_getterContext.setMetadata).toBe('function'); -expect(typeof a_getterContext.getMetadata).toBe('function'); expect(a_setterContext.name).toBe('a'); expect(a_setterContext.kind).toBe('setter'); expect(a_setterContext.static).toBe(true); expect(a_setterContext.private).toBe(false); expect(typeof a_setterContext.addInitializer).toBe('function'); -expect(typeof a_setterContext.setMetadata).toBe('function'); -expect(typeof a_setterContext.getMetadata).toBe('function'); expect(b_getterContext.name).toBe('b'); expect(b_getterContext.kind).toBe('getter'); expect(b_getterContext.static).toBe(true); expect(b_getterContext.private).toBe(false); expect(typeof b_getterContext.addInitializer).toBe('function'); -expect(typeof b_getterContext.setMetadata).toBe('function'); -expect(typeof b_getterContext.getMetadata).toBe('function'); expect(b_setterContext.name).toBe('b'); expect(b_setterContext.kind).toBe('setter'); expect(b_setterContext.static).toBe(true); expect(b_setterContext.private).toBe(false); expect(typeof b_setterContext.addInitializer).toBe('function'); -expect(typeof b_setterContext.setMetadata).toBe('function'); -expect(typeof b_setterContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/class/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/class/exec.js deleted file mode 100644 index 110e14700092..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/class/exec.js +++ /dev/null @@ -1,10 +0,0 @@ -const key = Symbol(); - -function dec(_, { setMetadata }) { - setMetadata(key, 123); -} - -@dec -class Foo {} - -expect(Foo[Symbol.for("Symbol.metadata")][key].constructor).toBe(123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/getting-previously-set-metadata/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/getting-previously-set-metadata/exec.js deleted file mode 100644 index 31091ae37ee7..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/getting-previously-set-metadata/exec.js +++ /dev/null @@ -1,30 +0,0 @@ -const key = Symbol(); - -function dec1(_, { setMetadata, getMetadata }) { - expect(getMetadata(key)).toBe(undefined); - setMetadata(key, 123); - expect(getMetadata(key)).toBe(123); -} - -function dec2(_, { setMetadata, getMetadata }) { - expect(getMetadata(key)).toBe(123); - setMetadata(key, 456); - expect(getMetadata(key)).toBe(456); -} - -class Foo { - @dec2 @dec1 a; -} - -function dec3(_, { setMetadata, getMetadata }) { - expect(getMetadata(key)).toBe(undefined); - setMetadata(key, 789); - expect(getMetadata(key)).toBe(789); -} - -class Bar extends Foo { - @dec3 a; -} - -expect(Foo.prototype[Symbol.for("Symbol.metadata")][key].public.a).toBe(456); -expect(Bar.prototype[Symbol.for("Symbol.metadata")][key].public.a).toBe(789); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/inheritance-private/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/inheritance-private/exec.js deleted file mode 100644 index de49e14701f3..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/inheritance-private/exec.js +++ /dev/null @@ -1,16 +0,0 @@ -const key = Symbol(); - -function dec(_, { setMetadata }) { - setMetadata(key, 123); -} - -class Foo { - @dec #a; -} - -class Bar extends Foo { - @dec #b; -} - -expect(Foo.prototype[Symbol.for("Symbol.metadata")][key].private).toEqual([123]); -expect(Bar.prototype[Symbol.for("Symbol.metadata")][key].private).toEqual([123, 123]); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/inheritance-public/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/inheritance-public/exec.js deleted file mode 100644 index 8bbd6808c028..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/inheritance-public/exec.js +++ /dev/null @@ -1,18 +0,0 @@ -const key = Symbol(); - -function dec(_, { setMetadata }) { - setMetadata(key, 123); -} - -class Foo { - @dec a; -} - -class Bar extends Foo { - @dec b; -} - -expect(Foo.prototype[Symbol.for("Symbol.metadata")][key].public.a).toEqual(123); -expect(Foo.prototype[Symbol.for("Symbol.metadata")][key].public.b).toEqual(undefined); -expect(Bar.prototype[Symbol.for("Symbol.metadata")][key].public.a).toEqual(123); -expect(Bar.prototype[Symbol.for("Symbol.metadata")][key].public.b).toEqual(123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/non-symbol-keys/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/non-symbol-keys/exec.js deleted file mode 100644 index a6c8ae1af6f8..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/non-symbol-keys/exec.js +++ /dev/null @@ -1,10 +0,0 @@ -expect(() => { - const key = 'test'; - - function dec(_, { setMetadata }) { - setMetadata(key, 123); - } - - @dec - class Foo {} -}).toThrow('Metadata keys must be symbols, received: test') diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/options.json b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/options.json deleted file mode 100644 index d10a62d5e998..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/options.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "plugins": [ - ["proposal-decorators", { "version": "2022-03" }], - "proposal-class-properties", - "proposal-private-methods", - "proposal-class-static-block" - ] -} diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/proto-private/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/proto-private/exec.js deleted file mode 100644 index 87ca2369944f..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/proto-private/exec.js +++ /dev/null @@ -1,11 +0,0 @@ -const key = Symbol(); - -function dec(_, { setMetadata }) { - setMetadata(key, 123); -} - -class Foo { - @dec #a; -} - -expect(Foo.prototype[Symbol.for("Symbol.metadata")][key].private[0]).toBe(123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/proto-public/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/proto-public/exec.js deleted file mode 100644 index c09dab0c4935..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/proto-public/exec.js +++ /dev/null @@ -1,11 +0,0 @@ -const key = Symbol(); - -function dec(_, { setMetadata }) { - setMetadata(key, 123); -} - -class Foo { - @dec a; -} - -expect(Foo.prototype[Symbol.for("Symbol.metadata")][key].public.a).toBe(123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/static-private/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/static-private/exec.js deleted file mode 100644 index d941ef10e5bb..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/static-private/exec.js +++ /dev/null @@ -1,11 +0,0 @@ -const key = Symbol(); - -function dec(_, { setMetadata }) { - setMetadata(key, 123); -} - -class Foo { - @dec static #a; -} - -expect(Foo[Symbol.for("Symbol.metadata")][key].private[0]).toBe(123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/static-public/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/static-public/exec.js deleted file mode 100644 index 649592a40010..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-metadata--to-es2015/static-public/exec.js +++ /dev/null @@ -1,11 +0,0 @@ -const key = Symbol(); - -function dec(_, { setMetadata }) { - setMetadata(key, 123); -} - -class Foo { - @dec static a; -} - -expect(Foo[Symbol.for("Symbol.metadata")][key].public.a).toBe(123); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/private-with-initializers/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/private-with-initializers/exec.js index 932d05de4054..ebbb23bd408b 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/private-with-initializers/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/private-with-initializers/exec.js @@ -37,5 +37,3 @@ expect(aContext.kind).toBe('method'); expect(aContext.static).toBe(false); expect(aContext.private).toBe(true); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/public-with-initializers/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/public-with-initializers/exec.js index df1929940869..85a4246eadfa 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/public-with-initializers/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/public-with-initializers/exec.js @@ -42,13 +42,9 @@ expect(aContext.kind).toBe('method'); expect(aContext.static).toBe(false); expect(aContext.private).toBe(false); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(bContext.name).toBe('b'); expect(bContext.kind).toBe('method'); expect(bContext.static).toBe(false); expect(bContext.private).toBe(false); expect(typeof bContext.addInitializer).toBe('function'); -expect(typeof bContext.setMetadata).toBe('function'); -expect(typeof bContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-private-with-initializers/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-private-with-initializers/exec.js index bec9a6ef8850..56ca1d2bb86c 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-private-with-initializers/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-private-with-initializers/exec.js @@ -35,5 +35,3 @@ expect(aContext.kind).toBe('method'); expect(aContext.static).toBe(true); expect(aContext.private).toBe(true); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-public-with-initializers/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-public-with-initializers/exec.js index a1f39bf04b3d..78b0de2d871f 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-public-with-initializers/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-methods--to-es2015/static-public-with-initializers/exec.js @@ -40,13 +40,9 @@ expect(aContext.kind).toBe('method'); expect(aContext.static).toBe(true); expect(aContext.private).toBe(false); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(bContext.name).toBe('b'); expect(bContext.kind).toBe('method'); expect(bContext.static).toBe(true); expect(bContext.private).toBe(false); expect(typeof bContext.addInitializer).toBe('function'); -expect(typeof bContext.setMetadata).toBe('function'); -expect(typeof bContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-get-metadata-throw/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-get-metadata-throw/exec.js deleted file mode 100644 index b34ef311dc39..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-get-metadata-throw/exec.js +++ /dev/null @@ -1,18 +0,0 @@ -let getMetadata; -let metadataSymbol = Symbol(); - -function decMethod(_, context) { - ({ getMetadata } = context); - getMetadata(metadataSymbol); -} - -try { - class C { - @decMethod - m() {} - } -} finally {} - -expect(() => { - getMetadata(metadataSymbol); -}).toThrow('attempted to call getMetadata after decoration was finished') diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-get-metadata/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-get-metadata/exec.js deleted file mode 100644 index aa76adb6722d..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-get-metadata/exec.js +++ /dev/null @@ -1,19 +0,0 @@ -let getMetadata; -let metadataSymbol = Symbol(); - -function callCapturedFunc() { - getMetadata(metadataSymbol); -} - -function decMethod(_, context) { - ({ getMetadata } = context); - getMetadata(metadataSymbol); -} - -expect(() => { - class C { - @callCapturedFunc - @decMethod - m() {} - } -}).toThrow('attempted to call getMetadata after decoration was finished') diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-set-metadata-throw/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-set-metadata-throw/exec.js deleted file mode 100644 index 9a4d2efc5934..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-set-metadata-throw/exec.js +++ /dev/null @@ -1,18 +0,0 @@ -let setMetadata; -let metadataSymbol = Symbol(); - -function decMethod(_, context) { - ({ setMetadata } = context); - setMetadata(metadataSymbol, 'value'); -} - -try { - class C { - @decMethod - m() {} - } -} finally {} - -expect(() => { - setMetadata(metadataSymbol, 'value'); -}).toThrow('attempted to call setMetadata after decoration was finished') diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-set-metadata/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-set-metadata/exec.js deleted file mode 100644 index 3ef67fa16e87..000000000000 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-misc--to-es2015/leaked-context-set-metadata/exec.js +++ /dev/null @@ -1,19 +0,0 @@ -let setMetadata; -let metadataSymbol = Symbol(); - -function callCapturedFunc() { - setMetadata(metadataSymbol, 'value'); -} - -function decMethod(_, context) { - ({ setMetadata } = context); - setMetadata(metadataSymbol, 'value'); -} - -expect(() => { - class C { - @callCapturedFunc - @decMethod - m() {} - } -}).toThrow('attempted to call setMetadata after decoration was finished') diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/private/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/private/exec.js index 1c94c2565c5c..92edbba8d758 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/private/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/private/exec.js @@ -36,5 +36,3 @@ expect(aContext.kind).toBe('setter'); expect(aContext.static).toBe(false); expect(aContext.private).toBe(true); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/public/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/public/exec.js index 6054daf8f655..2088079a4c03 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/public/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/public/exec.js @@ -38,13 +38,9 @@ expect(aContext.kind).toBe('setter'); expect(aContext.static).toBe(false); expect(aContext.private).toBe(false); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(bContext.name).toBe('b'); expect(bContext.kind).toBe('setter'); expect(bContext.static).toBe(false); expect(bContext.private).toBe(false); expect(typeof bContext.addInitializer).toBe('function'); -expect(typeof bContext.setMetadata).toBe('function'); -expect(typeof bContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-private/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-private/exec.js index 563d46ba84a0..7d90402d8101 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-private/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-private/exec.js @@ -34,5 +34,3 @@ expect(aContext.kind).toBe('setter'); expect(aContext.static).toBe(true); expect(aContext.private).toBe(true); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); diff --git a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-public/exec.js b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-public/exec.js index 76fb8b53a522..818681cbe4c3 100644 --- a/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-public/exec.js +++ b/packages/babel-plugin-proposal-decorators/test/fixtures/2022-03-setters--to-es2015/static-public/exec.js @@ -37,13 +37,9 @@ expect(aContext.kind).toBe('setter'); expect(aContext.static).toBe(true); expect(aContext.private).toBe(false); expect(typeof aContext.addInitializer).toBe('function'); -expect(typeof aContext.setMetadata).toBe('function'); -expect(typeof aContext.getMetadata).toBe('function'); expect(bContext.name).toBe('b'); expect(bContext.kind).toBe('setter'); expect(bContext.static).toBe(true); expect(bContext.private).toBe(false); expect(typeof bContext.addInitializer).toBe('function'); -expect(typeof bContext.setMetadata).toBe('function'); -expect(typeof bContext.getMetadata).toBe('function');