Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index e8b19ec635a6b639afd57cc5ba0ed130aad6b090..0992f0bfc8199d765d8a1ca2702bb9bf4f8bac45 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -261,6 +261,10 @@ template <class T> class V8EXPORT_INLINE Handle { |
return Handle<T>(T::Cast(*that)); |
} |
+ template <class S> inline Handle<S> As() { |
+ return Handle<S>::Cast(*this); |
+ } |
+ |
private: |
T* val_; |
}; |
@@ -295,6 +299,10 @@ template <class T> class V8EXPORT_INLINE Local : public Handle<T> { |
return Local<T>(T::Cast(*that)); |
} |
+ template <class S> inline Local<S> As() { |
+ return Local<S>::Cast(*this); |
+ } |
+ |
/** Create a local handle for the content of another handle. |
* The referee is kept alive by the local handle even when |
* the original handle is destroyed/disposed. |
@@ -368,6 +376,10 @@ template <class T> class V8EXPORT_INLINE Persistent : public Handle<T> { |
return Persistent<T>(T::Cast(*that)); |
} |
+ template <class S> inline Persistent<S> As() { |
+ return Persistent<S>::Cast(*this); |
+ } |
+ |
/** |
* Creates a new persistent handle for an existing local or |
* persistent handle. |
@@ -1178,6 +1190,9 @@ class V8EXPORT Object : public Value { |
Handle<Value> value, |
PropertyAttribute attribs = None); |
+ bool Set(uint32_t index, |
+ Handle<Value> value); |
+ |
// Sets a local property on this object bypassing interceptors and |
// overriding accessors or read-only properties. |
// |
@@ -1192,6 +1207,8 @@ class V8EXPORT Object : public Value { |
Local<Value> Get(Handle<Value> key); |
+ Local<Value> Get(uint32_t index); |
+ |
// TODO(1245389): Replace the type-specific versions of these |
// functions with generic ones that accept a Handle<Value> key. |
bool Has(Handle<String> key); |