diff options
author | Bert Belder <bertbelder@gmail.com> | 2020-02-24 15:53:29 -0800 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2020-02-26 11:44:33 -0800 |
commit | 1a8ef36b71838bfabc633efe6ccf8d32748d7060 (patch) | |
tree | 9d0bc946920a384ab57533d944a3eed782213721 /core/bindings.rs | |
parent | 9adcdabd6592e05d0196119deaaf642480a14a90 (diff) |
Upgrade to rusty_v8 v0.3.3 (#4119)
Diffstat (limited to 'core/bindings.rs')
-rw-r--r-- | core/bindings.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/core/bindings.rs b/core/bindings.rs index 6ea0b9b91..3db95d896 100644 --- a/core/bindings.rs +++ b/core/bindings.rs @@ -1,6 +1,8 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. use crate::es_isolate::EsIsolate; +use crate::isolate::encode_message_as_json; +use crate::isolate::handle_exception; use crate::isolate::Isolate; use crate::isolate::ZeroCopyBuf; @@ -278,13 +280,19 @@ pub extern "C" fn message_callback( unsafe { &mut *(scope.isolate().get_data(0) as *mut Isolate) }; // TerminateExecution was called - if scope.isolate().is_execution_terminating() { + // TODO(piscisaureus): rusty_v8 should implement the + // `is_execution_terminating()` method on struct `Isolate` also. + if scope + .isolate() + .thread_safe_handle() + .is_execution_terminating() + { let undefined = v8::undefined(scope).into(); - deno_isolate.handle_exception(scope, undefined); + handle_exception(scope, undefined, &mut deno_isolate.last_exception); return; } - let json_str = deno_isolate.encode_message_as_json(scope, message); + let json_str = encode_message_as_json(scope, message); deno_isolate.last_exception = Some(json_str); } @@ -668,7 +676,7 @@ pub fn encode_message_as_object<'a>( s: &mut impl v8::ToLocal<'a>, message: v8::Local<v8::Message>, ) -> v8::Local<'a, v8::Object> { - let context = s.isolate().get_current_context(); + let context = s.get_current_context().unwrap(); let json_obj = v8::Object::new(s); let exception_str = message.get(s); |