How to use the @webassemblyjs/helper-wasm-bytecode.exportTypesByName function in @webassemblyjs/helper-wasm-bytecode

To help you get started, we’ve selected a few @webassemblyjs/helper-wasm-bytecode 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 zc910704 / Vue.js-personal-note / www / day6.1.webpack的url-loader与babel / node_modules / @webassemblyjs / wasm-gen / esm / encoder / index.js View on Github external
export function encodeModuleExport(n) {
  var out = [];
  assertNotIdentifierNode(n.descr.id);
  var exportTypeByteString = constants.exportTypesByName[n.descr.exportType];

  if (typeof exportTypeByteString === "undefined") {
    throw new Error("Unknown export of type: " + n.descr.exportType);
  }

  var exportTypeByte = parseInt(exportTypeByteString, 10);
  out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.name)));
  out.push(exportTypeByte); // $FlowIgnore

  out.push.apply(out, _toConsumableArray(encodeU32(n.descr.id.value)));
  return out;
}
export function encodeTypeInstruction(n) {
github xtuc / webassemblyjs / packages / wasm-gen / src / encoder / index.js View on Github external
export function encodeModuleExport(n: ModuleExport): Array {
  const out = [];

  assertNotIdentifierNode(n.descr.id);

  const exportTypeByteString = constants.exportTypesByName[n.descr.exportType];

  if (typeof exportTypeByteString === "undefined") {
    throw new Error("Unknown export of type: " + n.descr.exportType);
  }

  const exportTypeByte = parseInt(exportTypeByteString, 10);

  out.push(...encodeUTF8Vec(n.name));
  out.push(exportTypeByte);

  // $FlowIgnore
  out.push(...encodeU32(n.descr.id.value));

  return out;
}
github flaviuse / mern-authentication / client / node_modules / @webassemblyjs / wasm-gen / esm / encoder / index.js View on Github external
export function encodeModuleExport(n) {
  var out = [];
  assertNotIdentifierNode(n.descr.id);
  var exportTypeByteString = constants.exportTypesByName[n.descr.exportType];

  if (typeof exportTypeByteString === "undefined") {
    throw new Error("Unknown export of type: " + n.descr.exportType);
  }

  var exportTypeByte = parseInt(exportTypeByteString, 10);
  out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.name)));
  out.push(exportTypeByte); // $FlowIgnore

  out.push.apply(out, _toConsumableArray(encodeU32(n.descr.id.value)));
  return out;
}
export function encodeTypeInstruction(n) {