diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2023-04-27 13:40:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-27 14:40:03 +0200 |
commit | 03132e19da6c8e34e8100c6a57cd911b43900950 (patch) | |
tree | 014db77ed12f9ae882abba3c23c5f541461f03b4 /cli/tools/test.rs | |
parent | d043a6d72cbf683c70f7eb4b9b3c09003afd2683 (diff) |
fix(test): handle dispatched exceptions from test functions (#18853)
Fixes #18852.
Diffstat (limited to 'cli/tools/test.rs')
-rw-r--r-- | cli/tools/test.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/cli/tools/test.rs b/cli/tools/test.rs index 268f3b4b9..62a104733 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -997,14 +997,7 @@ pub async fn test_specifier( } sender.send(TestEvent::Wait(desc.id))?; let earlier = SystemTime::now(); - let promise = { - let scope = &mut worker.js_runtime.handle_scope(); - let cb = function.open(scope); - let this = v8::undefined(scope).into(); - let promise = cb.call(scope, this, &[]).unwrap(); - v8::Global::new(scope, promise) - }; - let result = match worker.js_runtime.resolve_value(promise).await { + let result = match worker.js_runtime.call_and_await(&function).await { Ok(r) => r, Err(error) => { if error.is::<JsError>() { |