summaryrefslogtreecommitdiff
path: root/core/runtime.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/runtime.rs')
-rw-r--r--core/runtime.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/runtime.rs b/core/runtime.rs
index 47777099c..d640e3e04 100644
--- a/core/runtime.rs
+++ b/core/runtime.rs
@@ -1946,7 +1946,12 @@ impl JsRuntime {
for (promise_id, mut resp) in results.into_iter() {
args.push(v8::Integer::new(scope, promise_id).into());
- args.push(resp.to_v8(scope).unwrap());
+ args.push(match resp.to_v8(scope) {
+ Ok(v) => v,
+ Err(e) => OpResult::Err(OpError::new(&|_| "TypeError", e.into()))
+ .to_v8(scope)
+ .unwrap(),
+ });
}
let tc_scope = &mut v8::TryCatch::new(scope);