test/inspector/debugger/wasm-scripts.js
// Create module with given custom sections.
Create module with given custom sections.
Create module with given custom sections .
function createModule(...customSections) {
  var builder = new WasmModuleBuilder();
  builder.addFunction('nopFunction', kSig_v_v).addBody([kExprNop]);
  builder.addFunction('main', kSig_v_v)
      .addBody([kExprBlock, kWasmVoid, kExprI32Const, 2, kExprDrop, kExprEnd])
      .exportAs('main');
  for (var { name, value } of customSections) {
    builder.addCustomSection(name, value);
  }
  return builder.toArray();
}
function createModule ( ... customSections ) { var builder = new WasmModuleBuilder ( ) ; builder . addFunction ( 'nopFunction' , kSig_v_v ) . addBody ( [ kExprNop ] ) ; builder . addFunction ( 'main' , kSig_v_v ) . addBody ( [ kExprBlock , kWasmVoid , kExprI32Const , 2 , kExprDrop , kExprEnd ] ) . exportAs ( 'main' ) ; for ( var { name , value } of customSections ) { builder . addCustomSection ( name , value ) ; } return builder . toArray ( ) ; }
Create module with given custom sections.
Create module with given custom sections .