inspector: fix crash on exception#13455
inspector: fix crash on exception#13455seishun merged 0 commit intonodejs:masterfrom seishun:inspector-crash
Conversation
test/inspector/test-inspector.js
Outdated
There was a problem hiding this comment.
The “middle” parentheses are unnecessary here
refack
left a comment
There was a problem hiding this comment.
Wanted to do this myself 😃
test/inspector/inspector-helper.js
Outdated
There was a problem hiding this comment.
Do you have a guarantee that typeof mainScript.endsWith === 'function'?
Maybe try !String.prototype.endsWith(mainScript, '.js')
Also flip if/else and remove !
There was a problem hiding this comment.
This is an undocumented internal function. I think it's safe to assume that whoever wants to add a new test will look at the code to figure out how it works (just like I did).
There was a problem hiding this comment.
Ack.
But I'm still +1(non-blocking) on inverting
|
I would like to see a regression test in var child = spawn(process.argv[0], ['inspect', `${common.fixturesDir}/throws_error2.js`])
child.stdin.write('c\n');that should cause is to explode (before this fix) |
|
Two approvals, so it's CI time: https://ci.nodejs.org/job/node-test-commit/10357/ |
|
Regression is in |
|
Fixed the regression and flipped the if/else. Adding a test for the "inspect" command seems redundant (and less direct). |
👍
🤷♂️ |
|
Quick CI (linuxone): https://ci.nodejs.org/job/node-test-commit-linuxone/6390/ |
|
Rebased on master, reworked the test a bit. PTAL again. |
Fixes #13438.
cc @eugeneo
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
inspector