v8
3.28.71 (node 0.12.18)
V8 is Google's open source JavaScript engine
|
#include <v8.h>
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< Object > | New (Isolate *isolate) |
static V8_INLINE Object * | Cast (Value *obj) |
Static Public Member Functions inherited from Value | |
template<class T > | |
static V8_INLINE Value * | Cast (T *value) |
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.
Call an Object as a function if a callback is set by the ObjectTemplate::SetCallAsFunctionHandler method.
Clone this object with a fast but shallow copy. Values will point to the same values as the original object.
bool Delete | ( | uint32_t | index | ) |
Local<Object> FindInstanceInPrototypeChain | ( | Handle< FunctionTemplate > | tmpl | ) |
Finds an instance of the given function template in the prototype chain.
|
inlinestatic |
Same as above, but works for Persistents
Definition at line 2256 of file v8.h.
References Object::GetAlignedPointerFromInternalField().
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().
Returns the name of the function invoked as a constructor for this object.
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.
void* GetIndexedPropertiesExternalArrayData | ( | ) |
int GetIndexedPropertiesExternalArrayDataLength | ( | ) |
ExternalArrayType GetIndexedPropertiesExternalArrayDataType | ( | ) |
uint8_t* GetIndexedPropertiesPixelData | ( | ) |
int GetIndexedPropertiesPixelDataLength | ( | ) |
Gets the value from an internal field.
Definition at line 6193 of file v8.h.
References Internals::GetInstanceType(), v8::internal::kApiPointerSize, Internals::kJSObjectHeaderSize, Internals::kJSObjectType, Handle< T >::Local, and Internals::ReadField().
Returns Object.getOwnPropertyDescriptor as per ES5 section 15.2.3.3.
This function has the same functionality as GetPropertyNames but the returned array doesn't contain the names of properties from prototype objects.
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.
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.
Get the prototype object. This does not skip objects marked to be skipped by proto and it does not consult the security handler.
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.
If result.IsEmpty() no real property was located in the prototype chain. This means interceptors in the prototype chain are not called.
bool Has | ( | uint32_t | index | ) |
bool HasIndexedLookupInterceptor | ( | ) |
Tests for an index lookup interceptor.
bool HasIndexedPropertiesInExternalArrayData | ( | ) |
bool HasIndexedPropertiesInPixelData | ( | ) |
bool HasNamedLookupInterceptor | ( | ) |
Tests for a named lookup interceptor.
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.
bool HasRealIndexedProperty | ( | uint32_t | index | ) |
int InternalFieldCount | ( | ) |
Gets the number of internal fields for this Object.
Referenced by Object::InternalFieldCount().
|
inlinestatic |
Same as above, but works for Persistents
Definition at line 2237 of file v8.h.
References Object::InternalFieldCount().
bool IsCallable | ( | ) |
Checks whether a callback is set by the ObjectTemplate::SetCallAsFunctionHandler method. When an Object is callable this method returns true.
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.
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.
bool SetAccessor | ( | Handle< String > | name, |
AccessorGetterCallback | getter, | ||
AccessorSetterCallback | setter = 0 , |
||
Handle< Value > | data = Handle< Value >() , |
||
AccessControl | settings = DEFAULT , |
||
PropertyAttribute | attribute = None |
||
) |
void SetAccessorProperty | ( | Local< String > | name, |
Local< Function > | getter, | ||
Handle< Function > | setter = Handle< Function >() , |
||
PropertyAttribute | attribute = None , |
||
AccessControl | settings = DEFAULT |
||
) |
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.
bool SetDeclaredAccessor | ( | Local< String > | name, |
Local< DeclaredAccessorDescriptor > | descriptor, | ||
PropertyAttribute | attribute = None , |
||
AccessControl | settings = DEFAULT |
||
) |
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.
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.
Set the prototype object. This does not skip objects marked to be skipped by proto and it does not consult the security handler.
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.