How to use the wasmparser/dist/WasmDis.NameSectionReader function in wasmparser

To help you get started, we’ve selected a few wasmparser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github firefox-devtools / debugger / src / utils / wasm.js View on Github external
function maybeWasmSectionNameResolver(data: Uint8Array) {
  try {
    const parser = new BinaryReader();
    parser.setData(data.buffer, 0, data.length);
    const reader = new NameSectionReader();
    reader.read(parser);
    return reader.hasValidNames() ? reader.getNameResolver() : null;
  } catch (ex) {
    // Ignoring any errors during names section retrival.
    return null;
  }
}

wasmparser

Binary WebAssembly file parser.

Apache-2.0
Latest version published 2 months ago

Package Health Score

76 / 100
Full package analysis

Similar packages