From 9145a08395aa32fa2ca94660652aca9cdd7dd7ae Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 10 Aug 2014 11:20:41 +0800 Subject: [PATCH] Fix compilation error with node 0.10. --- native_mate/compat.h | 2 ++ native_mate/dictionary.cc | 4 ++-- native_mate/wrappable.cc | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/native_mate/compat.h b/native_mate/compat.h index 16b56b62dcf5..710171eb26cf 100644 --- a/native_mate/compat.h +++ b/native_mate/compat.h @@ -38,6 +38,7 @@ v8::Integer::NewFromUnsigned(isolate, data) #define MATE_EXTERNAL_NEW(isolate, data) v8::External::New(isolate, data) #define MATE_BOOLEAN_NEW(isolate, data) v8::Boolean::New(isolate, data) +#define MATE_OBJECT_NEW(isolate) v8::Object::New(isolate) #define MATE_SET_INTERNAL_FIELD_POINTER(object, index, value) \ object->SetAlignedPointerInInternalField(index, value) @@ -95,6 +96,7 @@ v8::Integer::NewFromUnsigned(data) #define MATE_EXTERNAL_NEW(isolate, data) v8::External::New(data) #define MATE_BOOLEAN_NEW(isolate, data) v8::Boolean::New(data) +#define MATE_OBJECT_NEW(isolate) v8::Object::New() #define MATE_SET_INTERNAL_FIELD_POINTER(object, index, value) \ object->SetPointerInInternalField(index, value) diff --git a/native_mate/dictionary.cc b/native_mate/dictionary.cc index 7ea17dd8fceb..1a1750ff12e5 100644 --- a/native_mate/dictionary.cc +++ b/native_mate/dictionary.cc @@ -8,7 +8,7 @@ namespace mate { Dictionary::Dictionary(v8::Isolate* isolate) : isolate_(isolate), - object_(v8::Object::New(isolate)) { + object_(MATE_OBJECT_NEW(isolate)) { } Dictionary::Dictionary(v8::Isolate* isolate, @@ -22,7 +22,7 @@ Dictionary::~Dictionary() { Dictionary Dictionary::CreateEmpty(v8::Isolate* isolate) { Dictionary dictionary(isolate); - dictionary.object_ = v8::Object::New(isolate); + dictionary.object_ = MATE_OBJECT_NEW(isolate); return dictionary; } diff --git a/native_mate/wrappable.cc b/native_mate/wrappable.cc index 9eed09cebfea..d783306c45be 100644 --- a/native_mate/wrappable.cc +++ b/native_mate/wrappable.cc @@ -44,7 +44,7 @@ ObjectTemplateBuilder Wrappable::GetObjectTemplateBuilder( // static MATE_WEAK_CALLBACK(Wrappable::WeakCallback, v8::Object, Wrappable) { MATE_WEAK_CALLBACK_INIT(Wrappable); - self->wrapper_.Reset(); + MATE_PERSISTENT_RESET(self->wrapper_); delete self; }