summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/wasm/jsapi/table/constructor-types.tentative.any.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/wasm/jsapi/table/constructor-types.tentative.any.js')
-rw-r--r--testing/web-platform/tests/wasm/jsapi/table/constructor-types.tentative.any.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/web-platform/tests/wasm/jsapi/table/constructor-types.tentative.any.js b/testing/web-platform/tests/wasm/jsapi/table/constructor-types.tentative.any.js
new file mode 100644
index 0000000000..b4015bdc6f
--- /dev/null
+++ b/testing/web-platform/tests/wasm/jsapi/table/constructor-types.tentative.any.js
@@ -0,0 +1,20 @@
+// META: global=window,dedicatedworker,jsshell,shadowrealm
+// META: script=/wasm/jsapi/assertions.js
+// META: script=/wasm/jsapi/table/assertions.js
+
+test(() => {
+ const argument = { "element": "anyfunc", "initial": 0, "minimum": 0 };
+ assert_throws_js(TypeError, () => new WebAssembly.Table(argument));
+}, "Initializing with both initial and minimum");
+
+test(() => {
+ const argument = { "element": "anyfunc", "minimum": 0 };
+ const table = new WebAssembly.Table(argument);
+ assert_Table(table, { "length": 0 });
+}, "Zero minimum");
+
+test(() => {
+ const argument = { "element": "anyfunc", "minimum": 5 };
+ const table = new WebAssembly.Table(argument);
+ assert_Table(table, { "length": 5 });
+}, "Non-zero minimum");