From 4ffbb7a00b5c4cbddc839ff0d711ca64e1eff0f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 3 Jan 2020 14:49:43 +0100 Subject: [PATCH] InIsolate for PromiseRejectMessage (#172) --- src/promise.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/promise.rs b/src/promise.rs index 548c3500..d22ae35f 100644 --- a/src/promise.rs +++ b/src/promise.rs @@ -1,8 +1,11 @@ use std::marker::PhantomData; +use crate::callback_scope::GetIsolate; use crate::support::MaybeBool; use crate::Context; use crate::Function; +use crate::InIsolate; +use crate::Isolate; use crate::Local; use crate::Promise; use crate::PromiseResolver; @@ -196,6 +199,12 @@ pub enum PromiseRejectEvent { #[repr(C)] pub struct PromiseRejectMessage<'msg>([usize; 3], PhantomData<&'msg ()>); +impl<'msg> InIsolate for PromiseRejectMessage<'msg> { + fn isolate(&mut self) -> &mut Isolate { + self.get_isolate() + } +} + impl<'msg> PromiseRejectMessage<'msg> { pub fn get_promise(&self) -> Local<'msg, Promise> { unsafe {