v8  3.28.71 (node 0.12.18)
V8 is Google's open source JavaScript engine
Object Class Reference

#include <v8.h>

Inheritance diagram for Object:
Collaboration diagram for Object:

Public Member Functions

bool Set (Handle< Value > key, Handle< Value > value)
 
bool Set (uint32_t index, Handle< Value > value)
 
bool ForceSet (Handle< Value > key, Handle< Value > value, PropertyAttribute attribs=None)
 
Local< ValueGet (Handle< Value > key)
 
Local< ValueGet (uint32_t index)
 
PropertyAttribute GetPropertyAttributes (Handle< Value > key)
 
Local< ValueGetOwnPropertyDescriptor (Local< String > key)
 
bool Has (Handle< Value > key)
 
bool Delete (Handle< Value > key)
 
bool ForceDelete (Handle< Value > key)
 
bool Has (uint32_t index)
 
bool Delete (uint32_t index)
 
bool SetAccessor (Handle< String > name, AccessorGetterCallback getter, AccessorSetterCallback setter=0, Handle< Value > data=Handle< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None)
 
bool SetDeclaredAccessor (Local< String > name, Local< DeclaredAccessorDescriptor > descriptor, PropertyAttribute attribute=None, AccessControl settings=DEFAULT)
 
void SetAccessorProperty (Local< String > name, Local< Function > getter, Handle< Function > setter=Handle< Function >(), PropertyAttribute attribute=None, AccessControl settings=DEFAULT)
 
bool HasPrivate (Handle< Private > key)
 
bool SetPrivate (Handle< Private > key, Handle< Value > value)
 
bool DeletePrivate (Handle< Private > key)
 
Local< ValueGetPrivate (Handle< Private > key)
 
Local< ArrayGetPropertyNames ()
 
Local< ArrayGetOwnPropertyNames ()
 
Local< ValueGetPrototype ()
 
bool SetPrototype (Handle< Value > prototype)
 
Local< ObjectFindInstanceInPrototypeChain (Handle< FunctionTemplate > tmpl)
 
Local< StringObjectProtoToString ()
 
Local< StringGetConstructorName ()
 
int InternalFieldCount ()
 
V8_INLINE Local< ValueGetInternalField (int index)
 
void SetInternalField (int index, Handle< Value > value)
 
V8_INLINE void * GetAlignedPointerFromInternalField (int index)
 
void SetAlignedPointerInInternalField (int index, void *value)
 
bool HasOwnProperty (Handle< String > key)
 
bool HasRealNamedProperty (Handle< String > key)
 
bool HasRealIndexedProperty (uint32_t index)
 
bool HasRealNamedCallbackProperty (Handle< String > key)
 
Local< ValueGetRealNamedPropertyInPrototypeChain (Handle< String > key)
 
Local< ValueGetRealNamedProperty (Handle< String > key)
 
bool HasNamedLookupInterceptor ()
 
bool HasIndexedLookupInterceptor ()
 
void TurnOnAccessCheck ()
 
int GetIdentityHash ()
 
bool SetHiddenValue (Handle< String > key, Handle< Value > value)
 
Local< ValueGetHiddenValue (Handle< String > key)
 
bool DeleteHiddenValue (Handle< String > key)
 
bool IsDirty ()
 
Local< ObjectClone ()
 
Local< ContextCreationContext ()
 
void SetIndexedPropertiesToPixelData (uint8_t *data, int length)
 
bool HasIndexedPropertiesInPixelData ()
 
uint8_t * GetIndexedPropertiesPixelData ()
 
int GetIndexedPropertiesPixelDataLength ()
 
void SetIndexedPropertiesToExternalArrayData (void *data, ExternalArrayType array_type, int number_of_elements)
 
bool HasIndexedPropertiesInExternalArrayData ()
 
void * GetIndexedPropertiesExternalArrayData ()
 
ExternalArrayType GetIndexedPropertiesExternalArrayDataType ()
 
int GetIndexedPropertiesExternalArrayDataLength ()
 
bool IsCallable ()
 
Local< ValueCallAsFunction (Handle< Value > recv, int argc, Handle< Value > argv[])
 
Local< ValueCallAsConstructor (int argc, Handle< Value > argv[])
 
- Public Member Functions inherited from Value
V8_INLINE bool IsUndefined () const
 
V8_INLINE bool IsNull () const
 
bool IsTrue () const
 
