Expose global setTimeout from C API #1502
-
|
I want to use the C api to bind the quickjs runtime to a DOM for an html document in a browser. I see the quickjs-libc.c defines the js_os_setTimeout function and I would like to reuse it (since I need a global setTimeout function) setting as a property of JS_GetGlobalObject. But the function is static and not exported. Should I have to implement my own or is there a way to reuse it for the purpose I described? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
You probably don't want to reuse it because it's basically an all-or-nothing proposition: it intertwines intimately with the event loop so then you have to design your program around the quickjs-libc event loop (js_std_loop, etc.) |
Beta Was this translation helpful? Give feedback.
You probably don't want to reuse it because it's basically an all-or-nothing proposition: it intertwines intimately with the event loop so then you have to design your program around the quickjs-libc event loop (js_std_loop, etc.)