v8.h   v8.h 
skipping to change at line 577 skipping to change at line 577
* and create a new one with the contents of other if other is non empty * and create a new one with the contents of other if other is non empty
*/ */
template <class S> template <class S>
V8_INLINE void Reset(Isolate* isolate, const Handle<S>& other); V8_INLINE void Reset(Isolate* isolate, const Handle<S>& other);
/** /**
* If non-empty, destroy the underlying storage cell * If non-empty, destroy the underlying storage cell
* and create a new one with the contents of other if other is non empty * and create a new one with the contents of other if other is non empty
*/ */
template <class S, class M2> template <class S, class M2>
V8_INLINE void Reset(Isolate* isolate, const Persistent<S, M2>& other); V8_INLINE void Reset(Isolate* isolate, const Persistent<S, M2>& other);
// TODO(dcarney): deprecate
V8_INLINE void Dispose() { Reset(); } V8_DEPRECATED("Use Reset instead",
V8_INLINE void Dispose()) { Reset(); }
V8_INLINE bool IsEmpty() const { return val_ == 0; } V8_INLINE bool IsEmpty() const { return val_ == 0; }
// TODO(dcarney): this is pretty useless, fix or remove // TODO(dcarney): this is pretty useless, fix or remove
template <class S> template <class S>
V8_INLINE static Persistent<T>& Cast(Persistent<S>& that) { // NOLINT V8_INLINE static Persistent<T>& Cast(Persistent<S>& that) { // NOLINT
#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()) T::Cast(*that); if (!that.IsEmpty()) T::Cast(*that);
skipping to change at line 634 skipping to change at line 635
template<typename P> template<typename P>
V8_INLINE void SetWeak( V8_INLINE void SetWeak(
P* parameter, P* parameter,
typename WeakCallbackData<T, P>::Callback callback); typename WeakCallbackData<T, P>::Callback callback);
template<typename S, typename P> template<typename S, typename P>
V8_INLINE void SetWeak( V8_INLINE void SetWeak(
P* parameter, P* parameter,
typename WeakCallbackData<S, P>::Callback callback); typename WeakCallbackData<S, P>::Callback callback);
// TODO(dcarney): deprecate
template<typename S, typename P> template<typename S, typename P>
V8_INLINE void MakeWeak( V8_DEPRECATED(
P* parameter, "Use SetWeak instead",
typename WeakReferenceCallbacks<S, P>::Revivable callback); V8_INLINE void MakeWeak(
P* parameter,
typename WeakReferenceCallbacks<S, P>::Revivable callback));
// TODO(dcarney): deprecate
template<typename P> template<typename P>
V8_INLINE void MakeWeak( V8_DEPRECATED(
P* parameter, "Use SetWeak instead",
typename WeakReferenceCallbacks<T, P>::Revivable callback); V8_INLINE void MakeWeak(
P* parameter,
typename WeakReferenceCallbacks<T, P>::Revivable callback));
V8_INLINE void ClearWeak(); V8_INLINE void ClearWeak();
/** /**
* Marks the reference to this object independent. Garbage collector is f ree * Marks the reference to this object independent. Garbage collector is f ree
* to ignore any object groups containing this object. Weak callback for an * to ignore any object groups containing this object. Weak callback for an
* independent handle should not assume that it will be preceded by a glo bal * independent handle should not assume that it will be preceded by a glo bal
* GC prologue callback or followed by a global GC epilogue callback. * GC prologue callback or followed by a global GC epilogue callback.
*/ */
V8_INLINE void MarkIndependent(); V8_INLINE void MarkIndependent();
skipping to change at line 686 skipping to change at line 689
* description in v8-profiler.h for details. * description in v8-profiler.h for details.
*/ */
V8_INLINE void SetWrapperClassId(uint16_t class_id); V8_INLINE void SetWrapperClassId(uint16_t class_id);
/** /**
* Returns the class ID previously assigned to this handle or 0 if no cla ss ID * Returns the class ID previously assigned to this handle or 0 if no cla ss ID
* was previously assigned. * was previously assigned.
*/ */
V8_INLINE uint16_t WrapperClassId() const; V8_INLINE uint16_t WrapperClassId() const;
// TODO(dcarney): remove V8_DEPRECATED("This will be removed",
V8_INLINE T* ClearAndLeak(); V8_INLINE T* ClearAndLeak());
// TODO(dcarney): remove V8_DEPRECATED("This will be removed",
V8_INLINE void Clear() { val_ = 0; } V8_INLINE void Clear()) { val_ = 0; }
// TODO(dcarney): remove // TODO(dcarney): remove
#ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR #ifndef V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR
private: private:
#endif #endif
template <class S> V8_INLINE Persistent(S* that) : val_(that) { } template <class S> V8_INLINE Persistent(S* that) : val_(that) { }
V8_INLINE T* operator*() const { return val_; } V8_INLINE T* operator*() const { return val_; }
skipping to change at line 735 skipping to change at line 738
* garbage collector will no longer track the object stored in the * garbage collector will no longer track the object stored in the
* handle and may deallocate it. The behavior of accessing a handle * handle and may deallocate it. The behavior of accessing a handle
* for which the handle scope has been deleted is undefined. * for which the handle scope has been deleted is undefined.
*/ */
class V8_EXPORT HandleScope { class V8_EXPORT HandleScope {
public: public:
HandleScope(Isolate* isolate); HandleScope(Isolate* isolate);
~HandleScope(); ~HandleScope();
// TODO(dcarney): deprecated - use EscapableHandleScope::Escape. template <class T>
template <class T> Local<T> Close(Handle<T> value); V8_DEPRECATED("Use EscapableHandleScope::Escape instead",
Local<T> Close(Handle<T> value));
/** /**
* Counts the number of allocated handles. * Counts the number of allocated handles.
*/ */
static int NumberOfHandles(); static int NumberOfHandles();
private: private:
/** /**
* Creates a new handle with the given value. * Creates a new handle with the given value.
*/ */
skipping to change at line 1019 skipping to change at line 1023
* Runs the script returning the resulting value. If the script is * Runs the script returning the resulting value. If the script is
* context independent (created using ::New) it will be run in the * context independent (created using ::New) it will be run in the
* currently entered context. If it is context specific (created * currently entered context. If it is context specific (created
* using ::Compile) it will be run in the context in which it was * using ::Compile) it will be run in the context in which it was
* compiled. * compiled.
*/ */
Local<Value> Run(); Local<Value> Run();
/** /**
* Returns the script id value. * Returns the script id value.
* DEPRECATED: Please use GetId().
*/ */
Local<Value> Id(); V8_DEPRECATED("Use GetId instead", Local<Value> Id());
/** /**
* Returns the script id. * Returns the script id.
*/ */
int GetId(); int GetId();
/** /**
* Associate an additional data object with the script. This is mainly us ed * Associate an additional data object with the script. This is mainly us ed
* with the debugger as this data object is only available through the * with the debugger as this data object is only available through the
* debugger API. * debugger API.
skipping to change at line 1797 skipping to change at line 1800
* The string is not modified if the operation fails. See NewExternal for * The string is not modified if the operation fails. See NewExternal for
* information on the lifetime of the resource. * information on the lifetime of the resource.
*/ */
bool MakeExternal(ExternalAsciiStringResource* resource); bool MakeExternal(ExternalAsciiStringResource* resource);
/** /**
* Returns true if this string can be made external. * Returns true if this string can be made external.
*/ */
bool CanMakeExternal(); bool CanMakeExternal();
// TODO(dcarney): deprecate
/** Creates an undetectable string from the supplied ASCII or UTF-8 data. */ /** Creates an undetectable string from the supplied ASCII or UTF-8 data. */
V8_INLINE static Local<String> NewUndetectable(const char* data, V8_DEPRECATED(
int length = -1); "Use NewFromUtf8 instead",
V8_INLINE static Local<String> NewUndetectable(const char* data,
int length = -1));
// TODO(dcarney): deprecate
/** Creates an undetectable string from the supplied 16-bit character cod es.*/ /** Creates an undetectable string from the supplied 16-bit character cod es.*/
V8_INLINE static Local<String> NewUndetectable(const uint16_t* data, V8_DEPRECATED(
int length = -1); "Use NewFromTwoByte instead",
V8_INLINE static Local<String> NewUndetectable(const uint16_t* data,
int length = -1));
/** /**
* Converts an object to a UTF-8-encoded character array. Useful if * Converts an object to a UTF-8-encoded character array. Useful if
* you want to print the object. If conversion to a string fails * you want to print the object. If conversion to a string fails
* (e.g. due to an exception in the toString() method of the object) * (e.g. due to an exception in the toString() method of the object)
* then the length() method returns 0 and the * operator returns * then the length() method returns 0 and the * operator returns
* NULL. * NULL.
*/ */
class V8_EXPORT Utf8Value { class V8_EXPORT Utf8Value {
public: public:
skipping to change at line 1839 skipping to change at line 1844
/** /**
* Converts an object to an ASCII string. * Converts an object to an ASCII string.
* Useful if you want to print the object. * Useful if you want to print the object.
* If conversion to a string fails (eg. due to an exception in the toStri ng() * If conversion to a string fails (eg. due to an exception in the toStri ng()
* method of the object) then the length() method returns 0 and the * ope rator * method of the object) then the length() method returns 0 and the * ope rator
* returns NULL. * returns NULL.
*/ */
class V8_EXPORT AsciiValue { class V8_EXPORT AsciiValue {
public: public:
// TODO(dcarney): deprecate V8_DEPRECATED("Use Utf8Value instead",
explicit AsciiValue(Handle<v8::Value> obj); explicit AsciiValue(Handle<v8::Value> obj));
~AsciiValue(); ~AsciiValue();
char* operator*() { return str_; } char* operator*() { return str_; }
const char* operator*() const { return str_; } const char* operator*() const { return str_; }
int length() const { return length_; } int length() const { return length_; }
private: private:
char* str_; char* str_;
int length_; int length_;
// Disallow copying and assigning. // Disallow copying and assigning.
AsciiValue(const AsciiValue&); AsciiValue(const AsciiValue&);
skipping to change at line 2444 skipping to change at line 2449
*/ */
int GetScriptLineNumber() const; int GetScriptLineNumber() const;
/** /**
* Returns zero based column number of function body and * Returns zero based column number of function body and
* kLineOffsetNotFound if no information available. * kLineOffsetNotFound if no information available.
*/ */
int GetScriptColumnNumber() const; int GetScriptColumnNumber() const;
/** /**
* Returns scriptId object. * Returns scriptId object.
* DEPRECATED: use ScriptId() instead.
*/ */
Handle<Value> GetScriptId() const; V8_DEPRECATED("Use ScriptId instead", Handle<Value> GetScriptId()) const;
/** /**
* Returns scriptId. * Returns scriptId.
*/ */
int ScriptId() const; int ScriptId() const;
ScriptOrigin GetScriptOrigin() const; ScriptOrigin GetScriptOrigin() const;
V8_INLINE static Function* Cast(Value* obj); V8_INLINE static Function* Cast(Value* obj);
static const int kLineOffsetNotFound; static const int kLineOffsetNotFound;
skipping to change at line 2794 skipping to change at line 2798
static void CheckCast(Value* obj); static void CheckCast(Value* obj);
}; };
/** /**
* An instance of the built-in Date constructor (ECMA-262, 15.9). * An instance of the built-in Date constructor (ECMA-262, 15.9).
*/ */
class V8_EXPORT Date : public Object { class V8_EXPORT Date : public Object {
public: public:
static Local<Value> New(double time); static Local<Value> New(double time);
// Deprecated, use Date::ValueOf() instead. V8_DEPRECATED(
// TODO(svenpanne) Actually deprecate when Chrome is adapted. "Use ValueOf instead",
double NumberValue() const { return ValueOf(); } double NumberValue()) const { return ValueOf(); }
/** /**
* A specialization of Value::NumberValue that is more efficient * A specialization of Value::NumberValue that is more efficient
* because we know the structure of this object. * because we know the structure of this object.
*/ */
double ValueOf() const; double ValueOf() const;
V8_INLINE static Date* Cast(v8::Value* obj); V8_INLINE static Date* Cast(v8::Value* obj);
/** /**
skipping to change at line 2831 skipping to change at line 2835
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
}; };
/** /**
* A Number object (ECMA-262, 4.3.21). * A Number object (ECMA-262, 4.3.21).
*/ */
class V8_EXPORT NumberObject : public Object { class V8_EXPORT NumberObject : public Object {
public: public:
static Local<Value> New(double value); static Local<Value> New(double value);
// Deprecated, use NumberObject::ValueOf() instead. V8_DEPRECATED(
// TODO(svenpanne) Actually deprecate when Chrome is adapted. "Use ValueOf instead",
double NumberValue() const { return ValueOf(); } double NumberValue()) const { return ValueOf(); }
/** /**
* Returns the Number held by the object. * Returns the Number held by the object.
*/ */
double ValueOf() const; double ValueOf() const;
V8_INLINE static NumberObject* Cast(v8::Value* obj); V8_INLINE static NumberObject* Cast(v8::Value* obj);
private: private:
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
}; };
/** /**
* A Boolean object (ECMA-262, 4.3.15). * A Boolean object (ECMA-262, 4.3.15).
*/ */
class V8_EXPORT BooleanObject : public Object { class V8_EXPORT BooleanObject : public Object {
public: public:
static Local<Value> New(bool value); static Local<Value> New(bool value);
// Deprecated, use BooleanObject::ValueOf() instead. V8_DEPRECATED(
// TODO(svenpanne) Actually deprecate when Chrome is adapted. "Use ValueOf instead",
bool BooleanValue() const { return ValueOf(); } bool BooleanValue()) const { return ValueOf(); }
/** /**
* Returns the Boolean held by the object. * Returns the Boolean held by the object.
*/ */
bool ValueOf() const; bool ValueOf() const;
V8_INLINE static BooleanObject* Cast(v8::Value* obj); V8_INLINE static BooleanObject* Cast(v8::Value* obj);
private: private:
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
}; };
/** /**
* A String object (ECMA-262, 4.3.18). * A String object (ECMA-262, 4.3.18).
*/ */
class V8_EXPORT StringObject : public Object { class V8_EXPORT StringObject : public Object {
public: public:
static Local<Value> New(Handle<String> value); static Local<Value> New(Handle<String> value);
// Deprecated, use StringObject::ValueOf() instead. V8_DEPRECATED(
// TODO(svenpanne) Actually deprecate when Chrome is adapted. "Use ValueOf instead",
Local<String> StringValue() const { return ValueOf(); } Local<String> StringValue()) const { return ValueOf(); }
/** /**
* Returns the String held by the object. * Returns the String held by the object.
*/ */
Local<String> ValueOf() const; Local<String> ValueOf() const;
V8_INLINE static StringObject* Cast(v8::Value* obj); V8_INLINE static StringObject* Cast(v8::Value* obj);
private: private:
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
skipping to change at line 2899 skipping to change at line 2903
/** /**
* A Symbol object (ECMA-262 edition 6). * A Symbol object (ECMA-262 edition 6).
* *
* This is an experimental feature. Use at your own risk. * This is an experimental feature. Use at your own risk.
*/ */
class V8_EXPORT SymbolObject : public Object { class V8_EXPORT SymbolObject : public Object {
public: public:
static Local<Value> New(Isolate* isolate, Handle<Symbol> value); static Local<Value> New(Isolate* isolate, Handle<Symbol> value);
// Deprecated, use SymbolObject::ValueOf() instead. V8_DEPRECATED(
// TODO(svenpanne) Actually deprecate when Chrome is adapted. "Use ValueOf instead",
Local<Symbol> SymbolValue() const { return ValueOf(); } Local<Symbol> SymbolValue()) const { return ValueOf(); }
/** /**
* Returns the Symbol held by the object. * Returns the Symbol held by the object.
*/ */
Local<Symbol> ValueOf() const; Local<Symbol> ValueOf() const;
V8_INLINE static SymbolObject* Cast(v8::Value* obj); V8_INLINE static SymbolObject* Cast(v8::Value* obj);
private: private:
static void CheckCast(v8::Value* obj); static void CheckCast(v8::Value* obj);
skipping to change at line 3691 skipping to change at line 3695
* Sets the given ResourceConstraints on the current isolate. * Sets the given ResourceConstraints on the current isolate.
*/ */
bool V8_EXPORT SetResourceConstraints(ResourceConstraints* constraints); bool V8_EXPORT SetResourceConstraints(ResourceConstraints* constraints);
// --- Exceptions --- // --- Exceptions ---
typedef void (*FatalErrorCallback)(const char* location, const char* messag e); typedef void (*FatalErrorCallback)(const char* location, const char* messag e);
typedef void (*MessageCallback)(Handle<Message> message, Handle<Value> erro r); typedef void (*MessageCallback)(Handle<Message> message, Handle<Value> erro r);
// TODO(dcarney): remove. Use Isolate::ThrowException instead. V8_DEPRECATED(
Handle<Value> V8_EXPORT ThrowException(Handle<Value> exception); "Use Isolate::ThrowException instead",
Handle<Value> V8_EXPORT ThrowException(Handle<Value> exception));
/** /**
* Create new error objects by calling the corresponding error object * Create new error objects by calling the corresponding error object
* constructor with the message. * constructor with the message.
*/ */
class V8_EXPORT Exception { class V8_EXPORT Exception {
public: public:
static Local<Value> RangeError(Handle<String> message); static Local<Value> RangeError(Handle<String> message);
static Local<Value> ReferenceError(Handle<String> message); static Local<Value> ReferenceError(Handle<String> message);
static Local<Value> SyntaxError(Handle<String> message); static Local<Value> SyntaxError(Handle<String> message);
skipping to change at line 4479 skipping to change at line 4484
* are not guaranteed to live past each call. The \p event_handler mu st * are not guaranteed to live past each call. The \p event_handler mu st
* copy strings and other parameters it needs to keep around. * copy strings and other parameters it needs to keep around.
* \note the set of events declared in JitCodeEvent::EventType is expecte d to * \note the set of events declared in JitCodeEvent::EventType is expecte d to
* grow over time, and the JitCodeEvent structure is expected to accr ue * grow over time, and the JitCodeEvent structure is expected to accr ue
* new members. The \p event_handler function must ignore event codes * new members. The \p event_handler function must ignore event codes
* it does not recognize to maintain future compatibility. * it does not recognize to maintain future compatibility.
*/ */
static void SetJitCodeEventHandler(JitCodeEventOptions options, static void SetJitCodeEventHandler(JitCodeEventOptions options,
JitCodeEventHandler event_handler); JitCodeEventHandler event_handler);
// TODO(svenpanne) Really deprecate me when Chrome is fixed. V8_DEPRECATED(
/** Deprecated. Use Isolate::AdjustAmountOfExternalAllocatedMemory instea "Use Isolate::AdjustAmountOfExternalAllocatedMemory instead",
d. */ static intptr_t AdjustAmountOfExternalAllocatedMemory(
static intptr_t AdjustAmountOfExternalAllocatedMemory( intptr_t change_in_bytes));
intptr_t change_in_bytes);
/** /**
* Forcefully terminate the current thread of JavaScript execution * Forcefully terminate the current thread of JavaScript execution
* in the given isolate. If no isolate is provided, the default * in the given isolate. If no isolate is provided, the default
* isolate is used. * isolate is used.
* *
* This method can be used by any thread even if that thread has not * This method can be used by any thread even if that thread has not
* acquired the V8 lock with a Locker object. * acquired the V8 lock with a Locker object.
* *
* \param isolate The isolate in which to terminate the current JS execut ion. * \param isolate The isolate in which to terminate the current JS execut ion.
skipping to change at line 4868 skipping to change at line 4873
/** /**
* Exit this context. Exiting the current context restores the * Exit this context. Exiting the current context restores the
* context that was in place when entering the current context. * context that was in place when entering the current context.
*/ */
void Exit(); void Exit();
/** Returns true if the context has experienced an out of memory situatio n. */ /** Returns true if the context has experienced an out of memory situatio n. */
bool HasOutOfMemoryException(); bool HasOutOfMemoryException();
// TODO(dcarney) Remove this function. V8_DEPRECATED("Use Isolate::InContext instead",
/** Deprecated. Use Isolate::InContext instead. */ static bool InContext());
static bool InContext();
/** Returns an isolate associated with a current context. */ /** Returns an isolate associated with a current context. */
v8::Isolate* GetIsolate(); v8::Isolate* GetIsolate();
/** /**
* Gets the embedder data with the given index, which must have been set by a * Gets the embedder data with the given index, which must have been set by a
* previous call to SetEmbedderData with the same index. Note that index 0 * previous call to SetEmbedderData with the same index. Note that index 0
* currently has a special meaning for Chrome's debugger. * currently has a special meaning for Chrome's debugger.
*/ */
V8_INLINE Local<Value> GetEmbedderData(int index); V8_INLINE Local<Value> GetEmbedderData(int index);
skipping to change at line 4941 skipping to change at line 4945
/** /**
* Stack-allocated class which sets the execution context for all * Stack-allocated class which sets the execution context for all
* operations executed within a local scope. * operations executed within a local scope.
*/ */
class Scope { class Scope {
public: public:
explicit V8_INLINE Scope(Handle<Context> context) : context_(context) { explicit V8_INLINE Scope(Handle<Context> context) : context_(context) {
context_->Enter(); context_->Enter();
} }
// TODO(dcarney): deprecate V8_DEPRECATED(
V8_INLINE Scope(Isolate* isolate, Persistent<Context>& context) // NOLI "Use Handle version instead",
NT V8_INLINE Scope(Isolate* isolate, Persistent<Context>& context)) //
NOLINT
: context_(Handle<Context>::New(isolate, context)) { : context_(Handle<Context>::New(isolate, context)) {
context_->Enter(); context_->Enter();
} }
V8_INLINE ~Scope() { context_->Exit(); } V8_INLINE ~Scope() { context_->Exit(); }
private: private:
Handle<Context> context_; Handle<Context> context_;
}; };
private: private:
 End of changes. 26 change blocks. 
56 lines changed or deleted 60 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/