diff options
Diffstat (limited to 'V8Binding/v8/include/v8.h')
-rw-r--r-- | V8Binding/v8/include/v8.h | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/V8Binding/v8/include/v8.h b/V8Binding/v8/include/v8.h index 87ce2a2..8f22c81 100644 --- a/V8Binding/v8/include/v8.h +++ b/V8Binding/v8/include/v8.h @@ -212,9 +212,9 @@ template <class T> class V8EXPORT_INLINE Handle { */ bool IsEmpty() const { return val_ == 0; } - T* operator->() const; + T* operator->() const { return val_; } - T* operator*() const; + T* operator*() const { return val_; } /** * Sets the handle to be empty. IsEmpty() will then return true. @@ -1176,6 +1176,12 @@ class V8EXPORT Array : public Object { public: uint32_t Length() const; + /** + * Clones an element at index |index|. Returns an empty + * handle if cloning fails (for any reason). + */ + Local<Object> CloneElementAt(uint32_t index); + static Local<Array> New(int length = 0); static Array* Cast(Value* obj); private: @@ -2509,18 +2515,6 @@ void Persistent<T>::ClearWeak() { V8::ClearWeak(reinterpret_cast<void**>(**this)); } -template <class T> -T* Handle<T>::operator->() const { - return val_; -} - - -template <class T> -T* Handle<T>::operator*() const { - return val_; -} - - Local<Value> Arguments::operator[](int i) const { if (i < 0 || length_ <= i) return Local<Value>(*Undefined()); return Local<Value>(reinterpret_cast<Value*>(values_ - i)); |