Commit 1e1ca028 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Slightly improve async tests

These tests are also used for streaming. This CL changes the test to
actually output the exception that unexpectedly happened.

R=ahaas@chromium.org

Bug: v8:7921
Change-Id: Ia9c91a7d3d9452f9c0180329a5434f049b56c3c8
Reviewed-on: https://chromium-review.googlesource.com/c/1319755
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57284}
parent ec8836fb
...@@ -7,17 +7,18 @@ ...@@ -7,17 +7,18 @@
load("test/mjsunit/wasm/wasm-constants.js"); load("test/mjsunit/wasm/wasm-constants.js");
load("test/mjsunit/wasm/wasm-module-builder.js"); load("test/mjsunit/wasm/wasm-module-builder.js");
function assertCompiles(buffer) { async function assertCompiles(buffer) {
return assertPromiseResult( var module = await WebAssembly.compile(buffer);
WebAssembly.compile(buffer), assertInstanceof(module, WebAssembly.Module);
module => assertTrue(module instanceof WebAssembly.Module),
ex => assertUnreachable());
} }
function assertCompileError(buffer) { async function assertCompileError(buffer) {
return assertPromiseResult( try {
WebAssembly.compile(buffer), module => assertUnreachable(), await WebAssembly.compile(buffer);
ex => assertTrue(ex instanceof WebAssembly.CompileError)); assertUnreachable();
} catch (e) {
if (!(e instanceof WebAssembly.CompileError)) throw e;
}
} }
assertPromiseResult(async function basicCompile() { assertPromiseResult(async function basicCompile() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment