Make ScopedPersistent do type conversion.
This commit is contained in:
parent
94dec0ff85
commit
9cc90ac7d5
2 changed files with 4 additions and 3 deletions
|
@ -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 {
|
||||
|
|
|
@ -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) {
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue