v8.h | v8.h | |||
---|---|---|---|---|
skipping to change at line 261 | skipping to change at line 261 | |||
template <class S> static inline Handle<T> Cast(Handle<S> that) { | template <class S> static inline Handle<T> Cast(Handle<S> that) { | |||
#ifdef V8_ENABLE_CHECKS | #ifdef V8_ENABLE_CHECKS | |||
// If we're going to perform the type check then we have to check | // If we're going to perform the type check then we have to check | |||
// that the handle isn't empty before doing the checked cast. | // that the handle isn't empty before doing the checked cast. | |||
if (that.IsEmpty()) return Handle<T>(); | if (that.IsEmpty()) return Handle<T>(); | |||
#endif | #endif | |||
return Handle<T>(T::Cast(*that)); | return Handle<T>(T::Cast(*that)); | |||
} | } | |||
template <class S> inline Handle<S> As() { | ||||
return Handle<S>::Cast(*this); | ||||
} | ||||
private: | private: | |||
T* val_; | T* val_; | |||
}; | }; | |||
/** | /** | |||
* A light-weight stack-allocated object handle. All operations | * A light-weight stack-allocated object handle. All operations | |||
* that return objects from within v8 return them in local handles. They | * that return objects from within v8 return them in local handles. They | |||
* are created within HandleScopes, and all local handles allocated within a | * are created within HandleScopes, and all local handles allocated within a | |||
* handle scope are destroyed when the handle scope is destroyed. Hence it | * handle scope are destroyed when the handle scope is destroyed. Hence it | |||
* is not necessary to explicitly deallocate local handles. | * is not necessary to explicitly deallocate local handles. | |||
skipping to change at line 294 | skipping to change at line 298 | |||
template <class S> inline Local(S* that) : Handle<T>(that) { } | template <class S> inline Local(S* that) : Handle<T>(that) { } | |||
template <class S> static inline Local<T> Cast(Local<S> that) { | template <class S> static inline Local<T> Cast(Local<S> that) { | |||
#ifdef V8_ENABLE_CHECKS | #ifdef V8_ENABLE_CHECKS | |||
// If we're going to perform the type check then we have to check | // If we're going to perform the type check then we have to check | |||
// that the handle isn't empty before doing the checked cast. | // that the handle isn't empty before doing the checked cast. | |||
if (that.IsEmpty()) return Local<T>(); | if (that.IsEmpty()) return Local<T>(); | |||
#endif | #endif | |||
return Local<T>(T::Cast(*that)); | 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. | /** Create a local handle for the content of another handle. | |||
* The referee is kept alive by the local handle even when | * The referee is kept alive by the local handle even when | |||
* the original handle is destroyed/disposed. | * the original handle is destroyed/disposed. | |||
*/ | */ | |||
inline static Local<T> New(Handle<T> that); | inline static Local<T> New(Handle<T> that); | |||
}; | }; | |||
/** | /** | |||
* An object reference that is independent of any handle scope. Where | * An object reference that is independent of any handle scope. Where | |||
* a Local handle only lives as long as the HandleScope in which it was | * a Local handle only lives as long as the HandleScope in which it was | |||
skipping to change at line 366 | skipping to change at line 374 | |||
template <class S> static inline Persistent<T> Cast(Persistent<S> that) { | template <class S> static inline Persistent<T> Cast(Persistent<S> that) { | |||
#ifdef V8_ENABLE_CHECKS | #ifdef V8_ENABLE_CHECKS | |||
// If we're going to perform the type check then we have to check | // If we're going to perform the type check then we have to check | |||
// that the handle isn't empty before doing the checked cast. | // that the handle isn't empty before doing the checked cast. | |||
if (that.IsEmpty()) return Persistent<T>(); | if (that.IsEmpty()) return Persistent<T>(); | |||
#endif | #endif | |||
return Persistent<T>(T::Cast(*that)); | 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 | * Creates a new persistent handle for an existing local or | |||
* persistent handle. | * persistent handle. | |||
*/ | */ | |||
inline static Persistent<T> New(Handle<T> that); | inline static Persistent<T> New(Handle<T> that); | |||
/** | /** | |||
* Releases the storage cell referenced by this persistent handle. | * Releases the storage cell referenced by this persistent handle. | |||
* Does not remove the reference to the cell from any handles. | * Does not remove the reference to the cell from any handles. | |||
* This handle's reference, and any any other references to the storage | * This handle's reference, and any any other references to the storage | |||
skipping to change at line 551 | skipping to change at line 563 | |||
static Local<Script> New(Handle<String> source, | static Local<Script> New(Handle<String> source, | |||
ScriptOrigin* origin = NULL, | ScriptOrigin* origin = NULL, | |||
ScriptData* pre_data = NULL, | ScriptData* pre_data = NULL, | |||
Handle<String> script_data = Handle<String>()); | Handle<String> script_data = Handle<String>()); | |||
/** | /** | |||
* Compiles the specified script using the specified file name | * Compiles the specified script using the specified file name | |||
* object (typically a string) as the script's origin. | * object (typically a string) as the script's origin. | |||
* | * | |||
* \param source Script source code. | * \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. | * as the script's origin. | |||
* \return Compiled script object (context independent; when run it | * \return Compiled script object (context independent; when run it | |||
* will use the currently entered context). | * will use the currently entered context). | |||
*/ | */ | |||
static Local<Script> New(Handle<String> source, | static Local<Script> New(Handle<String> source, | |||
Handle<Value> file_name); | Handle<Value> file_name); | |||
/** | /** | |||
* Compiles the specified script (bound to current context). | * Compiles the specified script (bound to current context). | |||
* | * | |||
skipping to change at line 744 | skipping to change at line 756 | |||
* Returns true if this value is external. | * Returns true if this value is external. | |||
*/ | */ | |||
bool IsExternal() const; | bool IsExternal() const; | |||
/** | /** | |||
* Returns true if this value is a 32-bit signed integer. | * Returns true if this value is a 32-bit signed integer. | |||
*/ | */ | |||
bool IsInt32() const; | 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. | * Returns true if this value is a Date. | |||
*/ | */ | |||
bool IsDate() const; | bool IsDate() const; | |||
Local<Boolean> ToBoolean() const; | Local<Boolean> ToBoolean() const; | |||
Local<Number> ToNumber() const; | Local<Number> ToNumber() const; | |||
Local<String> ToString() const; | Local<String> ToString() const; | |||
Local<String> ToDetailString() const; | Local<String> ToDetailString() const; | |||
Local<Object> ToObject() const; | Local<Object> ToObject() const; | |||
Local<Integer> ToInteger() const; | Local<Integer> ToInteger() const; | |||
skipping to change at line 1158 | skipping to change at line 1175 | |||
/** | /** | |||
* A JavaScript object (ECMA-262, 4.3.3) | * A JavaScript object (ECMA-262, 4.3.3) | |||
*/ | */ | |||
class V8EXPORT Object : public Value { | class V8EXPORT Object : public Value { | |||
public: | public: | |||
bool Set(Handle<Value> key, | bool Set(Handle<Value> key, | |||
Handle<Value> value, | Handle<Value> value, | |||
PropertyAttribute attribs = None); | PropertyAttribute attribs = None); | |||
bool Set(uint32_t index, | ||||
Handle<Value> value); | ||||
// Sets a local property on this object bypassing interceptors and | // Sets a local property on this object bypassing interceptors and | |||
// overriding accessors or read-only properties. | // overriding accessors or read-only properties. | |||
// | // | |||
// Note that if the object has an interceptor the property will be set | // Note that if the object has an interceptor the property will be set | |||
// locally, but since the interceptor takes precedence the local property | // locally, but since the interceptor takes precedence the local property | |||
// will only be returned if the interceptor doesn't return a value. | // will only be returned if the interceptor doesn't return a value. | |||
// | // | |||
// Note also that this only works for named properties. | // Note also that this only works for named properties. | |||
bool ForceSet(Handle<Value> key, | bool ForceSet(Handle<Value> key, | |||
Handle<Value> value, | Handle<Value> value, | |||
PropertyAttribute attribs = None); | PropertyAttribute attribs = None); | |||
Local<Value> Get(Handle<Value> key); | Local<Value> Get(Handle<Value> key); | |||
Local<Value> Get(uint32_t index); | ||||
// TODO(1245389): Replace the type-specific versions of these | // TODO(1245389): Replace the type-specific versions of these | |||
// functions with generic ones that accept a Handle<Value> key. | // functions with generic ones that accept a Handle<Value> key. | |||
bool Has(Handle<String> key); | bool Has(Handle<String> key); | |||
bool Delete(Handle<String> key); | bool Delete(Handle<String> key); | |||
// Delete a property on this object bypassing interceptors and | // Delete a property on this object bypassing interceptors and | |||
// ignoring dont-delete attributes. | // ignoring dont-delete attributes. | |||
bool ForceDelete(Handle<Value> key); | bool ForceDelete(Handle<Value> key); | |||
skipping to change at line 2423 | skipping to change at line 2445 | |||
static bool IdleNotification(); | static bool IdleNotification(); | |||
/** | /** | |||
* Optional notification that the system is running low on memory. | * Optional notification that the system is running low on memory. | |||
* V8 uses these notifications to attempt to free memory. | * V8 uses these notifications to attempt to free memory. | |||
*/ | */ | |||
static void LowMemoryNotification(); | static void LowMemoryNotification(); | |||
/** | /** | |||
* Optional notification that a context has been disposed. V8 uses | * Optional notification that a context has been disposed. V8 uses | |||
* these notifications to guide the garbage collection heuristic. | * 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 void ContextDisposedNotification(); | static int ContextDisposedNotification(); | |||
private: | private: | |||
V8(); | V8(); | |||
static internal::Object** GlobalizeReference(internal::Object** handle); | static internal::Object** GlobalizeReference(internal::Object** handle); | |||
static void DisposeGlobal(internal::Object** global_handle); | static void DisposeGlobal(internal::Object** global_handle); | |||
static void MakeWeak(internal::Object** global_handle, | static void MakeWeak(internal::Object** global_handle, | |||
void* data, | void* data, | |||
WeakReferenceCallback); | WeakReferenceCallback); | |||
static void ClearWeak(internal::Object** global_handle); | static void ClearWeak(internal::Object** global_handle); | |||
End of changes. 9 change blocks. | ||||
3 lines changed or deleted | 27 lines changed or added | |||