@@ -168,27 +168,27 @@ promise_test(async () => {
168
168
let builder = new WasmModuleBuilder ( ) ;
169
169
let AbeforeB = recordAbeforeB ( ) ;
170
170
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 ) ;
172
172
builder . addFunction ( "test" , kSig_i_i )
173
173
. addBody ( [
174
174
kExprLocalGet , 0 ,
175
175
kExprCallFunction , import42_index , // suspend?
176
- kExprCallFunction , importSetA_index
176
+ kExprCallFunction , importSetB_index
177
177
] ) . exportFunc ( ) ;
178
178
let import42 = WebAssembly . Suspending ( ( ) => 42 ) ;
179
179
let instance = builder . instantiate ( { m : { import42 : import42 ,
180
- setA :AbeforeB . setA } } ) ;
180
+ setB :AbeforeB . setB } } ) ;
181
181
182
182
let wrapped_export = WebAssembly . promising ( instance . exports . test ) ;
183
183
184
184
let exported_promise = wrapped_export ( ) ;
185
- AbeforeB . setB ( ) ;
185
+ AbeforeB . setA ( ) ;
186
186
187
187
assert_equals ( await exported_promise , 42 ) ;
188
188
// AbeforeB.showAbeforeB();
189
189
190
190
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 " ) ;
192
192
193
193
test ( t => {
194
194
console . log ( "Throw after the first suspension" ) ;
0 commit comments