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

Side by Side Diff: test/mjsunit/wasm/ffi-error.js

Issue 2254803002: [wasm] Throw a type error if an I64 is exported to JS. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove IfSuccess nodes for now. Created 4 years, 4 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/calls.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
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --expose-wasm 5 // Flags: --expose-wasm
6 6
7 load("test/mjsunit/wasm/wasm-constants.js"); 7 load("test/mjsunit/wasm/wasm-constants.js");
8 load("test/mjsunit/wasm/wasm-module-builder.js"); 8 load("test/mjsunit/wasm/wasm-module-builder.js");
9 9
10 function testCallFFI(ffi) { 10 function testCallFFI(ffi) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 testCallFFI(ffi); 52 testCallFFI(ffi);
53 }); 53 });
54 54
55 55
56 // "fun" should be a JS function. 56 // "fun" should be a JS function.
57 assertThrows(function() { 57 assertThrows(function() {
58 var ffi = new Object(); 58 var ffi = new Object();
59 ffi.fun = 0; 59 ffi.fun = 0;
60 testCallFFI(ffi); 60 testCallFFI(ffi);
61 }); 61 });
62
63
64 (function I64InSignatureThrows() {
65 var builder = new WasmModuleBuilder();
66
67 builder.addMemory(1, 1, true);
68 builder.addFunction("function_with_invalid_signature", kSig_l_ll)
69 .addBody([ // --
70 kExprGetLocal, 0, // --
71 kExprGetLocal, 1, // --
72 kExprI64Sub]) // --
73 .exportFunc()
74
75 var module = builder.instantiate();
76
77 assertThrows(function() {
78 module.exports.function_with_invalid_signature(33, 88);
79 }, TypeError);
80 })();
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/calls.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698