diff options
Diffstat (limited to 'testing/web-platform/tests/wasm/jsapi/module/toString.any.js')
-rw-r--r-- | testing/web-platform/tests/wasm/jsapi/module/toString.any.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/web-platform/tests/wasm/jsapi/module/toString.any.js b/testing/web-platform/tests/wasm/jsapi/module/toString.any.js new file mode 100644 index 0000000000..1c20cd6108 --- /dev/null +++ b/testing/web-platform/tests/wasm/jsapi/module/toString.any.js @@ -0,0 +1,18 @@ +// META: global=window,dedicatedworker,jsshell +// META: script=/wasm/jsapi/wasm-module-builder.js + +test(() => { + const emptyModuleBinary = new WasmModuleBuilder().toBuffer(); + const module = new WebAssembly.Module(emptyModuleBinary); + assert_class_string(module, "WebAssembly.Module"); +}, "Object.prototype.toString on an Module"); + +test(() => { + assert_own_property(WebAssembly.Module.prototype, Symbol.toStringTag); + + const propDesc = Object.getOwnPropertyDescriptor(WebAssembly.Module.prototype, Symbol.toStringTag); + assert_equals(propDesc.value, "WebAssembly.Module", "value"); + assert_equals(propDesc.configurable, true, "configurable"); + assert_equals(propDesc.enumerable, false, "enumerable"); + assert_equals(propDesc.writable, false, "writable"); +}, "@@toStringTag exists on the prototype with the appropriate descriptor"); |