Synchronous exceptions in ES modules are always 'caught'
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 122k
- Forks
- 37.3k
- Ø Merge
- 4 T. 2 Std.
- Gemergte PRs (30 T.)
- 283
Beschreibung
Version
20.3.1
Platform
Darwin mbp.peet.io 22.6.0 Darwin Kernel Version 22.6.0: Fri Sep 15 13:39:52 PDT 2023; root:xnu-8796.141.3.700.8~1/RELEASE_X86_64 x86_64
Subsystem
inspector
What steps will reproduce the bug?
- Start a program containing
throw new Error('foo');in an ES module - Attach a debugger, like devtools or VS Code's debugger, and enable "pause on uncaught exceptions"
- Run the program
How often does it reproduce? Is there a required condition?
100%
What is the expected behavior? Why is that the expected behavior?
The runtime should pause on the throw line
What do you see instead?
The runtime does not pause and the program exits
Additional information
First reported in https://github.com/microsoft/vscode-js-debug/issues/1861
Guessing this is because module evaluation is in a try/catch. Wonder if there's any machinery that can be used to mark containing exceptions as uncaught
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit lib/internal/modules/esm/module_job.js ungefähr bei den Zeilen 217–219 und reproduziere das Problem mithilfe eines ES-Moduls, das einen synchronen throw mit angehängtem Debugger enthält. Verfolge, wie der Inspector die Exception während der Modulauswertung behandelt; abgeschlossen ist die Aufgabe, wenn der Debugger beim throw pausiert, sobald pause on uncaught exceptions aktiviert ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100