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

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

Issue 2339053003: [V8][Wasm] Wasm throws. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addresses comments. Created 4 years, 3 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/wasm/exceptions.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/wasm-constants.js
diff --git a/test/mjsunit/wasm/wasm-constants.js b/test/mjsunit/wasm/wasm-constants.js
index 3a9ac5042e2e6566bfd39ef0f5d54e3e3258c467..5bcdb64a95b8295a98f4aa4adb4a0fcefdcd05e7 100644
--- a/test/mjsunit/wasm/wasm-constants.js
+++ b/test/mjsunit/wasm/wasm-constants.js
@@ -106,6 +106,7 @@ var kSig_v_ii = makeSig([kAstI32, kAstI32], []);
var kSig_v_iii = makeSig([kAstI32, kAstI32, kAstI32], []);
var kSig_v_d = makeSig([kAstF64], []);
var kSig_v_dd = makeSig([kAstF64, kAstF64], []);
+var kSig_v_ddi = makeSig([kAstF64, kAstF64, kAstI32], []);
function makeSig(params, results) {
return {params: params, results: results};
@@ -143,6 +144,7 @@ var kExprBrIf = 0x07;
var kExprBrTable = 0x08;
var kExprReturn = 0x09;
var kExprUnreachable = 0x0a;
+var kExprThrow = 0xfa;
var kExprEnd = 0x0f;
var kExprI32Const = 0x10;
@@ -348,3 +350,20 @@ function assertTraps(trap, code) {
}
throw new MjsUnitAssertionError("Did not trap, expected: " + kTrapMsgs[trap]);
}
+
+function assertWasmThrows(value, code) {
+ assertEquals("number", typeof(value));
+ try {
+ if (typeof code === 'function') {
+ code();
+ } else {
+ eval(code);
+ }
+ } catch (e) {
+ assertEquals("number", typeof e);
+ assertEquals(value, e);
+ // Success.
+ return;
+ }
+ throw new MjsUnitAssertionError("Did not throw at all, expected: " + value);
+}
« no previous file with comments | « test/mjsunit/wasm/exceptions.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698