0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-12-25 08:39:15 -05:00

InIsolate for PromiseRejectMessage (#172)

This commit is contained in:
Bartek Iwańczuk 2020-01-03 14:49:43 +01:00 committed by Ry Dahl
parent 64136e684e
commit 4ffbb7a00b

View file

@ -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 {