diff --git a/ext/v8/external.h b/ext/v8/external.h index 5a26e14..b9defb2 100644 --- a/ext/v8/external.h +++ b/ext/v8/external.h @@ -3,7 +3,7 @@ #define EXTERNAL_H namespace rr { - class External : Ref { + class External : public Ref { public: static void Init(); @@ -13,6 +13,8 @@ namespace rr { inline External(VALUE value) : Ref(value) {} inline External(v8::Isolate* isolate, v8::Handle handle) : Ref(isolate, handle) {} + inline External(v8::Isolate* isolate, v8::Handle value) : + External(isolate, v8::Handle::Cast(value)) {} struct Container { Container(VALUE v) : object(v) {} diff --git a/ext/v8/ref.h b/ext/v8/ref.h index d58dd8c..deaf008 100644 --- a/ext/v8/ref.h +++ b/ext/v8/ref.h @@ -97,7 +97,7 @@ namespace rr { isolate(isolate), cell(new v8::Persistent(isolate, handle)) {} virtual ~Holder() { - Isolate(isolate).scheduleDelete(cell); + Isolate(isolate).scheduleReleaseObject(cell); } v8::Isolate* isolate; diff --git a/ext/v8/value.cc b/ext/v8/value.cc index 02b4119..aa2df9d 100644 --- a/ext/v8/value.cc +++ b/ext/v8/value.cc @@ -166,10 +166,9 @@ namespace rr { return Qfalse; } - // TODO - // if (handle->IsExternal()) { - // return External((v8::Handle)v8::External::Cast(*handle)); - // } + if (handle->IsExternal()) { + return External(isolate, handle); + } if (handle->IsUint32()) { return UInt32(handle->Uint32Value());