forked from enlightenment/efl
[eina_js] add: now compatibility_persistent will store v8::Isolate
This commit is contained in:
parent
3d28180ead
commit
77ffb055a1
|
@ -337,6 +337,7 @@ struct compatibility_persistent<T, true> : v8::UniquePersistent<T>
|
|||
compatibility_persistent() {}
|
||||
compatibility_persistent(v8::Isolate* isolate, v8::Handle<T> v)
|
||||
: _base(isolate, v)
|
||||
, isolate(isolate)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -345,7 +346,12 @@ struct compatibility_persistent<T, true> : v8::UniquePersistent<T>
|
|||
return *handle();
|
||||
}
|
||||
|
||||
v8::Handle<T> handle() const { return v8::Local<T>::New(v8::Isolate::GetCurrent(), *this); }
|
||||
v8::Handle<T> handle() const { return v8::Local<T>::New(isolate, *this); }
|
||||
|
||||
v8::Isolate* GetIsolate() { return isolate; }
|
||||
|
||||
private:
|
||||
v8::Isolate *isolate;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
@ -354,13 +360,19 @@ struct compatibility_persistent<T, false> : v8::Persistent<T>
|
|||
typedef v8::Persistent<T> _base;
|
||||
|
||||
compatibility_persistent() {}
|
||||
compatibility_persistent(v8::Isolate*, v8::Handle<T> v)
|
||||
compatibility_persistent(v8::Isolate *isolate, v8::Handle<T> v)
|
||||
: _base(v)
|
||||
, isolate(isolate)
|
||||
{
|
||||
}
|
||||
|
||||
v8::Handle<T>& handle() { return *this; }
|
||||
v8::Handle<T> const& handle() const { return *this; }
|
||||
|
||||
v8::Isolate* GetIsolate() { return isolate; }
|
||||
|
||||
private:
|
||||
v8::Isolate *isolate;
|
||||
};
|
||||
|
||||
template <typename T = std::integral_constant<bool, v8_uses_isolate> >
|
||||
|
|
Loading…
Reference in New Issue