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

Side by Side Diff: test/mjsunit/wasm/wasm-api-overloading.js

Issue 2810203002: Revert of [wasm] instantiate expressed in terms of compile (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « test/mjsunit/wasm/js-api.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax
6
7 load("test/mjsunit/wasm/wasm-constants.js");
8 load("test/mjsunit/wasm/wasm-module-builder.js");
9
10 let buffer = (() => {
11 let builder = new WasmModuleBuilder();
12 builder.addFunction("f", kSig_i_v)
13 .addBody([kExprI32Const, 42])
14 .exportAs("f");
15 return builder.toBuffer();
16 })();
17
18 var module = new WebAssembly.Module(buffer);
19 var wrapper = Promise.resolve(module);
20
21 assertPromiseResult(
22 WebAssembly.instantiate(wrapper),
23 assertUnreachable,
24 e => assertTrue(e instanceof TypeError));
25
26 assertPromiseResult((
27 () => {
28 var old = %SetWasmCompileFromPromiseOverload();
29 var ret = WebAssembly.instantiate(wrapper);
30 %ResetWasmOverloads(old);
31 return ret;
32 })(),
33 pair => {
34 assertTrue(pair.instance instanceof WebAssembly.Instance);
35 assertTrue(pair.module instanceof WebAssembly.Module)
36 },
37 assertUnreachable);
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/js-api.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698