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 @@
load("test/mjsunit/wasm/wasm-constants.js");
load("test/mjsunit/wasm/wasm-module-builder.js");
function assertCompiles(buffer) {
return assertPromiseResult(
WebAssembly.compile(buffer),
module => assertTrue(module instanceof WebAssembly.Module),
ex => assertUnreachable());
async function assertCompiles(buffer) {
var module = await WebAssembly.compile(buffer);
assertInstanceof(module, WebAssembly.Module);
}
function assertCompileError(buffer) {
return assertPromiseResult(
WebAssembly.compile(buffer), module => assertUnreachable(),
ex => assertTrue(ex instanceof WebAssembly.CompileError));
async function assertCompileError(buffer) {
try {
await WebAssembly.compile(buffer);
assertUnreachable();
} catch (e) {
if (!(e instanceof WebAssembly.CompileError)) throw e;
}
}
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