mirror of
https://github.com/rubyjs/therubyracer
synced 2023-03-27 23:21:42 -04:00
make external fully integrated
This commit is contained in:
parent
fd61cb8f95
commit
ed982f0c52
3 changed files with 7 additions and 6 deletions
|
@ -3,7 +3,7 @@
|
|||
#define EXTERNAL_H
|
||||
|
||||
namespace rr {
|
||||
class External : Ref<v8::External> {
|
||||
class External : public Ref<v8::External> {
|
||||
public:
|
||||
|
||||
static void Init();
|
||||
|
@ -13,6 +13,8 @@ namespace rr {
|
|||
inline External(VALUE value) : Ref<v8::External>(value) {}
|
||||
inline External(v8::Isolate* isolate, v8::Handle<v8::External> handle) :
|
||||
Ref<v8::External>(isolate, handle) {}
|
||||
inline External(v8::Isolate* isolate, v8::Handle<v8::Value> value) :
|
||||
External(isolate, v8::Handle<v8::External>::Cast<v8::Value>(value)) {}
|
||||
|
||||
struct Container {
|
||||
Container(VALUE v) : object(v) {}
|
||||
|
|
|
@ -97,7 +97,7 @@ namespace rr {
|
|||
isolate(isolate), cell(new v8::Persistent<T>(isolate, handle)) {}
|
||||
|
||||
virtual ~Holder() {
|
||||
Isolate(isolate).scheduleDelete<T>(cell);
|
||||
Isolate(isolate).scheduleReleaseObject<T>(cell);
|
||||
}
|
||||
|
||||
v8::Isolate* isolate;
|
||||
|
|
|
@ -166,10 +166,9 @@ namespace rr {
|
|||
return Qfalse;
|
||||
}
|
||||
|
||||
// TODO
|
||||
// if (handle->IsExternal()) {
|
||||
// return External((v8::Handle<v8::External>)v8::External::Cast(*handle));
|
||||
// }
|
||||
if (handle->IsExternal()) {
|
||||
return External(isolate, handle);
|
||||
}
|
||||
|
||||
if (handle->IsUint32()) {
|
||||
return UInt32(handle->Uint32Value());
|
||||
|
|
Loading…
Add table
Reference in a new issue