bool IsFalse () const
 
V8_INLINE bool IsString () const
 
bool IsSymbol () const
 
bool IsFunction () const
 
bool IsArray () const
 
bool IsObject () const
 
bool IsBoolean () const
 
bool IsNumber () const
 
bool IsExternal () const
 
bool IsInt32 () const
 
bool IsUint32 () const
 
bool IsDate () const
 
bool IsBooleanObject () const
 
bool IsNumberObject () const
 
bool IsStringObject () const
 
bool IsSymbolObject () const
 
bool IsNativeError () const
 
bool IsRegExp () const
 
bool IsPromise () const
 
bool IsArrayBuffer () const
 
bool IsArrayBufferView () const
 
bool IsTypedArray () const
 
bool IsUint8Array () const
 
bool IsUint8ClampedArray () const
 
bool IsInt8Array () const
 
bool IsUint16Array () const
 
bool IsInt16Array () const
 
bool IsUint32Array () const
 
bool IsInt32Array () const
 
bool IsFloat32Array () const
 
bool IsFloat64Array () const
 
bool IsDataView () const
 
Local< BooleanToBoolean () const
 
Local< NumberToNumber () const
 
Local< StringToString () const
 
Local< StringToDetailString () const
 
Local< ObjectToObject () const
 
Local< IntegerToInteger () const
 
Local< Uint32ToUint32 () const
 
Local< Int32ToInt32 () const
 
Local< Uint32ToArrayIndex () const
 
bool BooleanValue () const
 
double NumberValue () const
 
int64_t IntegerValue () const
 
uint32_t Uint32Value () const
 
int32_t Int32Value () const
 
bool Equals (Handle< Value > that) const
 
bool StrictEquals (Handle< Value > that) const
 
bool SameValue (Handle< Value > that) const
 
template<class T >
ValueCast (T *value)
 

Static Public Member Functions

static V8_INLINE int InternalFieldCount (const PersistentBase< Object > &object)
 
static V8_INLINE void * GetAlignedPointerFromInternalField (const PersistentBase< Object > &object, int index)
 
static Local< ObjectNew (Isolate *isolate)
 
static V8_INLINE ObjectCast (Value *obj)
 
- Static Public Member Functions inherited from Value
template<class T >
static V8_INLINE ValueCast (T *value)
 

Detailed Description

A JavaScript object (ECMA-262, 4.3.3)

Definition at line 2110 of file v8.h.

Member Function Documentation

◆ CallAsConstructor()

Local<Value> CallAsConstructor ( int  argc,
Handle< Value argv[] 
)

Call an Object as a constructor if a callback is set by the ObjectTemplate::SetCallAsFunctionHandler method. Note: This method behaves like the Function::NewInstance method.

◆ CallAsFunction()

Local<Value> CallAsFunction ( Handle< Value recv,
int  argc,
Handle< Value argv[] 
)

Call an Object as a function if a callback is set by the ObjectTemplate::SetCallAsFunctionHandler method.

◆ Cast()

Object * Cast ( v8::Value value)
static

Definition at line 6413 of file v8.h.

◆ Clone()

Local<Object> Clone ( )

Clone this object with a fast but shallow copy. Values will point to the same values as the original object.

◆ CreationContext()

Local<Context> CreationContext ( )

Returns the context in which the object was created.

◆ Delete() [1/2]

bool Delete ( Handle< Value key)

◆ Delete() [2/2]

bool Delete ( uint32_t  index)

◆ DeleteHiddenValue()

bool DeleteHiddenValue ( Handle< String key)

◆ DeletePrivate()

bool DeletePrivate ( Handle< Private key)

◆ FindInstanceInPrototypeChain()

Local<Object> FindInstanceInPrototypeChain ( Handle< FunctionTemplate tmpl)

Finds an instance of the given function template in the prototype chain.

◆ ForceDelete()

bool ForceDelete ( Handle< Value key)

◆ ForceSet()

bool ForceSet ( Handle< Value key,
Handle< Value value,
PropertyAttribute  attribs = None 
)

◆ Get() [1/2]

Local<Value> Get ( Handle< Value key)

◆ Get() [2/2]

Local<Value> Get ( uint32_t  index)

◆ GetAlignedPointerFromInternalField() [1/2]

static V8_INLINE void* GetAlignedPointerFromInternalField ( const PersistentBase< Object > &  object,
int  index 
)
inlinestatic

