Uh oh!
There was an error while loading. Please reload this page.
lib,src: remove vm.runInDebugContext() - #13295
Conversation
addaleax
commented
May 30, 2017
There was a problem hiding this comment.
The file is whitelisted because the V8 builtins don't lint. They're not legal JS syntax, eslint can't parse them.
There was a problem hiding this comment.
You should be able add comments by starting lines with # – if you comment here in the PR, that sounds like a good indicator that it makes sense to do so. :)
There was a problem hiding this comment.
There are other lib/internal/v8 files whitelisted. I don't think we need a comment. But either way is fine.
There was a problem hiding this comment.
There is a minor change in behavior here in that the preview is now limited to 100 elements. Before, it would show them all but that is (IMO) rather annoying with large maps and sets (and it's basically equivalent to printing the map or set minus the already iterated over elements.)
I'm planning to follow up with a PR that prints a nice "..." if there are more elements but I can restore the old behavior if people prefer that.
bnoordhuis
commented
May 30, 2017
targos
commented
May 30, 2017
Documentation says Node 10+: https://github.com/nodejs/node/blob/master/doc/api/deprecations.md#dep0069-vmrunindebugcontextstring According to our deprecation policy, we should first emit a warning in Node 9 and remove the feature in Node 10 or higher. I guess it would have to be 10 here because V8 will remove the API by the end of the year. |
addaleax
commented
May 30, 2017
CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/845/ I don’t know about the reasons behind not going for a runtime deprecation in Node 8, I was just pretty sure I read somewhere that it was intentional. ¯\_(ツ)_/¯ |
targos
commented
May 30, 2017
There was a problem hiding this comment.
You should be able add comments by starting lines with # – if you comment here in the PR, that sounds like a good indicator that it makes sense to do so. :)
There was a problem hiding this comment.
You’ll also want to update the entry in deprecations.md to say Type: End-of-Life
bnoordhuis
commented
May 30, 2017
That doesn't apply to |
jasnell
commented
May 30, 2017
We really ought to have had a deprecation message added in 8.0.0 for this but it's rather too late now. If the plan is to remove it in 9.0, then we should get a runtime deprecation into an 8.x minor. |
TimothyGu
left a comment
There was a problem hiding this comment.
For context: the first part of this PR which removes the use of Debug Mirrors is, well, hacky as heck. But there is no other solution as I have found out when investigating #11875, other than convincing V8 devs to add C++ APIs for Map- and SetIterators.
@bnoordhuis can you attach a Fixes: https://github.com/nodejs/node/issues/11875 to the commit message as well?
There was a problem hiding this comment.
Can the 0/1/2/3 magic numbers be constants instead? V8 is using
define ITERATOR_KIND_KEYS = 1;
define ITERATOR_KIND_VALUES = 2;
define ITERATOR_KIND_ENTRIES = 3;
which looks good to me.
There was a problem hiding this comment.
Can a for-of loop be used directly on the cloned it?
There was a problem hiding this comment.
There are other lib/internal/v8 files whitelisted. I don't think we need a comment. But either way is fine.
There was a problem hiding this comment.
Can we test the SetIterator as well?
There was a problem hiding this comment.
I didn't add a test here, I just updated an existing test that was using internals.
TimothyGu
commented
Aug 3, 2017
@fhinkel Do you have a better way to preserve the Iterator support w/o using V8 natives syntax? |
fhinkel
commented
Aug 4, 2017
Maybe we could add these methods to the V8 API. Relying on intrinsic functions ( |
bnoordhuis
commented
Aug 4, 2017
Yes, that's my longer-term goal. Using natives syntax is a short-term + least-effort solution. |
BridgeAR
commented
Aug 30, 2017
This needs a rebase. |
TimothyGu
left a comment
There was a problem hiding this comment.
LGTM once #13295 (comment) is addressed.
BridgeAR
commented
Sep 19, 2017
@bnoordhuis do you still want to follow up on this? |
bnoordhuis
commented
Oct 2, 2017
Updated. CI for a change: https://ci.nodejs.org/job/node-test-pull-request/10379/ |
ofrobots
commented
Oct 16, 2017
I would like to formally request that we do NOT land this in Node 9. We have been migrating some of the code we use in https://github.com/GoogleCloudPlatform/cloud-debug-nodejs to the inspector module. At this point we do not think the inspector API is a complete replacement for the Since there is no pressing need to remove the API just yet, let's not accelerate the removal. |
mcollina
commented
Oct 17, 2017
👍 in waiting. |
addaleax
commented
Oct 23, 2017
This would need to be rebased now that the runtime deprecation has been merged. |
BridgeAR
commented
Nov 22, 2017
Ping @bnoordhuis this could land after a rebase |
ef78a22 to
fce7077CompareThere was a problem hiding this comment.
grr... this one is becoming quite annoying.
jasnell
commented
Nov 22, 2017
@bnoordhuis ... the extraneous js-yaml change is causing CI to fail on this. |
fce7077 to
76796b7Comparebnoordhuis
commented
Nov 23, 2017
With js-yaml change undone: https://ci.nodejs.org/job/node-test-pull-request/11679/ |
This paves the way for removing `vm.runInDebugContext()`. Inspection of Map and Set iterators is now done through V8 instrinsics. Fixes: nodejs#11875 PR-URL: nodejs#13295 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
The V8 API it is based on is deprecated and scheduled for removal later this year. Remove it. PR-URL: nodejs#13295 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
76796b7 to
6f724e1Compareaddaleax
commented
Dec 4, 2017
Btw: This breaks That’s nothing we can do anything about, we need this patch in order to avoid breakage ourselves, so it’s graceful-fs that needs to work around this, but I wanted to leave that information here. |
The V8 API it is based on is deprecated and scheduled for removal later this year. Remove it. PR-URL: nodejs#13295 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
The V8 API it is based on is deprecated and scheduled for removal later this year. Remove it.
The first commit replaces the
Debug.MakeMirror()call in lib/util.js with something else.The most important reason for doing this is of course to have a deprecation warning-free build again!