Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Dec 7, 2023
1 parent 314e77c commit f786872
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/babel-helpers/src/helpers-generated.ts
Expand Up @@ -43,10 +43,10 @@ export default Object.freeze({
"7.21.0",
'import checkInRHS from"checkInRHS";import setFunctionName from"setFunctionName";import toPropertyKey from"toPropertyKey";function applyDecs2301Factory(){function createAddInitializerMethod(e,t){return function(r){!function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished")}(t),assertCallable(r,"An initializer"),e.push(r)}}function assertInstanceIfPrivate(e,t){if(!e(t))throw new TypeError("Attempted to access private element on non-instance")}function memberDec(e,t,r,n,a,i,s,o,c){var u;switch(a){case 1:u="accessor";break;case 2:u="method";break;case 3:u="getter";break;case 4:u="setter";break;default:u="field"}var l,f,p={kind:u,name:s?"#"+t:toPropertyKey(t),static:i,private:s},d={v:!1};if(0!==a&&(p.addInitializer=createAddInitializerMethod(n,d)),s||0!==a&&2!==a)if(2===a)l=function(e){return assertInstanceIfPrivate(c,e),r.value};else{var h=0===a||1===a;(h||3===a)&&(l=s?function(e){return assertInstanceIfPrivate(c,e),r.get.call(e)}:function(e){return r.get.call(e)}),(h||4===a)&&(f=s?function(e,t){assertInstanceIfPrivate(c,e),r.set.call(e,t)}:function(e,t){r.set.call(e,t)})}else l=function(e){return e[t]},0===a&&(f=function(e,r){e[t]=r});var v=s?c.bind():function(e){return t in e};p.access=l&&f?{get:l,set:f,has:v}:l?{get:l,has:v}:{set:f,has:v};try{return e(o,p)}finally{d.v=!0}}function assertCallable(e,t){if("function"!=typeof e)throw new TypeError(t+" must be a function")}function assertValidReturnValue(e,t){var r=typeof t;if(1===e){if("object"!==r||null===t)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");void 0!==t.get&&assertCallable(t.get,"accessor.get"),void 0!==t.set&&assertCallable(t.set,"accessor.set"),void 0!==t.init&&assertCallable(t.init,"accessor.init")}else if("function"!==r)throw new TypeError((0===e?"field":10===e?"class":"method")+" decorators must return a function or void 0")}function curryThis2(e){return function(t){e(this,t)}}function applyMemberDec(e,t,r,n,a,i,s,o,c){var u,l,f,p,d,h,v,y,g=r[0];if(s?(0===a||1===a?(u={get:(d=r[3],function(){return d(this)}),set:curryThis2(r[4])},f="get"):3===a?(u={get:r[3]},f="get"):4===a?(u={set:r[3]},f="set"):u={value:r[3]},0!==a&&(1===a&&setFunctionName(u.set,"#"+n,"set"),setFunctionName(u[f||"value"],"#"+n,f))):0!==a&&(u=Object.getOwnPropertyDescriptor(t,n)),1===a?p={get:u.get,set:u.set}:2===a?p=u.value:3===a?p=u.get:4===a&&(p=u.set),"function"==typeof g)void 0!==(h=memberDec(g,n,u,o,a,i,s,p,c))&&(assertValidReturnValue(a,h),0===a?l=h:1===a?(l=h.init,v=h.get||p.get,y=h.set||p.set,p={get:v,set:y}):p=h);else for(var m=g.length-1;m>=0;m--){var b;void 0!==(h=memberDec(g[m],n,u,o,a,i,s,p,c))&&(assertValidReturnValue(a,h),0===a?b=h:1===a?(b=h.init,v=h.get||p.get,y=h.set||p.set,p={get:v,set:y}):p=h,void 0!==b&&(void 0===l?l=b:"function"==typeof l?l=[l,b]:l.push(b)))}if(0===a||1===a){if(void 0===l)l=function(e,t){return t};else if("function"!=typeof l){var I=l;l=function(e,t){for(var r=t,n=0;n<I.length;n++)r=I[n].call(e,r);return r}}else{var w=l;l=function(e,t){return w.call(e,t)}}e.push(l)}0!==a&&(1===a?(u.get=p.get,u.set=p.set):2===a?u.value=p:3===a?u.get=p:4===a&&(u.set=p),s?1===a?(e.push((function(e,t){return p.get.call(e,t)})),e.push((function(e,t){return p.set.call(e,t)}))):2===a?e.push(p):e.push((function(e,t){return p.call(e,t)})):Object.defineProperty(t,n,u))}function applyMemberDecs(e,t,r){for(var n,a,i,s=[],o=new Map,c=new Map,u=0;u<t.length;u++){var l=t[u];if(Array.isArray(l)){var f,p,d=l[1],h=l[2],v=l.length>3,y=d>=5,g=r;if(y?(f=e,0!=(d-=5)&&(p=a=a||[]),v&&!i&&(i=function(t){return checkInRHS(t)===e}),g=i):(f=e.prototype,0!==d&&(p=n=n||[])),0!==d&&!v){var m=y?c:o,b=m.get(h)||0;if(!0===b||3===b&&4!==d||4===b&&3!==d)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: "+h);!b&&d>2?m.set(h,d):m.set(h,!0)}applyMemberDec(s,f,l,h,d,y,v,p,g)}}return pushInitializers(s,n),pushInitializers(s,a),s}function pushInitializers(e,t){t&&e.push((function(e){for(var r=0;r<t.length;r++)t[r].call(e);return e}))}return function(e,t,r,n){return{e:applyMemberDecs(e,t,n),get c(){return function(e,t){if(t.length>0){for(var r=[],n=e,a=e.name,i=t.length-1;i>=0;i--){var s={v:!1};try{var o=t[i](n,{kind:"class",name:a,addInitializer:createAddInitializerMethod(r,s)})}finally{s.v=!0}void 0!==o&&(assertValidReturnValue(10,o),n=o)}return[n,function(){for(var e=0;e<r.length;e++)r[e].call(n)}]}}(e,r)}}}}export default function applyDecs2301(e,t,r,n){return(applyDecs2301=applyDecs2301Factory())(e,t,r,n)}',
),
// size: 3277, gzip size: 1604
// size: 3270, gzip size: 1602
applyDecs2305: helper(
"7.21.0",
'import checkInRHS from"checkInRHS";import setFunctionName from"setFunctionName";import toPropertyKey from"toPropertyKey";export default function applyDecs2305(e,t,r,n,o,a){function i(e,t,r){return function(n,o){return r&&r(n),e[t].call(n,o)}}function c(e,t){for(var r=0;r<e.length;r++)e[r].call(t);return t}function s(e,t,r,n){if("function"!=typeof e&&(n||void 0!==e))throw new TypeError(t+" must "+(r||"be")+" a function"+(n?"":" or void 0"));return e}function applyDec(e,t,r,n,o,a,c,u,l,f,p,d,h){function m(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var y,v,b=t[0],g=t[3],w=!u;if(!w){r||Array.isArray(b)||(b=[b]);var S={},A=[],P=3===o?"get":4===o||d?"set":"value";f?(p||d?S={get:setFunctionName((function(){return g(this)}),n,"get"),set:function(e){t[4](this,e)}}:S[P]=g,p||setFunctionName(S[P],n,2===o?"":P)):p||(S=Object.getOwnPropertyDescriptor(e,n))}for(var j=b.length-1;j>=0;j-=r?2:1){var D=b[j],E={},F={kind:["field","accessor","method","getter","setter","field","class"][o],name:n,metadata:a};F.addInitializer=function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");s(t,"An initializer","be",!0),c.push(t)}.bind(null,E);try{if(w)v=D.call(r?b[j-1]:void 0,e,F);else{var I,O;F.static=l,F.private=f,f||!p&&2!==o?2===o?I=function(e){return f&&m(e),S.value}:((o<2||3===o)&&(I=i(S,"get",f&&m)),(o<2||4===o)&&(O=i(S,"set",f&&m))):(I=function(e){return e[n]},p&&(O=function(e,t){e[n]=t}));var k=F.access={has:f?h.bind():function(e){return n in e}};if(I&&(k.get=I),O&&(k.set=O),v=D.call(r?b[j-1]:void 0,d?S:S[P],F),d){if("object"==typeof v&&v)(y=s(v.get,"accessor.get"))&&(S.get=y),(y=s(v.set,"accessor.set"))&&(S.set=y),(y=s(v.init,"accessor.init"))&&A.push(y);else if(void 0!==v)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else s(v,(p?"field":"method")+" decorators","return")&&(p?A.push(v):S[P]=v)}}finally{E.v=!0}}return(p||d)&&u.push((function(e,t){for(var r=A.length-1;r>=0;r--)t=A[r].call(e,t);return t})),p||w||(f?d?u.push(i(S,"get"),i(S,"set")):u.push(2===o?S[P]:Function.call.bind(S[P])):Object.defineProperty(e,n,S)),v}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var l=a[Symbol.metadata||Symbol.for("Symbol.metadata")];var f=Object.create(null==l?null:l),p=function(e,t,r,n){var o,a,i=[],s=function(t){return checkInRHS(t)===e},u=new Map;function l(e){e&&i.push(c.bind(null,e))}for(var f=0;f<t.length;f++){var p=t[f];if(Array.isArray(p)){var d=p[1],h=p[2],m=p.length>3,y=16&d,v=!!(8&d),b=0==(d&=7),g=h+"/"+v;if(!b&&!m){var w=u.get(g)||0;if(!0===w||3===w&&4!==d||4===w&&3!==d)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: "+h);u.set(g,!(d>2)||d)}applyDec(v?e:e.prototype,p,y,m?"#"+h:toPropertyKey(h),d,n,v?a=a||[]:o=o||[],i,v,m,b,1===d,v&&m?s:r)}}return l(o),l(a),i}(e,t,o,f);return r.length||u(e,f),{e:p,get c(){var t=[];return r.length&&[u(s(applyDec(e,[r],n,e.name,5,f,t),"class decorators","return")||e,f),c.bind(null,t,e)]}}}',
'import checkInRHS from"checkInRHS";import setFunctionName from"setFunctionName";import toPropertyKey from"toPropertyKey";export default function applyDecs2305(e,t,r,n,o,a){function i(e,t,r){return function(n,o){return r&&r(n),e[t].call(n,o)}}function c(e,t){for(var r=0;r<e.length;r++)e[r].call(t);return t}function s(e,t,r,n){if("function"!=typeof e&&(n||void 0!==e))throw new TypeError(t+" must "+(r||"be")+" a function"+(n?"":" or void 0"));return e}function applyDec(e,t,r,n,o,a,c,u,l,f,p,d,h){function m(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var y,v,b=t[0],g=t[3],w=!u;if(!w){r||Array.isArray(b)||(b=[b]);var S={},A=[],P=3===o?"get":4===o||d?"set":"value";f?(p||d?S={get:setFunctionName((function(){return g(this)}),n,"get"),set:function(e){t[4](this,e)}}:S[P]=g,p||setFunctionName(S[P],n,2===o?"":P)):p||(S=Object.getOwnPropertyDescriptor(e,n))}for(var j=b.length-1;j>=0;j-=r?2:1){var D=b[j],E={},I={kind:["field","accessor","method","getter","setter","field","class"][o],name:n,metadata:a};I.addInitializer=function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");s(t,"An initializer","be",!0),c.push(t)}.bind(null,E);try{if(w)v=D.call(r?b[j-1]:void 0,e,I);else{var O,k;I.static=l,I.private=f,f||!p&&2!==o?2===o?O=function(e){return f&&m(e),S.value}:((o<2||3===o)&&(O=i(S,"get",f&&m)),(o<2||4===o)&&(k=i(S,"set",f&&m))):(O=function(e){return e[n]},p&&(k=function(e,t){e[n]=t}));var F=I.access={has:f?h.bind():function(e){return n in e}};if(O&&(F.get=O),k&&(F.set=k),v=D.call(r?b[j-1]:void 0,d?S:S[P],I),d){if("object"==typeof v&&v)(y=s(v.get,"accessor.get"))&&(S.get=y),(y=s(v.set,"accessor.set"))&&(S.set=y),(y=s(v.init,"accessor.init"))&&A.push(y);else if(void 0!==v)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else s(v,(p?"field":"method")+" decorators","return")&&(p?A.push(v):S[P]=v)}}finally{E.v=!0}}return(p||d)&&u.push((function(e,t){for(var r=A.length-1;r>=0;r--)t=A[r].call(e,t);return t})),p||w||(f?d?u.push(i(S,"get"),i(S,"set")):u.push(2===o?S[P]:i.call.bind(S[P])):Object.defineProperty(e,n,S)),v}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for("Symbol.metadata"),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var l=a[Symbol.metadata||Symbol.for("Symbol.metadata")];var f=Object.create(null==l?null:l),p=function(e,t,r,n){var o,a,i=[],s=function(t){return checkInRHS(t)===e},u=new Map;function l(e){e&&i.push(c.bind(null,e))}for(var f=0;f<t.length;f++){var p=t[f];if(Array.isArray(p)){var d=p[1],h=p[2],m=p.length>3,y=16&d,v=!!(8&d),b=0==(d&=7),g=h+"/"+v;if(!b&&!m){var w=u.get(g)||0;if(!0===w||3===w&&4!==d||4===w&&3!==d)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: "+h);u.set(g,!(d>2)||d)}applyDec(v?e:e.prototype,p,y,m?"#"+h:toPropertyKey(h),d,n,v?a=a||[]:o=o||[],i,v,m,b,1===d,v&&m?s:r)}}return l(o),l(a),i}(e,t,o,f);return r.length||u(e,f),{e:p,get c(){var t=[];return r.length&&[u(s(applyDec(e,[r],n,e.name,5,f,t),"class decorators","return")||e,f),c.bind(null,t,e)]}}}',
),
// size: 544, gzip size: 300
asyncGeneratorDelegate: helper(
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-helpers/src/helpers/applyDecs2305.ts
Expand Up @@ -454,7 +454,7 @@ export default /* @no-mangle */ function applyDecs2305(
ret.push(
kind === PROP_KIND.METHOD
? desc[key]
: Function.call.bind(desc[key]),
: _bindPropCall.call.bind(desc[key]),
);
}
} else {
Expand Down

0 comments on commit f786872

Please sign in to comment.