text: /* Lovingly generated by gen-spec-js.py based on the wonderful content of *
   * https://github.com/WebAssembly/spec/blob/master/interpreter/host/js.ml */
  'use strict';
  
  let soft_validate = true;
  
  let spectest = {
    print: print || ((...xs) => console.log(...xs)),
    global: 666,
    table: new WebAssembly.Table({initial: 10, maximum: 20, element: 'anyfunc'}),
    memory: new WebAssembly.Memory({initial: 1, maximum: 2}),};
  
  let registry = {spectest};
  let $$;
  
  function register(name, instance) {
    registry[name] = instance.exports;
  }
  
  function module(bytes) {
    let buffer = new ArrayBuffer(bytes.length);
    let view = new Uint8Array(buffer);
    for (let i = 0; i < bytes.length; ++i) {
      view[i] = bytes.charCodeAt(i);
    }
    return new WebAssembly.Module(buffer);
  }
  
  function instance(bytes, imports = registry) {
    return new WebAssembly.Instance(module(bytes), imports);
  }
  
  function assert_malformed(bytes) {
    try { module(bytes) } catch (e) {
      if (e instanceof WebAssembly.CompileError) return;
    }
    throw new Error("Wasm decoding failure expected");
  }
  
  function assert_invalid(bytes) {
    try { module(bytes) } catch (e) {
      if (e instanceof WebAssembly.CompileError) return;
    }
    throw new Error("Wasm validation failure expected");
  }
  
  function assert_soft_invalid(bytes) {
    try { module(bytes) } catch (e) {
      if (e instanceof WebAssembly.CompileError) return;
      throw new Error("Wasm validation failure expected");
    }
    if (soft_validate)
      throw new Error("Wasm validation failure expected");
  }
  
  function assert_unlinkable(bytes) {
    let mod = module(bytes);
    try { new WebAssembly.Instance(mod, registry) } catch (e) {
      if (e instanceof TypeError) return;
    }
    throw new Error("Wasm linking failure expected");
  }
  
  function assert_uninstantiable(bytes) {
    let mod = module(bytes);
    try { new WebAssembly.Instance(mod, registry) } catch (e) {
      if (e instanceof WebAssembly.RuntimeError) return;
    }
    throw new Error("Wasm trap expected");
  }
  
  function assert_trap(action) {
    try { action() } catch (e) {
      if (e instanceof WebAssembly.RuntimeError) return;
    }
    throw new Error("Wasm trap expected");
  }
  
  function assert_return(action, expected) {
    let actual = action();
    if (!Object.is(actual, expected)) {
      throw new Error("Wasm return value " + expected + " expected, got " + actual);
    };
  }
  
  function assert_return_nan(action) {
    let actual = action();
    if (!Number.isNaN(actual)) {
      throw new Error("Wasm return value NaN expected, got " + actual);
    };
  }
  
  let f32 = Math.fround;
  
  $$ = instance("\x00\x61\x73\x6d\x0d\x00\x00\x00\x01\x26\x08\x60\x00\x00\x60\x03\x7f\x7f\x7f\x00\x60\x00\x01\x7f\x60\x00\x01\x7c\x60\x00\x01\x7e\x60\x02\x7f\x7f\x01\x7f\x60\x03\x7f\x7f\x7f\x00\x60\x00\x01\x7d\x03\x38\x37\x00\x01\x02\x02\x03\x03\x02\x02\x00\x02\x02\x02\x00\x02\x02\x02\x02\x00\x02\x02\x00\x02\x02\x00\x02\x02\x04\x02\x05\x05\x05\x05\x02\x00\x00\x00\x00\x00\x00\x00\x00\x07\x04\x00\x00\x00\x00\x07\x02\x04\x02\x02\x02\x02\x02\x04\x05\x01\x70\x01\x01\x01\x05\x03\x01\x00\x01\x07\x98\x07\x35\x08\x74\x79\x70\x65\x2d\x69\x33\x32\x00\x02\x08\x74\x79\x70\x65\x2d\x69\x36\x34\x00\x03\x08\x74\x79\x70\x65\x2d\x66\x33\x32\x00\x04\x08\x74\x79\x70\x65\x2d\x66\x36\x34\x00\x05\x0d\x61\x73\x2d\x66\x75\x6e\x63\x2d\x66\x69\x72\x73\x74\x00\x06\x0b\x61\x73\x2d\x66\x75\x6e\x63\x2d\x6d\x69\x64\x00\x07\x0c\x61\x73\x2d\x66\x75\x6e\x63\x2d\x6c\x61\x73\x74\x00\x08\x0d\x61\x73\x2d\x66\x75\x6e\x63\x2d\x76\x61\x6c\x75\x65\x00\x09\x0e\x61\x73\x2d\x62\x6c\x6f\x63\x6b\x2d\x66\x69\x72\x73\x74\x00\x0a\x0c\x61\x73\x2d\x62\x6c\x6f\x63\x6b\x2d\x6d\x69\x64\x00\x0b\x0d\x61\x73\x2d\x62\x6c\x6f\x63\x6b\x2d\x6c\x61\x73\x74\x00\x0c\x0e\x61\x73\x2d\x62\x6c\x6f\x63\x6b\x2d\x76\x61\x6c\x75\x65\x00\x0d\x0e\x61\x73\x2d\x62\x6c\x6f\x63\x6b\x2d\x62\x72\x6f\x6b\x65\x00\x0e\x0d\x61\x73\x2d\x6c\x6f\x6f\x70\x2d\x66\x69\x72\x73\x74\x00\x0f\x0b\x61\x73\x2d\x6c\x6f\x6f\x70\x2d\x6d\x69\x64\x00\x10\x0c\x61\x73\x2d\x6c\x6f\x6f\x70\x2d\x6c\x61\x73\x74\x00\x11\x0d\x61\x73\x2d\x6c\x6f\x6f\x70\x2d\x62\x72\x6f\x6b\x65\x00\x12\x0b\x61\x73\x2d\x62\x72\x2d\x76\x61\x6c\x75\x65\x00\x13\x0d\x61\x73\x2d\x62\x72\x5f\x69\x66\x2d\x63\x6f\x6e\x64\x00\x14\x0e\x61\x73\x2d\x62\x72\x5f\x69\x66\x2d\x76\x61\x6c\x75\x65\x00\x15\x13\x61\x73\x2d\x62\x72\x5f\x69\x66\x2d\x76\x61\x6c\x75\x65\x2d\x63\x6f\x6e\x64\x00\x16\x11\x61\x73\x2d\x62\x72\x5f\x74\x61\x62\x6c\x65\x2d\x69\x6e\x64\x65\x78\x00\x17\x11\x61\x73\x2d\x62\x72\x5f\x74\x61\x62\x6c\x65\x2d\x76\x61\x6c\x75\x65\x00\x18\x17\x61\x73\x2d\x62\x72\x5f\x74\x61\x62\x6c\x65\x2d\x76\x61\x6c\x75\x65\x2d\x69\x6e\x64\x65\x78\x00\x19\x0f\x61\x73\x2d\x72\x65\x74\x75\x72\x6e\x2d\x76\x61\x6c\x75\x65\x00\x1a\x0a\x61\x73\x2d\x69\x66\x2d\x63\x6f\x6e\x64\x00\x1b\x0a\x61\x73\x2d\x69\x66\x2d\x74\x68\x65\x6e\x00\x1c\x0a\x61\x73\x2d\x69\x66\x2d\x65\x6c\x73\x65\x00\x1d\x0f\x61\x73\x2d\x73\x65\x6c\x65\x63\x74\x2d\x66\x69\x72\x73\x74\x00\x1e\x10\x61\x73\x2d\x73\x65\x6c\x65\x63\x74\x2d\x73\x65\x63\x6f\x6e\x64\x00\x1f\x0e\x61\x73\x2d\x73\x65\x6c\x65\x63\x74\x2d\x63\x6f\x6e\x64\x00\x20\x0d\x61\x73\x2d\x63\x61\x6c\x6c\x2d\x66\x69\x72\x73\x74\x00\x21\x0b\x61\x73\x2d\x63\x61\x6c\x6c\x2d\x6d\x69\x64\x00\x22\x0c\x61\x73\x2d\x63\x61\x6c\x6c\x2d\x6c\x61\x73\x74\x00\x23\x15\x61\x73\x2d\x63\x61\x6c\x6c\x5f\x69\x6e\x64\x69\x72\x65\x63\x74\x2d\x66\x75\x6e\x63\x00\x24\x16\x61\x73\x2d\x63\x61\x6c\x6c\x5f\x69\x6e\x64\x69\x72\x65\x63\x74\x2d\x66\x69\x72\x73\x74\x00\x25\x14\x61\x73\x2d\x63\x61\x6c\x6c\x5f\x69\x6e\x64\x69\x72\x65\x63\x74\x2d\x6d\x69\x64\x00\x26\x15\x61\x73\x2d\x63\x61\x6c\x6c\x5f\x69\x6e\x64\x69\x72\x65\x63\x74\x2d\x6c\x61\x73\x74\x00\x27\x12\x61\x73\x2d\x73\x65\x74\x5f\x6c\x6f\x63\x61\x6c\x2d\x76\x61\x6c\x75\x65\x00\x28\x0f\x61\x73\x2d\x6c\x6f\x61\x64\x2d\x61\x64\x64\x72\x65\x73\x73\x00\x29\x10\x61\x73\x2d\x6c\x6f\x61\x64\x4e\x2d\x61\x64\x64\x72\x65\x73\x73\x00\x2a\x10\x61\x73\x2d\x73\x74\x6f\x72\x65\x2d\x61\x64\x64\x72\x65\x73\x73\x00\x2b\x0e\x61\x73\x2d\x73\x74\x6f\x72\x65\x2d\x76\x61\x6c\x75\x65\x00\x2c\x11\x61\x73\x2d\x73\x74\x6f\x72\x65\x4e\x2d\x61\x64\x64\x72\x65\x73\x73\x00\x2d\x0f\x61\x73\x2d\x73\x74\x6f\x72\x65\x4e\x2d\x76\x61\x6c\x75\x65\x00\x2e\x10\x61\x73\x2d\x75\x6e\x61\x72\x79\x2d\x6f\x70\x65\x72\x61\x6e\x64\x00\x2f\x0e\x61\x73\x2d\x62\x69\x6e\x61\x72\x79\x2d\x6c\x65\x66\x74\x00\x30\x0f\x61\x73\x2d\x62\x69\x6e\x61\x72\x79\x2d\x72\x69\x67\x68\x74\x00\x31\x0f\x61\x73\x2d\x74\x65\x73\x74\x2d\x6f\x70\x65\x72\x61\x6e\x64\x00\x32\x0f\x61\x73\x2d\x63\x6f\x6d\x70\x61\x72\x65\x2d\x6c\x65\x66\x74\x00\x33\x10\x61\x73\x2d\x63\x6f\x6d\x70\x61\x72\x65\x2d\x72\x69\x67\x68\x74\x00\x34\x12\x61\x73\x2d\x63\x6f\x6e\x76\x65\x72\x74\x2d\x6f\x70\x65\x72\x61\x6e\x64\x00\x35\x13\x61\x73\x2d\x67\x72\x6f\x77\x5f\x6d\x65\x6d\x6f\x72\x79\x2d\x73\x69\x7a\x65\x00\x36\x09\x07\x01\x00\x41\x00\x0b\x01\x01\x0a\xff\x03\x37\x02\x00\x0b\x02\x00\x0b\x03\x00\x00\x0b\x03\x00\x00\x0b\x03\x00\x00\x0b\x03\x00\x00\x0b\x05\x00\x00\x41\x7f\x0b\x07\x00\x10\x00\x00\x41\x7f\x0b\x05\x00\x10\x00\x00\x0b\x05\x00\x10\x00\x00\x0b\x08\x00\x02\x7f\x00\x41\x02\x0b\x0b\x0a\x00\x02\x7f\x10\x00\x00\x41\x02\x0b\x0b\x09\x00\x02\x40\x01\x10\x00\x00\x0b\x0b\x09\x00\x02\x7f\x01\x10\x00\x00\x0b\x0b\x0c\x00\x02\x7f\x10\x00\x41\x01\x0c\x00\x00\x0b\x0b\x08\x00\x03\x7f\x00\x41\x02\x0b\x0b\x0a\x00\x03\x7f\x10\x00\x00\x41\x02\x0b\x0b\x09\x00\x03\x40\x01\x10\x00\x00\x0b\x0b\x0f\x00\x02\x7f\x03\x7f\x10\x00\x41\x01\x0c\x01\x00\x0b\x0b\x0b\x08\x00\x02\x7f\x00\x0c\x00\x0b\x0b\x08\x00\x02\x40\x00\x0d\x00\x0b\x0b\x0d\x00\x02\x7f\x00\x41\x01\x0d\x00\x1a\x41\x07\x0b\x0b\x0d\x00\x02\x7f\x41\x06\x00\x0d\x00\x1a\x41\x07\x0b\x0b\x0b\x00\x02\x40\x00\x0e\x02\x00\x00\x00\x0b\x0b\x0f\x00\x02\x7f\x00\x41\x01\x0e\x02\x00\x00\x00\x41\x07\x0b\x0b\x0e\x00\x02\x7f\x41\x06\x00\x0e\x01\x00\x00\x41\x07\x0b\x0b\x04\x00\x00\x0f\x0b\x0b\x00\x00\x04\x7f\x41\x00\x05\x41\x01\x0b\x0b\x0b\x00\x20\x00\x04\x7f\x00\x05\x20\x01\x0b\x0b\x0b\x00\x20\x00\x04\x7f\x20\x01\x05\x00\x0b\x0b\x08\x00\x00\x20\x00\x20\x01\x1b\x0b\x08\x00\x20\x00\x00\x20\x01\x1b\x0b\x08\x00\x41\x00\x41\x01\x00\x1b\x0b\x09\x00\x00\x41\x02\x41\x03\x10\x01\x0b\x09\x00\x41\x01\x00\x41\x03\x10\x01\x0b\x09\x00\x41\x01\x41\x02\x00\x10\x01\x0b\x0c\x00\x00\x41\x01\x41\x02\x41\x03\x11\x06\x00\x0b\x0c\x00\x41\x00\x00\x41\x02\x41\x03\x11\x06\x00\x0b\x0c\x00\x41\x00\x41\x01\x00\x41\x03\x11\x06\x00\x0b\x0c\x00\x41\x00\x41\x01\x41\x02\x00\x11\x06\x00\x0b\x07\x01\x01\x7d\x00\x21\x00\x0b\x06\x00\x00\x2a\x02\x00\x0b\x06\x00\x00\x30\x00\x00\x0b\x0f\x00\x00\x44\x00\x00\x00\x00\x00\x00\x1c\x40\x39\x03\x00\x0b\x08\x00\x41\x02\x00\x37\x03\x00\x0b\x08\x00\x00\x41\x07\x3a\x00\x00\x0b\x08\x00\x41\x02\x00\x3d\x01\x00\x0b\x04\x00\x00\x8c\x0b\x06\x00\x00\x41\x0a\x6a\x0b\x06\x00\x42\x0a\x00\x7d\x0b\x04\x00\x00\x45\x0b\x0d\x00\x00\x44\x00\x00\x00\x00\x00\x00\x24\x40\x65\x0b\x09\x00\x43\x00\x00\x20\x41\x00\x5c\x0b\x04\x00\x00\xa7\x0b\x05\x00\x00\x40\x00\x0b");
  assert_trap(() => $$.exports["type-i32"]());
  assert_trap(() => $$.exports["type-i64"]());
  assert_trap(() => $$.exports["type-f32"]());
  assert_trap(() => $$.exports["type-f64"]());
  assert_trap(() => $$.exports["as-func-first"]());
  assert_trap(() => $$.exports["as-func-mid"]());
  assert_trap(() => $$.exports["as-func-last"]());
  assert_trap(() => $$.exports["as-func-value"]());
  assert_trap(() => $$.exports["as-block-first"]());
  assert_trap(() => $$.exports["as-block-mid"]());
  assert_trap(() => $$.exports["as-block-last"]());
  assert_trap(() => $$.exports["as-block-value"]());
  assert_return(() => $$.exports["as-block-broke"](), 1);
  assert_trap(() => $$.exports["as-loop-first"]());
  assert_trap(() => $$.exports["as-loop-mid"]());
  assert_trap(() => $$.exports["as-loop-last"]());
  assert_return(() => $$.exports["as-loop-broke"](), 1);
  assert_trap(() => $$.exports["as-br-value"]());
  assert_trap(() => $$.exports["as-br_if-cond"]());
  assert_trap(() => $$.exports["as-br_if-value"]());
  assert_trap(() => $$.exports["as-br_if-value-cond"]());
  assert_trap(() => $$.exports["as-br_table-index"]());
  assert_trap(() => $$.exports["as-br_table-value"]());
  assert_trap(() => $$.exports["as-br_table-value-index"]());
  assert_trap(() => $$.exports["as-return-value"]());
  assert_trap(() => $$.exports["as-if-cond"]());
  assert_trap(() => $$.exports["as-if-then"](1, 6));
  assert_return(() => $$.exports["as-if-then"](0, 6), 6);
  assert_trap(() => $$.exports["as-if-else"](0, 6));
  assert_return(() => $$.exports["as-if-else"](1, 6), 6);
  assert_trap(() => $$.exports["as-select-first"](0, 6));
  assert_trap(() => $$.exports["as-select-first"](1, 6));
  assert_trap(() => $$.exports["as-select-second"](0, 6));
  assert_trap(() => $$.exports["as-select-second"](1, 6));
  assert_trap(() => $$.exports["as-select-cond"]());
  assert_trap(() => $$.exports["as-call-first"]());
  assert_trap(() => $$.exports["as-call-mid"]());
  assert_trap(() => $$.exports["as-call-last"]());
  assert_trap(() => $$.exports["as-call_indirect-func"]());
  assert_trap(() => $$.exports["as-call_indirect-first"]());
  assert_trap(() => $$.exports["as-call_indirect-mid"]());
  assert_trap(() => $$.exports["as-call_indirect-last"]());
  assert_trap(() => $$.exports["as-set_local-value"]());
  assert_trap(() => $$.exports["as-load-address"]());
  assert_trap(() => $$.exports["as-loadN-address"]());
  assert_trap(() => $$.exports["as-store-address"]());
  assert_trap(() => $$.exports["as-store-value"]());
  assert_trap(() => $$.exports["as-storeN-address"]());
  assert_trap(() => $$.exports["as-storeN-value"]());
  assert_trap(() => $$.exports["as-unary-operand"]());
  assert_trap(() => $$.exports["as-binary-left"]());
  assert_trap(() => $$.exports["as-binary-right"]());
  assert_trap(() => $$.exports["as-test-operand"]());
  assert_trap(() => $$.exports["as-compare-left"]());
  assert_trap(() => $$.exports["as-compare-right"]());
  assert_trap(() => $$.exports["as-convert-operand"]());
  assert_trap(() => $$.exports["as-grow_memory-size"]());
  