From 5fa056e53be6d17ab746629ea0eaa89fe817141b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 18 Jan 2020 00:43:53 +0100 Subject: workers: minimal error handling and async module loading (#3665) --- core/isolate.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core') diff --git a/core/isolate.rs b/core/isolate.rs index 9c13f0e4d..5617caa86 100644 --- a/core/isolate.rs +++ b/core/isolate.rs @@ -368,6 +368,15 @@ impl Isolate { isolate } + pub fn clear_exception(&mut self) { + let isolate = self.v8_isolate.as_ref().unwrap(); + let mut locker = v8::Locker::new(isolate); + let mut hs = v8::HandleScope::new(&mut locker); + let scope = hs.enter(); + self.last_exception_handle.reset(scope); + self.last_exception.take(); + } + pub fn handle_exception<'a>( &mut self, scope: &mut impl v8::ToLocal<'a>, -- cgit v1.2.3