Created
June 17, 2020 06:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
/*Compiled using Cheerp (R) by Leaning Technologies Ltd*/ | |
var __imul=Math.imul; | |
var __fround=Math.fround; | |
var oSlot=0;var nullArray=[null];var nullObj={d:nullArray,o:0}; | |
function fetchBuffer(p){ | |
var b=null,f='function'; | |
if(typeof fetch===f)b=fetch(p).then(r=>r.arrayBuffer()); | |
else if(typeof require===f){ | |
p=require('path').join(__dirname, p); | |
b=new Promise((y,n)=>{ | |
require('fs').readFile(p,(e,d)=>{ | |
if(e)n(e); | |
else y(d); | |
}); | |
}); | |
}else b=new Promise((y,n)=>{ | |
y(read(p,'binary')); | |
}); | |
return b; | |
} | |
function assignHeaps(Z){ | |
HEAP8=new Uint8Array(Z); | |
HEAP16=new Uint16Array(Z); | |
HEAP32=new Int32Array(Z); | |
HEAPF32=new Float32Array(Z); | |
HEAPF64=new Float64Array(Z); | |
} | |
var HEAP8=null,HEAP16=null,HEAP32=null,HEAPF32=null,HEAPF64=null,__asm=null,__heap=null;function __dummy(){throw new Error('this should be unreachable');}; | |
fetchBuffer('main.wasm').then(Z=> | |
WebAssembly.instantiate(Z, | |
{i:{ | |
}}) | |
,console.log).then(Z=>{ | |
__asm=Z.instance.exports; | |
__heap=__asm.memory.buffer; | |
assignHeaps(__heap); | |
Promise.resolve(); | |
__asm.__Z7webMainv(); | |
},console.log,console.log); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't delete this, you moron.
https://stackoverflow.com/questions/62414709/how-do-i-load-a-cheerp-wasm-program-in-absence-of-a-path-module