Sha256: 5870c3811c8c17bab0b0e14c5ed62af987b8fa52382572a27cf704cded30f061

Contents?: true

Size: 1.06 KB

Versions: 11

Compression:

Stored size: 1.06 KB

Contents

const { TextEncoder } = require("util");

const data =
  "\u0000asm\u0001\u0000\u0000\u0000\u0001\b\u0002`\u0001\u007f\u0000`\u0000" +
  "\u0000\u0002\u0019\u0001\u0007imports\rimported_func\u0000\u0000\u0003" +
  "\u0002\u0001\u0001\u0007\u0011\u0001\rexported_func\u0000\u0001\n\b\u0001" +
  "\u0006\u0000A*\u0010\u0000\u000b";

const encoder = new TextEncoder();
const wasmArray = encoder.encode(data);

function getWasmArray() {
  return wasmArray;
}

function getTableObject() {
  return { element: "anyfunc", initial: 1 }
}

function getInvalidTableObject() {
  return { element: "anyfunc", initial: 1, maximum: 0 }
}

function getImports() {
  return {
    imports: {
      imported_func: function () {
        return 1;
      }
    }
  };
}

// Polyfill `WebAssembly.instantiateStreaming` for node.
if (!global.WebAssembly.instantiateStreaming) {
  global.WebAssembly.instantiateStreaming =
    (response, imports) => response.then(buf => WebAssembly.instantiate(buf, imports));
}

module.exports = {
  getInvalidTableObject,
  getTableObject,
  getWasmArray,
  getImports,
};

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
wasmtime-23.0.2 ./ext/cargo-vendor/js-sys-0.3.66/tests/wasm/WebAssembly.js
wasmtime-22.0.0 ./ext/cargo-vendor/js-sys-0.3.66/tests/wasm/WebAssembly.js
wasmtime-21.0.1 ./ext/cargo-vendor/js-sys-0.3.66/tests/wasm/WebAssembly.js
wasmtime-20.0.2 ./ext/cargo-vendor/js-sys-0.3.66/tests/wasm/WebAssembly.js
wasmtime-20.0.0 ./ext/cargo-vendor/js-sys-0.3.66/tests/wasm/WebAssembly.js
wasmtime-18.0.3 ./ext/cargo-vendor/js-sys-0.3.66/tests/wasm/WebAssembly.js
wasmtime-17.0.1 ./ext/cargo-vendor/js-sys-0.3.66/tests/wasm/WebAssembly.js
wasmtime-17.0.0 ./ext/cargo-vendor/js-sys-0.3.66/tests/wasm/WebAssembly.js
wasmtime-16.0.0 ./ext/cargo-vendor/js-sys-0.3.66/tests/wasm/WebAssembly.js
wasmtime-15.0.1 ./ext/cargo-vendor/js-sys-0.3.66/tests/wasm/WebAssembly.js
wasmtime-15.0.0 ./ext/cargo-vendor/js-sys-0.3.66/tests/wasm/WebAssembly.js