summaryrefslogtreecommitdiff
path: root/core/ops_builtin_v8.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-12-06 02:00:10 +0100
committerGitHub <noreply@github.com>2022-12-06 02:00:10 +0100
commit79285fa83bfbbef55d8afa8f28d11ae4a0b21927 (patch)
tree0a01c246c71c3dcf175d6d95c2746f5dd4743844 /core/ops_builtin_v8.rs
parenta7dd28a07c3d018c326636aa563ee4e9200445f8 (diff)
npm: ensure runtime exceptions are surfaced when debugger is attached (#16943)
Currently runtime exception are only displayed at the program end in terminal, which makes it only a partial fix, as a full fix requires https://github.com/denoland/rusty_v8/pull/1149 which adds new bindings to the inspector that allows to notify it about thrown exceptions. This will be handled in a follow up commit.
Diffstat (limited to 'core/ops_builtin_v8.rs')
-rw-r--r--core/ops_builtin_v8.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/ops_builtin_v8.rs b/core/ops_builtin_v8.rs
index cfbb3eba4..5f4f875ee 100644
--- a/core/ops_builtin_v8.rs
+++ b/core/ops_builtin_v8.rs
@@ -770,12 +770,13 @@ fn op_dispatch_exception(
scope.terminate_execution();
return;
}
- match state.inspector().try_borrow() {
- Ok(inspector) if !inspector.has_active_sessions() => {
- scope.terminate_execution();
- }
+
+ // FIXME(bartlomieju): I'm not sure if this assumption is valid... Maybe when
+ // inspector is polling on pause?
+ if state.inspector().try_borrow().is_ok() {
+ scope.terminate_execution();
+ } else {
// If the inspector is borrowed at this time, assume an inspector is active.
- _ => {}
}
}