Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: test/mjsunit/wasm/js-api.js

Issue 2638243002: [wasm] WebAssembly.Memory.grow() should handle the no instance case (Closed)
Patch Set: Review Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/regress/wasm/regression-680938.js ('k') | test/mjsunit/wasm/memory.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/js-api.js
diff --git a/test/mjsunit/wasm/js-api.js b/test/mjsunit/wasm/js-api.js
index bea88a030affef9d79500fb9a5e015ed5d72dc19..0c68f9bed4bff0f8920d1f5387b88a2a228218aa 100644
--- a/test/mjsunit/wasm/js-api.js
+++ b/test/mjsunit/wasm/js-api.js
@@ -373,29 +373,32 @@ assertEq(memGrowDesc.configurable, true);
// 'WebAssembly.Memory.prototype.grow' method
-if (false) { // TODO: bugs with Memory.grow
let memGrow = memGrowDesc.value;
assertEq(memGrow.length, 1);
-assertErrorMessage(() => memGrow.call(), TypeError, /called on incompatible undefined/);
-assertErrorMessage(() => memGrow.call({}), TypeError, /called on incompatible Object/);
-assertErrorMessage(() => memGrow.call(mem1, -1), RangeError, /bad Memory grow delta/);
-assertErrorMessage(() => memGrow.call(mem1, Math.pow(2,32)), RangeError, /bad Memory grow delta/);
+assertErrorMessage(() => memGrow.call(), TypeError,
+ /called on incompatible undefined/);
+assertErrorMessage(() => memGrow.call({}), TypeError,
+ /called on incompatible Object/);
+assertErrorMessage(() => memGrow.call(mem1, -1), RangeError,
+ /bad Memory grow delta/);
+assertErrorMessage(() => memGrow.call(mem1, Math.pow(2,32)), RangeError,
+ /bad Memory grow delta/);
var mem = new Memory({initial:1, maximum:2});
var buf = mem.buffer;
assertEq(buf.byteLength, kPageSize);
assertEq(mem.grow(0), 1);
-assertEq(buf !== mem.buffer, true);
-assertEq(buf.byteLength, 0);
+// TODO(gdeepti): Pending spec clarification
+// assertEq(buf !== mem.buffer, true);
+// assertEq(buf.byteLength, 0);
buf = mem.buffer;
assertEq(buf.byteLength, kPageSize);
assertEq(mem.grow(1), 1);
-assertEq(buf !== mem.buffer, true);
-assertEq(buf.byteLength, 0);
+// TODO(gdeepti): assertEq(buf !== mem.buffer, true);
+// TODO(gdeepti): assertEq(buf.byteLength, 0);
buf = mem.buffer;
assertEq(buf.byteLength, 2 * kPageSize);
assertErrorMessage(() => mem.grow(1), Error, /failed to grow memory/);
assertEq(buf, mem.buffer);
-}
// 'WebAssembly.Table' data property
let tableDesc = Object.getOwnPropertyDescriptor(WebAssembly, 'Table');
« no previous file with comments | « test/mjsunit/regress/wasm/regression-680938.js ('k') | test/mjsunit/wasm/memory.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698