@@ -168,27 +168,27 @@ promise_test(async () => {
168168 let builder = new WasmModuleBuilder ( ) ;
169169 let AbeforeB = recordAbeforeB ( ) ;
170170 import42_index = builder . addImport ( 'm' , 'import42' , kSig_i_i ) ;
171- importSetA_index = builder . addImport ( 'm' , 'setA ' , kSig_v_v ) ;
171+ importSetB_index = builder . addImport ( 'm' , 'setB ' , kSig_v_v ) ;
172172 builder . addFunction ( "test" , kSig_i_i )
173173 . addBody ( [
174174 kExprLocalGet , 0 ,
175175 kExprCallFunction , import42_index , // suspend?
176- kExprCallFunction , importSetA_index
176+ kExprCallFunction , importSetB_index
177177 ] ) . exportFunc ( ) ;
178178 let import42 = WebAssembly . Suspending ( ( ) => 42 ) ;
179179 let instance = builder . instantiate ( { m : { import42 : import42 ,
180- setA :AbeforeB . setA } } ) ;
180+ setB :AbeforeB . setB } } ) ;
181181
182182 let wrapped_export = WebAssembly . promising ( instance . exports . test ) ;
183183
184184 let exported_promise = wrapped_export ( ) ;
185- AbeforeB . setB ( ) ;
185+ AbeforeB . setA ( ) ;
186186
187187 assert_equals ( await exported_promise , 42 ) ;
188188 // AbeforeB.showAbeforeB();
189189
190190 assert_true ( AbeforeB . isAbeforeB ( ) ) ;
191- } , "Do not suspend if the import's return value is not a Promise" ) ;
191+ } , "Do suspend even if the import's return value is not a Promise by wrapping it with Promise.resolve " ) ;
192192
193193test ( t => {
194194 console . log ( "Throw after the first suspension" ) ;
0 commit comments