Closed declann closed 6 months ago
This is not an issue. In the second example you're just creating a JSContext but you have to enter it
>>> import STPyV8
>>> c = STPyV8.JSContext()
>>> c.enter()
>>> print(c.eval("2+2"))
4
>>> c.leave()
Using the with statement just saves you from entering and leaving the context as the context manager takes care of such details for you. Hope this helps.
My bad, thanks a lot for the explanation!
On Thu 16 May 2024, 10:47 buffer, @.***> wrote:
This is not an issue. In the second example you're just creating a JSContext but you have to enter it
import STPyV8 c = STPyV8.JSContext() c.enter() print(c.eval("2+2")) 4 c.leave()
Using the with statement just saves you from entering and leaving the context as the context manager takes care of such details for you. Hope this helps.
— Reply to this email directly, view it on GitHub https://github.com/cloudflare/stpyv8/issues/108#issuecomment-2114723752, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACWHPTYV7OXDGJ7BGNEFKLZCR6BZAVCNFSM6AAAAABHQQXSQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJUG4ZDGNZVGI . You are receiving this because you authored the thread.Message ID: @.***>
Hi,
Thanks for STPyV8, I have a workaround noted below but posting in case there are issues you want to fix.
This works:
But this causes a segfault:
I like the latter pattern for notebook/interactive calls to JS.
Heres a workaround that seems to suits my needs:
Thanks, Declan