@@ -325,49 +325,6 @@ function createTaskHolder(resConverter?: MarshalerToJs) {
325325 return holder ;
326326}
327327
328- export function SystemInteropJS_ResolveOrRejectPromise ( args : JSMarshalerArguments ) : void {
329- // rejection/resolution should not arrive earlier than the promise created by marshaling in SystemInteropJS_InvokeJSImportSync
330- Module . safeSetTimeout ( ( ) => SystemInteropJS_ResolveOrRejectPromiseImpl ( args ) , 0 ) ;
331- }
332-
333- export function SystemInteropJS_ResolveOrRejectPromiseImpl ( args : JSMarshalerArguments ) : void {
334- if ( ! isRuntimeRunning ( ) ) {
335- dotnetLogger . debug ( "This promise resolution/rejection can't be propagated to managed code, runtime already exited." ) ;
336- return ;
337- }
338- args = fixupPointer ( args , 0 ) ;
339- const exc = getArg ( args , 0 ) ;
340- // TODO-WASM const receiverShouldFree = WasmEnableThreads && isReceiverShouldFree(args);
341- try {
342- assertRuntimeRunning ( ) ;
343-
344- const res = getArg ( args , 1 ) ;
345- const argHandle = getArg ( args , 2 ) ;
346- const argValue = getArg ( args , 3 ) ;
347-
348- const type = getArgType ( argHandle ) ;
349- const jsHandle = getArgJsHandle ( argHandle ) ;
350-
351- const holder = getJSObjectFromJSHandle ( jsHandle ) as TaskHolder ;
352- dotnetAssert . check ( holder , ( ) => `Cannot find Promise for JSHandle ${ jsHandle } ` ) ;
353-
354- holder . resolveOrReject ( type , jsHandle , argValue ) ;
355- /*TODO-WASM if (receiverShouldFree) {
356- // this works together with AllocHGlobal in JSFunctionBinding.ResolveOrRejectPromise
357- free(args as any);
358- } else {*/
359- setArgType ( res , MarshalerType . Void ) ;
360- setArgType ( exc , MarshalerType . None ) ;
361- //}
362-
363- } catch ( ex : any ) {
364- /*TODO-WASM if (receiverShouldFree) {
365- dotnetAssert.check(false, () => `Failed to resolve or reject promise ${ex}`);
366- }*/
367- marshalExceptionToCs ( exc , ex ) ;
368- }
369- }
370-
371328// eslint-disable-next-line @typescript-eslint/no-unused-vars
372329export function marshalStringToJs ( arg : JSMarshalerArgument ) : string | null {
373330 const type = getArgType ( arg ) ;
0 commit comments