File tree 6 files changed +39
-1
lines changed
test/cases/wasm/imports-many-direct
6 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ function generateImportObject(module) {
96
96
) . join ( ", " ) ;
97
97
const variables = Array . from (
98
98
waitForInstances . keys ( ) ,
99
- ( name , i ) => `${ name } = array[${ i } ]; `
99
+ ( name , i ) => `${ name } = array[${ i } ]`
100
100
) . join ( ", " ) ;
101
101
return Template . asString ( [
102
102
`${ JSON . stringify ( module . id ) } : function() {` ,
Original file line number Diff line number Diff line change
1
+ it ( "should allow to run a WebAssembly module with many direct wasm dependencies" , function ( ) {
2
+ return import ( "./wasm.wat" ) . then ( function ( wasm ) {
3
+ const result = wasm . testI64 ( ) ;
4
+ expect ( result ) . toEqual ( 42 ) ;
5
+ } ) ;
6
+ } ) ;
Original file line number Diff line number Diff line change
1
+ (module
2
+ (type $t0 (func (param i64 ) (result i64 )))
3
+ (func $getI64 (type $t0 ) (param $p0 i64 ) (result i64 )
4
+ get_local $p0
5
+ i64.const 20
6
+ i64.add )
7
+ (export " getI64" (func $getI64 )))
Original file line number Diff line number Diff line change
1
+ (module
2
+ (type $t0 (func (param i64 ) (result i64 )))
3
+ (func $getI64 (type $t0 ) (param $p0 i64 ) (result i64 )
4
+ get_local $p0
5
+ i64.const 22
6
+ i64.add )
7
+ (export " getI64" (func $getI64 )))
Original file line number Diff line number Diff line change
1
+ var supportsWebAssembly = require ( "../../../helpers/supportsWebAssembly" ) ;
2
+
3
+ module . exports = function ( config ) {
4
+ return supportsWebAssembly ( ) ;
5
+ } ;
Original file line number Diff line number Diff line change
1
+ (module
2
+ (type $t0 (func (param i64 ) (result i64 )))
3
+ (type $t1 (func (result i32 )))
4
+ (import " ./other1.wat" " getI64" (func $getI641 (type $t0 )))
5
+ (import " ./other2.wat" " getI64" (func $getI642 (type $t0 )))
6
+ (func $testI64 (type $t1 ) (result i32 )
7
+ i64.const 1152921504606846976
8
+ call $getI641
9
+ call $getI642
10
+ i64.const 1152921504606846976
11
+ i64.sub
12
+ i32.wrap /i64 )
13
+ (export " testI64" (func $testI64 )))
You can’t perform that action at this time.
0 commit comments