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

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

Issue 2552123004: [wasm] Fix ToNumber conversion (Closed)
Patch Set: Minor fix Created 4 years 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/ffi.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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 kExprI64SConvertI32, 108 kExprI64SConvertI32,
109 kExprCallFunction, index // -- 109 kExprCallFunction, index // --
110 ]) // -- 110 ]) // --
111 .exportFunc(); 111 .exportFunc();
112 var func = function() {return {};}; 112 var func = function() {return {};};
113 var main = builder.instantiate({func: func}).exports.main; 113 var main = builder.instantiate({func: func}).exports.main;
114 assertThrows(function() { 114 assertThrows(function() {
115 main(13); 115 main(13);
116 }, TypeError); 116 }, TypeError);
117 })(); 117 })();
118
119 (function ImportSymbolToNumberThrows() {
120 var builder = new WasmModuleBuilder();
121 var index = builder.addImport("func", kSig_i_v);
122 builder.addFunction("main", kSig_i_v)
123 .addBody([kExprCallFunction, 0])
124 .exportFunc();
125 var func = () => Symbol();
126 var main = builder.instantiate({func: func}).exports.main;
127 assertThrows(() => main(), TypeError);
128 })();
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/ffi.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698