Commit 10d7e01e authored by Aleksei Koziatinskii's avatar Aleksei Koziatinskii Committed by Aleksei Koziatinskii
Browse files

inspector: added NodeRuntime domain

Historically Node process sends Runtime.executionContextDestroyed
with main context as argument when it is finished.
This approach has some disadvantages. V8 prevents running some
protocol command on destroyed contexts, e.g. Runtime.evaluate
will return an error or Debugger.enable won't return a list of
scripts.
Both command might be useful for different tools, e.g. tool runs
Profiler.startPreciseCoverage and at the end of node process it
would like to get list of all scripts to match data to source code.
Or some tooling frontend would like to provide capabilities to run
commands in console when node process is finished to allow user to
inspect state of the program at exit.
This PR adds new domain: NodeRuntime. After
NodeRuntime.notifyWhenWaitingForDisconnect is enabled by at least one
client, node will send NodeRuntime.waitingForDebuggerToDisconnect
event instead of Runtime.executionContextDestroyed. Based on this
signal any protocol client can capture all required information and
then disconnect its session.

PR-URL: https://github.com/nodejs/node/pull/27600


Reviewed-By: default avatarEugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
parent 23ef3e4c
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment