@babel/helpers
Advanced tools
Comparing version 7.23.9 to 7.24.0
@@ -24,2 +24,4 @@ "use strict"; | ||
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 undefined"));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=t[0],g=t[3],b=!u;if(!b){r||Array.isArray(v)||(v=[v]);var w={},S=[],A=3===o?"get":4===o||d?"set":"value";f?(p||d?w={get:setFunctionName((function(){return g(this)}),n,"get"),set:function(e){t[4](this,e)}}:w[A]=g,p||setFunctionName(w[A],n,2===o?"":A)):p||(w=Object.getOwnPropertyDescriptor(e,n))}for(var P=e,j=v.length-1;j>=0;j-=r?2:1){var D=v[j],E=r?v[j-1]:void 0,I={},O={kind:["field","accessor","method","getter","setter","class"][o],name:n,metadata:a,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,I)};try{if(b)(y=s(D.call(E,P,O),"class decorators","return"))&&(P=y);else{var k,F;O.static=l,O.private=f,f?2===o?k=function(e){return m(e),w.value}:(o<4&&(k=i(w,"get",m)),3!==o&&(F=i(w,"set",m))):(k=function(e){return e[n]},(o<2||4===o)&&(F=function(e,t){e[n]=t}));var N=O.access={has:f?h.bind():function(e){return n in e}};if(k&&(N.get=k),F&&(N.set=F),P=D.call(E,d?{get:w.get,set:w.set}:w[A],O),d){if("object"==typeof P&&P)(y=s(P.get,"accessor.get"))&&(w.get=y),(y=s(P.set,"accessor.set"))&&(w.set=y),(y=s(P.init,"accessor.init"))&&S.push(y);else if(void 0!==P)throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0")}else s(P,(p?"field":"method")+" decorators","return")&&(p?S.push(P):w[A]=P)}}finally{I.v=!0}}return(p||d)&&u.push((function(e,t){for(var r=S.length-1;r>=0;r--)t=S[r].call(e,t);return t})),p||b||(f?d?u.push(i(w,"get"),i(w,"set")):u.push(2===o?w[A]:i.call.bind(w[A])):Object.defineProperty(e,n,w)),P}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),g=0==(d&=7),b=h+"/"+v;if(!g&&!m){var w=u.get(b);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(b,!(d>2)||d)}applyDec(v?e:e.prototype,p,y,m?"#"+h:toPropertyKey(h),d,n,v?a=a||[]:o=o||[],i,v,m,g,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(applyDec(e,[r],n,e.name,5,f,t),f),c.bind(null,t,e)]}}}'), | ||
applyDecs2311: helper("7.24.0", 'import checkInRHS from"checkInRHS";import setFunctionName from"setFunctionName";import toPropertyKey from"toPropertyKey";export default function applyDecs2311(e,t,n,r,o,i){var a,c,u,s,f,l,p,d=Symbol.metadata||Symbol.for("Symbol.metadata"),m=Object.defineProperty,h=Object.create,y=[h(null),h(null)],v=t.length;function g(t,n,r){return function(o,i){n&&(i=o,o=e);for(var a=0;a<t.length;a++)i=t[a].apply(o,r?[i]:[]);return r?i:o}}function b(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function applyDec(e,t,n,r,o,i,u,s,f,l,p){function d(e){if(!p(e))throw new TypeError("Attempted to access private element on non-instance")}var h=[].concat(t[0]),v=t[3],w=!u,D=1===o,S=3===o,j=4===o,E=2===o;function I(t,n,r){return function(o,i){return n&&(i=o,o=e),r&&r(o),P[t].call(o,i)}}if(!w){var P={},k=[],F=S?"get":j||D?"set":"value";if(f?(l||D?P={get:setFunctionName((function(){return v(this)}),r,"get"),set:function(e){t[4](this,e)}}:P[F]=v,l||setFunctionName(P[F],r,E?"":F)):l||(P=Object.getOwnPropertyDescriptor(e,r)),!l&&!f){if((c=y[+s][r])&&7!=(c^o))throw new Error("Decorating two elements with the same name ("+P[F].name+") is not supported yet");y[+s][r]=o<3?1:o}}for(var N=e,O=h.length-1;O>=0;O-=n?2:1){var z=h[O],H=n?h[O-1]:void 0,K={},R={kind:["field","accessor","method","getter","setter","class"][o],name:r,metadata:a,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");b(t,"An initializer","be",!0),i.push(t)}.bind(null,K)};if(w)c=z.call(H,N,R),K.v=1,b(c,"class decorators","return")&&(N=c);else if(R.static=s,R.private=f,c=R.access={has:f?p.bind():function(e){return r in e}},j||(c.get=f?E?function(e){return d(e),P.value}:I("get",0,d):function(e){return e[r]}),E||S||(c.set=f?I("set",0,d):function(e,t){e[r]=t}),N=z.call(H,D?{get:P.get,set:P.set}:P[F],R),K.v=1,D){if("object"==typeof N&&N)(c=b(N.get,"accessor.get"))&&(P.get=c),(c=b(N.set,"accessor.set"))&&(P.set=c),(c=b(N.init,"accessor.init"))&&k.unshift(c);else if(void 0!==N)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else b(N,(l?"field":"method")+" decorators","return")&&(l?k.unshift(N):P[F]=N)}return o<2&&u.push(g(k,s,1),g(i,s,0)),l||w||(f?D?u.splice(-1,0,I("get",s),I("set",s)):u.push(E?P[F]:b.call.bind(P[F])):m(e,r,P)),N}function w(e){return m(e,d,{configurable:!0,enumerable:!0,value:a})}return void 0!==i&&(a=i[d]),a=h(null==a?null:a),f=[],l=function(e){e&&f.push(g(e))},p=function(t,r){for(var i=0;i<n.length;i++){var a=n[i],c=a[1],l=7&c;if((8&c)==t&&!l==r){var p=a[2],d=!!a[3],m=16&c;applyDec(t?e:e.prototype,a,m,d?"#"+p:toPropertyKey(p),l,l<2?[]:t?s=s||[]:u=u||[],f,!!t,d,r,t&&d?function(t){return checkInRHS(t)===e}:o)}}},p(8,0),p(0,0),p(8,1),p(0,1),l(u),l(s),c=f,v||w(e),{e:c,get c(){var n=[];return v&&[w(e=applyDec(e,[t],r,e.name,5,n)),g(n,1)]}}}'), | ||
assertClassBrand: helper("7.24.0", 'export default function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}'), | ||
asyncGeneratorDelegate: helper("7.0.0-beta.0", 'import OverloadYield from"OverloadYield";export default function _asyncGeneratorDelegate(t){var e={},n=!1;function pump(e,r){return n=!0,r=new Promise((function(n){n(t[e](r))})),{done:!1,value:new OverloadYield(r,1)}}return e["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},e.next=function(t){return n?(n=!1,t):pump("next",t)},"function"==typeof t.throw&&(e.throw=function(t){if(n)throw n=!1,t;return pump("throw",t)}),"function"==typeof t.return&&(e.return=function(t){return n?(n=!1,t):pump("return",t)}),e}'), | ||
@@ -30,2 +32,6 @@ asyncIterator: helper("7.15.9", 'export default function _asyncIterator(r){var n,t,o,e=2;for("undefined"!=typeof Symbol&&(t=Symbol.asyncIterator,o=Symbol.iterator);e--;){if(t&&null!=(n=r[t]))return n.call(r);if(o&&null!=(n=r[o]))return new AsyncFromSyncIterator(n.call(r));t="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")}function AsyncFromSyncIterator(r){function AsyncFromSyncIteratorContinuation(r){if(Object(r)!==r)return Promise.reject(new TypeError(r+" is not an object."));var n=r.done;return Promise.resolve(r.value).then((function(r){return{value:r,done:n}}))}return AsyncFromSyncIterator=function(r){this.s=r,this.n=r.next},AsyncFromSyncIterator.prototype={s:null,n:null,next:function(){return AsyncFromSyncIteratorContinuation(this.n.apply(this.s,arguments))},return:function(r){var n=this.s.return;return void 0===n?Promise.resolve({value:r,done:!0}):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))},throw:function(r){var n=this.s.return;return void 0===n?Promise.reject(r):AsyncFromSyncIteratorContinuation(n.apply(this.s,arguments))}},new AsyncFromSyncIterator(r)}'), | ||
checkInRHS: helper("7.20.5", 'export default function _checkInRHS(e){if(Object(e)!==e)throw TypeError("right-hand side of \'in\' should be an object, got "+(null!==e?typeof e:"null"));return e}'), | ||
classPrivateFieldGet2: helper("7.24.0", 'import assertClassBrand from"assertClassBrand";export default function _classPrivateFieldGet2(s,a){return s.get(assertClassBrand(s,a))}'), | ||
classPrivateFieldSet2: helper("7.24.0", 'import assertClassBrand from"assertClassBrand";export default function _classPrivateFieldSet2(s,a,r){return s.set(assertClassBrand(s,a),r),r}'), | ||
classPrivateGetter: helper("7.24.0", 'import assertClassBrand from"assertClassBrand";export default function _classPrivateGetter(s,r,a){return a(assertClassBrand(s,r))}'), | ||
classPrivateSetter: helper("7.24.0", 'import assertClassBrand from"assertClassBrand";export default function _classPrivateSetter(s,r,a,t){return r(assertClassBrand(s,a),t),t}'), | ||
construct: helper("7.0.0-beta.0", 'import setPrototypeOf from"setPrototypeOf";import isNativeReflectConstruct from"isNativeReflectConstruct";export default function _construct(t,e,r){if(isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o));return r&&setPrototypeOf(p,r.prototype),p}'), | ||
@@ -45,2 +51,3 @@ defineAccessor: helper("7.20.7", "export default function _defineAccessor(e,r,n,t){var c={configurable:!0,enumerable:!0};return c[e]=t,Object.defineProperty(r,n,c)}"), | ||
toPropertyKey: helper("7.1.5", 'import toPrimitive from"toPrimitive";export default function toPropertyKey(t){var i=toPrimitive(t,"string");return"symbol"==typeof i?i:String(i)}'), | ||
toSetter: helper("7.24.0", 'export default function _toSetter(t,e,n){e||(e=[]);var r=e.length++;return Object.defineProperty({},"_",{set:function(o){e[r]=o,t.apply(n,e)}})}'), | ||
typeof: helper("7.0.0-beta.0", 'export default function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}'), | ||
@@ -47,0 +54,0 @@ using: helper("7.22.0", 'export default function _using(o,n,e){if(null==n)return n;if(Object(n)!==n)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(e)var r=n[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(null==r&&(r=n[Symbol.dispose||Symbol.for("Symbol.dispose")]),"function"!=typeof r)throw new TypeError("Property [Symbol.dispose] is not a function.");return o.push({v:n,d:r,a:e}),n}'), |
@@ -821,5 +821,5 @@ "use strict"; | ||
import classApplyDescriptorGet from "classApplyDescriptorGet"; | ||
import classExtractFieldDescriptor from "classExtractFieldDescriptor"; | ||
import classPrivateFieldGet2 from "classPrivateFieldGet2"; | ||
export default function _classPrivateFieldGet(receiver, privateMap) { | ||
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "get"); | ||
var descriptor = classPrivateFieldGet2(privateMap, receiver); | ||
return classApplyDescriptorGet(receiver, descriptor); | ||
@@ -830,5 +830,5 @@ } | ||
import classApplyDescriptorSet from "classApplyDescriptorSet"; | ||
import classExtractFieldDescriptor from "classExtractFieldDescriptor"; | ||
import classPrivateFieldGet2 from "classPrivateFieldGet2"; | ||
export default function _classPrivateFieldSet(receiver, privateMap, value) { | ||
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set"); | ||
var descriptor = classPrivateFieldGet2(privateMap, receiver); | ||
classApplyDescriptorSet(receiver, descriptor, value); | ||
@@ -840,5 +840,5 @@ return value; | ||
import classApplyDescriptorDestructureSet from "classApplyDescriptorDestructureSet"; | ||
import classExtractFieldDescriptor from "classExtractFieldDescriptor"; | ||
import classPrivateFieldGet2 from "classPrivateFieldGet2"; | ||
export default function _classPrivateFieldDestructureSet(receiver, privateMap) { | ||
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set"); | ||
var descriptor = classPrivateFieldGet2(privateMap, receiver); | ||
return classApplyDescriptorDestructureSet(receiver, descriptor); | ||
@@ -848,7 +848,6 @@ } | ||
helpers.classExtractFieldDescriptor = helper("7.13.10")` | ||
export default function _classExtractFieldDescriptor(receiver, privateMap, action) { | ||
if (!privateMap.has(receiver)) { | ||
throw new TypeError("attempted to " + action + " private field on non-instance"); | ||
} | ||
return privateMap.get(receiver); | ||
import classPrivateFieldGet2 from "classPrivateFieldGet2"; | ||
export default function _classExtractFieldDescriptor(receiver, privateMap) { | ||
return classPrivateFieldGet2(privateMap, receiver); | ||
} | ||
@@ -858,6 +857,6 @@ `; | ||
import classApplyDescriptorGet from "classApplyDescriptorGet"; | ||
import classCheckPrivateStaticAccess from "classCheckPrivateStaticAccess"; | ||
import assertClassBrand from "assertClassBrand"; | ||
import classCheckPrivateStaticFieldDescriptor from "classCheckPrivateStaticFieldDescriptor"; | ||
export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) { | ||
classCheckPrivateStaticAccess(receiver, classConstructor); | ||
assertClassBrand(classConstructor, receiver); | ||
classCheckPrivateStaticFieldDescriptor(descriptor, "get"); | ||
@@ -869,6 +868,6 @@ return classApplyDescriptorGet(receiver, descriptor); | ||
import classApplyDescriptorSet from "classApplyDescriptorSet"; | ||
import classCheckPrivateStaticAccess from "classCheckPrivateStaticAccess"; | ||
import assertClassBrand from "assertClassBrand"; | ||
import classCheckPrivateStaticFieldDescriptor from "classCheckPrivateStaticFieldDescriptor"; | ||
export default function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) { | ||
classCheckPrivateStaticAccess(receiver, classConstructor); | ||
assertClassBrand(classConstructor, receiver); | ||
classCheckPrivateStaticFieldDescriptor(descriptor, "set"); | ||
@@ -880,5 +879,5 @@ classApplyDescriptorSet(receiver, descriptor, value); | ||
helpers.classStaticPrivateMethodGet = helper("7.3.2")` | ||
import classCheckPrivateStaticAccess from "classCheckPrivateStaticAccess"; | ||
import assertClassBrand from "assertClassBrand"; | ||
export default function _classStaticPrivateMethodGet(receiver, classConstructor, method) { | ||
classCheckPrivateStaticAccess(receiver, classConstructor); | ||
assertClassBrand(classConstructor, receiver); | ||
return method; | ||
@@ -940,6 +939,6 @@ } | ||
import classApplyDescriptorDestructureSet from "classApplyDescriptorDestructureSet"; | ||
import classCheckPrivateStaticAccess from "classCheckPrivateStaticAccess"; | ||
import assertClassBrand from "assertClassBrand"; | ||
import classCheckPrivateStaticFieldDescriptor from "classCheckPrivateStaticFieldDescriptor"; | ||
export default function _classStaticPrivateFieldDestructureSet(receiver, classConstructor, descriptor) { | ||
classCheckPrivateStaticAccess(receiver, classConstructor); | ||
assertClassBrand(classConstructor, receiver); | ||
classCheckPrivateStaticFieldDescriptor(descriptor, "set"); | ||
@@ -950,6 +949,5 @@ return classApplyDescriptorDestructureSet(receiver, descriptor); | ||
helpers.classCheckPrivateStaticAccess = helper("7.13.10")` | ||
export default function _classCheckPrivateStaticAccess(receiver, classConstructor) { | ||
if (receiver !== classConstructor) { | ||
throw new TypeError("Private static access of wrong provenance"); | ||
} | ||
import assertClassBrand from "assertClassBrand"; | ||
export default function _classCheckPrivateStaticAccess(receiver, classConstructor, returnValue) { | ||
return assertClassBrand(classConstructor, receiver, returnValue); | ||
} | ||
@@ -1638,6 +1636,5 @@ `; | ||
helpers.classPrivateMethodGet = helper("7.1.6")` | ||
import assertClassBrand from "assertClassBrand"; | ||
export default function _classPrivateMethodGet(receiver, privateSet, fn) { | ||
if (!privateSet.has(receiver)) { | ||
throw new TypeError("attempted to get private field on non-instance"); | ||
} | ||
assertClassBrand(privateSet, receiver); | ||
return fn; | ||
@@ -1644,0 +1641,0 @@ } |
@@ -85,3 +85,5 @@ "use strict"; | ||
if (!binding) { | ||
globals.add(name); | ||
if (name !== "arguments" || child.scope.path.isProgram()) { | ||
globals.add(name); | ||
} | ||
} else if (dependencies.has(binding.identifier)) { | ||
@@ -88,0 +90,0 @@ importBindingsReferences.push(makePath(child)); |
{ | ||
"name": "@babel/helpers", | ||
"version": "7.23.9", | ||
"version": "7.24.0", | ||
"description": "Collection of helper functions used by Babel transforms.", | ||
@@ -18,5 +18,5 @@ "author": "The Babel Team (https://babel.dev/team)", | ||
"dependencies": { | ||
"@babel/template": "^7.23.9", | ||
"@babel/traverse": "^7.23.9", | ||
"@babel/types": "^7.23.9" | ||
"@babel/template": "^7.24.0", | ||
"@babel/traverse": "^7.24.0", | ||
"@babel/types": "^7.24.0" | ||
}, | ||
@@ -26,3 +26,3 @@ "devDependencies": { | ||
"@babel/helper-plugin-test-runner": "^7.22.5", | ||
"@babel/parser": "^7.23.9", | ||
"@babel/parser": "^7.24.0", | ||
"regenerator-runtime": "^0.14.0" | ||
@@ -29,0 +29,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
648608
86
5551
13
Updated@babel/template@^7.24.0
Updated@babel/traverse@^7.24.0
Updated@babel/types@^7.24.0