wasm.js 497 B

12345678910111213141516
  1. (function (){
  2. let bytes = new Uint8Array([
  3. 0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00,
  4. 0x01, 0x07, 0x01, 0x60, 0x02, 0x7f, 0x7f, 0x01,
  5. 0x7f, 0x03, 0x02, 0x01, 0x00, 0x07, 0x07, 0x01,
  6. 0x03, 0x73, 0x75, 0x6d, 0x00, 0x00, 0x0a, 0x0a,
  7. 0x01, 0x08, 0x00, 0x20, 0x00, 0x20, 0x01, 0x6a,
  8. 0x0f, 0x0b
  9. ]);
  10. console.log(bytes);
  11. let mod = new WebAssembly.Module(bytes);
  12. let instance = new WebAssembly.Instance(mod, {});
  13. console.log(instance.exports);
  14. return instance.exports.sum(2020, 1);
  15. }());