Same as above, but works for Persistents

Definition at line 2256 of file v8.h.

References Object::GetAlignedPointerFromInternalField().

◆ GetAlignedPointerFromInternalField() [2/2]

void * GetAlignedPointerFromInternalField ( int  index)

Gets a 2-byte-aligned native pointer from an internal field. This field must have been set by SetAlignedPointerInInternalField, everything else leads to undefined behavior.

Definition at line 6212 of file v8.h.

References Internals::GetInstanceType(), v8::internal::kApiPointerSize, Internals::kJSObjectHeaderSize, Internals::kJSObjectType, and Internals::ReadField().

Referenced by Object::GetAlignedPointerFromInternalField().

◆ GetConstructorName()

Local<String> GetConstructorName ( )

Returns the name of the function invoked as a constructor for this object.

◆ GetHiddenValue()

Local<Value> GetHiddenValue ( Handle< String key)

◆ GetIdentityHash()

int GetIdentityHash ( )

Returns the identity hash for this object. The current implementation uses a hidden property on the object to store the identity hash.

The return value will never be 0. Also, it is not guaranteed to be unique.

◆ GetIndexedPropertiesExternalArrayData()

void* GetIndexedPropertiesExternalArrayData ( )

◆ GetIndexedPropertiesExternalArrayDataLength()

int GetIndexedPropertiesExternalArrayDataLength ( )

◆ GetIndexedPropertiesExternalArrayDataType()

ExternalArrayType GetIndexedPropertiesExternalArrayDataType ( )

◆ GetIndexedPropertiesPixelData()

uint8_t* GetIndexedPropertiesPixelData ( )

◆ GetIndexedPropertiesPixelDataLength()

int GetIndexedPropertiesPixelDataLength ( )

◆ GetInternalField()

Local< Value > GetInternalField ( int  index)

◆ GetOwnPropertyDescriptor()

Local<Value> GetOwnPropertyDescriptor ( Local< String key)

Returns Object.getOwnPropertyDescriptor as per ES5 section 15.2.3.3.

◆ GetOwnPropertyNames()

Local<Array> GetOwnPropertyNames ( )

This function has the same functionality as GetPropertyNames but the returned array doesn't contain the names of properties from prototype objects.

◆ GetPrivate()

Local<Value> GetPrivate ( Handle< Private key)

◆ GetPropertyAttributes()

PropertyAttribute GetPropertyAttributes ( Handle< Value key)

Gets the property attributes of a property which can be None or any combination of ReadOnly, DontEnum and DontDelete. Returns None when the property doesn't exist.

◆ GetPropertyNames()

Local<Array> GetPropertyNames ( )

Returns an array containing the names of the enumerable properties of this object, including properties from prototype objects. The array returned by this method contains the same values as would be enumerated by a for-in statement over this object.

◆ GetPrototype()

Local<Value> GetPrototype ( )

Get the prototype object. This does not skip objects marked to be skipped by proto and it does not consult the security handler.

◆ GetRealNamedProperty()

Local<Value> GetRealNamedProperty ( Handle< String key)

If result.IsEmpty() no real property was located on the object or in the prototype chain. This means interceptors in the prototype chain are not called.

◆ GetRealNamedPropertyInPrototypeChain()

Local<Value> GetRealNamedPropertyInPrototypeChain ( Handle< String key)

If result.IsEmpty() no real property was located in the prototype chain. This means interceptors in the prototype chain are not called.

◆ Has() [1/2]

bool Has ( Handle< Value key)

◆ Has() [2/2]

bool Has ( uint32_t  index)

◆ HasIndexedLookupInterceptor()

bool HasIndexedLookupInterceptor ( )

Tests for an index lookup interceptor.

◆ HasIndexedPropertiesInExternalArrayData()

bool HasIndexedPropertiesInExternalArrayData ( )

◆ HasIndexedPropertiesInPixelData()

bool HasIndexedPropertiesInPixelData ( )

◆ HasNamedLookupInterceptor()

bool HasNamedLookupInterceptor ( )

Tests for a named lookup interceptor.

◆ HasOwnProperty()

bool HasOwnProperty ( Handle< String key)

◆ HasPrivate()

bool HasPrivate ( Handle< Private key)

Functionality for private properties. This is an experimental feature, use at your own risk. Note: Private properties are inherited. Do not rely on this, since it may change.

◆ HasRealIndexedProperty()

