update wfajs module
This commit is contained in:
1 parent
2b5c1bbf11
commit
31bfa79e66
2 files changed
+2
-1
No files matched your search
+2
-1
@@ -1 +1,2 @@
|
||||
var A=a=>typeof a==='number';(()=>{if(typeof global!=='undefined'){}else if(typeof window!=='undefined')window.global=window;else if(typeof self!=='undefined')self.global=self;else throw Error('cannot export Go (neither global, window nor self is defined)');(!global.require&&typeof require!=='undefined')&&(global.require=require);(!global.fs&&global.require)&&(global.fs=require('node:fs'));var B=()=>{const _a=Error('not implemented');_a.code='ENOSYS';return _a},F=[];if(!global.fs){let D='';global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(_A,_b){D+=d.decode(_b);var _C=D.lastIndexOf('\n');_C!=-1&&(console.log(D.substr(0,_C)),D=D.substr(_C+1));return _b.length},write(E,_B,aA,_d,_e,_f){if(aA!==0||_d!==_B.length||_e!==null){_f(B());return}_f(null,this.writeSync(E,_B))},chmod(aB,aC,aD){aD(B())},chown(aE,aF,aG,_D){_D(B())},close(aH,aI){aI(B())},fchmod(aJ,aK,aL){aL(B())},fchown(aM,aN,aO,aP){aP(B())},fstat(aQ,aR){aR(B())},fsync(aS,aT){aT(null)},ftruncate(aU,aV,aW){aW(B())},lchown(aX,aY,aZ,bA){bA(B())},link(bB,bC,bD){bD(B())},lstat(bE,bF){bF(B())},mkdir(bG,bH,bI){bI(B())},open(bJ,bK,bL,bM){bM(B())},read(bN,bO,bP,bQ,_E,_F){_F(B())},readdir(bR,bS){bS(B())},readlink(bT,bU){bU(B())},rename(bV,bW,bX){bX(B())},rmdir(bY,bZ){bZ(B())},stat(cA,cB){cB(B())},symlink(cC,cD,cE){cE(B())},truncate(cF,cG,cH){cH(B())},unlink(cI,cJ){cJ(B())},utimes(cK,cL,cM,cN){cN(B())}}}!global.process&&(global.process={getuid(){return -1},getgid(){return -1},geteuid(){return -1},getegid(){return -1},getgroups(){throw B()},pid:-1,ppid:-1,umask(){throw B()},cwd(){throw B()},chdir(){throw B()}});if(!global.crypto){var C=require('node:crypto');global.crypto={getRandomValues(b){C.randomFillSync(b)}}}!global.performance&&(global.performance={now(){const[cO,cP]=process.hrtime();return cO*1000+cP/1000000}});!global.TextEncoder&&(global.TextEncoder=require('node:util').TextEncoder);!global.TextDecoder&&(global.TextDecoder=require('node:util').TextDecoder);var _c=new TextEncoder('utf-8');var d=new TextDecoder('utf-8');let e=new DataView(new ArrayBuffer(8));global.Go=class{constructor(){this._callbackTimeouts=new Map();this._nextCallbackTimeoutID=1;var cQ=()=>new DataView(this._inst.exports.memory.buffer),cR=cW=>{e.setBigInt64(0,cW,!0);const f=e.getFloat64(0,!0);if(f===0)return;if(!isNaN(f))return f;const cX=cW&0xffffffffn;return this._values[cX]},cS=cY=>{return cR(cQ().getBigUint64(cY,!0))},cT=v=>{const cZ=0x7FF80000n;if(A(v)){if(isNaN(v))return cZ<<32n;if(v===0)return (cZ<<32n)|1n;e.setFloat64(0,v,!0);return e.getBigInt64(0,!0)}switch(v) {case void 0:return 0n;case null:return (cZ<<32n)|2n;case !0:return (cZ<<32n)|3n;case !1:return (cZ<<32n)|4n}let dA=this._ids.get(v);if(dA===void 0){dA=this._idPool.pop();dA===void 0&&(dA=BigInt(this._values.length));this._values[dA]=v;this._goRefCounts[dA]=0;this._ids.set(v,dA)}this._goRefCounts[dA]++;let dB=1n;switch(typeof v) {case 'string':dB=2n;break;case 'symbol':dB=3n;break;case 'function':dB=4n;break}return dA|((cZ|dB)<<32n)},cU=(dC,v)=>{cQ().setBigUint64(dC,cT(v),!0)},cV=(dD,dE,dF)=>new Uint8Array(this._inst.exports.memory.buffer, dD, dE),G=(dG,dH,dI)=>{const a=Array(dH);for(let i=0;i<dH;i++)a[i]=cS(dG+i*8);return a},h=(dJ,dK)=>d.decode(new DataView(this._inst.exports.memory.buffer, dJ, dK)),I=Date.now()-performance.now();this.importObject={wasi_snapshot_preview1:{fd_write:function(dL,dM,dN,dO){let dP=0;if(dL==1)for(let dQ=0;dQ<dN;dQ++){let dR=dM+dQ*8;let dS=cQ().getUint32(dR+0,!0);let dT=cQ().getUint32(dR+4,!0);dP+=dT;for(let i=0;i<dT;i++){let c=cQ().getUint8(dS+i);if(c==13){}else if(c==10){F=[];console.log(d.decode(new Uint8Array(F)))}else F.push(c)}}else console.error('invalid file descriptor:',dL);cQ().setUint32(dO,dP,!0);return 0},fd_close:()=>0,fd_fdstat_get:()=>0,fd_seek:()=>0,'proc_exit':dU=>{if(global.process)process.exit(dU);else throw `trying to exit with code ${dU}`},random_get:(dV,dW)=>(crypto.getRandomValues(cV(dV,dW)),0)},gojs:{'runtime.ticks':()=>I+performance.now(),'runtime.sleepTicks':dX=>setTimeout(this._inst.exports.go_scheduler,dX),'syscall/js.finalizeRef':dY=>{var dZ=cQ().getUint32(cR(dY),!0);this._goRefCounts[dZ]--;if(this._goRefCounts[dZ]===0){var v=this._values[dZ];this._values[dZ]=null;this._ids.delete(v);this._idPool.push(dZ)}},'syscall/js.stringVal':(eA,eB)=>{return cT(h(eA,eB))},'syscall/js.valueGet':(eC,eD,eE)=>{return cT(Reflect.get(cR(eC),h(eD,eE)))},'syscall/js.valueSet':(eF,eG,eH,eI)=>{Reflect.set(cR(eF),h(eG,eH),cR(eI))},'syscall/js.valueDelete':(eJ,eK,eL)=>{Reflect.deleteProperty(cR(eJ),h(eK,eL))},'syscall/js.valueIndex':(eM,i)=>cT(Reflect.get(cR(eM),i)),'syscall/js.valueSetIndex':(eN,i,eO)=>Reflect.set(cR(eN),i,cR(eO)),'syscall/js.valueCall':(eP,eQ,eR,eS,eT,eU,_g)=>{var v=cR(eQ),_i=h(eR,eS),j=G(eT,eU,_g);try{var m=Reflect.get(v,_i);cU(eP,Reflect.apply(m,v,j));cQ().setUint8(eP+8,1)}catch(eV){cU(eP,eV);cQ().setUint8(eP+8,0)}},'syscall/js.valueInvoke':(eW,eX,eY,eZ,fA)=>{try{var v=cR(eX),_G=G(eY,eZ,fA);cU(eW,Reflect.apply(v,void 0,_G)Line truncated
|
||||
(()=>{if(typeof global!="undefined");else if(typeof window!="undefined")window.global=window;else if(typeof self!="undefined")self.global=self;else throw new Error("cannot export Go (neither global, window nor self is defined)");!global.require&&typeof require!="undefined"&&(global.require=require),!global.fs&&global.require&&(global.fs=require("node:fs"));const e=()=>{const e=new Error("not implemented");return e.code="ENOSYS",e};if(!global.fs){let t="";global.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1},writeSync(e,s){t+=n.decode(s);const o=t.lastIndexOf(`
|
||||
`);return o!=-1&&(console.log(t.substr(0,o)),t=t.substr(o+1)),s.length},write(t,n,s,o,i,a){if(s!==0||o!==n.length||i!==null){a(e());return}const r=this.writeSync(t,n);a(null,r)},chmod(t,n,s){s(e())},chown(t,n,s,o){o(e())},close(t,n){n(e())},fchmod(t,n,s){s(e())},fchown(t,n,s,o){o(e())},fstat(t,n){n(e())},fsync(e,t){t(null)},ftruncate(t,n,s){s(e())},lchown(t,n,s,o){o(e())},link(t,n,s){s(e())},lstat(t,n){n(e())},mkdir(t,n,s){s(e())},open(t,n,s,o){o(e())},read(t,n,s,o,i,a){a(e())},readdir(t,n){n(e())},readlink(t,n){n(e())},rename(t,n,s){s(e())},rmdir(t,n){n(e())},stat(t,n){n(e())},symlink(t,n,s){s(e())},truncate(t,n,s){s(e())},unlink(t,n){n(e())},utimes(t,n,s,o){o(e())}}}if(global.process||(global.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw e()},pid:-1,ppid:-1,umask(){throw e()},cwd(){throw e()},chdir(){throw e()}}),!global.crypto){const e=require("node:crypto");global.crypto={getRandomValues(t){e.randomFillSync(t)}}}global.performance||(global.performance={now(){const[e,t]=process.hrtime();return e*1e3+t/1e6}}),global.TextEncoder||(global.TextEncoder=require("node:util").TextEncoder),global.TextDecoder||(global.TextDecoder=require("node:util").TextDecoder);const o=new TextEncoder("utf-8"),n=new TextDecoder("utf-8");let t=new DataView(new ArrayBuffer(8));var s=[];if(global.Go=class{constructor(){this._callbackTimeouts=new Map,this._nextCallbackTimeoutID=1;const e=()=>new DataView(this._inst.exports.memory.buffer),i=e=>{t.setBigInt64(0,e,!0);const n=t.getFloat64(0,!0);if(n===0)return void 0;if(!isNaN(n))return n;const s=e&4294967295n;return this._values[s]},u=t=>{let n=e().getBigUint64(t,!0);return i(n)},c=e=>{const s=2146959360n;if(typeof e=="number")return isNaN(e)?s<<32n:e===0?s<<32n|1n:(t.setFloat64(0,e,!0),t.getBigInt64(0,!0));switch(e){case void 0:return 0n;case null:return s<<32n|2n;case!0:return s<<32n|3n;case!1:return s<<32n|4n}let n=this._ids.get(e);n===void 0&&(n=this._idPool.pop(),n===void 0&&(n=BigInt(this._values.length)),this._values[n]=e,this._goRefCounts[n]=0,this._ids.set(e,n)),this._goRefCounts[n]++;let o=1n;switch(typeof e){case"string":o=2n;break;case"symbol":o=3n;break;case"function":o=4n;break}return n|(s|o)<<32n},a=(t,n)=>{let s=c(n);e().setBigUint64(t,s,!0)},l=(e,t)=>new Uint8Array(this._inst.exports.memory.buffer,e,t),d=(e,t)=>{const s=new Array(t);for(let n=0;n<t;n++)s[n]=u(e+n*8);return s},r=(e,t)=>n.decode(new DataView(this._inst.exports.memory.buffer,e,t)),h=Date.now()-performance.now();this.importObject={wasi_snapshot_preview1:{fd_write:function(t,o,i,a){let r=0;if(t==1)for(let t=0;t<i;t++){let a=o+t*8,l=e().getUint32(a+0,!0),c=e().getUint32(a+4,!0);r+=c;for(let t=0;t<c;t++){let o=e().getUint8(l+t);if(o==13);else if(o==10){let e=n.decode(new Uint8Array(s));s=[],console.log(e)}else s.push(o)}}else console.error("invalid file descriptor:",t);return e().setUint32(a,r,!0),0},fd_close:()=>0,fd_fdstat_get:()=>0,fd_seek:()=>0,proc_exit:e=>{if(global.process)process.exit(e);else throw"trying to exit with code "+e},random_get:(e,t)=>(crypto.getRandomValues(l(e,t)),0)},gojs:{"runtime.ticks":()=>h+performance.now(),"runtime.sleepTicks":e=>{setTimeout(this._inst.exports.go_scheduler,e)},"syscall/js.finalizeRef":t=>{const n=e().getUint32(i(t),!0);if(this._goRefCounts[n]--,this._goRefCounts[n]===0){const e=this._values[n];this._values[n]=null,this._ids.delete(e),this._idPool.push(n)}},"syscall/js.stringVal":(e,t)=>{const n=r(e,t);return c(n)},"syscall/js.valueGet":(e,t,n)=>{let s=r(t,n),o=i(e),a=Reflect.get(o,s);return c(a)},"syscall/js.valueSet":(e,t,n,s)=>{const o=i(e),a=r(t,n),c=i(s);Reflect.set(o,a,c)},"syscall/js.valueDelete":(e,t,n)=>{const s=i(e),o=r(t,n);Reflect.deleteProperty(s,o)},"syscall/js.valueIndex":(e,t)=>c(Reflect.get(i(e),t)),"syscall/js.valueSetIndex":(e,t,n)=>{Reflect.set(i(e),t,i(n))},"syscall/js.valueCall":(t,n,s,o,c,l,u)=>{const h=i(n),m=r(s,o),f=d(c,l,u);try{const n=Reflect.get(h,m);a(t,Reflect.apply(n,h,f)),e().setUint8(t+8,1)}catch(n){a(t,n),e().setUint8(t+8,0)}},"syscall/js.valueInvoke":(t,n,s,o,r)=>{try{const c=i(n),l=d(s,o,r);a(t,Reflect.apply(c,void 0,l)),e().setUint8(t+8,1)}catch(n){a(t,n),e().setUint8(t+8,0)}},"syscall/js.valueNew":(t,n,s,o,r)=>{const c=i(n),l=d(s,o,r);try{a(t,Reflect.construct(c,l)),e().setUint8(t+8,1)}catch(n){a(t,n),e().setUint8(t+8,0)}},"syscall/js.valueLength":e=>i(e).length,"syscall/js.valuePrepareString":(t,n)=>{const r=String(i(n)),s=o.encode(r);a(t,s),e().setInt32(t+8,s.length,!0)},"syscall/js.valueLoadString":(e,t,n,s)=>{const o=i(e);l(t,n,s).set(o)},"syscall/js.valueInstanceOf":(e,t)=>i(e)instanceof i(t),"syscall/js.copyBytesToGo":(t,n,s,o,a)=>{let h=t,c=t+4;const d=l(n,s),r=i(a);if(!(r instanceof Uint8Array||r instanceof Uint8ClampedArray)){e().setUint8(c,0);return}const u=r.subarray(0,d.length);d.set(u),e().setUint32(h,u.length,!0),e().setUint8(c,1)},"syscall/js.copyBytesToJS":(t,n,s,o)=>{let u=t,c=t+4;const r=i(n),h=l(s,o);if(!(r instanceof Uint8Array||r instanceof Uint8C
Line truncated
|
||||
Binary file not shown.
Reference in new issue
Block a user