diff options
Diffstat (limited to 'deps/v8/test/mjsunit/wasm/async-compile.js')
-rw-r--r-- | deps/v8/test/mjsunit/wasm/async-compile.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/deps/v8/test/mjsunit/wasm/async-compile.js b/deps/v8/test/mjsunit/wasm/async-compile.js index 39a339aae6..122eccbe96 100644 --- a/deps/v8/test/mjsunit/wasm/async-compile.js +++ b/deps/v8/test/mjsunit/wasm/async-compile.js @@ -2,22 +2,23 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --wasm-async-compilation --expose-wasm --allow-natives-syntax +// Flags: --expose-wasm --allow-natives-syntax 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() { |