-
Notifications
You must be signed in to change notification settings - Fork 523
Expand file tree
/
Copy pathlimits-memory64.any.js
More file actions
31 lines (27 loc) · 1.04 KB
/
limits-memory64.any.js
File metadata and controls
31 lines (27 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// META: global=window,dedicatedworker,jsshell
// META: script=/wasm/jsapi/table/assertions.js
// Same limit as table32
const kJSEmbeddingMaxTable64Size = 10000000n;
test(() => {
const table = new WebAssembly.Table(
{address: "i64",
element: "anyfunc",
initial: 1n, maximum: kJSEmbeddingMaxTable64Size + 1n});
assert_Table(table, { length: 1n }, "i64")
}, `Create WebAssembly.Table with maximum size at the runtime limit (i64)`);
test(() => {
assert_throws(
new RangeError(),
() => new WebAssembly.Table(
{address: "i64",
element: "anyfunc",
initial: kJSEmbeddingMaxTable64Size + 1n}));
}, `Create WebAssembly.Table with initial size over the runtime limit (i64)`);
test(() => {
let table = new WebAssembly.Table(
{address: "i64",
element: "anyfunc",
initial: 1n, maximum: kJSEmbeddingMaxTable64Size + 1n});
assert_throws(new RangeError(),
() => table.grow(kJSEmbeddingMaxTable64Size));
}, `Grow WebAssembly.Table object beyond the runtime limit (i64)`);