Skip to content

Commit

Permalink
Use BigInt parameter in 16gb-wasm-memory tests
Browse files Browse the repository at this point in the history
The JS API for Memory was updated in
WebAssembly/memory64#68 to require BigInt
parameters when the Memory type is i64.

Also see chromium-side failures (https://crbug.com/370792790).
  • Loading branch information
backes committed Oct 4, 2024
1 parent 0f39bef commit d362fae
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(() => {
let view;
try {
view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE / PAGE }).buffer);
view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: BigInt(SIZE / PAGE) }).buffer);
} catch (e) {
testPassed(`Allocating ${SIZE} threw: ${e}`);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(() => {
let view;
try {
view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE / PAGE }).buffer);
view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: BigInt(SIZE / PAGE) }).buffer);
} catch (e) {
testPassed(`Allocating ${SIZE} threw: ${e}`);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(() => {
let view;
try {
view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE / PAGE }).buffer);
view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: BigInt(SIZE / PAGE) }).buffer);
} catch (e) {
testPassed(`Allocating ${SIZE} threw: ${e}`);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
(() => {
let view;
try {
view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE / PAGE }).buffer);
view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: BigInt(SIZE / PAGE) }).buffer);
} catch (e) {
testPassed(`Allocating ${SIZE} threw: ${e}`);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(() => {
let view;
try {
view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE / PAGE }).buffer);
view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: BigInt(SIZE / PAGE) }).buffer);
} catch (e) {
testPassed(`Allocating ${SIZE} threw: ${e}`);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(() => {
let view;
try {
view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE / PAGE }).buffer);
view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: BigInt(SIZE / PAGE) }).buffer);
} catch (e) {
testPassed(`Allocating ${SIZE} threw: ${e}`);
return;
Expand Down

0 comments on commit d362fae

Please sign in to comment.