File tree Expand file tree Collapse file tree 10 files changed +65
-1
lines changed
Expand file tree Collapse file tree 10 files changed +65
-1
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ function generateImportObject(module) {
9696 ) . join ( ", " ) ;
9797 const variables = Array . from (
9898 waitForInstances . keys ( ) ,
99- ( name , i ) => `${ name } = array[${ i } ]; `
99+ ( name , i ) => `${ name } = array[${ i } ]`
100100 ) . join ( ", " ) ;
101101 return Template . asString ( [
102102 `${ 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 )))
Original file line number Diff line number Diff line change 1+ it ( "should allow wasm with unused exports" , function ( ) {
2+ return import ( "./module" ) . then ( function ( module ) {
3+ const result = module . run ( ) ;
4+ expect ( result ) . toEqual ( 42 ) ;
5+ } ) ;
6+ } ) ;
Original file line number Diff line number Diff line change 1+ import { getNumber } from "./wasm.wat" ;
2+
3+ export function run ( ) {
4+ return getNumber ( ) ;
5+ }
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 i32 i32 ) (result i32 )))
3+ (type $t1 (func (result i32 )))
4+ (func $add (export " add" ) (type $t0 ) (param $p0 i32 ) (param $p1 i32 ) (result i32 )
5+ (i32.add
6+ (get_local $p0 )
7+ (get_local $p1 )))
8+ (func $getNumber (export " getNumber" ) (type $t1 ) (result i32 )
9+ (i32.const 42 )))
10+
You can’t perform that action at this time.
0 commit comments