-
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
Node must not rely on functionality exposed through --allow-natives-syntax
#20409
Comments
I think we can be very empathetic to this, because it’s a problem that we’ve been running into far too many times ourselves :) Do you have any suggestions for how we’d best avoid this? We only use it for inspecting these objects at the moment in Also, one more note: We do use |
This one's on me, I'm afraid... the use of natives was only a stop-gap measure. It's on my todo list to file CLs to add a proper C++ API for inspecting map and set iterators, but I haven't gotten around to it yet. |
Turn `debug::EntriesPreview` into a public API. This is a straightforward approach to addressing nodejs/node#20409 (not relying on functionality behind `--allow-natives-syntax`) in Node.js. Refs: nodejs/node#20409 Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel Change-Id: I7021e5846012a55a82c488408ded6591f6b139e7 Reviewed-on: https://chromium-review.googlesource.com/1057467 Reviewed-by: Yang Guo <yangguo@chromium.org> Commit-Queue: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#53226}
Use a new public V8 API for inspecting weak collections and collection iterators, rather than using V8-internal functions to achieve this. This currently comes with a slight modification of the output for inspecting iterators generated by `Set().entries()`. Fixes: nodejs#20409
Original commit message: [api] Expose PreviewEntries as public API Turn `debug::EntriesPreview` into a public API. This is a straightforward approach to addressing nodejs#20409 (not relying on functionality behind `--allow-natives-syntax`) in Node.js. Refs: v8/v8@ff0a979
Use a new public V8 API for inspecting weak collections and collection iterators, rather than using V8-internal functions to achieve this. This currently comes with a slight modification of the output for inspecting iterators generated by `Set().entries()`. Fixes: nodejs#20409
Original commit message: [api] Expose PreviewEntries as public API Turn `debug::EntriesPreview` into a public API. This is a straightforward approach to addressing #20409 (not relying on functionality behind `--allow-natives-syntax`) in Node.js. Refs: v8/v8@ff0a979 PR-URL: #20719 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Thanks for fixing this! |
Original commit message: [api] Expose PreviewEntries as public API Turn `debug::EntriesPreview` into a public API. This is a straightforward approach to addressing #20409 (not relying on functionality behind `--allow-natives-syntax`) in Node.js. Refs: v8/v8@ff0a979 PR-URL: #20719 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Use a new public V8 API for inspecting weak collections and collection iterators, rather than using V8-internal functions to achieve this. This currently comes with a slight modification of the output for inspecting iterators generated by `Set().entries()`. Fixes: #20409 PR-URL: #20719 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Node.js 10.2.0 needs it. https://chromium-review.googlesource.com/1057467 nodejs/node#20409
Original commit message: [api] Expose PreviewEntries as public API Turn `debug::EntriesPreview` into a public API. This is a straightforward approach to addressing nodejs#20409 (not relying on functionality behind `--allow-natives-syntax`) in Node.js. Refs: v8/v8@ff0a979 PR-URL: nodejs#20719 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Original commit message: [api] Expose PreviewEntries as public API Turn `debug::EntriesPreview` into a public API. This is a straightforward approach to addressing #20409 (not relying on functionality behind `--allow-natives-syntax`) in Node.js. Refs: v8/v8@ff0a979 PR-URL: #20719 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Original commit message: [api] Expose PreviewEntries as public API Turn `debug::EntriesPreview` into a public API. This is a straightforward approach to addressing #20409 (not relying on functionality behind `--allow-natives-syntax`) in Node.js. Refs: v8/v8@ff0a979 PR-URL: #20719 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
As I found out here, Node enables
--allow-natives-syntax
in V8 during bootstrapping and disables later.This is so
v8.previewMapIterator
andv8.previewSetIterator
inlib/internal/v8.js
can be compiled during bootstrapping, as the call%MapIteratorClone
and%SetIteratorClone
. There are two major flaws in this:v8/src/runtime/runtime.h
defining%MapIteratorClone
. Note that this is an implementation detail deep inside of V8 and could change at any time without any warning. In this particular case,%MapIteratorClone
is only used inside V8 for the outdated debug context implementation that we were planning to remove for a long time.Well I guess now that V8 tests against Node, V8 developers are forced to not violate these wrong assumptions.
Please please remove these dependencies.
The text was updated successfully, but these errors were encountered: