dwatch_bg.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import * as wasm from './dwatch_bg.wasm';
  2. const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
  3. let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
  4. cachedTextDecoder.decode();
  5. let cachegetUint8Memory0 = null;
  6. function getUint8Memory0() {
  7. if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
  8. cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
  9. }
  10. return cachegetUint8Memory0;
  11. }
  12. function getStringFromWasm0(ptr, len) {
  13. return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
  14. }
  15. /**
  16. * @returns {Handle}
  17. */
  18. export function init() {
  19. var ret = wasm.init();
  20. return Handle.__wrap(ret);
  21. }
  22. /**
  23. */
  24. export class Handle {
  25. static __wrap(ptr) {
  26. const obj = Object.create(Handle.prototype);
  27. obj.ptr = ptr;
  28. return obj;
  29. }
  30. free() {
  31. const ptr = this.ptr;
  32. this.ptr = 0;
  33. wasm.__wbg_handle_free(ptr);
  34. }
  35. }
  36. export const __wbg_alert_f5393de24ed74e50 = function(arg0, arg1) {
  37. alert(getStringFromWasm0(arg0, arg1));
  38. };
  39. export const __wbindgen_throw = function(arg0, arg1) {
  40. throw new Error(getStringFromWasm0(arg0, arg1));
  41. };