mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
fix(inspector): send "isDefault" in aux data (#16836)
With trial and error I found that most debuggers expect "isDefault" to be sent in "auxData" field of "executionContextCreated" notification. This stems from the fact that Node.js sends this data and eg. VSCode requires it to close connection to the debugger when the program finishes execution.
This commit is contained in:
parent
d8ab492d01
commit
3a320db270
4 changed files with 36 additions and 8 deletions
|
@ -92,17 +92,19 @@ impl ReplSession {
|
|||
for notification in session.notifications() {
|
||||
let method = notification.get("method").unwrap().as_str().unwrap();
|
||||
let params = notification.get("params").unwrap();
|
||||
|
||||
if method == "Runtime.executionContextCreated" {
|
||||
context_id = params
|
||||
.get("context")
|
||||
let context = params.get("context").unwrap();
|
||||
assert!(context
|
||||
.get("auxData")
|
||||
.unwrap()
|
||||
.get("id")
|
||||
.get("isDefault")
|
||||
.unwrap()
|
||||
.as_u64()
|
||||
.unwrap();
|
||||
.as_bool()
|
||||
.unwrap());
|
||||
context_id = context.get("id").unwrap().as_u64().unwrap();
|
||||
}
|
||||
}
|
||||
assert_ne!(context_id, 0);
|
||||
|
||||
let mut repl_session = ReplSession {
|
||||
worker,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue