Closed PetterS closed 4 years ago
This API can only add callable to global scope now, whether need be more flexible?
We are not sure whether the API was called success now. e.g.
context.eval("let f;")
context.add_callable("f", lambda x: x + 2) # no throw
context.eval("f(1);") # throw at here
We are not sure whether the API was called success now. e.g.
Not sure how to fix this. JS_SetPropertyStr
returns success.
If arg is null, we should deallocate args and throw an OOM error. I guess PyTuple_SET_ITEM will crash otherwise?
Done, but I can not trigger this in unit tests since this conversion "always" succeeds.
Time limits are now disallowed when calling into Python.
use name here, maybe it makes for nicer stack traces
Yes, thanks, missed that.
Fixes #27.
Passing more complicated objects than simple types (int, bool, str) is not supported and will have to be JSON decoded manually.