diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-01-18 00:43:53 +0100 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2020-01-17 18:43:53 -0500 |
commit | 5fa056e53be6d17ab746629ea0eaa89fe817141b (patch) | |
tree | c32c4ab39577a2dc14da3843e3223395c5a7ea54 /core/isolate.rs | |
parent | d7203092039d3c46ca8480ff8eecf612deb2b2f6 (diff) |
workers: minimal error handling and async module loading (#3665)
Diffstat (limited to 'core/isolate.rs')
-rw-r--r-- | core/isolate.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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>, |