isolated-vm icon indicating copy to clipboard operation
isolated-vm copied to clipboard

`getSync` on `Reference` to function

Open mifopen opened this issue 1 year ago • 1 comments

I'm trying to return a function wrapped into Reference from an isolate and then access some custom-defined field with getSync. But this line of code prevents this https://github.com/laverdet/isolated-vm/blob/61bc6a808086b29d2c58cfd9f809fadd66b9083c/src/module/reference_handle.cc#L455 Is it some strong requirement that is impossible to work around or just something not implemented? I thought that it's legal if I'm not trying to deref function and just access some field on it.

mifopen avatar Nov 21 '23 17:11 mifopen

Seems like an oversight. We have to be careful in that place to avoid invoking accessor functions which may jump into user code without a timeout.

laverdet avatar Nov 21 '23 19:11 laverdet