You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
What is the behavior of the dynamically import function #993
if(!import.meta.path||self.entry==import.meta.path){constfile=self.argv[0];if(!file){thrownewError('Expect an arg to run test');}console.log('Start test:',file,'\n');try{constpath=(import.meta.dirname||self.dirname)+'/'+file+'.js';console.log(path);import(path);delay(10000);}catch(e){console.error('Could not load test:'+file,e);}}
However,the promise never come fulfilled,while the follow one works
import * as test from "./test.js"
And the follow example will block the whole program infinitely
awaitimport(path);
The key function that would affect this is "JS_ExecutePendingJob", however, I am confused about its role.
I would appreciate it if someone could tell me its role.
Activity
saghul commentedon Mar 23, 2025
Please paste a full script that exhibits the problem.
bnoordhuis commentedon Mar 23, 2025
Call
JS_ExecutePendingJob(ctx, &ctx1)in a loop, or calljs_std_loop(ctx)when your program callsjs_std_init(ctx, m).You can find examples of how to use both functions in this repo.