• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// META: global=window,dedicatedworker,jsshell
2// META: script=/wasm/jsapi/wasm-module-builder.js
3
4test(() => {
5  const emptyModuleBinary = new WasmModuleBuilder().toBuffer();
6  const module = new WebAssembly.Module(emptyModuleBinary);
7  const instance = new WebAssembly.Instance(module);
8  assert_class_string(instance, "WebAssembly.Instance");
9}, "Object.prototype.toString on an Instance");
10
11test(() => {
12  assert_own_property(WebAssembly.Instance.prototype, Symbol.toStringTag);
13
14  const propDesc = Object.getOwnPropertyDescriptor(WebAssembly.Instance.prototype, Symbol.toStringTag);
15  assert_equals(propDesc.value, "WebAssembly.Instance", "value");
16  assert_equals(propDesc.configurable, true, "configurable");
17  assert_equals(propDesc.enumerable, false, "enumerable");
18  assert_equals(propDesc.writable, false, "writable");
19}, "@@toStringTag exists on the prototype with the appropriate descriptor");
20