blob: 3248c13444e1c876b74fc7b267d8f8e318fd55f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
let { exports } = new WebAssembly.Instance(
new WebAssembly.Module(wasmTextToBinary(`
(module
(func (import "module" "fn") (param f64 i32) (result i32 f64))
(func (export "f") (result i32)
f64.const 4.2
i32.const 7
call 0
drop
)
)
`)),
{
"module": {
fn(f32, i32) {
assertEq(f32, 4.2);
assertEq(i32, 7);
return [2, 7.3];
},
}
});
assertEq(exports.f(), 2);
|