dop251 / goja_nodejs

Nodejs compatibility library for Goja
MIT License
336 stars 81 forks source link

Implement setImmediate #49

Closed gbl08ma closed 1 year ago

gbl08ma commented 1 year ago

As proposed by me in #47, I'm implementing setImmediate/clearImmediate support matching the Node.js semantics.

I'm also fixing a bug in argument propagation to the callbacks of setTimeout and setInterval that had to do with reusing slice references from a different scope (the slice call.Arguments of a goja.FunctionCall apparently should not be referenced after the call is handled).

I've added/changed tests to validate my changes.

dop251 commented 1 year ago

Thanks!