diff options
author | Matt Mastracci <matthew@mastracci.com> | 2024-03-13 21:23:37 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-14 04:23:37 +0100 |
commit | 66fd6f286641d4d2491d7b4bb314bd7e7eff16d8 (patch) | |
tree | b84aa4cac4c0a756539c91e5df4193d3636ae2bb /runtime/worker.rs | |
parent | 1f3c4c976313904d5df0b33b2cc0e282e62d1000 (diff) |
fix(cli): unbreak extension example and fix __runtime_js_sources (#22906)
Better example to close https://github.com/denoland/deno/issues/22600
---------
Signed-off-by: Matt Mastracci <matthew@mastracci.com>
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r-- | runtime/worker.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs index 97ea53980..2fb32c766 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -566,11 +566,16 @@ impl MainWorker { } let scope = &mut self.js_runtime.handle_scope(); + let scope = &mut v8::TryCatch::new(scope); let args = options.as_v8(scope); let bootstrap_fn = self.bootstrap_fn_global.take().unwrap(); let bootstrap_fn = v8::Local::new(scope, bootstrap_fn); let undefined = v8::undefined(scope); - bootstrap_fn.call(scope, undefined.into(), &[args]).unwrap(); + bootstrap_fn.call(scope, undefined.into(), &[args]); + if let Some(exception) = scope.exception() { + let error = JsError::from_v8_exception(scope, exception); + panic!("Bootstrap exception: {error}"); + } } /// See [JsRuntime::execute_script](deno_core::JsRuntime::execute_script) |