-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inspector: Runtime.evaluate with throwOnSideEffect & contextId of vm.createContext throws when it shouldn't #27518
Comments
Runtime.evaluate
with throwOnSideEffect
& contextId
of vm.createContext
throws it shouldn't
@nodejs/v8-inspector |
it actually does cause a side effect. the VM context is a c++ defined proxy-like object. |
Is this intended behaviour then @devsnek? If so, are there any workarounds? |
@devsnek Um … what’s the side effect? Yes, it’s a proxy, but accessing variables doesn’t have side effects, right? I think we’d need to extend |
I believe that it calls some C++ code, as @addalex mentioned - any C++ callback should be explicitly marked as nosideeffects: https://cs.chromium.org/chromium/src/v8/include/v8.h?rcl=ea50a032a6e5e9c796e408bf2dafc14b767d9896&l=6033 otherwise V8 considers it as side effect. |
Oh, thanks @ak239 – I missed that |
Fixes: #27518 PR-URL: #27523 Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
v12.1.0
, although seems to apply to older versions toomacOS
inspector
orvm
Demonstrating the issue from the title:
^ exits with code
1
, even though the provided expressiona
is clearly causing no side effect.Weirdly enough, changing the
contextId
from2
to1
(1
being the global one) makes the snippet exit with0
, hence working as expected.The text was updated successfully, but these errors were encountered: