summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinícius dos Santos Oliveira <vini.ipsmaker@expertisesolutions.com.br>2015-06-03 01:09:39 -0300
committerVinícius dos Santos Oliveira <vini.ipsmaker@expertisesolutions.com.br>2015-06-03 01:09:39 -0300
commit77ffb055a15aee55ba2a84e890955433ce697cb2 (patch)
tree3090ad18f8d9040ff872b74d00819b531859758d
parent3d28180eadbc56b6e28a864fe47ed62636cefd58 (diff)
downloadefl-77ffb055a15aee55ba2a84e890955433ce697cb2.tar.gz
[eina_js] add: now compatibility_persistent will store v8::Isolate
-rw-r--r--src/bindings/eina_js/eina_js_compatibility.hh16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/bindings/eina_js/eina_js_compatibility.hh b/src/bindings/eina_js/eina_js_compatibility.hh
index 72d054dee0..7e8792ce5e 100644
--- a/src/bindings/eina_js/eina_js_compatibility.hh
+++ b/src/bindings/eina_js/eina_js_compatibility.hh
@@ -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> >