(e,{refName:t})
| 181 | throw new Error('"' + '${e}' + '" is read-only.'); |
| 182 | })() |
| 183 | `;const i={ReferencedIdentifier(e){const{seen:t,buildImportReference:r,scope:s,imported:i,requeueInParent:a}=this;if(t.has(e.node))return;t.add(e.node);const o=e.node.name;const l=i.get(o);if(l){if(isInType(e)){throw e.buildCodeFrameError(`Cannot transform the imported binding "${o}" since it's also used in a type annotation. `+`Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`)}const t=e.scope.getBinding(o);const i=s.getBinding(o);if(i!==t)return;const c=r(l,e.node);c.loc=e.node.loc;if((e.parentPath.isCallExpression({callee:e.node})||e.parentPath.isOptionalCallExpression({callee:e.node})||e.parentPath.isTaggedTemplateExpression({tag:e.node}))&&n.types.isMemberExpression(c)){e.replaceWith(n.types.sequenceExpression([n.types.numericLiteral(0),c]))}else if(e.isJSXIdentifier()&&n.types.isMemberExpression(c)){const{object:t,property:r}=c;e.replaceWith(n.types.jsxMemberExpression(n.types.jsxIdentifier(t.name),n.types.jsxIdentifier(r.name)))}else{e.replaceWith(c)}a(e);e.skip()}},UpdateExpression(e){const{scope:t,seen:r,imported:s,exported:i,requeueInParent:a,buildImportReference:o}=this;if(r.has(e.node))return;r.add(e.node);const l=e.get("argument");if(l.isMemberExpression())return;const c=e.node;if(l.isIdentifier()){const r=l.node.name;if(t.getBinding(r)!==e.scope.getBinding(r)){return}const a=i.get(r);const p=s.get(r);if((a==null?void 0:a.length)>0||p){if(p){e.replaceWith(n.types.assignmentExpression(c.operator[0]+"=",o(p,l.node),buildImportThrow(r)))}else if(c.prefix){e.replaceWith(buildBindingExportAssignmentExpression(this.metadata,a,n.types.cloneNode(c),e.scope))}else{const s=t.generateDeclaredUidIdentifier(r);e.replaceWith(n.types.sequenceExpression([n.types.assignmentExpression("=",n.types.cloneNode(s),n.types.cloneNode(c)),buildBindingExportAssignmentExpression(this.metadata,a,n.types.identifier(r),e.scope),n.types.cloneNode(s)]))}}}a(e);e.skip()},AssignmentExpression:{exit(e){const{scope:t,seen:r,imported:s,exported:i,requeueInParent:a,buildImportReference:o}=this;if(r.has(e.node))return;r.add(e.node);const l=e.get("left");if(l.isMemberExpression())return;if(l.isIdentifier()){const r=l.node.name;if(t.getBinding(r)!==e.scope.getBinding(r)){return}const c=i.get(r);const p=s.get(r);if((c==null?void 0:c.length)>0||p){const t=e.node;if(p){t.left=o(p,l.node);t.right=n.types.sequenceExpression([t.right,buildImportThrow(r)])}const{operator:s}=t;let i;if(s==="="){i=t}else if(s==="&&="||s==="||="||s==="??="){i=n.types.assignmentExpression("=",t.left,n.types.logicalExpression(s.slice(0,-1),n.types.cloneNode(t.left),t.right))}else{i=n.types.assignmentExpression("=",t.left,n.types.binaryExpression(s.slice(0,-1),n.types.cloneNode(t.left),t.right))}e.replaceWith(buildBindingExportAssignmentExpression(this.metadata,c,i,e.scope));a(e);e.skip()}}else{const r=l.getOuterBindingIdentifiers();const o=Object.keys(r).filter((r=>t.getBinding(r)===e.scope.getBinding(r)));const c=o.find((e=>s.has(e)));if(c){e.node.right=n.types.sequenceExpression([e.node.right,buildImportThrow(c)])}const p=[];o.forEach((t=>{const r=i.get(t)||[];if(r.length>0){p.push(buildBindingExportAssignmentExpression(this.metadata,r,n.types.identifier(t),e.scope))}}));if(p.length>0){let t=n.types.sequenceExpression(p);if(e.parentPath.isExpressionStatement()){t=n.types.expressionStatement(t);t._blockHoist=e.parentPath.node._blockHoist}const r=e.insertAfter(t)[0];a(r)}}}},ForXStatement(e){const{scope:t,node:r}=e;const{left:s}=r;const{exported:i,imported:a,scope:o}=this;if(!n.types.isVariableDeclaration(s)){let r=false,l;const c=e.get("body").scope;for(const e of Object.keys(n.types.getOuterBindingIdentifiers(s))){if(o.getBinding(e)===t.getBinding(e)){if(i.has(e)){r=true;if(c.hasOwnBinding(e)){c.rename(e)}}if(a.has(e)&&!l){l=e}}}if(!r&&!l){return}e.ensureBlock();const p=e.get("body");const u=t.generateUidIdentifierBasedOnNode(s);e.get("left").replaceWith(n.types.variableDeclaration("let",[n.types.variableDeclarator(n.types.cloneNode(u))]));t.registerDeclaration(e.get("left"));if(r){p.unshiftContainer("body",n.types.expressionStatement(n.types.assignmentExpression("=",s,u)))}if(l){p.unshiftContainer("body",n.types.expressionStatement(buildImportThrow(l)))}}}}},5002:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=rewriteThis;var n=r(2358);var s=r(8026);let i;function rewriteThis(e){if(!i){i=s.visitors.environmentVisitor({ThisExpression(e){e.replaceWith(n.types.unaryExpression("void",n.types.numericLiteral(0),true))}});i.noScope=true}(0,s.default)(e.node,i)}},582:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=optimiseCallExpression;var n=r(3061);const{callExpression:s,identifier:i,isIdentifier:a,isSpreadElement:o,memberExpression:l,optionalCallExpression:c,optionalMemberExpression:p}=n;function optimiseCallExpression(e,t,r,n){if(r.length===1&&o(r[0])&&a(r[0].argument,{name:"arguments"})){if(n){return c(p(e,i("apply"),false,true),[t,r[0].argument],false)}return s(l(e,i("apply")),[t,r[0].argument])}else{if(n){return c(p(e,i("call"),false,true),[t,...r],false)}return s(l(e,i("call")),[t,...r])}}},9045:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.declare=declare;t.declarePreset=void 0;const r={assertVersion:e=>t=>{throwVersionError(t,e.version)}};{Object.assign(r,{targets:()=>()=>({}),assumption:()=>()=>undefined,addExternalDependency:()=>()=>{}})}function declare(e){return(t,n,s)=>{var i;let a;for(const e of Object.keys(r)){var o;if(t[e])continue;(o=a)!=null?o:a=copyApiObject(t);a[e]=r[e](a)}return e((i=a)!=null?i:t,n||{},s)}}const n=t.declarePreset=declare;function copyApiObject(e){let t=null;if(typeof e.version==="string"&&/^7\./.test(e.version)){t=Object.getPrototypeOf(e);if(t&&(!hasOwnProperty.call(t,"version")||!hasOwnProperty.call(t,"transform")||!hasOwnProperty.call(t,"template")||!hasOwnProperty.call(t,"types"))){t=null}}return Object.assign({},t,e)}function throwVersionError(e,t){if(typeof e==="number"){if(!Number.isInteger(e)){throw new Error("Expected string or integer value.")}e=`^${e}.0.0-0`}if(typeof e!=="string"){throw new Error("Expected string or integer value.")}const r=Error.stackTraceLimit;if(typeof r==="number"&&r<25){Error.stackTraceLimit=25}let n;if(t.slice(0,2)==="7."){n=new Error(`Requires Babel "^7.0.0-beta.41", but was loaded with "${t}". `+`You'll need to update your @babel/core version.`)}else{n=new Error(`Requires Babel "${e}", but was loaded with "${t}". `+`If you are sure you have a compatible version of @babel/core, `+`it is likely that something in your build process is loading the `+`wrong version. Inspect the stack trace of this error to look for `+`the first entry that doesn't mention "@babel/core" or "babel-core" `+`to see what is calling Babel.`)}if(typeof r==="number"){Error.stackTraceLimit=r}throw Object.assign(n,{code:"BABEL_VERSION_UNSUPPORTED",version:t,range:e})}},6721:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;var n=r(3034);var s=r(582);var i=r(2358);var a=r(8026);const{assignmentExpression:o,callExpression:l,cloneNode:c,identifier:p,memberExpression:u,sequenceExpression:d,stringLiteral:f,thisExpression:h}=i.types;{t.environmentVisitor=a.visitors.environmentVisitor({});t.skipAllButComputedKey=function skipAllButComputedKey(e){e.skip();if(e.node.computed){e.context.maybeQueue(e.get("key"))}}}const m=a.visitors.environmentVisitor({Super(e,t){const{node:r,parentPath:n}=e;if(!n.isMemberExpression({object:r}))return;t.handle(n)}});const y=a.visitors.environmentVisitor({Scopable(e,{refName:t}){const r=e.scope.getOwnBinding(t);if(r&&r.identifier.name===t){e.scope.rename(t)}}});const g={memoise(e,t){const{scope:r,node:n}=e;const{computed:s,property:i}=n;if(!s){return}const a=r.maybeGenerateMemoised(i);if(!a){return}this.memoiser.set(i,a,t)},prop(e){const{computed:t,property:r}=e.node;if(this.memoiser.has(r)){return c(this.memoiser.get(r))}if(t){return c(r)}return f(r.name)},_getPrototypeOfExpression(){const e=c(this.getObjectRef());const t=this.isStatic||this.isPrivateMethod?e:u(e,p("prototype"));return l(this.file.addHelper("getPrototypeOf"),[t])},get(e){const t=c(this.getObjectRef());return l(this.file.addHelper("superPropGet"),[this.isDerivedConstructor?d([h(),t]):t,this.prop(e),h(),...this.isStatic||this.isPrivateMethod?[]:[i.types.numericLiteral(1)]])},_call(e,t,r){const n=c(this.getObjectRef());let s;if(t.length===1&&i.types.isSpreadElement(t[0])&&(i.types.isIdentifier(t[0].argument)||i.types.isArrayExpression(t[0].argument))){s=t[0].argument}else{s=i.types.arrayExpression(t)}const a=i.types.callExpression(this.file.addHelper("superPropGet"),[this.isDerivedConstructor?d([h(),n]):n,this.prop(e),h(),i.types.numericLiteral(2|(this.isStatic||this.isPrivateMethod?0:1))]);if(r){return i.types.optionalCallExpression(a,[s],true)}return l(a,[s])},set(e,t){const r=c(this.getObjectRef());return l(this.file.addHelper("superPropSet"),[this.isDerivedConstructor?d([h(),r]):r,this.prop(e),t,h(),i.types.numericLiteral(e.isInStrictMode()?1:0),...this.isStatic||this.isPrivateMethod?[]:[i.types.numericLiteral(1)]])},destructureSet(e){throw e.buildCodeFrameError(`Destructuring to a super field is not supported yet.`)},call(e,t){return this._call(e,t,false)},optionalCall(e,t){return this._call(e,t,true)},delete(e){if(e.node.computed){return d([l(this.file.addHelper("toPropertyKey"),[c(e.node.property)]),i.template.expression.ast` |
| 184 | function () { throw new ReferenceError("'delete super[expr]' is invalid"); }() |
| 185 | `])}else{return i.template.expression.ast` |
| 186 | function () { throw new ReferenceError("'delete super.prop' is invalid"); }() |
nothing calls this directly
no test coverage detected