Sami Vaarala
Sami Vaarala
The main limitation for Duktape w.r.t. duk_suspend/duk_resume and coroutines is that Duktape doesn't have the capability to switch native stacks -- i.e. to suspend a certain native stack, establish a...
At present the code base relies on obvious behavior for unsigned overflows (not for signed ones, at least by intention). I can see what it would take to fix these...
No idea off hand why that would happen. One thing Duktape does assume is exact IEEE arithmetic, can you verify that works (especially integer/double casts, fmod(), and floor())?
The problem with `duk_push_this()` in your case probably was that there was no "this" binding, i.e. the function was invoked as a normal function rather than a method. The error...
Duktape doesn't store the argument names to save space because they're not needed for execution. Also function String() coercion doesn't provide them as it is not required when the source...
There are multiple reasons to "pump" events via an event queue. Call stack is one, and predictability of when the callbacks happen (and won't happen) is another. For example, it's...
So assuming that the implementation is some kind of API call like: ``` duk_process_pending_event(ctx); ``` the event callbacks (promises here) would in fact be executed "from the top level". Or...
... As an amusing coincidence, I'm just debugging a callback sequence (implemented without promises) that runs into callbacks in some rare cases being executed earlier than expected... Highly annoying :grin:
Some high level notes on event loop approaches: - Externalize the event loop mechanism somehow so that Duktape won't implement an event queue or dispatcher but let application code do...
So, if I wrote an eventloop outside of the application (with the event function registered e.g. into the global stash), how would that be visible through side effects?