Make ScopedPersistent do type conversion.

This commit is contained in:
Cheng Zhao 2014-04-18 16:45:44 +08:00
parent 94dec0ff85
commit 9cc90ac7d5
2 changed files with 4 additions and 3 deletions

View file

@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "native_mate/wrappable.h"
#include "native_mate/function_template.h"
namespace mate {

View file

@ -18,8 +18,8 @@ class ScopedPersistent {
ScopedPersistent() {
}
explicit ScopedPersistent(v8::Handle<T> handle) {
reset(handle);
explicit ScopedPersistent(v8::Handle<v8::Value> handle) {
reset(v8::Handle<T>::Cast(handle));
}
~ScopedPersistent() {
@ -93,7 +93,7 @@ class RefCountedPersistent : public ScopedPersistent<T>,
public:
RefCountedPersistent() {}
explicit RefCountedPersistent(v8::Handle<T> handle)
explicit RefCountedPersistent(v8::Handle<v8::Value> handle)
: ScopedPersistent<T>(handle) {
}