bool HasRealIndexedProperty ( uint32_t  index)

◆ HasRealNamedCallbackProperty()

bool HasRealNamedCallbackProperty ( Handle< String key)

◆ HasRealNamedProperty()

bool HasRealNamedProperty ( Handle< String key)

◆ InternalFieldCount() [1/2]

int InternalFieldCount ( )

Gets the number of internal fields for this Object.

Referenced by Object::InternalFieldCount().

◆ InternalFieldCount() [2/2]

static V8_INLINE int InternalFieldCount ( const PersistentBase< Object > &  object)
inlinestatic

Same as above, but works for Persistents

Definition at line 2237 of file v8.h.

References Object::InternalFieldCount().

◆ IsCallable()

bool IsCallable ( )

Checks whether a callback is set by the ObjectTemplate::SetCallAsFunctionHandler method. When an Object is callable this method returns true.

◆ IsDirty()

bool IsDirty ( )

Returns true if this is an instance of an api function (one created from a function created from a function template) and has been modified since it was created. Note that this method is conservative and may return true for objects that haven't actually been modified.

◆ New()

static Local<Object> New ( Isolate isolate)
static

◆ ObjectProtoToString()

Local<String> ObjectProtoToString ( )

Call builtin Object.prototype.toString on this object. This is different from Value::ToString() that may call user-defined toString function. This one does not.

◆ Set() [1/2]

bool Set ( Handle< Value key,
Handle< Value value 
)

◆ Set() [2/2]

bool Set ( uint32_t  index,
Handle< Value value 
)

◆ SetAccessor()

bool SetAccessor ( Handle< String name,
AccessorGetterCallback  getter,
AccessorSetterCallback  setter = 0,
Handle< Value data = HandleValue >(),
AccessControl  settings = DEFAULT,
PropertyAttribute  attribute = None 
)

◆ SetAccessorProperty()

void SetAccessorProperty ( Local< String name,
Local< Function getter,
Handle< Function setter = HandleFunction >(),
PropertyAttribute  attribute = None,
AccessControl  settings = DEFAULT 
)

◆ SetAlignedPointerInInternalField()

void SetAlignedPointerInInternalField ( int  index,
void *  value 
)

Sets a 2-byte-aligned native pointer in an internal field. To retrieve such a field, GetAlignedPointerFromInternalField must be used, everything else leads to undefined behavior.

◆ SetDeclaredAccessor()

bool SetDeclaredAccessor ( Local< String name,
Local< DeclaredAccessorDescriptor descriptor,
PropertyAttribute  attribute = None,
AccessControl  settings = DEFAULT 
)

◆ SetHiddenValue()

bool SetHiddenValue ( Handle< String key,
Handle< Value value 
)

Access hidden properties on JavaScript objects. These properties are hidden from the executing JavaScript and only accessible through the V8 C++ API. Hidden properties introduced by V8 internally (for example the identity hash) are prefixed with "v8::".

◆ SetIndexedPropertiesToExternalArrayData()

void SetIndexedPropertiesToExternalArrayData ( void *  data,
ExternalArrayType  array_type,
int  number_of_elements 
)

Set the backing store of the indexed properties to be managed by the embedding layer. Access to the indexed properties will follow the rules spelled out for the CanvasArray subtypes in the WebGL specification. Note: The embedding program still owns the data and needs to ensure that the backing store is preserved while V8 has a reference.

◆ SetIndexedPropertiesToPixelData()

void SetIndexedPropertiesToPixelData ( uint8_t *  data,
int  length 
)

Set the backing store of the indexed properties to be managed by the embedding layer. Access to the indexed properties will follow the rules spelled out in CanvasPixelArray. Note: The embedding program still owns the data and needs to ensure that the backing store is preserved while V8 has a reference.

◆ SetInternalField()

void SetInternalField ( int  index,
Handle< Value value 
)

Sets the value in an internal field.

◆ SetPrivate()

bool SetPrivate ( Handle< Private key,
Handle< Value value 
)

◆ SetPrototype()

bool SetPrototype ( Handle< Value prototype)

Set the prototype object. This does not skip objects marked to be skipped by proto and it does not consult the security handler.

◆ TurnOnAccessCheck()

void TurnOnAccessCheck ( )

Turns on access check on the object if the object is an instance of a template that has access check callbacks. If an object has no access check info, the object cannot be accessed by anyone.


The documentation for this class was generated from the following file: