* callbacks as their content becomes invalid. These objects are from the
* debugger event that started the debug message loop.
*/
- virtual Handle<Object> GetExecutionState() const = 0;
- virtual Handle<Object> GetEventData() const = 0;
+ virtual Local<Object> GetExecutionState() const = 0;
+ virtual Local<Object> GetEventData() const = 0;
/**
* Get the debugger protocol JSON.
*/
- virtual Handle<String> GetJSON() const = 0;
+ virtual Local<String> GetJSON() const = 0;
/**
* Get the context active when the debug event happened. Note this is not
* the current active context as the JavaScript part of the debugger is
* running in its own context which is entered at this point.
*/
- virtual Handle<Context> GetEventContext() const = 0;
+ virtual Local<Context> GetEventContext() const = 0;
/**
* Client data passed with the corresponding request if any. This is the
* Access to execution state and event data of the debug event. Don't store
* these cross callbacks as their content becomes invalid.
*/
- virtual Handle<Object> GetExecutionState() const = 0;
- virtual Handle<Object> GetEventData() const = 0;
+ virtual Local<Object> GetExecutionState() const = 0;
+ virtual Local<Object> GetEventData() const = 0;
/**
* Get the context active when the debug event happened. Note this is not
* the current active context as the JavaScript part of the debugger is
* running in its own context which is entered at this point.
*/
- virtual Handle<Context> GetEventContext() const = 0;
+ virtual Local<Context> GetEventContext() const = 0;
/**
* Client data passed with the corresponding callback when it was
* registered.
*/
- virtual Handle<Value> GetCallbackData() const = 0;
+ virtual Local<Value> GetCallbackData() const = 0;
/**
* Client data passed to DebugBreakForCommand function. The
typedef void (*DebugMessageDispatchHandler)();
static bool SetDebugEventListener(EventCallback that,
- Handle<Value> data = Handle<Value>());
+ Local<Value> data = Local<Value>());
// Schedule a debugger break to happen when JavaScript code is run
// in the given isolate.
*/
static V8_DEPRECATE_SOON(
"Use maybe version",
- Local<Value> Call(v8::Handle<v8::Function> fun,
- Handle<Value> data = Handle<Value>()));
+ Local<Value> Call(v8::Local<v8::Function> fun,
+ Local<Value> data = Local<Value>()));
// TODO(dcarney): data arg should be a MaybeLocal
static MaybeLocal<Value> Call(Local<Context> context,
- v8::Handle<v8::Function> fun,
- Handle<Value> data = Handle<Value>());
+ v8::Local<v8::Function> fun,
+ Local<Value> data = Local<Value>());
/**
* Returns a mirror object for the given object.
*/
static V8_DEPRECATE_SOON("Use maybe version",
- Local<Value> GetMirror(v8::Handle<v8::Value> obj));
+ Local<Value> GetMirror(v8::Local<v8::Value> obj));
static MaybeLocal<Value> GetMirror(Local<Context> context,
- v8::Handle<v8::Value> obj);
+ v8::Local<v8::Value> obj);
/**
* Makes V8 process all pending debug messages.
};
/** Returns function name (empty string for anonymous functions.) */
- Handle<String> GetFunctionName() const;
+ Local<String> GetFunctionName() const;
/** Returns id of the script where function is located. */
int GetScriptId() const;
/** Returns resource name for script from where the function originates. */
- Handle<String> GetScriptResourceName() const;
+ Local<String> GetScriptResourceName() const;
/**
* Returns the number, 1-based, of the line where the function originates.
class V8_EXPORT CpuProfile {
public:
/** Returns CPU profile title. */
- Handle<String> GetTitle() const;
+ Local<String> GetTitle() const;
/** Returns the root node of the top down call tree. */
const CpuProfileNode* GetTopDownRoot() const;
* |record_samples| parameter controls whether individual samples should
* be recorded in addition to the aggregated tree.
*/
- void StartProfiling(Handle<String> title, bool record_samples = false);
+ void StartProfiling(Local<String> title, bool record_samples = false);
/**
* Stops collecting CPU profile with a given title and returns it.
* If the title given is empty, finishes the last profile started.
*/
- CpuProfile* StopProfiling(Handle<String> title);
+ CpuProfile* StopProfiling(Local<String> title);
/**
* Tells the profiler whether the embedder is idle.
* Returns edge name. This can be a variable name, an element index, or
* a property name.
*/
- Handle<Value> GetName() const;
+ Local<Value> GetName() const;
/** Returns origin node. */
const HeapGraphNode* GetFromNode() const;
* of the constructor (for objects), the name of the function (for
* closures), string value, or an empty string (for compiled code).
*/
- Handle<String> GetName() const;
+ Local<String> GetName() const;
/**
* Returns node id. For the same heap object, the id remains the same
* while the callback is running: only getters on the handle and
* GetPointerFromInternalField on the objects are allowed.
*/
- typedef RetainedObjectInfo* (*WrapperInfoCallback)
- (uint16_t class_id, Handle<Value> wrapper);
+ typedef RetainedObjectInfo* (*WrapperInfoCallback)(uint16_t class_id,
+ Local<Value> wrapper);
/** Returns the number of snapshots taken. */
int GetSnapshotCount();
* Returns SnapshotObjectId for a heap object referenced by |value| if
* it has been seen by the heap profiler, kUnknownObjectId otherwise.
*/
- SnapshotObjectId GetObjectId(Handle<Value> value);
+ SnapshotObjectId GetObjectId(Local<Value> value);
/**
* Returns heap object with given SnapshotObjectId if the object is alive,
* otherwise empty handle is returned.
*/
- Handle<Value> FindObjectById(SnapshotObjectId id);
+ Local<Value> FindObjectById(SnapshotObjectId id);
/**
* Clears internal map from SnapshotObjectId to heap object. The new objects
* Returns name to be used in the heap snapshot for given node. Returned
* string must stay alive until snapshot collection is completed.
*/
- virtual const char* GetName(Handle<Object> object) = 0;
+ virtual const char* GetName(Local<Object> object) = 0;
+
protected:
virtual ~ObjectNameResolver() {}
};
: val_(reinterpret_cast<T*>(*that)) {
/**
* This check fails when trying to convert between incompatible
- * handles. For example, converting from a Handle<String> to a
- * Handle<Number>.
+ * handles. For example, converting from a Local<String> to a
+ * Local<Number>.
*/
TYPE_CHECK(T, S);
}
};
-// Handle is an alias for Local for historical reasons.
+#if !defined(V8_IMMINENT_DEPRECATION_WARNINGS)
+// Local is an alias for Local for historical reasons.
template <class T>
using Handle = Local<T>;
+#endif
/**
* and create a new one with the contents of other if other is non empty
*/
template <class S>
- V8_INLINE void Reset(Isolate* isolate, const Handle<S>& other);
+ V8_INLINE void Reset(Isolate* isolate, const Local<S>& other);
/**
* If non-empty, destroy the underlying storage cell
return *a == *b;
}
- template <class S> V8_INLINE bool operator==(const Handle<S>& that) const {
+ template <class S>
+ V8_INLINE bool operator==(const Local<S>& that) const {
internal::Object** a = reinterpret_cast<internal::Object**>(this->val_);
internal::Object** b = reinterpret_cast<internal::Object**>(that.val_);
if (a == NULL) return b == NULL;
return !operator==(that);
}
- template <class S> V8_INLINE bool operator!=(const Handle<S>& that) const {
+ template <class S>
+ V8_INLINE bool operator!=(const Local<S>& that) const {
return !operator==(that);
}
*/
V8_INLINE Persistent() : PersistentBase<T>(0) { }
/**
- * Construct a Persistent from a Handle.
- * When the Handle is non-empty, a new storage cell is created
+ * Construct a Persistent from a Local.
+ * When the Local is non-empty, a new storage cell is created
* pointing to the same object, and no flags are set.
*/
- template <class S> V8_INLINE Persistent(Isolate* isolate, Handle<S> that)
+ template <class S>
+ V8_INLINE Persistent(Isolate* isolate, Local<S> that)
: PersistentBase<T>(PersistentBase<T>::New(isolate, *that)) {
TYPE_CHECK(T, S);
}
*/
V8_INLINE Global() : PersistentBase<T>(nullptr) {}
/**
- * Construct a Global from a Handle.
- * When the Handle is non-empty, a new storage cell is created
+ * Construct a Global from a Local.
+ * When the Local is non-empty, a new storage cell is created
* pointing to the same object, and no flags are set.
*/
template <class S>
- V8_INLINE Global(Isolate* isolate, Handle<S> that)
+ V8_INLINE Global(Isolate* isolate, Local<S> that)
: PersistentBase<T>(PersistentBase<T>::New(isolate, *that)) {
TYPE_CHECK(T, S);
}
class ScriptOrigin {
public:
V8_INLINE ScriptOrigin(
- Handle<Value> resource_name,
- Handle<Integer> resource_line_offset = Handle<Integer>(),
- Handle<Integer> resource_column_offset = Handle<Integer>(),
- Handle<Boolean> resource_is_shared_cross_origin = Handle<Boolean>(),
- Handle<Integer> script_id = Handle<Integer>(),
- Handle<Boolean> resource_is_embedder_debug_script = Handle<Boolean>(),
- Handle<Value> source_map_url = Handle<Value>(),
- Handle<Boolean> resource_is_opaque = Handle<Boolean>());
- V8_INLINE Handle<Value> ResourceName() const;
- V8_INLINE Handle<Integer> ResourceLineOffset() const;
- V8_INLINE Handle<Integer> ResourceColumnOffset() const;
+ Local<Value> resource_name,
+ Local<Integer> resource_line_offset = Local<Integer>(),
+ Local<Integer> resource_column_offset = Local<Integer>(),
+ Local<Boolean> resource_is_shared_cross_origin = Local<Boolean>(),
+ Local<Integer> script_id = Local<Integer>(),
+ Local<Boolean> resource_is_embedder_debug_script = Local<Boolean>(),
+ Local<Value> source_map_url = Local<Value>(),
+ Local<Boolean> resource_is_opaque = Local<Boolean>());
+ V8_INLINE Local<Value> ResourceName() const;
+ V8_INLINE Local<Integer> ResourceLineOffset() const;
+ V8_INLINE Local<Integer> ResourceColumnOffset() const;
/**
* Returns true for embedder's debugger scripts
*/
- V8_INLINE Handle<Integer> ScriptID() const;
- V8_INLINE Handle<Value> SourceMapUrl() const;
+ V8_INLINE Local<Integer> ScriptID() const;
+ V8_INLINE Local<Value> SourceMapUrl() const;
V8_INLINE ScriptOriginOptions Options() const { return options_; }
private:
- Handle<Value> resource_name_;
- Handle<Integer> resource_line_offset_;
- Handle<Integer> resource_column_offset_;
+ Local<Value> resource_name_;
+ Local<Integer> resource_line_offset_;
+ Local<Integer> resource_column_offset_;
ScriptOriginOptions options_;
- Handle<Integer> script_id_;
- Handle<Value> source_map_url_;
+ Local<Integer> script_id_;
+ Local<Value> source_map_url_;
};
Local<Script> BindToCurrentContext();
int GetId();
- Handle<Value> GetScriptName();
+ Local<Value> GetScriptName();
/**
* Data read from magic sourceURL comments.
*/
- Handle<Value> GetSourceURL();
+ Local<Value> GetSourceURL();
/**
* Data read from magic sourceMappingURL comments.
*/
- Handle<Value> GetSourceMappingURL();
+ Local<Value> GetSourceMappingURL();
/**
* Returns zero based line number of the code_pos location in the script.
*/
static V8_DEPRECATE_SOON(
"Use maybe version",
- Local<Script> Compile(Handle<String> source,
+ Local<Script> Compile(Local<String> source,
ScriptOrigin* origin = nullptr));
static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
- Local<Context> context, Handle<String> source,
+ Local<Context> context, Local<String> source,
ScriptOrigin* origin = nullptr);
static Local<Script> V8_DEPRECATE_SOON("Use maybe version",
- Compile(Handle<String> source,
- Handle<String> file_name));
+ Compile(Local<String> source,
+ Local<String> file_name));
/**
* Runs the script returning the resulting value. It will be run in the
Local<String> source_string;
// Origin information
- Handle<Value> resource_name;
- Handle<Integer> resource_line_offset;
- Handle<Integer> resource_column_offset;
+ Local<Value> resource_name;
+ Local<Integer> resource_line_offset;
+ Local<Integer> resource_column_offset;
ScriptOriginOptions resource_options;
- Handle<Value> source_map_url;
+ Local<Value> source_map_url;
// Cached data from previous compilation (if a kConsume*Cache flag is
// set), or hold newly generated cache data (kProduce*Cache flags) are
static V8_DEPRECATE_SOON(
"Use maybe version",
Local<Script> Compile(Isolate* isolate, StreamedSource* source,
- Handle<String> full_source_string,
+ Local<String> full_source_string,
const ScriptOrigin& origin));
static V8_WARN_UNUSED_RESULT MaybeLocal<Script> Compile(
Local<Context> context, StreamedSource* source,
- Handle<String> full_source_string, const ScriptOrigin& origin);
+ Local<String> full_source_string, const ScriptOrigin& origin);
/**
* Return a version tag for CachedData for the current V8 version & flags.
* Returns the resource name for the script from where the function causing
* the error originates.
*/
- Handle<Value> GetScriptResourceName() const;
+ Local<Value> GetScriptResourceName() const;
/**
* Exception stack trace. By default stack traces are not captured for
* uncaught exceptions. SetCaptureStackTraceForUncaughtExceptions allows
* to change this option.
*/
- Handle<StackTrace> GetStackTrace() const;
+ Local<StackTrace> GetStackTrace() const;
/**
* Returns the number, 1-based, of the line where the error occurred.
class V8_EXPORT NativeWeakMap : public Data {
public:
static Local<NativeWeakMap> New(Isolate* isolate);
- void Set(Handle<Value> key, Handle<Value> value);
- Local<Value> Get(Handle<Value> key);
- bool Has(Handle<Value> key);
- bool Delete(Handle<Value> key);
+ void Set(Local<Value> key, Local<Value> value);
+ Local<Value> Get(Local<Value> key);
+ bool Has(Local<Value> key);
+ bool Delete(Local<Value> key);
};
V8_DEPRECATE_SOON("Use maybe version", int32_t Int32Value() const);
/** JS == */
- V8_DEPRECATE_SOON("Use maybe version", bool Equals(Handle<Value> that) const);
+ V8_DEPRECATE_SOON("Use maybe version", bool Equals(Local<Value> that) const);
V8_WARN_UNUSED_RESULT Maybe<bool> Equals(Local<Context> context,
- Handle<Value> that) const;
- bool StrictEquals(Handle<Value> that) const;
- bool SameValue(Handle<Value> that) const;
+ Local<Value> that) const;
+ bool StrictEquals(Local<Value> that) const;
+ bool SameValue(Local<Value> that) const;
template <class T> V8_INLINE static Value* Cast(T* value);
public:
bool Value() const;
V8_INLINE static Boolean* Cast(v8::Value* obj);
- V8_INLINE static Handle<Boolean> New(Isolate* isolate, bool value);
+ V8_INLINE static Local<Boolean> New(Isolate* isolate, bool value);
+
private:
static void CheckCast(v8::Value* obj);
};
* Creates a new string by concatenating the left and the right strings
* passed in as parameters.
*/
- static Local<String> Concat(Handle<String> left, Handle<String> right);
+ static Local<String> Concat(Local<String> left, Local<String> right);
/**
* Creates a new external string using the data defined in the given
*/
class V8_EXPORT Utf8Value {
public:
- explicit Utf8Value(Handle<v8::Value> obj);
+ explicit Utf8Value(Local<v8::Value> obj);
~Utf8Value();
char* operator*() { return str_; }
const char* operator*() const { return str_; }
*/
class V8_EXPORT Value {
public:
- explicit Value(Handle<v8::Value> obj);
+ explicit Value(Local<v8::Value> obj);
~Value();
uint16_t* operator*() { return str_; }
const uint16_t* operator*() const { return str_; }
class V8_EXPORT Object : public Value {
public:
V8_DEPRECATE_SOON("Use maybe version",
- bool Set(Handle<Value> key, Handle<Value> value));
+ bool Set(Local<Value> key, Local<Value> value));
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
Local<Value> key, Local<Value> value);
V8_DEPRECATE_SOON("Use maybe version",
- bool Set(uint32_t index, Handle<Value> value));
+ bool Set(uint32_t index, Local<Value> value));
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
Local<Value> value);
//
// Note also that this only works for named properties.
V8_DEPRECATE_SOON("Use CreateDataProperty",
- bool ForceSet(Handle<Value> key, Handle<Value> value,
+ bool ForceSet(Local<Value> key, Local<Value> value,
PropertyAttribute attribs = None));
V8_DEPRECATE_SOON("Use CreateDataProperty",
Maybe<bool> ForceSet(Local<Context> context,
Local<Value> key, Local<Value> value,
PropertyAttribute attribs = None));
- V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Handle<Value> key));
+ V8_DEPRECATE_SOON("Use maybe version", Local<Value> Get(Local<Value> key));
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
Local<Value> key);
* None when the property doesn't exist.
*/
V8_DEPRECATE_SOON("Use maybe version",
- PropertyAttribute GetPropertyAttributes(Handle<Value> key));
+ PropertyAttribute GetPropertyAttributes(Local<Value> key));
V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute> GetPropertyAttributes(
Local<Context> context, Local<Value> key);
V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetOwnPropertyDescriptor(
Local<Context> context, Local<String> key);
- V8_DEPRECATE_SOON("Use maybe version", bool Has(Handle<Value> key));
+ V8_DEPRECATE_SOON("Use maybe version", bool Has(Local<Value> key));
V8_WARN_UNUSED_RESULT Maybe<bool> Has(Local<Context> context,
Local<Value> key);
- V8_DEPRECATE_SOON("Use maybe version", bool Delete(Handle<Value> key));
+ V8_DEPRECATE_SOON("Use maybe version", bool Delete(Local<Value> key));
// TODO(dcarney): mark V8_WARN_UNUSED_RESULT
Maybe<bool> Delete(Local<Context> context, Local<Value> key);
Maybe<bool> Delete(Local<Context> context, uint32_t index);
V8_DEPRECATE_SOON("Use maybe version",
- bool SetAccessor(Handle<String> name,
+ bool SetAccessor(Local<String> name,
AccessorGetterCallback getter,
AccessorSetterCallback setter = 0,
- Handle<Value> data = Handle<Value>(),
+ Local<Value> data = Local<Value>(),
AccessControl settings = DEFAULT,
PropertyAttribute attribute = None));
V8_DEPRECATE_SOON("Use maybe version",
- bool SetAccessor(Handle<Name> name,
+ bool SetAccessor(Local<Name> name,
AccessorNameGetterCallback getter,
AccessorNameSetterCallback setter = 0,
- Handle<Value> data = Handle<Value>(),
+ Local<Value> data = Local<Value>(),
AccessControl settings = DEFAULT,
PropertyAttribute attribute = None));
// TODO(dcarney): mark V8_WARN_UNUSED_RESULT
AccessControl settings = DEFAULT,
PropertyAttribute attribute = None);
- void SetAccessorProperty(Local<Name> name,
- Local<Function> getter,
- Handle<Function> setter = Handle<Function>(),
+ void SetAccessorProperty(Local<Name> name, Local<Function> getter,
+ Local<Function> setter = Local<Function>(),
PropertyAttribute attribute = None,
AccessControl settings = DEFAULT);
* handler.
*/
V8_DEPRECATE_SOON("Use maybe version",
- bool SetPrototype(Handle<Value> prototype));
+ bool SetPrototype(Local<Value> prototype));
V8_WARN_UNUSED_RESULT Maybe<bool> SetPrototype(Local<Context> context,
Local<Value> prototype);
* Finds an instance of the given function template in the prototype
* chain.
*/
- Local<Object> FindInstanceInPrototypeChain(Handle<FunctionTemplate> tmpl);
+ Local<Object> FindInstanceInPrototypeChain(Local<FunctionTemplate> tmpl);
/**
* Call builtin Object.prototype.toString on this object.
V8_INLINE Local<Value> GetInternalField(int index);
/** Sets the value in an internal field. */
- void SetInternalField(int index, Handle<Value> value);
+ void SetInternalField(int index, Local<Value> value);
/**
* Gets a 2-byte-aligned native pointer from an internal field. This field
// Testers for local properties.
V8_DEPRECATE_SOON("Use maybe version",
- bool HasOwnProperty(Handle<String> key));
+ bool HasOwnProperty(Local<String> key));
V8_WARN_UNUSED_RESULT Maybe<bool> HasOwnProperty(Local<Context> context,
Local<Name> key);
V8_DEPRECATE_SOON("Use maybe version",
- bool HasRealNamedProperty(Handle<String> key));
+ bool HasRealNamedProperty(Local<String> key));
V8_WARN_UNUSED_RESULT Maybe<bool> HasRealNamedProperty(Local<Context> context,
Local<Name> key);
V8_DEPRECATE_SOON("Use maybe version",
V8_WARN_UNUSED_RESULT Maybe<bool> HasRealIndexedProperty(
Local<Context> context, uint32_t index);
V8_DEPRECATE_SOON("Use maybe version",
- bool HasRealNamedCallbackProperty(Handle<String> key));
+ bool HasRealNamedCallbackProperty(Local<String> key));
V8_WARN_UNUSED_RESULT Maybe<bool> HasRealNamedCallbackProperty(
Local<Context> context, Local<Name> key);
*/
V8_DEPRECATE_SOON(
"Use maybe version",
- Local<Value> GetRealNamedPropertyInPrototypeChain(Handle<String> key));
+ Local<Value> GetRealNamedPropertyInPrototypeChain(Local<String> key));
V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedPropertyInPrototypeChain(
Local<Context> context, Local<Name> key);
V8_DEPRECATE_SOON(
"Use maybe version",
Maybe<PropertyAttribute> GetRealNamedPropertyAttributesInPrototypeChain(
- Handle<String> key));
+ Local<String> key));
V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute>
GetRealNamedPropertyAttributesInPrototypeChain(Local<Context> context,
Local<Name> key);
* This means interceptors in the prototype chain are not called.
*/
V8_DEPRECATE_SOON("Use maybe version",
- Local<Value> GetRealNamedProperty(Handle<String> key));
+ Local<Value> GetRealNamedProperty(Local<String> key));
V8_WARN_UNUSED_RESULT MaybeLocal<Value> GetRealNamedProperty(
Local<Context> context, Local<Name> key);
*/
V8_DEPRECATE_SOON("Use maybe version",
Maybe<PropertyAttribute> GetRealNamedPropertyAttributes(
- Handle<String> key));
+ Local<String> key));
V8_WARN_UNUSED_RESULT Maybe<PropertyAttribute> GetRealNamedPropertyAttributes(
Local<Context> context, Local<Name> key);
* identity hash) are prefixed with "v8::".
*/
// TODO(dcarney): convert these to take a isolate and optionally bailout?
- bool SetHiddenValue(Handle<String> key, Handle<Value> value);
- Local<Value> GetHiddenValue(Handle<String> key);
- bool DeleteHiddenValue(Handle<String> key);
+ bool SetHiddenValue(Local<String> key, Local<Value> value);
+ Local<Value> GetHiddenValue(Local<String> key);
+ bool DeleteHiddenValue(Local<String> key);
/**
* Clone this object with a fast but shallow copy. Values will point
* ObjectTemplate::SetCallAsFunctionHandler method.
*/
V8_DEPRECATE_SOON("Use maybe version",
- Local<Value> CallAsFunction(Handle<Value> recv, int argc,
- Handle<Value> argv[]));
+ Local<Value> CallAsFunction(Local<Value> recv, int argc,
+ Local<Value> argv[]));
V8_WARN_UNUSED_RESULT MaybeLocal<Value> CallAsFunction(Local<Context> context,
- Handle<Value> recv,
+ Local<Value> recv,
int argc,
- Handle<Value> argv[]);
+ Local<Value> argv[]);
/**
* Call an Object as a constructor if a callback is set by the
*/
V8_DEPRECATE_SOON("Use maybe version",
Local<Value> CallAsConstructor(int argc,
- Handle<Value> argv[]));
+ Local<Value> argv[]));
V8_WARN_UNUSED_RESULT MaybeLocal<Value> CallAsConstructor(
Local<Context> context, int argc, Local<Value> argv[]);
: value_(that.value_) {
TYPE_CHECK(T, S);
}
- // Handle setters
+ // Local setters
template <typename S>
V8_INLINE V8_DEPRECATE_SOON("Use Global<> instead",
void Set(const Persistent<S>& handle));
Local<Value> data = Local<Value>(), int length = 0));
V8_DEPRECATE_SOON("Use maybe version",
- Local<Object> NewInstance(int argc, Handle<Value> argv[])
+ Local<Object> NewInstance(int argc, Local<Value> argv[])
const);
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
- Local<Context> context, int argc, Handle<Value> argv[]) const;
+ Local<Context> context, int argc, Local<Value> argv[]) const;
V8_DEPRECATE_SOON("Use maybe version", Local<Object> NewInstance() const);
V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(
}
V8_DEPRECATE_SOON("Use maybe version",
- Local<Value> Call(Handle<Value> recv, int argc,
- Handle<Value> argv[]));
+ Local<Value> Call(Local<Value> recv, int argc,
+ Local<Value> argv[]));
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Call(Local<Context> context,
- Handle<Value> recv, int argc,
- Handle<Value> argv[]);
+ Local<Value> recv, int argc,
+ Local<Value> argv[]);
- void SetName(Handle<String> name);
- Handle<Value> GetName() const;
+ void SetName(Local<String> name);
+ Local<Value> GetName() const;
/**
* Name inferred from variable or property assignment of this function.
* in an OO style, where many functions are anonymous but are assigned
* to object properties.
*/
- Handle<Value> GetInferredName() const;
+ Local<Value> GetInferredName() const;
/**
* User-defined name assigned to the "displayName" property of this function.
* Used to facilitate debugging and profiling of JavaScript code.
*/
- Handle<Value> GetDisplayName() const;
+ Local<Value> GetDisplayName() const;
/**
* Returns zero based line number of function body and
* Resolve/reject the associated promise with a given value.
* Ignored if the promise is no longer pending.
*/
- V8_DEPRECATE_SOON("Use maybe version", void Resolve(Handle<Value> value));
+ V8_DEPRECATE_SOON("Use maybe version", void Resolve(Local<Value> value));
// TODO(dcarney): mark V8_WARN_UNUSED_RESULT
- Maybe<bool> Resolve(Local<Context> context, Handle<Value> value);
+ Maybe<bool> Resolve(Local<Context> context, Local<Value> value);
- V8_DEPRECATE_SOON("Use maybe version", void Reject(Handle<Value> value));
+ V8_DEPRECATE_SOON("Use maybe version", void Reject(Local<Value> value));
// TODO(dcarney): mark V8_WARN_UNUSED_RESULT
- Maybe<bool> Reject(Local<Context> context, Handle<Value> value);
+ Maybe<bool> Reject(Local<Context> context, Local<Value> value);
V8_INLINE static Resolver* Cast(Value* obj);
* invoked at the end of turn.
*/
V8_DEPRECATE_SOON("Use maybe version",
- Local<Promise> Chain(Handle<Function> handler));
+ Local<Promise> Chain(Local<Function> handler));
V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Chain(Local<Context> context,
- Handle<Function> handler);
+ Local<Function> handler);
V8_DEPRECATE_SOON("Use maybe version",
- Local<Promise> Catch(Handle<Function> handler));
+ Local<Promise> Catch(Local<Function> handler));
V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Catch(Local<Context> context,
- Handle<Function> handler);
+ Local<Function> handler);
V8_DEPRECATE_SOON("Use maybe version",
- Local<Promise> Then(Handle<Function> handler));
+ Local<Promise> Then(Local<Function> handler));
V8_WARN_UNUSED_RESULT MaybeLocal<Promise> Then(Local<Context> context,
- Handle<Function> handler);
+ Local<Function> handler);
/**
* Returns true if the promise has at least one derived promise, and
*/
class V8_EXPORT Uint8Array : public TypedArray {
public:
- static Local<Uint8Array> New(Handle<ArrayBuffer> array_buffer,
+ static Local<Uint8Array> New(Local<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length);
- static Local<Uint8Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
+ static Local<Uint8Array> New(Local<SharedArrayBuffer> shared_array_buffer,
size_t byte_offset, size_t length);
V8_INLINE static Uint8Array* Cast(Value* obj);
*/
class V8_EXPORT Uint8ClampedArray : public TypedArray {
public:
- static Local<Uint8ClampedArray> New(Handle<ArrayBuffer> array_buffer,
- size_t byte_offset, size_t length);
+ static Local<Uint8ClampedArray> New(Local<ArrayBuffer> array_buffer,
+ size_t byte_offset, size_t length);
static Local<Uint8ClampedArray> New(
- Handle<SharedArrayBuffer> shared_array_buffer, size_t byte_offset,
+ Local<SharedArrayBuffer> shared_array_buffer, size_t byte_offset,
size_t length);
V8_INLINE static Uint8ClampedArray* Cast(Value* obj);
*/
class V8_EXPORT Int8Array : public TypedArray {
public:
- static Local<Int8Array> New(Handle<ArrayBuffer> array_buffer,
- size_t byte_offset, size_t length);
- static Local<Int8Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
+ static Local<Int8Array> New(Local<ArrayBuffer> array_buffer,
+ size_t byte_offset, size_t length);
+ static Local<Int8Array> New(Local<SharedArrayBuffer> shared_array_buffer,
size_t byte_offset, size_t length);
V8_INLINE static Int8Array* Cast(Value* obj);
*/
class V8_EXPORT Uint16Array : public TypedArray {
public:
- static Local<Uint16Array> New(Handle<ArrayBuffer> array_buffer,
- size_t byte_offset, size_t length);
- static Local<Uint16Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
+ static Local<Uint16Array> New(Local<ArrayBuffer> array_buffer,
+ size_t byte_offset, size_t length);
+ static Local<Uint16Array> New(Local<SharedArrayBuffer> shared_array_buffer,
size_t byte_offset, size_t length);
V8_INLINE static Uint16Array* Cast(Value* obj);
*/
class V8_EXPORT Int16Array : public TypedArray {
public:
- static Local<Int16Array> New(Handle<ArrayBuffer> array_buffer,
+ static Local<Int16Array> New(Local<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length);
- static Local<Int16Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
+ static Local<Int16Array> New(Local<SharedArrayBuffer> shared_array_buffer,
size_t byte_offset, size_t length);
V8_INLINE static Int16Array* Cast(Value* obj);
*/
class V8_EXPORT Uint32Array : public TypedArray {
public:
- static Local<Uint32Array> New(Handle<ArrayBuffer> array_buffer,
- size_t byte_offset, size_t length);
- static Local<Uint32Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
+ static Local<Uint32Array> New(Local<ArrayBuffer> array_buffer,
+ size_t byte_offset, size_t length);
+ static Local<Uint32Array> New(Local<SharedArrayBuffer> shared_array_buffer,
size_t byte_offset, size_t length);
V8_INLINE static Uint32Array* Cast(Value* obj);
*/
class V8_EXPORT Int32Array : public TypedArray {
public:
- static Local<Int32Array> New(Handle<ArrayBuffer> array_buffer,
+ static Local<Int32Array> New(Local<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length);
- static Local<Int32Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
+ static Local<Int32Array> New(Local<SharedArrayBuffer> shared_array_buffer,
size_t byte_offset, size_t length);
V8_INLINE static Int32Array* Cast(Value* obj);
*/
class V8_EXPORT Float32Array : public TypedArray {
public:
- static Local<Float32Array> New(Handle<ArrayBuffer> array_buffer,
- size_t byte_offset, size_t length);
- static Local<Float32Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
+ static Local<Float32Array> New(Local<ArrayBuffer> array_buffer,
+ size_t byte_offset, size_t length);
+ static Local<Float32Array> New(Local<SharedArrayBuffer> shared_array_buffer,
size_t byte_offset, size_t length);
V8_INLINE static Float32Array* Cast(Value* obj);
*/
class V8_EXPORT Float64Array : public TypedArray {
public:
- static Local<Float64Array> New(Handle<ArrayBuffer> array_buffer,
- size_t byte_offset, size_t length);
- static Local<Float64Array> New(Handle<SharedArrayBuffer> shared_array_buffer,
+ static Local<Float64Array> New(Local<ArrayBuffer> array_buffer,
+ size_t byte_offset, size_t length);
+ static Local<Float64Array> New(Local<SharedArrayBuffer> shared_array_buffer,
size_t byte_offset, size_t length);
V8_INLINE static Float64Array* Cast(Value* obj);
*/
class V8_EXPORT DataView : public ArrayBufferView {
public:
- static Local<DataView> New(Handle<ArrayBuffer> array_buffer,
+ static Local<DataView> New(Local<ArrayBuffer> array_buffer,
size_t byte_offset, size_t length);
- static Local<DataView> New(Handle<SharedArrayBuffer> shared_array_buffer,
+ static Local<DataView> New(Local<SharedArrayBuffer> shared_array_buffer,
size_t byte_offset, size_t length);
V8_INLINE static DataView* Cast(Value* obj);
*/
class V8_EXPORT StringObject : public Object {
public:
- static Local<Value> New(Handle<String> value);
+ static Local<Value> New(Local<String> value);
Local<String> ValueOf() const;
*/
class V8_EXPORT SymbolObject : public Object {
public:
- static Local<Value> New(Isolate* isolate, Handle<Symbol> value);
+ static Local<Value> New(Isolate* isolate, Local<Symbol> value);
Local<Symbol> ValueOf() const;
* is equivalent to evaluating "/foo/gm".
*/
static V8_DEPRECATE_SOON("Use maybe version",
- Local<RegExp> New(Handle<String> pattern,
+ Local<RegExp> New(Local<String> pattern,
Flags flags));
static V8_WARN_UNUSED_RESULT MaybeLocal<RegExp> New(Local<Context> context,
- Handle<String> pattern,
+ Local<String> pattern,
Flags flags);
/**
class V8_EXPORT Template : public Data {
public:
/** Adds a property to each instance created by this template.*/
- void Set(Handle<Name> name, Handle<Data> value,
+ void Set(Local<Name> name, Local<Data> value,
PropertyAttribute attributes = None);
- V8_INLINE void Set(Isolate* isolate, const char* name, Handle<Data> value);
+ V8_INLINE void Set(Isolate* isolate, const char* name, Local<Data> value);
void SetAccessorProperty(
Local<Name> name,
* defined by FunctionTemplate::HasInstance()), an implicit TypeError is
* thrown and no callback is invoked.
*/
- void SetNativeDataProperty(Local<String> name,
- AccessorGetterCallback getter,
- AccessorSetterCallback setter = 0,
- // TODO(dcarney): gcc can't handle Local below
- Handle<Value> data = Handle<Value>(),
- PropertyAttribute attribute = None,
- Local<AccessorSignature> signature =
- Local<AccessorSignature>(),
- AccessControl settings = DEFAULT);
- void SetNativeDataProperty(Local<Name> name,
- AccessorNameGetterCallback getter,
- AccessorNameSetterCallback setter = 0,
- // TODO(dcarney): gcc can't handle Local below
- Handle<Value> data = Handle<Value>(),
- PropertyAttribute attribute = None,
- Local<AccessorSignature> signature =
- Local<AccessorSignature>(),
- AccessControl settings = DEFAULT);
+ void SetNativeDataProperty(
+ Local<String> name, AccessorGetterCallback getter,
+ AccessorSetterCallback setter = 0,
+ // TODO(dcarney): gcc can't handle Local below
+ Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
+ Local<AccessorSignature> signature = Local<AccessorSignature>(),
+ AccessControl settings = DEFAULT);
+ void SetNativeDataProperty(
+ Local<Name> name, AccessorNameGetterCallback getter,
+ AccessorNameSetterCallback setter = 0,
+ // TODO(dcarney): gcc can't handle Local below
+ Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
+ Local<AccessorSignature> signature = Local<AccessorSignature>(),
+ AccessControl settings = DEFAULT);
private:
Template();
public:
/** Creates a function template.*/
static Local<FunctionTemplate> New(
- Isolate* isolate,
- FunctionCallback callback = 0,
- Handle<Value> data = Handle<Value>(),
- Handle<Signature> signature = Handle<Signature>(),
- int length = 0);
+ Isolate* isolate, FunctionCallback callback = 0,
+ Local<Value> data = Local<Value>(),
+ Local<Signature> signature = Local<Signature>(), int length = 0);
/** Returns the unique function instance in the current execution context.*/
V8_DEPRECATE_SOON("Use maybe version", Local<Function> GetFunction());
* FunctionTemplate is called.
*/
void SetCallHandler(FunctionCallback callback,
- Handle<Value> data = Handle<Value>());
+ Local<Value> data = Local<Value>());
/** Set the predefined length property for the FunctionTemplate. */
void SetLength(int length);
Local<ObjectTemplate> InstanceTemplate();
/** Causes the function template to inherit from a parent function template.*/
- void Inherit(Handle<FunctionTemplate> parent);
+ void Inherit(Local<FunctionTemplate> parent);
/**
* A PrototypeTemplate is the template used to create the prototype object
* printing objects created with the function created from the
* FunctionTemplate as its constructor.
*/
- void SetClassName(Handle<String> name);
+ void SetClassName(Local<String> name);
/**
* Returns true if the given object is an instance of this function
* template.
*/
- bool HasInstance(Handle<Value> object);
+ bool HasInstance(Local<Value> object);
private:
FunctionTemplate();
GenericNamedPropertyQueryCallback query = 0,
GenericNamedPropertyDeleterCallback deleter = 0,
GenericNamedPropertyEnumeratorCallback enumerator = 0,
- Handle<Value> data = Handle<Value>(),
+ Local<Value> data = Local<Value>(),
PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
: getter(getter),
setter(setter),
GenericNamedPropertyQueryCallback query;
GenericNamedPropertyDeleterCallback deleter;
GenericNamedPropertyEnumeratorCallback enumerator;
- Handle<Value> data;
+ Local<Value> data;
PropertyHandlerFlags flags;
};
IndexedPropertyQueryCallback query = 0,
IndexedPropertyDeleterCallback deleter = 0,
IndexedPropertyEnumeratorCallback enumerator = 0,
- Handle<Value> data = Handle<Value>(),
+ Local<Value> data = Local<Value>(),
PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
: getter(getter),
setter(setter),
IndexedPropertyQueryCallback query;
IndexedPropertyDeleterCallback deleter;
IndexedPropertyEnumeratorCallback enumerator;
- Handle<Value> data;
+ Local<Value> data;
PropertyHandlerFlags flags;
};
/** Creates an ObjectTemplate. */
static Local<ObjectTemplate> New(
Isolate* isolate,
- Handle<FunctionTemplate> constructor = Handle<FunctionTemplate>());
+ Local<FunctionTemplate> constructor = Local<FunctionTemplate>());
static V8_DEPRECATE_SOON("Use isolate version", Local<ObjectTemplate> New());
/** Creates a new instance of this template.*/
* defined by FunctionTemplate::HasInstance()), an implicit TypeError is
* thrown and no callback is invoked.
*/
- void SetAccessor(Handle<String> name,
- AccessorGetterCallback getter,
- AccessorSetterCallback setter = 0,
- Handle<Value> data = Handle<Value>(),
- AccessControl settings = DEFAULT,
- PropertyAttribute attribute = None,
- Handle<AccessorSignature> signature =
- Handle<AccessorSignature>());
- void SetAccessor(Handle<Name> name,
- AccessorNameGetterCallback getter,
- AccessorNameSetterCallback setter = 0,
- Handle<Value> data = Handle<Value>(),
- AccessControl settings = DEFAULT,
- PropertyAttribute attribute = None,
- Handle<AccessorSignature> signature =
- Handle<AccessorSignature>());
+ void SetAccessor(
+ Local<String> name, AccessorGetterCallback getter,
+ AccessorSetterCallback setter = 0, Local<Value> data = Local<Value>(),
+ AccessControl settings = DEFAULT, PropertyAttribute attribute = None,
+ Local<AccessorSignature> signature = Local<AccessorSignature>());
+ void SetAccessor(
+ Local<Name> name, AccessorNameGetterCallback getter,
+ AccessorNameSetterCallback setter = 0, Local<Value> data = Local<Value>(),
+ AccessControl settings = DEFAULT, PropertyAttribute attribute = None,
+ Local<AccessorSignature> signature = Local<AccessorSignature>());
/**
* Sets a named property handler on the object template.
* whenever they are invoked.
*/
// TODO(dcarney): deprecate
- void SetNamedPropertyHandler(
- NamedPropertyGetterCallback getter,
- NamedPropertySetterCallback setter = 0,
- NamedPropertyQueryCallback query = 0,
- NamedPropertyDeleterCallback deleter = 0,
- NamedPropertyEnumeratorCallback enumerator = 0,
- Handle<Value> data = Handle<Value>());
+ void SetNamedPropertyHandler(NamedPropertyGetterCallback getter,
+ NamedPropertySetterCallback setter = 0,
+ NamedPropertyQueryCallback query = 0,
+ NamedPropertyDeleterCallback deleter = 0,
+ NamedPropertyEnumeratorCallback enumerator = 0,
+ Local<Value> data = Local<Value>());
void SetHandler(const NamedPropertyHandlerConfiguration& configuration);
/**
IndexedPropertyQueryCallback query = 0,
IndexedPropertyDeleterCallback deleter = 0,
IndexedPropertyEnumeratorCallback enumerator = 0,
- Handle<Value> data = Handle<Value>()) {
+ Local<Value> data = Local<Value>()) {
SetHandler(IndexedPropertyHandlerConfiguration(getter, setter, query,
deleter, enumerator, data));
}
* function.
*/
void SetCallAsFunctionHandler(FunctionCallback callback,
- Handle<Value> data = Handle<Value>());
+ Local<Value> data = Local<Value>());
/**
* Mark object instances of the template as undetectable.
*/
void SetAccessCheckCallbacks(NamedSecurityCallback named_handler,
IndexedSecurityCallback indexed_handler,
- Handle<Value> data = Handle<Value>());
+ Local<Value> data = Local<Value>());
/**
* Gets the number of internal fields for objects generated from
private:
ObjectTemplate();
static Local<ObjectTemplate> New(internal::Isolate* isolate,
- Handle<FunctionTemplate> constructor);
+ Local<FunctionTemplate> constructor);
friend class FunctionTemplate;
};
public:
static Local<Signature> New(
Isolate* isolate,
- Handle<FunctionTemplate> receiver = Handle<FunctionTemplate>());
+ Local<FunctionTemplate> receiver = Local<FunctionTemplate>());
private:
Signature();
*/
class V8_EXPORT AccessorSignature : public Data {
public:
- static Local<AccessorSignature> New(Isolate* isolate,
- Handle<FunctionTemplate> receiver =
- Handle<FunctionTemplate>());
+ static Local<AccessorSignature> New(
+ Isolate* isolate,
+ Local<FunctionTemplate> receiver = Local<FunctionTemplate>());
private:
AccessorSignature();
*/
class V8_EXPORT TypeSwitch : public Data {
public:
- static Local<TypeSwitch> New(Handle<FunctionTemplate> type);
- static Local<TypeSwitch> New(int argc, Handle<FunctionTemplate> types[]);
- int match(Handle<Value> value);
+ static Local<TypeSwitch> New(Local<FunctionTemplate> type);
+ static Local<TypeSwitch> New(int argc, Local<FunctionTemplate> types[]);
+ int match(Local<Value> value);
+
private:
TypeSwitch();
};
const char** deps = 0,
int source_length = -1);
virtual ~Extension() { }
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
- v8::Isolate* isolate, v8::Handle<v8::String> name) {
- return v8::Handle<v8::FunctionTemplate>();
+ virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
+ v8::Isolate* isolate, v8::Local<v8::String> name) {
+ return v8::Local<v8::FunctionTemplate>();
}
const char* name() const { return name_; }
// --- Statics ---
-V8_INLINE Handle<Primitive> Undefined(Isolate* isolate);
-V8_INLINE Handle<Primitive> Null(Isolate* isolate);
-V8_INLINE Handle<Boolean> True(Isolate* isolate);
-V8_INLINE Handle<Boolean> False(Isolate* isolate);
+V8_INLINE Local<Primitive> Undefined(Isolate* isolate);
+V8_INLINE Local<Primitive> Null(Isolate* isolate);
+V8_INLINE Local<Boolean> True(Isolate* isolate);
+V8_INLINE Local<Boolean> False(Isolate* isolate);
/**
typedef void (*FatalErrorCallback)(const char* location, const char* message);
-typedef void (*MessageCallback)(Handle<Message> message, Handle<Value> error);
+typedef void (*MessageCallback)(Local<Message> message, Local<Value> error);
// --- Tracing ---
*/
class V8_EXPORT Exception {
public:
- static Local<Value> RangeError(Handle<String> message);
- static Local<Value> ReferenceError(Handle<String> message);
- static Local<Value> SyntaxError(Handle<String> message);
- static Local<Value> TypeError(Handle<String> message);
- static Local<Value> Error(Handle<String> message);
+ static Local<Value> RangeError(Local<String> message);
+ static Local<Value> ReferenceError(Local<String> message);
+ static Local<Value> SyntaxError(Local<String> message);
+ static Local<Value> TypeError(Local<String> message);
+ static Local<Value> Error(Local<String> message);
/**
* Creates an error message for the given exception.
* Will try to reconstruct the original stack trace from the exception value,
* or capture the current stack trace if not available.
*/
- static Local<Message> CreateMessage(Handle<Value> exception);
+ static Local<Message> CreateMessage(Local<Value> exception);
/**
* Returns the original stack trace that was captured at the creation time
* of a given exception, or an empty handle if not available.
*/
- static Local<StackTrace> GetStackTrace(Handle<Value> exception);
+ static Local<StackTrace> GetStackTrace(Local<Value> exception);
};
class PromiseRejectMessage {
public:
- PromiseRejectMessage(Handle<Promise> promise, PromiseRejectEvent event,
- Handle<Value> value, Handle<StackTrace> stack_trace)
+ PromiseRejectMessage(Local<Promise> promise, PromiseRejectEvent event,
+ Local<Value> value, Local<StackTrace> stack_trace)
: promise_(promise),
event_(event),
value_(value),
stack_trace_(stack_trace) {}
- V8_INLINE Handle<Promise> GetPromise() const { return promise_; }
+ V8_INLINE Local<Promise> GetPromise() const { return promise_; }
V8_INLINE PromiseRejectEvent GetEvent() const { return event_; }
- V8_INLINE Handle<Value> GetValue() const { return value_; }
+ V8_INLINE Local<Value> GetValue() const { return value_; }
// DEPRECATED. Use v8::Exception::CreateMessage(GetValue())->GetStackTrace()
- V8_INLINE Handle<StackTrace> GetStackTrace() const { return stack_trace_; }
+ V8_INLINE Local<StackTrace> GetStackTrace() const { return stack_trace_; }
private:
- Handle<Promise> promise_;
+ Local<Promise> promise_;
PromiseRejectEvent event_;
- Handle<Value> value_;
- Handle<StackTrace> stack_trace_;
+ Local<Value> value_;
+ Local<StackTrace> stack_trace_;
};
typedef void (*PromiseRejectCallback)(PromiseRejectMessage message);
// Size of the instructions.
size_t code_len;
// Script info for CODE_ADDED event.
- Handle<UnboundScript> script;
+ Local<UnboundScript> script;
// User-defined data for *_LINE_INFO_* event. It's used to hold the source
// code line information which is returned from the
// CODE_START_LINE_INFO_RECORDING event. And it's passed to subsequent
class V8_EXPORT ExternalResourceVisitor { // NOLINT
public:
virtual ~ExternalResourceVisitor() {}
- virtual void VisitExternalString(Handle<String> string) {}
+ virtual void VisitExternalString(Local<String> string) {}
};
/**
* Experimental: Enqueues the callback to the Microtask Work Queue
*/
- void EnqueueMicrotask(Handle<Function> microtask);
+ void EnqueueMicrotask(Local<Function> microtask);
/**
* Experimental: Enqueues the callback to the Microtask Work Queue
* Otherwise, the exception object will be passed to the callback instead.
*/
bool AddMessageListener(MessageCallback that,
- Handle<Value> data = Handle<Value>());
+ Local<Value> data = Local<Value>());
/**
* Remove all message listeners from the specified callback function.
V8_INLINE static V8_DEPRECATE_SOON(
"Use isolate version",
bool AddMessageListener(MessageCallback that,
- Handle<Value> data = Handle<Value>()));
+ Local<Value> data = Local<Value>()));
/**
* Remove all message listeners from the specified callback function.
* ReThrow; the caller must return immediately to where the exception
* is caught.
*/
- Handle<Value> ReThrow();
+ Local<Value> ReThrow();
/**
* Returns the exception caught by this try/catch block. If no exception has
* and only object identify will remain.
*/
static Local<Context> New(
- Isolate* isolate,
- ExtensionConfiguration* extensions = NULL,
- Handle<ObjectTemplate> global_template = Handle<ObjectTemplate>(),
- Handle<Value> global_object = Handle<Value>());
+ Isolate* isolate, ExtensionConfiguration* extensions = NULL,
+ Local<ObjectTemplate> global_template = Local<ObjectTemplate>(),
+ Local<Value> global_object = Local<Value>());
/**
* Sets the security token for the context. To access an object in
* another context, the security tokens must match.
*/
- void SetSecurityToken(Handle<Value> token);
+ void SetSecurityToken(Local<Value> token);
/** Restores the security token to the default value. */
void UseDefaultSecurityToken();
/** Returns the security token of this context.*/
- Handle<Value> GetSecurityToken();
+ Local<Value> GetSecurityToken();
/**
* Enter this context. After entering a context, all code compiled
* needed. Note that index 0 currently has a special meaning for Chrome's
* debugger.
*/
- void SetEmbedderData(int index, Handle<Value> value);
+ void SetEmbedderData(int index, Local<Value> value);
/**
* Gets a 2-byte-aligned native pointer from the embedder data with the given
* code generation from strings is not allowed and 'eval' or the 'Function'
* constructor are called.
*/
- void SetErrorMessageForCodeGenerationFromStrings(Handle<String> message);
+ void SetErrorMessageForCodeGenerationFromStrings(Local<String> message);
/**
* Stack-allocated class which sets the execution context for all
*/
class Scope {
public:
- explicit V8_INLINE Scope(Handle<Context> context) : context_(context) {
+ explicit V8_INLINE Scope(Local<Context> context) : context_(context) {
context_->Enter();
}
V8_INLINE ~Scope() { context_->Exit(); }
private:
- Handle<Context> context_;
+ Local<Context> context_;
};
private:
template <class T>
template <class S>
-void PersistentBase<T>::Reset(Isolate* isolate, const Handle<S>& other) {
+void PersistentBase<T>::Reset(Isolate* isolate, const Local<S>& other) {
TYPE_CHECK(T, S);
Reset();
if (other.IsEmpty()) return;
return length_;
}
-ScriptOrigin::ScriptOrigin(Handle<Value> resource_name,
- Handle<Integer> resource_line_offset,
- Handle<Integer> resource_column_offset,
- Handle<Boolean> resource_is_shared_cross_origin,
- Handle<Integer> script_id,
- Handle<Boolean> resource_is_embedder_debug_script,
- Handle<Value> source_map_url,
- Handle<Boolean> resource_is_opaque)
+ScriptOrigin::ScriptOrigin(Local<Value> resource_name,
+ Local<Integer> resource_line_offset,
+ Local<Integer> resource_column_offset,
+ Local<Boolean> resource_is_shared_cross_origin,
+ Local<Integer> script_id,
+ Local<Boolean> resource_is_embedder_debug_script,
+ Local<Value> source_map_url,
+ Local<Boolean> resource_is_opaque)
: resource_name_(resource_name),
resource_line_offset_(resource_line_offset),
resource_column_offset_(resource_column_offset),
script_id_(script_id),
source_map_url_(source_map_url) {}
-Handle<Value> ScriptOrigin::ResourceName() const {
- return resource_name_;
-}
+Local<Value> ScriptOrigin::ResourceName() const { return resource_name_; }
-Handle<Integer> ScriptOrigin::ResourceLineOffset() const {
+Local<Integer> ScriptOrigin::ResourceLineOffset() const {
return resource_line_offset_;
}
-Handle<Integer> ScriptOrigin::ResourceColumnOffset() const {
+Local<Integer> ScriptOrigin::ResourceColumnOffset() const {
return resource_column_offset_;
}
-Handle<Integer> ScriptOrigin::ScriptID() const {
- return script_id_;
-}
+Local<Integer> ScriptOrigin::ScriptID() const { return script_id_; }
-Handle<Value> ScriptOrigin::SourceMapUrl() const { return source_map_url_; }
+Local<Value> ScriptOrigin::SourceMapUrl() const { return source_map_url_; }
ScriptCompiler::Source::Source(Local<String> string, const ScriptOrigin& origin,
}
-Handle<Boolean> Boolean::New(Isolate* isolate, bool value) {
+Local<Boolean> Boolean::New(Isolate* isolate, bool value) {
return value ? True(isolate) : False(isolate);
}
-void Template::Set(Isolate* isolate, const char* name, v8::Handle<Data> value) {
+void Template::Set(Isolate* isolate, const char* name, v8::Local<Data> value) {
Set(v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal)
.ToLocalChecked(),
value);
}
-Handle<Primitive> Undefined(Isolate* isolate) {
+Local<Primitive> Undefined(Isolate* isolate) {
typedef internal::Object* S;
typedef internal::Internals I;
I::CheckInitialized(isolate);
S* slot = I::GetRoot(isolate, I::kUndefinedValueRootIndex);
- return Handle<Primitive>(reinterpret_cast<Primitive*>(slot));
+ return Local<Primitive>(reinterpret_cast<Primitive*>(slot));
}
-Handle<Primitive> Null(Isolate* isolate) {
+Local<Primitive> Null(Isolate* isolate) {
typedef internal::Object* S;
typedef internal::Internals I;
I::CheckInitialized(isolate);
S* slot = I::GetRoot(isolate, I::kNullValueRootIndex);
- return Handle<Primitive>(reinterpret_cast<Primitive*>(slot));
+ return Local<Primitive>(reinterpret_cast<Primitive*>(slot));
}
-Handle<Boolean> True(Isolate* isolate) {
+Local<Boolean> True(Isolate* isolate) {
typedef internal::Object* S;
typedef internal::Internals I;
I::CheckInitialized(isolate);
S* slot = I::GetRoot(isolate, I::kTrueValueRootIndex);
- return Handle<Boolean>(reinterpret_cast<Boolean*>(slot));
+ return Local<Boolean>(reinterpret_cast<Boolean*>(slot));
}
-Handle<Boolean> False(Isolate* isolate) {
+Local<Boolean> False(Isolate* isolate) {
typedef internal::Object* S;
typedef internal::Internals I;
I::CheckInitialized(isolate);
S* slot = I::GetRoot(isolate, I::kFalseValueRootIndex);
- return Handle<Boolean>(reinterpret_cast<Boolean*>(slot));
+ return Local<Boolean>(reinterpret_cast<Boolean*>(slot));
}
}
-bool V8::AddMessageListener(MessageCallback that, Handle<Value> data) {
+bool V8::AddMessageListener(MessageCallback that, Local<Value> data) {
Isolate* isolate = Isolate::GetCurrent();
return isolate->AddMessageListener(that, data);
}
i::Snapshot::Metadata metadata;
{
HandleScope handle_scope(isolate);
- Handle<Context> new_context = Context::New(isolate);
+ Local<Context> new_context = Context::New(isolate);
internal_isolate->set_creating_default_snapshot(false);
context.Reset(isolate, new_context);
if (custom_source != NULL) {
}
-void Context::SetEmbedderData(int index, v8::Handle<Value> value) {
+void Context::SetEmbedderData(int index, v8::Local<Value> value) {
const char* location = "v8::Context::SetEmbedderData()";
i::Handle<i::FixedArray> data = EmbedderDataFor(this, index, true, location);
if (data.is_null()) return;
}
-void Template::Set(v8::Handle<Name> name,
- v8::Handle<Data> value,
+void Template::Set(v8::Local<Name> name, v8::Local<Data> value,
v8::PropertyAttribute attribute) {
auto templ = Utils::OpenHandle(this);
i::Isolate* isolate = templ->GetIsolate();
}
-void FunctionTemplate::Inherit(v8::Handle<FunctionTemplate> value) {
+void FunctionTemplate::Inherit(v8::Local<FunctionTemplate> value) {
auto info = Utils::OpenHandle(this);
EnsureNotInstantiated(info, "v8::FunctionTemplate::Inherit");
i::Isolate* isolate = info->GetIsolate();
static Local<FunctionTemplate> FunctionTemplateNew(
- i::Isolate* isolate,
- FunctionCallback callback,
- v8::Handle<Value> data,
- v8::Handle<Signature> signature,
- int length,
- bool do_not_cache) {
+ i::Isolate* isolate, FunctionCallback callback, v8::Local<Value> data,
+ v8::Local<Signature> signature, int length, bool do_not_cache) {
i::Handle<i::Struct> struct_obj =
isolate->factory()->NewStruct(i::FUNCTION_TEMPLATE_INFO_TYPE);
i::Handle<i::FunctionTemplateInfo> obj =
return Utils::ToLocal(obj);
}
-Local<FunctionTemplate> FunctionTemplate::New(
- Isolate* isolate,
- FunctionCallback callback,
- v8::Handle<Value> data,
- v8::Handle<Signature> signature,
- int length) {
+Local<FunctionTemplate> FunctionTemplate::New(Isolate* isolate,
+ FunctionCallback callback,
+ v8::Local<Value> data,
+ v8::Local<Signature> signature,
+ int length) {
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
// Changes to the environment cannot be captured in the snapshot. Expect no
// function templates when the isolate is created for serialization.
Local<Signature> Signature::New(Isolate* isolate,
- Handle<FunctionTemplate> receiver) {
+ Local<FunctionTemplate> receiver) {
return Utils::SignatureToLocal(Utils::OpenHandle(*receiver));
}
Local<AccessorSignature> AccessorSignature::New(
- Isolate* isolate,
- Handle<FunctionTemplate> receiver) {
+ Isolate* isolate, Local<FunctionTemplate> receiver) {
return Utils::AccessorSignatureToLocal(Utils::OpenHandle(*receiver));
}
-Local<TypeSwitch> TypeSwitch::New(Handle<FunctionTemplate> type) {
- Handle<FunctionTemplate> types[1] = { type };
+Local<TypeSwitch> TypeSwitch::New(Local<FunctionTemplate> type) {
+ Local<FunctionTemplate> types[1] = {type};
return TypeSwitch::New(1, types);
}
-Local<TypeSwitch> TypeSwitch::New(int argc, Handle<FunctionTemplate> types[]) {
+Local<TypeSwitch> TypeSwitch::New(int argc, Local<FunctionTemplate> types[]) {
i::Isolate* isolate = i::Isolate::Current();
LOG_API(isolate, "TypeSwitch::New");
ENTER_V8(isolate);
}
-int TypeSwitch::match(v8::Handle<Value> value) {
+int TypeSwitch::match(v8::Local<Value> value) {
i::Handle<i::TypeSwitchInfo> info = Utils::OpenHandle(this);
LOG_API(info->GetIsolate(), "TypeSwitch::match");
i::Handle<i::Object> obj = Utils::OpenHandle(*value);
void FunctionTemplate::SetCallHandler(FunctionCallback callback,
- v8::Handle<Value> data) {
+ v8::Local<Value> data) {
auto info = Utils::OpenHandle(this);
EnsureNotInstantiated(info, "v8::FunctionTemplate::SetCallHandler");
i::Isolate* isolate = info->GetIsolate();
static i::Handle<i::AccessorInfo> SetAccessorInfoProperties(
- i::Handle<i::AccessorInfo> obj,
- v8::Handle<Name> name,
- v8::AccessControl settings,
- v8::PropertyAttribute attributes,
- v8::Handle<AccessorSignature> signature) {
+ i::Handle<i::AccessorInfo> obj, v8::Local<Name> name,
+ v8::AccessControl settings, v8::PropertyAttribute attributes,
+ v8::Local<AccessorSignature> signature) {
obj->set_name(*Utils::OpenHandle(*name));
if (settings & ALL_CAN_READ) obj->set_all_can_read(true);
if (settings & ALL_CAN_WRITE) obj->set_all_can_write(true);
}
-template<typename Getter, typename Setter>
+template <typename Getter, typename Setter>
static i::Handle<i::AccessorInfo> MakeAccessorInfo(
- v8::Handle<Name> name,
- Getter getter,
- Setter setter,
- v8::Handle<Value> data,
- v8::AccessControl settings,
- v8::PropertyAttribute attributes,
- v8::Handle<AccessorSignature> signature) {
+ v8::Local<Name> name, Getter getter, Setter setter, v8::Local<Value> data,
+ v8::AccessControl settings, v8::PropertyAttribute attributes,
+ v8::Local<AccessorSignature> signature) {
i::Isolate* isolate = Utils::OpenHandle(*name)->GetIsolate();
i::Handle<i::ExecutableAccessorInfo> obj =
isolate->factory()->NewExecutableAccessorInfo();
}
-void FunctionTemplate::SetClassName(Handle<String> name) {
+void FunctionTemplate::SetClassName(Local<String> name) {
auto info = Utils::OpenHandle(this);
EnsureNotInstantiated(info, "v8::FunctionTemplate::SetClassName");
auto isolate = info->GetIsolate();
Local<ObjectTemplate> ObjectTemplate::New(
- Isolate* isolate, v8::Handle<FunctionTemplate> constructor) {
+ Isolate* isolate, v8::Local<FunctionTemplate> constructor) {
return New(reinterpret_cast<i::Isolate*>(isolate), constructor);
}
Local<ObjectTemplate> ObjectTemplate::New(
- i::Isolate* isolate,
- v8::Handle<FunctionTemplate> constructor) {
+ i::Isolate* isolate, v8::Local<FunctionTemplate> constructor) {
// Changes to the environment cannot be captured in the snapshot. Expect no
// object templates when the isolate is created for serialization.
DCHECK(!isolate->serializer_enabled());
void Template::SetNativeDataProperty(v8::Local<String> name,
AccessorGetterCallback getter,
AccessorSetterCallback setter,
- v8::Handle<Value> data,
+ v8::Local<Value> data,
PropertyAttribute attribute,
v8::Local<AccessorSignature> signature,
AccessControl settings) {
void Template::SetNativeDataProperty(v8::Local<Name> name,
AccessorNameGetterCallback getter,
AccessorNameSetterCallback setter,
- v8::Handle<Value> data,
+ v8::Local<Value> data,
PropertyAttribute attribute,
v8::Local<AccessorSignature> signature,
AccessControl settings) {
}
-void ObjectTemplate::SetAccessor(v8::Handle<String> name,
+void ObjectTemplate::SetAccessor(v8::Local<String> name,
AccessorGetterCallback getter,
AccessorSetterCallback setter,
- v8::Handle<Value> data,
- AccessControl settings,
+ v8::Local<Value> data, AccessControl settings,
PropertyAttribute attribute,
- v8::Handle<AccessorSignature> signature) {
+ v8::Local<AccessorSignature> signature) {
TemplateSetAccessor(
this, name, getter, setter, data, settings, attribute, signature);
}
-void ObjectTemplate::SetAccessor(v8::Handle<Name> name,
+void ObjectTemplate::SetAccessor(v8::Local<Name> name,
AccessorNameGetterCallback getter,
AccessorNameSetterCallback setter,
- v8::Handle<Value> data,
- AccessControl settings,
+ v8::Local<Value> data, AccessControl settings,
PropertyAttribute attribute,
- v8::Handle<AccessorSignature> signature) {
+ v8::Local<AccessorSignature> signature) {
TemplateSetAccessor(
this, name, getter, setter, data, settings, attribute, signature);
}
Getter getter, Setter setter,
Query query, Deleter remover,
Enumerator enumerator,
- Handle<Value> data,
+ Local<Value> data,
PropertyHandlerFlags flags) {
i::Isolate* isolate = Utils::OpenHandle(templ)->GetIsolate();
ENTER_V8(isolate);
void ObjectTemplate::SetNamedPropertyHandler(
NamedPropertyGetterCallback getter, NamedPropertySetterCallback setter,
NamedPropertyQueryCallback query, NamedPropertyDeleterCallback remover,
- NamedPropertyEnumeratorCallback enumerator, Handle<Value> data) {
+ NamedPropertyEnumeratorCallback enumerator, Local<Value> data) {
ObjectTemplateSetNamedPropertyHandler(
this, getter, setter, query, remover, enumerator, data,
PropertyHandlerFlags::kOnlyInterceptStrings);
void ObjectTemplate::SetAccessCheckCallbacks(
NamedSecurityCallback named_callback,
- IndexedSecurityCallback indexed_callback, Handle<Value> data) {
+ IndexedSecurityCallback indexed_callback, Local<Value> data) {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
ENTER_V8(isolate);
i::HandleScope scope(isolate);
void ObjectTemplate::SetCallAsFunctionHandler(FunctionCallback callback,
- Handle<Value> data) {
+ Local<Value> data) {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
ENTER_V8(isolate);
i::HandleScope scope(isolate);
}
-Handle<Value> UnboundScript::GetScriptName() {
+Local<Value> UnboundScript::GetScriptName() {
i::Handle<i::SharedFunctionInfo> obj =
i::Handle<i::SharedFunctionInfo>::cast(Utils::OpenHandle(this));
i::Isolate* isolate = obj->GetIsolate();
i::Object* name = i::Script::cast(obj->script())->name();
return Utils::ToLocal(i::Handle<i::Object>(name, isolate));
} else {
- return Handle<String>();
+ return Local<String>();
}
}
-Handle<Value> UnboundScript::GetSourceURL() {
+Local<Value> UnboundScript::GetSourceURL() {
i::Handle<i::SharedFunctionInfo> obj =
i::Handle<i::SharedFunctionInfo>::cast(Utils::OpenHandle(this));
i::Isolate* isolate = obj->GetIsolate();
i::Object* url = i::Script::cast(obj->script())->source_url();
return Utils::ToLocal(i::Handle<i::Object>(url, isolate));
} else {
- return Handle<String>();
+ return Local<String>();
}
}
-Handle<Value> UnboundScript::GetSourceMappingURL() {
+Local<Value> UnboundScript::GetSourceMappingURL() {
i::Handle<i::SharedFunctionInfo> obj =
i::Handle<i::SharedFunctionInfo>::cast(Utils::OpenHandle(this));
i::Isolate* isolate = obj->GetIsolate();
i::Object* url = i::Script::cast(obj->script())->source_mapping_url();
return Utils::ToLocal(i::Handle<i::Object>(url, isolate));
} else {
- return Handle<String>();
+ return Local<String>();
}
}
MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context,
StreamedSource* v8_source,
- Handle<String> full_source_string,
+ Local<String> full_source_string,
const ScriptOrigin& origin) {
PREPARE_FOR_EXECUTION(context, "v8::ScriptCompiler::Compile()", Script);
i::StreamedSource* source = v8_source->impl();
Local<Script> ScriptCompiler::Compile(Isolate* v8_isolate,
StreamedSource* v8_source,
- Handle<String> full_source_string,
+ Local<String> full_source_string,
const ScriptOrigin& origin) {
auto context = v8_isolate->GetCurrentContext();
RETURN_TO_LOCAL_UNCHECKED(
}
-MaybeLocal<Script> Script::Compile(Local<Context> context,
- Handle<String> source,
+MaybeLocal<Script> Script::Compile(Local<Context> context, Local<String> source,
ScriptOrigin* origin) {
if (origin) {
ScriptCompiler::Source script_source(source, *origin);
}
-Local<Script> Script::Compile(v8::Handle<String> source,
+Local<Script> Script::Compile(v8::Local<String> source,
v8::ScriptOrigin* origin) {
auto str = Utils::OpenHandle(*source);
auto context = ContextFromHeapObject(str);
}
-Local<Script> Script::Compile(v8::Handle<String> source,
- v8::Handle<String> file_name) {
+Local<Script> Script::Compile(v8::Local<String> source,
+ v8::Local<String> file_name) {
auto str = Utils::OpenHandle(*source);
auto context = ContextFromHeapObject(str);
ScriptOrigin origin(file_name);
}
-v8::Handle<v8::Value> v8::TryCatch::ReThrow() {
+v8::Local<v8::Value> v8::TryCatch::ReThrow() {
if (!HasCaught()) return v8::Local<v8::Value>();
rethrow_ = true;
return v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate_));
}
-v8::Handle<Value> Message::GetScriptResourceName() const {
+v8::Local<Value> Message::GetScriptResourceName() const {
return GetScriptOrigin().ResourceName();
}
-v8::Handle<v8::StackTrace> Message::GetStackTrace() const {
+v8::Local<v8::StackTrace> Message::GetStackTrace() const {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
ENTER_V8(isolate);
EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate));
auto message = i::Handle<i::JSMessageObject>::cast(Utils::OpenHandle(this));
i::Handle<i::Object> stackFramesObj(message->stack_frames(), isolate);
- if (!stackFramesObj->IsJSArray()) return v8::Handle<v8::StackTrace>();
+ if (!stackFramesObj->IsJSArray()) return v8::Local<v8::StackTrace>();
auto stackTrace = i::Handle<i::JSArray>::cast(stackFramesObj);
return scope.Escape(Utils::StackTraceToLocal(stackTrace));
}
}
-void NativeWeakMap::Set(Handle<Value> v8_key, Handle<Value> v8_value) {
+void NativeWeakMap::Set(Local<Value> v8_key, Local<Value> v8_value) {
i::Handle<i::JSWeakMap> weak_collection = Utils::OpenHandle(this);
i::Isolate* isolate = weak_collection->GetIsolate();
ENTER_V8(isolate);
}
-Local<Value> NativeWeakMap::Get(Handle<Value> v8_key) {
+Local<Value> NativeWeakMap::Get(Local<Value> v8_key) {
i::Handle<i::JSWeakMap> weak_collection = Utils::OpenHandle(this);
i::Isolate* isolate = weak_collection->GetIsolate();
ENTER_V8(isolate);
}
-bool NativeWeakMap::Has(Handle<Value> v8_key) {
+bool NativeWeakMap::Has(Local<Value> v8_key) {
i::Handle<i::JSWeakMap> weak_collection = Utils::OpenHandle(this);
i::Isolate* isolate = weak_collection->GetIsolate();
ENTER_V8(isolate);
}
-bool NativeWeakMap::Delete(Handle<Value> v8_key) {
+bool NativeWeakMap::Delete(Local<Value> v8_key) {
i::Handle<i::JSWeakMap> weak_collection = Utils::OpenHandle(this);
i::Isolate* isolate = weak_collection->GetIsolate();
ENTER_V8(isolate);
}
-Maybe<bool> Value::Equals(Local<Context> context, Handle<Value> that) const {
+Maybe<bool> Value::Equals(Local<Context> context, Local<Value> that) const {
auto self = Utils::OpenHandle(this);
auto other = Utils::OpenHandle(*that);
if (self->IsSmi() && other->IsSmi()) {
}
-bool Value::Equals(Handle<Value> that) const {
+bool Value::Equals(Local<Value> that) const {
auto self = Utils::OpenHandle(this);
auto other = Utils::OpenHandle(*that);
if (self->IsSmi() && other->IsSmi()) {
}
-bool Value::StrictEquals(Handle<Value> that) const {
+bool Value::StrictEquals(Local<Value> that) const {
i::Handle<i::Object> obj = Utils::OpenHandle(this);
i::Handle<i::Object> other = Utils::OpenHandle(*that);
if (obj->IsSmi()) {
}
-bool Value::SameValue(Handle<Value> that) const {
+bool Value::SameValue(Local<Value> that) const {
auto self = Utils::OpenHandle(this);
auto other = Utils::OpenHandle(*that);
return self->SameValue(*other);
}
-bool v8::Object::Set(v8::Handle<Value> key, v8::Handle<Value> value) {
+bool v8::Object::Set(v8::Local<Value> key, v8::Local<Value> value) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
return Set(context, key, value).FromMaybe(false);
}
}
-bool v8::Object::Set(uint32_t index, v8::Handle<Value> value) {
+bool v8::Object::Set(uint32_t index, v8::Local<Value> value) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
return Set(context, index, value).FromMaybe(false);
}
}
-bool v8::Object::ForceSet(v8::Handle<Value> key, v8::Handle<Value> value,
+bool v8::Object::ForceSet(v8::Local<Value> key, v8::Local<Value> value,
v8::PropertyAttribute attribs) {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
PREPARE_FOR_EXECUTION_GENERIC(isolate, Local<Context>(),
}
-Local<Value> v8::Object::Get(v8::Handle<Value> key) {
+Local<Value> v8::Object::Get(v8::Local<Value> key) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
RETURN_TO_LOCAL_UNCHECKED(Get(context, key), Value);
}
}
-PropertyAttribute v8::Object::GetPropertyAttributes(v8::Handle<Value> key) {
+PropertyAttribute v8::Object::GetPropertyAttributes(v8::Local<Value> key) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
return GetPropertyAttributes(context, key)
.FromMaybe(static_cast<PropertyAttribute>(NONE));
}
-bool v8::Object::SetPrototype(Handle<Value> value) {
+bool v8::Object::SetPrototype(Local<Value> value) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
return SetPrototype(context, value).FromMaybe(false);
}
Local<Object> v8::Object::FindInstanceInPrototypeChain(
- v8::Handle<FunctionTemplate> tmpl) {
+ v8::Local<FunctionTemplate> tmpl) {
auto isolate = Utils::OpenHandle(this)->GetIsolate();
i::PrototypeIterator iter(isolate, *Utils::OpenHandle(this),
i::PrototypeIterator::START_AT_RECEIVER);
}
-bool v8::Object::Delete(v8::Handle<Value> key) {
+bool v8::Object::Delete(v8::Local<Value> key) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
return Delete(context, key).FromMaybe(false);
}
}
-bool v8::Object::Has(v8::Handle<Value> key) {
+bool v8::Object::Has(v8::Local<Value> key) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
return Has(context, key).FromMaybe(false);
}
AccessControl settings,
PropertyAttribute attributes) {
PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::SetAccessor()", bool);
- v8::Handle<AccessorSignature> signature;
+ v8::Local<AccessorSignature> signature;
auto info = MakeAccessorInfo(name, getter, setter, data, settings, attributes,
signature);
if (info.is_null()) return Nothing<bool>();
}
-bool Object::SetAccessor(Handle<String> name,
- AccessorGetterCallback getter,
- AccessorSetterCallback setter,
- v8::Handle<Value> data,
- AccessControl settings,
- PropertyAttribute attributes) {
+bool Object::SetAccessor(Local<String> name, AccessorGetterCallback getter,
+ AccessorSetterCallback setter, v8::Local<Value> data,
+ AccessControl settings, PropertyAttribute attributes) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
return ObjectSetAccessor(context, this, name, getter, setter, data, settings,
attributes).FromMaybe(false);
}
-bool Object::SetAccessor(Handle<Name> name,
- AccessorNameGetterCallback getter,
+bool Object::SetAccessor(Local<Name> name, AccessorNameGetterCallback getter,
AccessorNameSetterCallback setter,
- v8::Handle<Value> data,
- AccessControl settings,
+ v8::Local<Value> data, AccessControl settings,
PropertyAttribute attributes) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
return ObjectSetAccessor(context, this, name, getter, setter, data, settings,
}
-void Object::SetAccessorProperty(Local<Name> name,
- Local<Function> getter,
- Handle<Function> setter,
+void Object::SetAccessorProperty(Local<Name> name, Local<Function> getter,
+ Local<Function> setter,
PropertyAttribute attribute,
AccessControl settings) {
// TODO(verwaest): Remove |settings|.
}
-bool v8::Object::HasOwnProperty(Handle<String> key) {
+bool v8::Object::HasOwnProperty(Local<String> key) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
return HasOwnProperty(context, key).FromMaybe(false);
}
}
-bool v8::Object::HasRealNamedProperty(Handle<String> key) {
+bool v8::Object::HasRealNamedProperty(Local<String> key) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
return HasRealNamedProperty(context, key).FromMaybe(false);
}
}
-bool v8::Object::HasRealNamedCallbackProperty(Handle<String> key) {
+bool v8::Object::HasRealNamedCallbackProperty(Local<String> key) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
return HasRealNamedCallbackProperty(context, key).FromMaybe(false);
}
Local<Value> v8::Object::GetRealNamedPropertyInPrototypeChain(
- Handle<String> key) {
+ Local<String> key) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
RETURN_TO_LOCAL_UNCHECKED(GetRealNamedPropertyInPrototypeChain(context, key),
Value);
Maybe<PropertyAttribute>
-v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(Handle<String> key) {
+v8::Object::GetRealNamedPropertyAttributesInPrototypeChain(Local<String> key) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
return GetRealNamedPropertyAttributesInPrototypeChain(context, key);
}
}
-Local<Value> v8::Object::GetRealNamedProperty(Handle<String> key) {
+Local<Value> v8::Object::GetRealNamedProperty(Local<String> key) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
RETURN_TO_LOCAL_UNCHECKED(GetRealNamedProperty(context, key), Value);
}
Maybe<PropertyAttribute> v8::Object::GetRealNamedPropertyAttributes(
- Handle<String> key) {
+ Local<String> key) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
return GetRealNamedPropertyAttributes(context, key);
}
}
-bool v8::Object::SetHiddenValue(v8::Handle<v8::String> key,
- v8::Handle<v8::Value> value) {
+bool v8::Object::SetHiddenValue(v8::Local<v8::String> key,
+ v8::Local<v8::Value> value) {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
if (value.IsEmpty()) return DeleteHiddenValue(key);
ENTER_V8(isolate);
}
-v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Handle<v8::String> key) {
+v8::Local<v8::Value> v8::Object::GetHiddenValue(v8::Local<v8::String> key) {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
ENTER_V8(isolate);
i::Handle<i::JSObject> self = Utils::OpenHandle(this);
}
-bool v8::Object::DeleteHiddenValue(v8::Handle<v8::String> key) {
+bool v8::Object::DeleteHiddenValue(v8::Local<v8::String> key) {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
ENTER_V8(isolate);
i::HandleScope scope(isolate);
MaybeLocal<Value> Object::CallAsFunction(Local<Context> context,
- Handle<Value> recv, int argc,
- Handle<Value> argv[]) {
+ Local<Value> recv, int argc,
+ Local<Value> argv[]) {
PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, "v8::Object::CallAsFunction()",
Value);
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
auto self = Utils::OpenHandle(this);
auto recv_obj = Utils::OpenHandle(*recv);
- STATIC_ASSERT(sizeof(v8::Handle<v8::Value>) == sizeof(i::Object**));
+ STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**));
i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv);
i::Handle<i::JSFunction> fun;
if (self->IsJSFunction()) {
}
-Local<v8::Value> Object::CallAsFunction(v8::Handle<v8::Value> recv, int argc,
- v8::Handle<v8::Value> argv[]) {
+Local<v8::Value> Object::CallAsFunction(v8::Local<v8::Value> recv, int argc,
+ v8::Local<v8::Value> argv[]) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
Local<Value>* argv_cast = reinterpret_cast<Local<Value>*>(argv);
RETURN_TO_LOCAL_UNCHECKED(CallAsFunction(context, recv, argc, argv_cast),
"v8::Object::CallAsConstructor()", Value);
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
auto self = Utils::OpenHandle(this);
- STATIC_ASSERT(sizeof(v8::Handle<v8::Value>) == sizeof(i::Object**));
+ STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**));
i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv);
if (self->IsJSFunction()) {
auto fun = i::Handle<i::JSFunction>::cast(self);
Local<v8::Value> Object::CallAsConstructor(int argc,
- v8::Handle<v8::Value> argv[]) {
+ v8::Local<v8::Value> argv[]) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
Local<Value>* argv_cast = reinterpret_cast<Local<Value>*>(argv);
RETURN_TO_LOCAL_UNCHECKED(CallAsConstructor(context, argc, argv_cast), Value);
MaybeLocal<Object> Function::NewInstance(Local<Context> context, int argc,
- v8::Handle<v8::Value> argv[]) const {
+ v8::Local<v8::Value> argv[]) const {
PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, "v8::Function::NewInstance()",
Object);
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
auto self = Utils::OpenHandle(this);
- STATIC_ASSERT(sizeof(v8::Handle<v8::Value>) == sizeof(i::Object**));
+ STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**));
i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv);
Local<Object> result;
has_pending_exception =
Local<v8::Object> Function::NewInstance(int argc,
- v8::Handle<v8::Value> argv[]) const {
+ v8::Local<v8::Value> argv[]) const {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
RETURN_TO_LOCAL_UNCHECKED(NewInstance(context, argc, argv), Object);
}
MaybeLocal<v8::Value> Function::Call(Local<Context> context,
- v8::Handle<v8::Value> recv, int argc,
- v8::Handle<v8::Value> argv[]) {
+ v8::Local<v8::Value> recv, int argc,
+ v8::Local<v8::Value> argv[]) {
PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, "v8::Function::Call()", Value);
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
auto self = Utils::OpenHandle(this);
i::Handle<i::Object> recv_obj = Utils::OpenHandle(*recv);
- STATIC_ASSERT(sizeof(v8::Handle<v8::Value>) == sizeof(i::Object**));
+ STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**));
i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv);
Local<Value> result;
has_pending_exception =
}
-Local<v8::Value> Function::Call(v8::Handle<v8::Value> recv, int argc,
- v8::Handle<v8::Value> argv[]) {
+Local<v8::Value> Function::Call(v8::Local<v8::Value> recv, int argc,
+ v8::Local<v8::Value> argv[]) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
RETURN_TO_LOCAL_UNCHECKED(Call(context, recv, argc, argv), Value);
}
-void Function::SetName(v8::Handle<v8::String> name) {
+void Function::SetName(v8::Local<v8::String> name) {
i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
func->shared()->set_name(*Utils::OpenHandle(*name));
}
-Handle<Value> Function::GetName() const {
+Local<Value> Function::GetName() const {
i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
return Utils::ToLocal(i::Handle<i::Object>(func->shared()->name(),
func->GetIsolate()));
}
-Handle<Value> Function::GetInferredName() const {
+Local<Value> Function::GetInferredName() const {
i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
return Utils::ToLocal(i::Handle<i::Object>(func->shared()->inferred_name(),
func->GetIsolate()));
}
-Handle<Value> Function::GetDisplayName() const {
+Local<Value> Function::GetDisplayName() const {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
ENTER_V8(isolate);
i::Handle<i::JSFunction> func = Utils::OpenHandle(this);
i::Handle<i::Script> script(i::Script::cast(func->shared()->script()));
return GetScriptOriginForScript(func->GetIsolate(), script);
}
- return v8::ScriptOrigin(Handle<Value>());
+ return v8::ScriptOrigin(Local<Value>());
}
}
-void v8::Object::SetInternalField(int index, v8::Handle<Value> value) {
+void v8::Object::SetInternalField(int index, v8::Local<Value> value) {
i::Handle<i::JSObject> obj = Utils::OpenHandle(this);
const char* location = "v8::Object::SetInternalField()";
if (!InternalFieldOK(obj, index, location)) return;
static i::Handle<i::Context> CreateEnvironment(
- i::Isolate* isolate,
- v8::ExtensionConfiguration* extensions,
- v8::Handle<ObjectTemplate> global_template,
- v8::Handle<Value> maybe_global_proxy) {
+ i::Isolate* isolate, v8::ExtensionConfiguration* extensions,
+ v8::Local<ObjectTemplate> global_template,
+ v8::Local<Value> maybe_global_proxy) {
i::Handle<i::Context> env;
// Enter V8 via an ENTER_V8 scope.
{
ENTER_V8(isolate);
- v8::Handle<ObjectTemplate> proxy_template = global_template;
+ v8::Local<ObjectTemplate> proxy_template = global_template;
i::Handle<i::FunctionTemplateInfo> proxy_constructor;
i::Handle<i::FunctionTemplateInfo> global_constructor;
return env;
}
-Local<Context> v8::Context::New(
- v8::Isolate* external_isolate,
- v8::ExtensionConfiguration* extensions,
- v8::Handle<ObjectTemplate> global_template,
- v8::Handle<Value> global_object) {
+Local<Context> v8::Context::New(v8::Isolate* external_isolate,
+ v8::ExtensionConfiguration* extensions,
+ v8::Local<ObjectTemplate> global_template,
+ v8::Local<Value> global_object) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate);
LOG_API(isolate, "Context::New");
i::HandleScope scope(isolate);
}
-void v8::Context::SetSecurityToken(Handle<Value> token) {
+void v8::Context::SetSecurityToken(Local<Value> token) {
i::Handle<i::Context> env = Utils::OpenHandle(this);
i::Handle<i::Object> token_handle = Utils::OpenHandle(*token);
env->set_security_token(*token_handle);
}
-Handle<Value> v8::Context::GetSecurityToken() {
+Local<Value> v8::Context::GetSecurityToken() {
i::Handle<i::Context> env = Utils::OpenHandle(this);
i::Isolate* isolate = env->GetIsolate();
i::Object* security_token = env->security_token();
}
-void Context::SetErrorMessageForCodeGenerationFromStrings(
- Handle<String> error) {
+void Context::SetErrorMessageForCodeGenerationFromStrings(Local<String> error) {
i::Handle<i::Context> context = Utils::OpenHandle(this);
i::Handle<i::String> error_handle = Utils::OpenHandle(*error);
context->set_error_message_for_code_gen_from_strings(*error_handle);
}
-bool FunctionTemplate::HasInstance(v8::Handle<v8::Value> value) {
+bool FunctionTemplate::HasInstance(v8::Local<v8::Value> value) {
auto self = Utils::OpenHandle(this);
auto obj = Utils::OpenHandle(*value);
return self->IsTemplateFor(*obj);
}
-Local<String> v8::String::Concat(Handle<String> left, Handle<String> right) {
+Local<String> v8::String::Concat(Local<String> left, Local<String> right) {
i::Handle<i::String> left_string = Utils::OpenHandle(*left);
i::Isolate* isolate = left_string->GetIsolate();
ENTER_V8(isolate);
}
-Local<v8::Value> v8::StringObject::New(Handle<String> value) {
+Local<v8::Value> v8::StringObject::New(Local<String> value) {
i::Handle<i::String> string = Utils::OpenHandle(*value);
i::Isolate* isolate = string->GetIsolate();
LOG_API(isolate, "StringObject::New");
}
-Local<v8::Value> v8::SymbolObject::New(Isolate* isolate, Handle<Symbol> value) {
+Local<v8::Value> v8::SymbolObject::New(Isolate* isolate, Local<Symbol> value) {
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
LOG_API(i_isolate, "SymbolObject::New");
ENTER_V8(i_isolate);
MaybeLocal<v8::RegExp> v8::RegExp::New(Local<Context> context,
- Handle<String> pattern, Flags flags) {
+ Local<String> pattern, Flags flags) {
PREPARE_FOR_EXECUTION(context, "RegExp::New", RegExp);
Local<v8::RegExp> result;
has_pending_exception =
}
-Local<v8::RegExp> v8::RegExp::New(Handle<String> pattern, Flags flags) {
+Local<v8::RegExp> v8::RegExp::New(Local<String> pattern, Flags flags) {
auto isolate =
reinterpret_cast<Isolate*>(Utils::OpenHandle(*pattern)->GetIsolate());
auto context = isolate->GetCurrentContext();
Maybe<bool> Promise::Resolver::Resolve(Local<Context> context,
- Handle<Value> value) {
+ Local<Value> value) {
PREPARE_FOR_EXECUTION_PRIMITIVE(context, "Promise::Resolver::Resolve", bool);
auto self = Utils::OpenHandle(this);
i::Handle<i::Object> argv[] = {self, Utils::OpenHandle(*value)};
}
-void Promise::Resolver::Resolve(Handle<Value> value) {
+void Promise::Resolver::Resolve(Local<Value> value) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
USE(Resolve(context, value));
}
Maybe<bool> Promise::Resolver::Reject(Local<Context> context,
- Handle<Value> value) {
+ Local<Value> value) {
PREPARE_FOR_EXECUTION_PRIMITIVE(context, "Promise::Resolver::Resolve", bool);
auto self = Utils::OpenHandle(this);
i::Handle<i::Object> argv[] = {self, Utils::OpenHandle(*value)};
}
-void Promise::Resolver::Reject(Handle<Value> value) {
+void Promise::Resolver::Reject(Local<Value> value) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
USE(Reject(context, value));
}
MaybeLocal<Promise> Promise::Chain(Local<Context> context,
- Handle<Function> handler) {
+ Local<Function> handler) {
PREPARE_FOR_EXECUTION(context, "Promise::Chain", Promise);
auto self = Utils::OpenHandle(this);
i::Handle<i::Object> argv[] = {Utils::OpenHandle(*handler)};
}
-Local<Promise> Promise::Chain(Handle<Function> handler) {
+Local<Promise> Promise::Chain(Local<Function> handler) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
RETURN_TO_LOCAL_UNCHECKED(Chain(context, handler), Promise);
}
MaybeLocal<Promise> Promise::Catch(Local<Context> context,
- Handle<Function> handler) {
+ Local<Function> handler) {
PREPARE_FOR_EXECUTION(context, "Promise::Catch", Promise);
auto self = Utils::OpenHandle(this);
i::Handle<i::Object> argv[] = { Utils::OpenHandle(*handler) };
}
-Local<Promise> Promise::Catch(Handle<Function> handler) {
+Local<Promise> Promise::Catch(Local<Function> handler) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
RETURN_TO_LOCAL_UNCHECKED(Catch(context, handler), Promise);
}
MaybeLocal<Promise> Promise::Then(Local<Context> context,
- Handle<Function> handler) {
+ Local<Function> handler) {
PREPARE_FOR_EXECUTION(context, "Promise::Then", Promise);
auto self = Utils::OpenHandle(this);
i::Handle<i::Object> argv[] = { Utils::OpenHandle(*handler) };
}
-Local<Promise> Promise::Then(Handle<Function> handler) {
+Local<Promise> Promise::Then(Local<Function> handler) {
auto context = ContextFromHeapObject(Utils::OpenHandle(this));
RETURN_TO_LOCAL_UNCHECKED(Then(context, handler), Promise);
}
}
-#define TYPED_ARRAY_NEW(Type, type, TYPE, ctype, size) \
- Local<Type##Array> Type##Array::New(Handle<ArrayBuffer> array_buffer, \
- size_t byte_offset, size_t length) { \
- i::Isolate* isolate = Utils::OpenHandle(*array_buffer)->GetIsolate(); \
- LOG_API(isolate, \
- "v8::" #Type "Array::New(Handle<ArrayBuffer>, size_t, size_t)"); \
- ENTER_V8(isolate); \
- if (!Utils::ApiCheck(length <= static_cast<size_t>(i::Smi::kMaxValue), \
- "v8::" #Type \
- "Array::New(Handle<ArrayBuffer>, size_t, size_t)", \
- "length exceeds max allowed value")) { \
- return Local<Type##Array>(); \
- } \
- i::Handle<i::JSArrayBuffer> buffer = Utils::OpenHandle(*array_buffer); \
- i::Handle<i::JSTypedArray> obj = isolate->factory()->NewJSTypedArray( \
- i::kExternal##Type##Array, buffer, byte_offset, length); \
- return Utils::ToLocal##Type##Array(obj); \
- } \
- Local<Type##Array> Type##Array::New( \
- Handle<SharedArrayBuffer> shared_array_buffer, size_t byte_offset, \
- size_t length) { \
- CHECK(i::FLAG_harmony_sharedarraybuffer); \
- i::Isolate* isolate = \
- Utils::OpenHandle(*shared_array_buffer)->GetIsolate(); \
- LOG_API(isolate, "v8::" #Type \
- "Array::New(Handle<SharedArrayBuffer>, size_t, size_t)"); \
- ENTER_V8(isolate); \
- if (!Utils::ApiCheck( \
- length <= static_cast<size_t>(i::Smi::kMaxValue), \
- "v8::" #Type \
- "Array::New(Handle<SharedArrayBuffer>, size_t, size_t)", \
- "length exceeds max allowed value")) { \
- return Local<Type##Array>(); \
- } \
- i::Handle<i::JSArrayBuffer> buffer = \
- Utils::OpenHandle(*shared_array_buffer); \
- i::Handle<i::JSTypedArray> obj = isolate->factory()->NewJSTypedArray( \
- i::kExternal##Type##Array, buffer, byte_offset, length); \
- return Utils::ToLocal##Type##Array(obj); \
+#define TYPED_ARRAY_NEW(Type, type, TYPE, ctype, size) \
+ Local<Type##Array> Type##Array::New(Local<ArrayBuffer> array_buffer, \
+ size_t byte_offset, size_t length) { \
+ i::Isolate* isolate = Utils::OpenHandle(*array_buffer)->GetIsolate(); \
+ LOG_API(isolate, \
+ "v8::" #Type "Array::New(Local<ArrayBuffer>, size_t, size_t)"); \
+ ENTER_V8(isolate); \
+ if (!Utils::ApiCheck(length <= static_cast<size_t>(i::Smi::kMaxValue), \
+ "v8::" #Type \
+ "Array::New(Local<ArrayBuffer>, size_t, size_t)", \
+ "length exceeds max allowed value")) { \
+ return Local<Type##Array>(); \
+ } \
+ i::Handle<i::JSArrayBuffer> buffer = Utils::OpenHandle(*array_buffer); \
+ i::Handle<i::JSTypedArray> obj = isolate->factory()->NewJSTypedArray( \
+ i::kExternal##Type##Array, buffer, byte_offset, length); \
+ return Utils::ToLocal##Type##Array(obj); \
+ } \
+ Local<Type##Array> Type##Array::New( \
+ Local<SharedArrayBuffer> shared_array_buffer, size_t byte_offset, \
+ size_t length) { \
+ CHECK(i::FLAG_harmony_sharedarraybuffer); \
+ i::Isolate* isolate = \
+ Utils::OpenHandle(*shared_array_buffer)->GetIsolate(); \
+ LOG_API(isolate, "v8::" #Type \
+ "Array::New(Local<SharedArrayBuffer>, size_t, size_t)"); \
+ ENTER_V8(isolate); \
+ if (!Utils::ApiCheck( \
+ length <= static_cast<size_t>(i::Smi::kMaxValue), \
+ "v8::" #Type \
+ "Array::New(Local<SharedArrayBuffer>, size_t, size_t)", \
+ "length exceeds max allowed value")) { \
+ return Local<Type##Array>(); \
+ } \
+ i::Handle<i::JSArrayBuffer> buffer = \
+ Utils::OpenHandle(*shared_array_buffer); \
+ i::Handle<i::JSTypedArray> obj = isolate->factory()->NewJSTypedArray( \
+ i::kExternal##Type##Array, buffer, byte_offset, length); \
+ return Utils::ToLocal##Type##Array(obj); \
}
TYPED_ARRAYS(TYPED_ARRAY_NEW)
#undef TYPED_ARRAY_NEW
-Local<DataView> DataView::New(Handle<ArrayBuffer> array_buffer,
+Local<DataView> DataView::New(Local<ArrayBuffer> array_buffer,
size_t byte_offset, size_t byte_length) {
i::Handle<i::JSArrayBuffer> buffer = Utils::OpenHandle(*array_buffer);
i::Isolate* isolate = buffer->GetIsolate();
- LOG_API(isolate, "v8::DataView::New(Handle<ArrayBuffer>, size_t, size_t)");
+ LOG_API(isolate, "v8::DataView::New(Local<ArrayBuffer>, size_t, size_t)");
ENTER_V8(isolate);
i::Handle<i::JSDataView> obj =
isolate->factory()->NewJSDataView(buffer, byte_offset, byte_length);
}
-Local<DataView> DataView::New(Handle<SharedArrayBuffer> shared_array_buffer,
+Local<DataView> DataView::New(Local<SharedArrayBuffer> shared_array_buffer,
size_t byte_offset, size_t byte_length) {
CHECK(i::FLAG_harmony_sharedarraybuffer);
i::Handle<i::JSArrayBuffer> buffer = Utils::OpenHandle(*shared_array_buffer);
i::Isolate* isolate = buffer->GetIsolate();
LOG_API(isolate,
- "v8::DataView::New(Handle<SharedArrayBuffer>, size_t, size_t)");
+ "v8::DataView::New(Local<SharedArrayBuffer>, size_t, size_t)");
ENTER_V8(isolate);
i::Handle<i::JSDataView> obj =
isolate->factory()->NewJSDataView(buffer, byte_offset, byte_length);
}
-void Isolate::EnqueueMicrotask(Handle<Function> microtask) {
+void Isolate::EnqueueMicrotask(Local<Function> microtask) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
isolate->EnqueueMicrotask(Utils::OpenHandle(*microtask));
}
}
-bool Isolate::AddMessageListener(MessageCallback that, Handle<Value> data) {
+bool Isolate::AddMessageListener(MessageCallback that, Local<Value> data) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
ENTER_V8(isolate);
i::HandleScope scope(isolate);
}
-String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj)
+String::Utf8Value::Utf8Value(v8::Local<v8::Value> obj)
: str_(NULL), length_(0) {
if (obj.IsEmpty()) return;
i::Isolate* isolate = i::Isolate::Current();
i::HandleScope scope(isolate);
Local<Context> context = v8_isolate->GetCurrentContext();
TryCatch try_catch(v8_isolate);
- Handle<String> str;
+ Local<String> str;
if (!obj->ToString(context).ToLocal(&str)) return;
i::Handle<i::String> i_str = Utils::OpenHandle(*str);
length_ = v8::Utf8Length(*i_str, isolate);
}
-String::Value::Value(v8::Handle<v8::Value> obj)
- : str_(NULL), length_(0) {
+String::Value::Value(v8::Local<v8::Value> obj) : str_(NULL), length_(0) {
if (obj.IsEmpty()) return;
i::Isolate* isolate = i::Isolate::Current();
Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate);
i::HandleScope scope(isolate);
Local<Context> context = v8_isolate->GetCurrentContext();
TryCatch try_catch(v8_isolate);
- Handle<String> str;
+ Local<String> str;
if (!obj->ToString(context).ToLocal(&str)) return;
length_ = str->Length();
str_ = i::NewArray<uint16_t>(length_ + 1);
#define DEFINE_ERROR(NAME) \
- Local<Value> Exception::NAME(v8::Handle<v8::String> raw_message) { \
+ Local<Value> Exception::NAME(v8::Local<v8::String> raw_message) { \
i::Isolate* isolate = i::Isolate::Current(); \
LOG_API(isolate, #NAME); \
ENTER_V8(isolate); \
#undef DEFINE_ERROR
-Local<Message> Exception::CreateMessage(Handle<Value> exception) {
+Local<Message> Exception::CreateMessage(Local<Value> exception) {
i::Handle<i::Object> obj = Utils::OpenHandle(*exception);
if (!obj->IsHeapObject()) return Local<Message>();
i::Isolate* isolate = i::HeapObject::cast(*obj)->GetIsolate();
}
-Local<StackTrace> Exception::GetStackTrace(Handle<Value> exception) {
+Local<StackTrace> Exception::GetStackTrace(Local<Value> exception) {
i::Handle<i::Object> obj = Utils::OpenHandle(*exception);
if (!obj->IsJSObject()) return Local<StackTrace>();
i::Handle<i::JSObject> js_obj = i::Handle<i::JSObject>::cast(obj);
// --- D e b u g S u p p o r t ---
-bool Debug::SetDebugEventListener(EventCallback that, Handle<Value> data) {
+bool Debug::SetDebugEventListener(EventCallback that, Local<Value> data) {
i::Isolate* isolate = i::Isolate::Current();
ENTER_V8(isolate);
i::HandleScope scope(isolate);
MaybeLocal<Value> Debug::Call(Local<Context> context,
- v8::Handle<v8::Function> fun,
- v8::Handle<v8::Value> data) {
+ v8::Local<v8::Function> fun,
+ v8::Local<v8::Value> data) {
PREPARE_FOR_EXECUTION(context, "v8::Debug::Call()", Value);
i::Handle<i::Object> data_obj;
if (data.IsEmpty()) {
}
-Local<Value> Debug::Call(v8::Handle<v8::Function> fun,
- v8::Handle<v8::Value> data) {
+Local<Value> Debug::Call(v8::Local<v8::Function> fun,
+ v8::Local<v8::Value> data) {
auto context = ContextFromHeapObject(Utils::OpenHandle(*fun));
RETURN_TO_LOCAL_UNCHECKED(Call(context, fun, data), Value);
}
MaybeLocal<Value> Debug::GetMirror(Local<Context> context,
- v8::Handle<v8::Value> obj) {
+ v8::Local<v8::Value> obj) {
PREPARE_FOR_EXECUTION(context, "v8::Debug::GetMirror()", Value);
i::Debug* isolate_debug = isolate->debug();
has_pending_exception = !isolate_debug->Load();
auto fun_obj = i::Object::GetProperty(debug, name).ToHandleChecked();
auto v8_fun = Utils::ToLocal(i::Handle<i::JSFunction>::cast(fun_obj));
const int kArgc = 1;
- v8::Handle<v8::Value> argv[kArgc] = {obj};
+ v8::Local<v8::Value> argv[kArgc] = {obj};
Local<Value> result;
has_pending_exception = !v8_fun->Call(context, Utils::ToLocal(debug), kArgc,
argv).ToLocal(&result);
}
-Local<Value> Debug::GetMirror(v8::Handle<v8::Value> obj) {
+Local<Value> Debug::GetMirror(v8::Local<v8::Value> obj) {
RETURN_TO_LOCAL_UNCHECKED(GetMirror(Local<Context>(), obj), Value);
}
}
-Handle<String> CpuProfileNode::GetFunctionName() const {
+Local<String> CpuProfileNode::GetFunctionName() const {
i::Isolate* isolate = i::Isolate::Current();
const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);
const i::CodeEntry* entry = node->entry();
}
-Handle<String> CpuProfileNode::GetScriptResourceName() const {
+Local<String> CpuProfileNode::GetScriptResourceName() const {
i::Isolate* isolate = i::Isolate::Current();
const i::ProfileNode* node = reinterpret_cast<const i::ProfileNode*>(this);
return ToApiHandle<String>(isolate->factory()->InternalizeUtf8String(
}
-Handle<String> CpuProfile::GetTitle() const {
+Local<String> CpuProfile::GetTitle() const {
i::Isolate* isolate = i::Isolate::Current();
const i::CpuProfile* profile = reinterpret_cast<const i::CpuProfile*>(this);
return ToApiHandle<String>(isolate->factory()->InternalizeUtf8String(
}
-void CpuProfiler::StartProfiling(Handle<String> title, bool record_samples) {
+void CpuProfiler::StartProfiling(Local<String> title, bool record_samples) {
reinterpret_cast<i::CpuProfiler*>(this)->StartProfiling(
*Utils::OpenHandle(*title), record_samples);
}
-CpuProfile* CpuProfiler::StopProfiling(Handle<String> title) {
+CpuProfile* CpuProfiler::StopProfiling(Local<String> title) {
return reinterpret_cast<CpuProfile*>(
reinterpret_cast<i::CpuProfiler*>(this)->StopProfiling(
*Utils::OpenHandle(*title)));
}
-Handle<Value> HeapGraphEdge::GetName() const {
+Local<Value> HeapGraphEdge::GetName() const {
i::Isolate* isolate = i::Isolate::Current();
i::HeapGraphEdge* edge = ToInternal(this);
switch (edge->type()) {
}
-Handle<String> HeapGraphNode::GetName() const {
+Local<String> HeapGraphNode::GetName() const {
i::Isolate* isolate = i::Isolate::Current();
return ToApiHandle<String>(
isolate->factory()->InternalizeUtf8String(ToInternal(this)->name()));
}
-SnapshotObjectId HeapProfiler::GetObjectId(Handle<Value> value) {
+SnapshotObjectId HeapProfiler::GetObjectId(Local<Value> value) {
i::Handle<i::Object> obj = Utils::OpenHandle(*value);
return reinterpret_cast<i::HeapProfiler*>(this)->GetSnapshotObjectId(obj);
}
-Handle<Value> HeapProfiler::FindObjectById(SnapshotObjectId id) {
+Local<Value> HeapProfiler::FindObjectById(SnapshotObjectId id) {
i::Handle<i::Object> obj =
reinterpret_cast<i::HeapProfiler*>(this)->FindHeapObjectById(id);
if (obj.is_null()) return Local<Value>();
namespace internal {
-template<typename T>
-template<typename V>
-v8::Handle<V> CustomArguments<T>::GetReturnValue(Isolate* isolate) {
+template <typename T>
+template <typename V>
+v8::Local<V> CustomArguments<T>::GetReturnValue(Isolate* isolate) {
// Check the ReturnValue.
Object** handle = &this->begin()[kReturnValueOffset];
// Nothing was set, return empty handle as per previous behaviour.
- if ((*handle)->IsTheHole()) return v8::Handle<V>();
+ if ((*handle)->IsTheHole()) return v8::Local<V>();
return Utils::Convert<Object, V>(Handle<Object>(handle));
}
-v8::Handle<v8::Value> FunctionCallbackArguments::Call(FunctionCallback f) {
+v8::Local<v8::Value> FunctionCallbackArguments::Call(FunctionCallback f) {
Isolate* isolate = this->isolate();
VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
}
-#define WRITE_CALL_0(Function, ReturnValue) \
-v8::Handle<ReturnValue> PropertyCallbackArguments::Call(Function f) { \
- Isolate* isolate = this->isolate(); \
- VMState<EXTERNAL> state(isolate); \
- ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
- PropertyCallbackInfo<ReturnValue> info(begin()); \
- f(info); \
- return GetReturnValue<ReturnValue>(isolate); \
-}
-
-
-#define WRITE_CALL_1(Function, ReturnValue, Arg1) \
-v8::Handle<ReturnValue> PropertyCallbackArguments::Call(Function f, \
- Arg1 arg1) { \
- Isolate* isolate = this->isolate(); \
- VMState<EXTERNAL> state(isolate); \
- ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
- PropertyCallbackInfo<ReturnValue> info(begin()); \
- f(arg1, info); \
- return GetReturnValue<ReturnValue>(isolate); \
-}
-
-
-#define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2) \
-v8::Handle<ReturnValue> PropertyCallbackArguments::Call(Function f, \
- Arg1 arg1, \
- Arg2 arg2) { \
- Isolate* isolate = this->isolate(); \
- VMState<EXTERNAL> state(isolate); \
- ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
- PropertyCallbackInfo<ReturnValue> info(begin()); \
- f(arg1, arg2, info); \
- return GetReturnValue<ReturnValue>(isolate); \
-}
+#define WRITE_CALL_0(Function, ReturnValue) \
+ v8::Local<ReturnValue> PropertyCallbackArguments::Call(Function f) { \
+ Isolate* isolate = this->isolate(); \
+ VMState<EXTERNAL> state(isolate); \
+ ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
+ PropertyCallbackInfo<ReturnValue> info(begin()); \
+ f(info); \
+ return GetReturnValue<ReturnValue>(isolate); \
+ }
+
+
+#define WRITE_CALL_1(Function, ReturnValue, Arg1) \
+ v8::Local<ReturnValue> PropertyCallbackArguments::Call(Function f, \
+ Arg1 arg1) { \
+ Isolate* isolate = this->isolate(); \
+ VMState<EXTERNAL> state(isolate); \
+ ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
+ PropertyCallbackInfo<ReturnValue> info(begin()); \
+ f(arg1, info); \
+ return GetReturnValue<ReturnValue>(isolate); \
+ }
+
+
+#define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2) \
+ v8::Local<ReturnValue> PropertyCallbackArguments::Call( \
+ Function f, Arg1 arg1, Arg2 arg2) { \
+ Isolate* isolate = this->isolate(); \
+ VMState<EXTERNAL> state(isolate); \
+ ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
+ PropertyCallbackInfo<ReturnValue> info(begin()); \
+ f(arg1, arg2, info); \
+ return GetReturnValue<ReturnValue>(isolate); \
+ }
#define WRITE_CALL_2_VOID(Function, ReturnValue, Arg1, Arg2) \
protected:
explicit inline CustomArguments(Isolate* isolate) : Super(isolate) {}
- template<typename V>
- v8::Handle<V> GetReturnValue(Isolate* isolate);
+ template <typename V>
+ v8::Local<V> GetReturnValue(Isolate* isolate);
inline Isolate* isolate() {
return reinterpret_cast<Isolate*>(this->begin()[T::kIsolateIndex]);
* and used if it's been set to anything inside the callback.
* New style callbacks always use the return value.
*/
-#define WRITE_CALL_0(Function, ReturnValue) \
- v8::Handle<ReturnValue> Call(Function f); \
+#define WRITE_CALL_0(Function, ReturnValue) \
+ v8::Local<ReturnValue> Call(Function f);
-#define WRITE_CALL_1(Function, ReturnValue, Arg1) \
- v8::Handle<ReturnValue> Call(Function f, Arg1 arg1); \
+#define WRITE_CALL_1(Function, ReturnValue, Arg1) \
+ v8::Local<ReturnValue> Call(Function f, Arg1 arg1);
-#define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2) \
- v8::Handle<ReturnValue> Call(Function f, Arg1 arg1, Arg2 arg2); \
+#define WRITE_CALL_2(Function, ReturnValue, Arg1, Arg2) \
+ v8::Local<ReturnValue> Call(Function f, Arg1 arg1, Arg2 arg2);
#define WRITE_CALL_2_VOID(Function, ReturnValue, Arg1, Arg2) \
void Call(Function f, Arg1 arg1, Arg2 arg2); \
* and used if it's been set to anything inside the callback.
* New style callbacks always use the return value.
*/
- v8::Handle<v8::Value> Call(FunctionCallback f);
+ v8::Local<v8::Value> Call(FunctionCallback f);
private:
internal::Object** argv_;
class Genesis BASE_EMBEDDED {
public:
- Genesis(Isolate* isolate,
- MaybeHandle<JSGlobalProxy> maybe_global_proxy,
- v8::Handle<v8::ObjectTemplate> global_proxy_template,
+ Genesis(Isolate* isolate, MaybeHandle<JSGlobalProxy> maybe_global_proxy,
+ v8::Local<v8::ObjectTemplate> global_proxy_template,
v8::ExtensionConfiguration* extensions);
~Genesis() { }
// we have to used the deserialized ones that are linked together with the
// rest of the context snapshot.
Handle<GlobalObject> CreateNewGlobals(
- v8::Handle<v8::ObjectTemplate> global_proxy_template,
+ v8::Local<v8::ObjectTemplate> global_proxy_template,
Handle<JSGlobalProxy> global_proxy);
// Hooks the given global proxy into the context. If the context was created
// by deserialization then this will unhook the global proxy that was
bool ConfigureApiObject(Handle<JSObject> object,
Handle<ObjectTemplateInfo> object_template);
bool ConfigureGlobalObjects(
- v8::Handle<v8::ObjectTemplate> global_proxy_template);
+ v8::Local<v8::ObjectTemplate> global_proxy_template);
// Migrates all properties from the 'from' object to the 'to'
// object and overrides the prototype in 'to' with the one from
Handle<Context> Bootstrapper::CreateEnvironment(
MaybeHandle<JSGlobalProxy> maybe_global_proxy,
- v8::Handle<v8::ObjectTemplate> global_proxy_template,
+ v8::Local<v8::ObjectTemplate> global_proxy_template,
v8::ExtensionConfiguration* extensions) {
HandleScope scope(isolate_);
Genesis genesis(
Handle<GlobalObject> Genesis::CreateNewGlobals(
- v8::Handle<v8::ObjectTemplate> global_proxy_template,
+ v8::Local<v8::ObjectTemplate> global_proxy_template,
Handle<JSGlobalProxy> global_proxy) {
// The argument global_proxy_template aka data is an ObjectTemplateInfo.
// It has a constructor pointer that points at global_constructor which is a
bool Genesis::ConfigureGlobalObjects(
- v8::Handle<v8::ObjectTemplate> global_proxy_template) {
+ v8::Local<v8::ObjectTemplate> global_proxy_template) {
Handle<JSObject> global_proxy(
JSObject::cast(native_context()->global_proxy()));
Handle<JSObject> global_object(
Genesis::Genesis(Isolate* isolate,
MaybeHandle<JSGlobalProxy> maybe_global_proxy,
- v8::Handle<v8::ObjectTemplate> global_proxy_template,
+ v8::Local<v8::ObjectTemplate> global_proxy_template,
v8::ExtensionConfiguration* extensions)
- : isolate_(isolate),
- active_(isolate->bootstrapper()) {
+ : isolate_(isolate), active_(isolate->bootstrapper()) {
NoTrackDoubleFieldsForSerializerScope disable_scope(isolate);
result_ = Handle<Context>::null();
// Before creating the roots we must save the context and restore it
// The returned value is a global handle casted to V8Environment*.
Handle<Context> CreateEnvironment(
MaybeHandle<JSGlobalProxy> maybe_global_proxy,
- v8::Handle<v8::ObjectTemplate> global_object_template,
+ v8::Local<v8::ObjectTemplate> global_object_template,
v8::ExtensionConfiguration* extensions);
// Detach the environment from its outer global object.
args.length() - 1,
is_construct);
- v8::Handle<v8::Value> value = custom.Call(callback);
+ v8::Local<v8::Value> value = custom.Call(callback);
Handle<Object> result;
if (value.IsEmpty()) {
result = isolate->factory()->undefined_value();
&args[0] - 1,
args.length() - 1,
is_construct_call);
- v8::Handle<v8::Value> value = custom.Call(callback);
+ v8::Local<v8::Value> value = custom.Call(callback);
if (value.IsEmpty()) {
result = heap->undefined_value();
} else {
Handle<JSFunction> GetFunction(Isolate* isolate, const char* name) {
v8::ExtensionConfiguration no_extensions;
Handle<Context> ctx = isolate->bootstrapper()->CreateEnvironment(
- MaybeHandle<JSGlobalProxy>(), v8::Handle<v8::ObjectTemplate>(),
+ MaybeHandle<JSGlobalProxy>(), v8::Local<v8::ObjectTemplate>(),
&no_extensions);
Handle<JSBuiltinsObject> builtins = handle(ctx->builtins());
MaybeHandle<Object> fun = Object::GetProperty(isolate, builtins, name);
}
-static v8::Handle<v8::Context> GetDebugEventContext(Isolate* isolate) {
+static v8::Local<v8::Context> GetDebugEventContext(Isolate* isolate) {
Handle<Context> context = isolate->debug()->debugger_entry()->GetContext();
// Isolate::context() may have been NULL when "script collected" event
// occured.
// Create the debugger context.
HandleScope scope(isolate_);
ExtensionConfiguration no_extensions;
- Handle<Context> context =
- isolate_->bootstrapper()->CreateEnvironment(
- MaybeHandle<JSGlobalProxy>(),
- v8::Handle<ObjectTemplate>(),
- &no_extensions);
+ Handle<Context> context = isolate_->bootstrapper()->CreateEnvironment(
+ MaybeHandle<JSGlobalProxy>(), v8::Local<ObjectTemplate>(),
+ &no_extensions);
// Fail if no context could be created.
if (context.is_null()) return false;
}
-v8::Handle<v8::Object> MessageImpl::GetExecutionState() const {
+v8::Local<v8::Object> MessageImpl::GetExecutionState() const {
return v8::Utils::ToLocal(exec_state_);
}
}
-v8::Handle<v8::Object> MessageImpl::GetEventData() const {
+v8::Local<v8::Object> MessageImpl::GetEventData() const {
return v8::Utils::ToLocal(event_data_);
}
-v8::Handle<v8::String> MessageImpl::GetJSON() const {
+v8::Local<v8::String> MessageImpl::GetJSON() const {
Isolate* isolate = event_data_->GetIsolate();
v8::EscapableHandleScope scope(reinterpret_cast<v8::Isolate*>(isolate));
Handle<Object> fun = Object::GetProperty(
isolate, event_data_, "toJSONProtocol").ToHandleChecked();
if (!fun->IsJSFunction()) {
- return v8::Handle<v8::String>();
+ return v8::Local<v8::String>();
}
MaybeHandle<Object> maybe_json =
Execution::TryCall(Handle<JSFunction>::cast(fun), event_data_, 0, NULL);
Handle<Object> json;
if (!maybe_json.ToHandle(&json) || !json->IsString()) {
- return v8::Handle<v8::String>();
+ return v8::Local<v8::String>();
}
return scope.Escape(v8::Utils::ToLocal(Handle<String>::cast(json)));
} else {
}
-v8::Handle<v8::Context> MessageImpl::GetEventContext() const {
+v8::Local<v8::Context> MessageImpl::GetEventContext() const {
Isolate* isolate = event_data_->GetIsolate();
- v8::Handle<v8::Context> context = GetDebugEventContext(isolate);
+ v8::Local<v8::Context> context = GetDebugEventContext(isolate);
// Isolate::context() may be NULL when "script collected" event occurs.
DCHECK(!context.IsEmpty());
return context;
}
-v8::Handle<v8::Object> EventDetailsImpl::GetExecutionState() const {
+v8::Local<v8::Object> EventDetailsImpl::GetExecutionState() const {
return v8::Utils::ToLocal(exec_state_);
}
-v8::Handle<v8::Object> EventDetailsImpl::GetEventData() const {
+v8::Local<v8::Object> EventDetailsImpl::GetEventData() const {
return v8::Utils::ToLocal(event_data_);
}
-v8::Handle<v8::Context> EventDetailsImpl::GetEventContext() const {
+v8::Local<v8::Context> EventDetailsImpl::GetEventContext() const {
return GetDebugEventContext(exec_state_->GetIsolate());
}
-v8::Handle<v8::Value> EventDetailsImpl::GetCallbackData() const {
+v8::Local<v8::Value> EventDetailsImpl::GetCallbackData() const {
return v8::Utils::ToLocal(callback_data_);
}
virtual bool IsResponse() const;
virtual DebugEvent GetEvent() const;
virtual bool WillStartRunning() const;
- virtual v8::Handle<v8::Object> GetExecutionState() const;
- virtual v8::Handle<v8::Object> GetEventData() const;
- virtual v8::Handle<v8::String> GetJSON() const;
- virtual v8::Handle<v8::Context> GetEventContext() const;
+ virtual v8::Local<v8::Object> GetExecutionState() const;
+ virtual v8::Local<v8::Object> GetEventData() const;
+ virtual v8::Local<v8::String> GetJSON() const;
+ virtual v8::Local<v8::Context> GetEventContext() const;
virtual v8::Debug::ClientData* GetClientData() const;
virtual v8::Isolate* GetIsolate() const;
Handle<Object> callback_data,
v8::Debug::ClientData* client_data);
virtual DebugEvent GetEvent() const;
- virtual v8::Handle<v8::Object> GetExecutionState() const;
- virtual v8::Handle<v8::Object> GetEventData() const;
- virtual v8::Handle<v8::Context> GetEventContext() const;
- virtual v8::Handle<v8::Value> GetCallbackData() const;
+ virtual v8::Local<v8::Object> GetExecutionState() const;
+ virtual v8::Local<v8::Object> GetEventData() const;
+ virtual v8::Local<v8::Context> GetEventContext() const;
+ virtual v8::Local<v8::Value> GetCallbackData() const;
virtual v8::Debug::ClientData* GetClientData() const;
private:
DebugEvent event_; // Debug event causing the break.
"native function externalizeString();"
"native function isOneByteString();";
-v8::Handle<v8::FunctionTemplate>
+v8::Local<v8::FunctionTemplate>
ExternalizeStringExtension::GetNativeFunctionTemplate(
- v8::Isolate* isolate, v8::Handle<v8::String> str) {
+ v8::Isolate* isolate, v8::Local<v8::String> str) {
if (strcmp(*v8::String::Utf8Value(str), "externalizeString") == 0) {
return v8::FunctionTemplate::New(isolate,
ExternalizeStringExtension::Externalize);
class ExternalizeStringExtension : public v8::Extension {
public:
ExternalizeStringExtension() : v8::Extension("v8/externalize", kSource) {}
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
- v8::Isolate* isolate,
- v8::Handle<v8::String> name);
+ virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
+ v8::Isolate* isolate, v8::Local<v8::String> name);
static void Externalize(const v8::FunctionCallbackInfo<v8::Value>& args);
static void IsOneByte(const v8::FunctionCallbackInfo<v8::Value>& args);
namespace internal {
-v8::Handle<v8::FunctionTemplate> FreeBufferExtension::GetNativeFunctionTemplate(
- v8::Isolate* isolate,
- v8::Handle<v8::String> str) {
+v8::Local<v8::FunctionTemplate> FreeBufferExtension::GetNativeFunctionTemplate(
+ v8::Isolate* isolate, v8::Local<v8::String> str) {
return v8::FunctionTemplate::New(isolate, FreeBufferExtension::FreeBuffer);
}
void FreeBufferExtension::FreeBuffer(
const v8::FunctionCallbackInfo<v8::Value>& args) {
- v8::Handle<v8::ArrayBuffer> arrayBuffer = args[0].As<v8::ArrayBuffer>();
+ v8::Local<v8::ArrayBuffer> arrayBuffer = args[0].As<v8::ArrayBuffer>();
v8::ArrayBuffer::Contents contents = arrayBuffer->Externalize();
Isolate* isolate = reinterpret_cast<Isolate*>(args.GetIsolate());
isolate->array_buffer_allocator()->Free(contents.Data(),
public:
FreeBufferExtension()
: v8::Extension("v8/free-buffer", "native function freeBuffer();") {}
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
- v8::Isolate* isolate,
- v8::Handle<v8::String> name);
+ virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
+ v8::Isolate* isolate, v8::Local<v8::String> name);
static void FreeBuffer(const v8::FunctionCallbackInfo<v8::Value>& args);
};
namespace internal {
-v8::Handle<v8::FunctionTemplate> GCExtension::GetNativeFunctionTemplate(
- v8::Isolate* isolate,
- v8::Handle<v8::String> str) {
+v8::Local<v8::FunctionTemplate> GCExtension::GetNativeFunctionTemplate(
+ v8::Isolate* isolate, v8::Local<v8::String> str) {
return v8::FunctionTemplate::New(isolate, GCExtension::GC);
}
explicit GCExtension(const char* fun_name)
: v8::Extension("v8/gc",
BuildSource(buffer_, sizeof(buffer_), fun_name)) {}
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
- v8::Isolate* isolate,
- v8::Handle<v8::String> name);
+ virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
+ v8::Isolate* isolate, v8::Local<v8::String> name);
static void GC(const v8::FunctionCallbackInfo<v8::Value>& args);
private:
"native function getV8Statistics();";
-v8::Handle<v8::FunctionTemplate> StatisticsExtension::GetNativeFunctionTemplate(
- v8::Isolate* isolate,
- v8::Handle<v8::String> str) {
+v8::Local<v8::FunctionTemplate> StatisticsExtension::GetNativeFunctionTemplate(
+ v8::Isolate* isolate, v8::Local<v8::String> str) {
DCHECK(strcmp(*v8::String::Utf8Value(str), "getV8Statistics") == 0);
return v8::FunctionTemplate::New(isolate, StatisticsExtension::GetCounters);
}
class StatisticsExtension : public v8::Extension {
public:
StatisticsExtension() : v8::Extension("v8/statistics", kSource) {}
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
- v8::Isolate* isolate,
- v8::Handle<v8::String> name);
+ virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
+ v8::Isolate* isolate, v8::Local<v8::String> name);
static void GetCounters(const v8::FunctionCallbackInfo<v8::Value>& args);
private:
"native function triggerSlowAssertFalse();";
-v8::Handle<v8::FunctionTemplate>
-TriggerFailureExtension::GetNativeFunctionTemplate(
- v8::Isolate* isolate,
- v8::Handle<v8::String> str) {
+v8::Local<v8::FunctionTemplate>
+TriggerFailureExtension::GetNativeFunctionTemplate(v8::Isolate* isolate,
+ v8::Local<v8::String> str) {
if (strcmp(*v8::String::Utf8Value(str), "triggerCheckFalse") == 0) {
return v8::FunctionTemplate::New(
isolate,
class TriggerFailureExtension : public v8::Extension {
public:
TriggerFailureExtension() : v8::Extension("v8/trigger-failure", kSource) {}
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate(
- v8::Isolate* isolate,
- v8::Handle<v8::String> name);
+ virtual v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
+ v8::Isolate* isolate, v8::Local<v8::String> name);
static void TriggerCheckFalse(
const v8::FunctionCallbackInfo<v8::Value>& args);
static void TriggerAssertFalse(
// Compute the function template for the native function.
Handle<String> name = expr->name();
- v8::Handle<v8::FunctionTemplate> fun_template =
+ v8::Local<v8::FunctionTemplate> fun_template =
expr->extension()->GetNativeFunctionTemplate(v8_isolate,
v8::Utils::ToLocal(name));
DCHECK(!fun_template.IsEmpty());
template<class T>
void DeleteNativeObjectAt(const v8::WeakCallbackData<v8::Value, void>& data,
int index) {
- v8::Local<v8::Object> obj = v8::Handle<v8::Object>::Cast(data.GetValue());
+ v8::Local<v8::Object> obj = v8::Local<v8::Object>::Cast(data.GetValue());
delete reinterpret_cast<T*>(obj->GetAlignedPointerFromInternalField(index));
}
LOG(isolate, ApiNamedPropertyAccess("load", *holder, *name));
PropertyCallbackArguments args(isolate, info->data(), *receiver, *holder);
- v8::Handle<v8::Value> result =
- args.Call(call_fun, v8::Utils::ToLocal(name));
+ v8::Local<v8::Value> result = args.Call(call_fun, v8::Utils::ToLocal(name));
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
if (result.IsEmpty()) {
return ReadAbsentProperty(isolate, receiver, name, language_mode);
if (interceptor->setter()->IsUndefined()) return MaybeHandle<Object>();
Handle<JSObject> holder = it->GetHolder<JSObject>();
- v8::Handle<v8::Value> result;
+ v8::Local<v8::Value> result;
PropertyCallbackArguments args(isolate, interceptor->data(),
*it->GetReceiver(), *holder);
PropertyCallbackArguments args(isolate, interceptor->data(),
*it->GetReceiver(), *holder);
if (!interceptor->query()->IsUndefined()) {
- v8::Handle<v8::Integer> result;
+ v8::Local<v8::Integer> result;
if (it->IsElement()) {
uint32_t index = it->index();
v8::IndexedPropertyQueryCallback query =
}
} else if (!interceptor->getter()->IsUndefined()) {
// TODO(verwaest): Use GetPropertyWithInterceptor?
- v8::Handle<v8::Value> result;
+ v8::Local<v8::Value> result;
if (it->IsElement()) {
uint32_t index = it->index();
v8::IndexedPropertyGetterCallback getter =
PropertyCallbackArguments args(isolate, interceptor->data(),
*it->GetReceiver(), *holder);
- v8::Handle<v8::Boolean> result;
+ v8::Local<v8::Boolean> result;
if (it->IsElement()) {
uint32_t index = it->index();
v8::IndexedPropertyDeleterCallback deleter =
}
Handle<JSObject> holder = it->GetHolder<JSObject>();
- v8::Handle<v8::Value> result;
+ v8::Local<v8::Value> result;
PropertyCallbackArguments args(isolate, interceptor->data(),
*it->GetReceiver(), *holder);
Handle<InterceptorInfo> interceptor(object->GetNamedInterceptor());
PropertyCallbackArguments
args(isolate, interceptor->data(), *receiver, *object);
- v8::Handle<v8::Object> result;
+ v8::Local<v8::Object> result;
if (!interceptor->enumerator()->IsUndefined()) {
v8::GenericNamedPropertyEnumeratorCallback enum_fun =
v8::ToCData<v8::GenericNamedPropertyEnumeratorCallback>(
Handle<InterceptorInfo> interceptor(object->GetIndexedInterceptor());
PropertyCallbackArguments
args(isolate, interceptor->data(), *receiver, *object);
- v8::Handle<v8::Object> result;
+ v8::Local<v8::Object> result;
if (!interceptor->enumerator()->IsUndefined()) {
v8::IndexedPropertyEnumeratorCallback enum_fun =
v8::ToCData<v8::IndexedPropertyEnumeratorCallback>(