| Index: include/v8.h
|
| ===================================================================
|
| --- include/v8.h (revision 3964)
|
| +++ include/v8.h (working copy)
|
| @@ -261,6 +261,10 @@
|
| 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 @@
|
| 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 @@
|
| 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.
|
| @@ -538,13 +550,13 @@
|
| * Compiles the specified script (context-independent).
|
| *
|
| * \param source Script source code.
|
| - * \param origin Script origin, owned by caller, no references are kept
|
| + * \param origin Script origin, owned by caller, no references are kept
|
| * when New() returns
|
| * \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile()
|
| * using pre_data speeds compilation if it's done multiple times.
|
| * Owned by caller, no references are kept when New() returns.
|
| * \param script_data Arbitrary data associated with script. Using
|
| - * this has same effect as calling SetData(), but allows data to be
|
| + * this has same effect as calling SetData(), but allows data to be
|
| * available to compile event handlers.
|
| * \return Compiled script object (context independent; when run it
|
| * will use the currently entered context).
|
| @@ -559,7 +571,7 @@
|
| * object (typically a string) as the script's origin.
|
| *
|
| * \param source Script source code.
|
| - * \patam file_name file name object (typically a string) to be used
|
| + * \param file_name file name object (typically a string) to be used
|
| * as the script's origin.
|
| * \return Compiled script object (context independent; when run it
|
| * will use the currently entered context).
|
| @@ -571,7 +583,7 @@
|
| * Compiles the specified script (bound to current context).
|
| *
|
| * \param source Script source code.
|
| - * \param origin Script origin, owned by caller, no references are kept
|
| + * \param origin Script origin, owned by caller, no references are kept
|
| * when Compile() returns
|
| * \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile()
|
| * using pre_data speeds compilation if it's done multiple times.
|
| @@ -755,6 +767,11 @@
|
| bool IsInt32() const;
|
|
|
| /**
|
| + * Returns true if this value is a 32-bit signed integer.
|
| + */
|
| + bool IsUint32() const;
|
| +
|
| + /**
|
| * Returns true if this value is a Date.
|
| */
|
| bool IsDate() const;
|
| @@ -1178,6 +1195,9 @@
|
| 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 +1212,8 @@
|
|
|
| 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);
|
| @@ -2442,6 +2464,16 @@
|
| static void TerminateExecution();
|
|
|
| /**
|
| + * Is V8 terminating JavaScript execution.
|
| + *
|
| + * Returns true if JavaScript execution is currently terminating
|
| + * because of a call to TerminateExecution. In that case there are
|
| + * still JavaScript frames on the stack and the termination
|
| + * exception is still active.
|
| + */
|
| + static bool IsExecutionTerminating();
|
| +
|
| + /**
|
| * Releases any resources used by v8 and stops any utility threads
|
| * that may be running. Note that disposing v8 is permanent, it
|
| * cannot be reinitialized.
|
| @@ -2473,6 +2505,14 @@
|
| */
|
| static void LowMemoryNotification();
|
|
|
| + /**
|
| + * Optional notification that a context has been disposed. V8 uses
|
| + * these notifications to guide the GC heuristic. Returns the number
|
| + * of context disposals - including this one - since the last time
|
| + * V8 had a chance to clean up.
|
| + */
|
| + static int ContextDisposedNotification();
|
| +
|
| private:
|
| V8();
|
|
|
|
|