Skip to content

Instantly share code, notes, and snippets.

@Xunie
Created June 17, 2020 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Xunie/5325fcdf2e765f485bf5b6f18b92a949 to your computer and use it in GitHub Desktop.
Save Xunie/5325fcdf2e765f485bf5b6f18b92a949 to your computer and use it in GitHub Desktop.
"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);
@Xunie
Copy link
Author

Xunie commented Jun 23, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment