Index: test/mjsunit/wasm/instantiate-module-basic.js |
diff --git a/test/mjsunit/wasm/instantiate-module-basic.js b/test/mjsunit/wasm/instantiate-module-basic.js |
index dd5871f13f62bf3640781e5c4075efbd403d14c5..36f7429d96713a179d3c9ec5636133c36d881bc0 100644 |
--- a/test/mjsunit/wasm/instantiate-module-basic.js |
+++ b/test/mjsunit/wasm/instantiate-module-basic.js |
@@ -141,10 +141,10 @@ assertFalse(WebAssembly.validate(bytes(88, 88, 88, 88, 88, 88, 88, 88))); |
var module = new WebAssembly.Module(builder.toBuffer()); |
- var mem_1 = new ArrayBuffer(4); |
- var mem_2 = new ArrayBuffer(4); |
- var view_1 = new Int32Array(mem_1); |
- var view_2 = new Int32Array(mem_2); |
+ var mem_1 = new WebAssembly.Memory({initial: 1}); |
+ var mem_2 = new WebAssembly.Memory({initial: 1}); |
+ var view_1 = new Int32Array(mem_1.buffer); |
+ var view_2 = new Int32Array(mem_2.buffer); |
view_1[0] = 42; |
view_2[0] = 1000; |
@@ -199,10 +199,10 @@ assertFalse(WebAssembly.validate(bytes(88, 88, 88, 88, 88, 88, 88, 88))); |
kExprI32LoadMem, 0, 0 |
]).exportFunc(); |
- var mem_1 = new ArrayBuffer(65536); |
- var mem_2 = new ArrayBuffer(65536); |
- var view_1 = new Int32Array(mem_1); |
- var view_2 = new Int32Array(mem_2); |
+ var mem_1 = new WebAssembly.Memory({initial: 1}); |
+ var mem_2 = new WebAssembly.Memory({initial: 1}); |
+ var view_1 = new Int32Array(mem_1.buffer); |
+ var view_2 = new Int32Array(mem_2.buffer); |
view_1[0] = 1; |
view_2[0] = 1000; |
@@ -213,3 +213,9 @@ assertFalse(WebAssembly.validate(bytes(88, 88, 88, 88, 88, 88, 88, 88))); |
assertEquals(1, i1.exports.f()); |
assertEquals(1000, i2.exports.f()); |
})(); |
+ |
+(function MustBeMemory() { |
+ var memory = new ArrayBuffer(65536); |
+ var module = new WebAssembly.Module(buffer); |
+ assertThrows(() => new WebAssembly.Instance(module, null, memory), TypeError); |
+})(); |