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

Unified Diff: test/mjsunit/wasm/start-function.js

Issue 2458983002: [wasm] Start function must not have a return value. (Closed)
Patch Set: Created 4 years, 2 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 | « src/wasm/module-decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/start-function.js
diff --git a/test/mjsunit/wasm/start-function.js b/test/mjsunit/wasm/start-function.js
index e98c044dd2f2c9eb906f0d99921cc94eb1f3b90f..58ff79e1608f7939dececb5d794a909d36aa8301 100644
--- a/test/mjsunit/wasm/start-function.js
+++ b/test/mjsunit/wasm/start-function.js
@@ -18,16 +18,6 @@ function instantiate(sig, body) {
return builder.instantiate();
}
-function assertFails(sig, body) {
- try {
- var module = instantiate(sig, body);
- print("expected failure, but passes");
- assertFalse(true);
- } catch (expected) {
- print("ok: " + expected);
- }
-}
-
function assertVerifies(sig, body) {
var module = instantiate(sig, body);
assertFalse(module === undefined);
@@ -38,12 +28,12 @@ function assertVerifies(sig, body) {
}
assertVerifies(kSig_v_v, [kExprNop]);
-assertVerifies(kSig_i_v, [kExprI8Const, 0]);
// Arguments aren't allow to start functions.
-assertFails(kSig_i_i, [kExprGetLocal, 0]);
-assertFails(kSig_i_ii, [kExprGetLocal, 0]);
-assertFails(kSig_i_dd, [kExprGetLocal, 0]);
+assertThrows(() => {instantiate(kSig_i_i, [kExprGetLocal, 0]);});
+assertThrows(() => {instantiate(kSig_i_ii, [kExprGetLocal, 0]);});
+assertThrows(() => {instantiate(kSig_i_dd, [kExprGetLocal, 0]);});
+assertThrows(() => {instantiate(kSig_i_v, [kExprI8Const, 0]);});
(function testInvalidIndex() {
print("testInvalidIndex");
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698