vm: allow modifying context name in inspector#17720
vm: allow modifying context name in inspector#17720TimothyGu wants to merge 4 commits intonodejs:masterfrom
Conversation
doc/api/vm.md
Outdated
There was a problem hiding this comment.
the empty string -> an empty string or just empty string
doc/api/vm.md
Outdated
doc/api/vm.md
Outdated
There was a problem hiding this comment.
It seems this bottom reference (line 505) needs to be updated now:
[`vm.createContext()`]: #vm_vm_createcontext_sandbox
into the
[`vm.createContext()`]: #vm_vm_createcontext_sandbox_options
lib/vm.js
Outdated
There was a problem hiding this comment.
Not a super big deal, but should this code section be extracted into a separate function, since it's also used below?
src/node_contextify.cc
Outdated
doc/api/vm.md
Outdated
There was a problem hiding this comment.
Consider documenting that it's a (file?) URL? The linked page doesn't do a great job at describing what it is and mentions things that aren't relevant (e.g. CORS.)
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
Not necessary, as far as I can tell. A Local<String> is a Local<Value>.
src/inspector_agent.cc
Outdated
There was a problem hiding this comment.
I would prefer if ContextInfo used std::string because then you don't have to worry whether it's safe to call into V8 from here and what the lifetime of the Local<String> is (and also because it's a bit awkward to create a JS string here, only to unpack it almost immediately again.)
|
@vsemozhetbyt @maclover7 @bnoordhuis Comments addressed; PTAL. |
|
@bnoordhuis Done and done. |
maclover7
left a comment
There was a problem hiding this comment.
LGTM as far as docs and JS code goes. Can't really to speak to C++ side
|
Landed in 2cb2145. |
The `auxData` field is not exposed to JavaScript, as DevTools uses it for its `isDefault` parameter, which is implemented faithfully, contributing to the nice indentation in the context selection panel. Without the indentation, when `Target` domain gets implemented (along with a single Inspector for cluster) in #16627, subprocesses and VM contexts will be mixed up, causing confusion. PR-URL: #17720 Refs: #14231 (comment) Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com>
The `auxData` field is not exposed to JavaScript, as DevTools uses it for its `isDefault` parameter, which is implemented faithfully, contributing to the nice indentation in the context selection panel. Without the indentation, when `Target` domain gets implemented (along with a single Inspector for cluster) in #16627, subprocesses and VM contexts will be mixed up, causing confusion. PR-URL: #17720 Refs: #14231 (comment) Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com>
The `auxData` field is not exposed to JavaScript, as DevTools uses it for its `isDefault` parameter, which is implemented faithfully, contributing to the nice indentation in the context selection panel. Without the indentation, when `Target` domain gets implemented (along with a single Inspector for cluster) in #16627, subprocesses and VM contexts will be mixed up, causing confusion. PR-URL: #17720 Refs: #14231 (comment) Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com>
The `auxData` field is not exposed to JavaScript, as DevTools uses it for its `isDefault` parameter, which is implemented faithfully, contributing to the nice indentation in the context selection panel. Without the indentation, when `Target` domain gets implemented (along with a single Inspector for cluster) in #16627, subprocesses and VM contexts will be mixed up, causing confusion. PR-URL: #17720 Refs: #14231 (comment) Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: James M Snell <jasnell@gmail.com>
|
The test for this fails when cherry-picking to v8.x: ▶▶▶ tools/test.py test/sequential/test-inspector-contexts.js ~/wrk/com/DANGER/node (⇡v8.x-staging✦)
=== release test-inspector-contexts ===
Path: sequential/test-inspector-contexts
Testing context created/destroyed notifications
/Users/gib/wrk/com/DANGER/node/test/common/index.js:822
(err) => process.nextTick(() => { throw err; }));
^
TypeError: Cannot read property 'isDefault' of undefined
at testContextCreatedAndDestroyed (/Users/gib/wrk/com/DANGER/node/test/sequential/test-inspector-contexts.js:39:25)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
at Function.Module.runMain (module.js:686:11)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
Command: out/Release/node --expose-gc /Users/gib/wrk/com/DANGER/node/test/sequential/test-inspector-contexts.js
[00:00|% 100|+ 0|- 1]: DoneCould you either backport or change the label to dont-land (if it shouldn't land)? |
The
auxDatafield is not exposed to JavaScript, as DevTools uses it for itsisDefaultparameter, which is implemented faithfully, contributing to the nice indentation in the context selection panel. Without the indentation, whenTargetdomain gets implemented (along with a single Inspector for cluster) in #16627, subprocesses and VM contexts will be mixed up, causing confusion.Refs: #14231 (comment)
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
vm, inspector, src