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

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

Issue 2806073002: [wasm] instantiate expressed in terms of compile (Closed)
Patch Set: feedback 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
« src/wasm/wasm-js.cc ('K') | « 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 %ResetWasmOverloads();
11 let buffer = (() => {
12 let builder = new WasmModuleBuilder();
13 builder.addFunction("f", kSig_i_v)
14 .addBody([kExprI32Const, 42])
15 .exportAs("f");
16 return builder.toBuffer();
17 })();
18
19 var module = new WebAssembly.Module(buffer);
20 var wrapper = [module];
21
22 assertPromiseResult(
23 WebAssembly.instantiate(wrapper),
24 assertUnreachable,
25 e => assertTrue(e instanceof TypeError));
26
27 assertPromiseResult(
28 (() => {
29 %SetWasmCompileFromPromiseOverload();
30 return WebAssembly.instantiate(wrapper);
31 })(),
32 pair => {
33 print(2);
34 var pair = result.pair;
35 assertTrue(pair.instance instanceof WebAssembly.Instance);
36 assertTrue(pair.module instanceof WebAssembly.Module);
37 %ResetWasmOverloads();
38 },
39 assertUnreachable);
OLDNEW
« src/wasm/wasm-js.cc ('K') | « test/mjsunit/wasm/js-api.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698