v8  3.11.10(node0.8.26)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Object Class Reference

#include <v8.h>

Inheritance diagram for Object:
Collaboration diagram for Object:

Public Member Functions

V8EXPORT bool Set (Handle< Value > key, Handle< Value > value, PropertyAttribute attribs=None)
 
V8EXPORT bool Set (uint32_t index, Handle< Value > value)
 
V8EXPORT bool ForceSet (Handle< Value > key, Handle< Value > value, PropertyAttribute attribs=None)
 
V8EXPORT Local< ValueGet (Handle< Value > key)
 
V8EXPORT Local< ValueGet (uint32_t index)
 
V8EXPORT PropertyAttribute GetPropertyAttributes (Handle< Value > key)
 
V8EXPORT bool Has (Handle< String > key)
 
V8EXPORT bool Delete (Handle< String > key)
 
V8EXPORT bool ForceDelete (Handle< Value > key)
 
V8EXPORT bool Has (uint32_t index)
 
V8EXPORT bool Delete (uint32_t index)
 
V8EXPORT bool SetAccessor (Handle< String > name, AccessorGetter getter, AccessorSetter setter=0, Handle< Value > data=Handle< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None)
 
V8EXPORT Local< ArrayGetPropertyNames ()
 
V8EXPORT Local< ArrayGetOwnPropertyNames ()
 
V8EXPORT Local< ValueGetPrototype ()
 
V8EXPORT bool SetPrototype (Handle< Value > prototype)
 
V8EXPORT Local< ObjectFindInstanceInPrototypeChain (Handle< FunctionTemplate > tmpl)
 
V8EXPORT Local< StringObjectProtoToString ()
 
V8EXPORT Local< StringGetConstructorName ()
 
V8EXPORT int InternalFieldCount ()
 
Local< ValueGetInternalField (int index)
 
V8EXPORT void SetInternalField (int index, Handle< Value > value)
 
void * GetPointerFromInternalField (int index)
 
V8EXPORT void SetPointerInInternalField (int index, void *value)
 
V8EXPORT bool HasOwnProperty (Handle< String > key)
 
V8EXPORT bool HasRealNamedProperty (Handle< String > key)
 
V8EXPORT bool HasRealIndexedProperty (uint32_t index)
 
V8EXPORT bool HasRealNamedCallbackProperty (Handle< String > key)
 
V8EXPORT Local< ValueGetRealNamedPropertyInPrototypeChain (Handle< String > key)
 
V8EXPORT Local< ValueGetRealNamedProperty (Handle< String > key)
 
V8EXPORT bool HasNamedLookupInterceptor ()
 
V8EXPORT bool HasIndexedLookupInterceptor ()
 
V8EXPORT void TurnOnAccessCheck ()
 
V8EXPORT int GetIdentityHash ()
 
V8EXPORT bool SetHiddenValue (Handle< String > key, Handle< Value > value)
 
V8EXPORT Local< ValueGetHiddenValue (Handle< String > key)
 
V8EXPORT bool DeleteHiddenValue (Handle< String > key)
 
V8EXPORT bool IsDirty ()
 
V8EXPORT Local< ObjectClone ()
 
V8EXPORT Local< ContextCreationContext ()
 
V8EXPORT void SetIndexedPropertiesToPixelData (uint8_t *data, int length)
 
V8EXPORT bool HasIndexedPropertiesInPixelData ()
 
V8EXPORT uint8_t * GetIndexedPropertiesPixelData ()
 
V8EXPORT int GetIndexedPropertiesPixelDataLength ()
 
V8EXPORT void SetIndexedPropertiesToExternalArrayData (void *data, ExternalArrayType array_type, int number_of_elements)
 
V8EXPORT bool HasIndexedPropertiesInExternalArrayData ()
 
V8EXPORT void * GetIndexedPropertiesExternalArrayData ()
 
V8EXPORT ExternalArrayType GetIndexedPropertiesExternalArrayDataType ()
 
V8EXPORT int GetIndexedPropertiesExternalArrayDataLength ()
 
V8EXPORT bool IsCallable ()
 
V8EXPORT Local< ValueCallAsFunction (Handle< Object > recv, int argc, Handle< Value > argv[])
 
V8EXPORT Local< ValueCallAsConstructor (int argc, Handle< Value > argv[])
 
- Public Member Functions inherited from Value
bool IsUndefined () const
 
bool IsNull () const
 
V8EXPORT bool IsTrue () const
 
V8EXPORT bool IsFalse () const
 
bool IsString () const
 
V8EXPORT bool IsFunction () const
 
V8EXPORT bool IsArray () const
 
V8EXPORT bool IsObject () const
 
V8EXPORT bool IsBoolean () const
 
V8EXPORT bool IsNumber () const
 
V8EXPORT bool IsExternal () const
 
V8EXPORT bool IsInt32 () const
 
V8EXPORT bool IsUint32 () const
 
V8EXPORT bool IsDate () const
 
V8EXPORT bool IsBooleanObject () const
 
V8EXPORT bool IsNumberObject () const
 
V8EXPORT bool IsStringObject () const
 
V8EXPORT bool IsNativeError () const
 
V8EXPORT bool IsRegExp () const
 
V8EXPORT Local< BooleanToBoolean () const
 
V8EXPORT Local< NumberToNumber () const
 
V8EXPORT Local< StringToString () const
 
V8EXPORT Local< StringToDetailString () const
 
V8EXPORT Local< ObjectToObject () const
 
V8EXPORT Local< IntegerToInteger () const
 
V8EXPORT Local< Uint32ToUint32 () const
 
V8EXPORT Local< Int32ToInt32 () const
 
V8EXPORT Local< Uint32ToArrayIndex () const
 
V8EXPORT bool BooleanValue () const
 
V8EXPORT double NumberValue () const
 
V8EXPORT int64_t IntegerValue () const
 
V8EXPORT uint32_t Uint32Value () const
 
V8EXPORT int32_t Int32Value () const
 
V8EXPORT bool Equals (Handle< Value > that) const
 
V8EXPORT bool StrictEquals (Handle< Value > that) const
 

Static Public Member Functions

static V8EXPORT Local< ObjectNew ()
 
static ObjectCast (Value *obj)
 

Detailed Description

A JavaScript object (ECMA-262, 4.3.3)

Definition at line 1457 of file v8.h.

Member Function Documentation

Object * Cast ( v8::Value value)
inlinestatic

Definition at line 4386 of file v8.h.

Referenced by NonStrictArgsIndexedPropertyEnumerator(), and THREADED_TEST().

Local< v8::Object > Clone ( )

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

Definition at line 3237 of file api.cc.

References v8::internal::Copy(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Handle< T >::is_null(), ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().

Referenced by THREADED_TEST().

Local< v8::Context > CreationContext ( )

Returns the context in which the object was created.

Definition at line 3265 of file api.cc.

References ENTER_V8, ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().

bool Delete ( v8::Handle< String key)

Definition at line 3045 of file api.cc.

References JSObject::DeleteProperty(), ENTER_V8, Value::IsTrue(), ON_BAILOUT, and Utils::OpenHandle().

Referenced by TEST(), and THREADED_TEST().

bool Delete ( uint32_t  index)
bool DeleteHiddenValue ( Handle< String key)

Definition at line 3314 of file api.cc.

References ENTER_V8, ON_BAILOUT, and Utils::OpenHandle().

Referenced by THREADED_TEST().

Local< Object > FindInstanceInPrototypeChain ( v8::Handle< FunctionTemplate tmpl)

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

Definition at line 2920 of file api.cc.

References JSObject::cast(), ENTER_V8, Object::GetPrototype(), Object::IsInstanceOf(), ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().

bool ForceSet ( v8::Handle< Value key,
v8::Handle< Value value,
v8::PropertyAttribute  attribs = None 
)
Local< String > GetConstructorName ( )

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

Definition at line 3034 of file api.cc.

References ENTER_V8, ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().

v8::Local< v8::Value > GetHiddenValue ( Handle< String key)

Definition at line 3301 of file api.cc.

References ENTER_V8, ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().

Referenced by THREADED_TEST().

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.

Definition at line 3276 of file api.cc.

References ENTER_V8, JSObject::GetIdentityHash(), ON_BAILOUT, and Utils::OpenHandle().

void * GetIndexedPropertiesExternalArrayData ( )

Definition at line 3469 of file api.cc.

References FixedArrayBase::cast(), NULL, ON_BAILOUT, and Utils::OpenHandle().

Referenced by ExternalArrayInfoTestHelper().

int GetIndexedPropertiesExternalArrayDataLength ( )

Definition at line 3512 of file api.cc.

References FixedArrayBase::cast(), ON_BAILOUT, and Utils::OpenHandle().

Referenced by ExternalArrayInfoTestHelper().

uint8_t * GetIndexedPropertiesPixelData ( )

Definition at line 3412 of file api.cc.

References ExternalPixelArray::cast(), NULL, ON_BAILOUT, and Utils::OpenHandle().

Referenced by THREADED_TEST().

int GetIndexedPropertiesPixelDataLength ( )

Definition at line 3425 of file api.cc.

References ExternalPixelArray::cast(), ON_BAILOUT, and Utils::OpenHandle().

Referenced by THREADED_TEST().

Local< Value > GetInternalField ( int  index)
inline

Gets the value in an internal field.

Definition at line 4180 of file v8.h.

Referenced by THREADED_TEST().

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.

Definition at line 2959 of file api.cc.

References HandleScope::CloseAndEscape(), Factory::CopyFixedArray(), ENTER_V8, Isolate::factory(), v8::internal::GetKeysInFixedArrayFor(), v8::internal::LOCAL_ONLY, Factory::NewJSArrayWithElements(), ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().

Referenced by CheckOwnProperties().

void * GetPointerFromInternalField ( int  index)
inline

Gets a native pointer from an internal field.

Definition at line 4223 of file v8.h.

References I, and v8::internal::kApiPointerSize.

PropertyAttribute GetPropertyAttributes ( v8::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.

Definition at line 2872 of file api.cc.

References ABSENT, Handle< T >::cast(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, NONE, ON_BAILOUT, Utils::OpenHandle(), and Execution::ToString().

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.

Definition at line 2938 of file api.cc.

References HandleScope::CloseAndEscape(), Factory::CopyFixedArray(), ENTER_V8, Isolate::factory(), v8::internal::GetKeysInFixedArrayFor(), v8::internal::INCLUDE_PROTOS, Factory::NewJSArrayWithElements(), ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().

Referenced by CheckProperties().

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.

Definition at line 2892 of file api.cc.

References ENTER_V8, ON_BAILOUT, Utils::OpenHandle(), and Utils::ToLocal().

Referenced by v8::internal::RUNTIME_FUNCTION(), TEST(), and THREADED_TEST().

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.

Definition at line 3198 of file api.cc.

References ENTER_V8, ON_BAILOUT, and Utils::OpenHandle().

Referenced by THREADED_TEST().

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.

Definition at line 3183 of file api.cc.

References ENTER_V8, ON_BAILOUT, and Utils::OpenHandle().

bool Has ( v8::Handle< String key)

Definition at line 3056 of file api.cc.

References ENTER_V8, ON_BAILOUT, and Utils::OpenHandle().

Referenced by THREADED_TEST().

bool Has ( uint32_t  index)

Definition at line 3077 of file api.cc.

References ON_BAILOUT, and Utils::OpenHandle().

bool HasIndexedLookupInterceptor ( )

Tests for an index lookup interceptor.

Definition at line 3152 of file api.cc.

References ON_BAILOUT, and Utils::OpenHandle().

bool HasIndexedPropertiesInExternalArrayData ( )

Definition at line 3460 of file api.cc.

References ON_BAILOUT, and Utils::OpenHandle().

Referenced by ExternalArrayInfoTestHelper().

bool HasIndexedPropertiesInPixelData ( )

Definition at line 3404 of file api.cc.

References ON_BAILOUT, and Utils::OpenHandle().

Referenced by THREADED_TEST().

bool HasNamedLookupInterceptor ( )

Tests for a named lookup interceptor.

Definition at line 3144 of file api.cc.

References ON_BAILOUT, and Utils::OpenHandle().

bool HasOwnProperty ( Handle< String key)

Definition at line 3107 of file api.cc.

References ON_BAILOUT, and Utils::OpenHandle().

bool HasRealIndexedProperty ( uint32_t  index)

Definition at line 3125 of file api.cc.

References ON_BAILOUT, and Utils::OpenHandle().

Referenced by TEST().

bool HasRealNamedCallbackProperty ( Handle< String key)

Definition at line 3133 of file api.cc.

References ENTER_V8, ON_BAILOUT, and Utils::OpenHandle().

Referenced by TEST().

bool HasRealNamedProperty ( Handle< String key)

Definition at line 3116 of file api.cc.

References ON_BAILOUT, and Utils::OpenHandle().

Referenced by TEST().

int InternalFieldCount ( )

Gets the number of internal fields for this Object.

Definition at line 4121 of file api.cc.

References Utils::OpenHandle().

Referenced by TEST(), and THREADED_TEST().

bool IsCallable ( )

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

Definition at line 3525 of file api.cc.

References ENTER_V8, Execution::GetFunctionDelegate(), ON_BAILOUT, and Utils::OpenHandle().

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.

Definition at line 3232 of file api.cc.

References Utils::OpenHandle().

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.

Definition at line 2980 of file api.cc.

References Handle< T >::cast(), v8::internal::CStrVector(), ENTER_V8, v8::internal::kCharSize, String::New(), ON_BAILOUT, Utils::OpenHandle(), Vector< T >::start(), v8::internal::StrLength(), and Utils::ToLocal().

bool SetAccessor ( Handle< String name,
AccessorGetter  getter,
AccessorSetter  setter = 0,
v8::Handle< Value data = Handle<Value>(),
AccessControl  settings = DEFAULT,
PropertyAttribute  attribute = None 
)
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::".

Definition at line 3286 of file api.cc.

References ENTER_V8, ON_BAILOUT, Utils::OpenHandle(), and JSObject::SetHiddenProperty().

Referenced by Shell::ReadBuffer(), and THREADED_TEST().

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.

Definition at line 3437 of file api.cc.

References ENTER_V8, ExternalArray::kMaxLength, ON_BAILOUT, and Utils::OpenHandle().

Referenced by ExternalArrayInfoTestHelper(), and Shell::ReadBuffer().

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.

Definition at line 3384 of file api.cc.

References ENTER_V8, v8::kExternalPixelArray, ExternalArray::kMaxLength, ON_BAILOUT, and Utils::OpenHandle().

Referenced by THREADED_TEST().

void SetInternalField ( int  index,
v8::Handle< Value value 
)

Sets the value in an internal field.

Definition at line 4150 of file api.cc.

References ENTER_V8, and Utils::OpenHandle().

Referenced by TEST(), and THREADED_TEST().

void SetPointerInInternalField ( int  index,
void *  value 
)

Sets a native pointer in an internal field.

Definition at line 4184 of file api.cc.

References ASSERT_EQ, ENTER_V8, Isolate::factory(), Handle< T >::is_null(), Factory::NewForeign(), Utils::OpenHandle(), and v8::internal::TENURED.

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.

Definition at line 2903 of file api.cc.

References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, Handle< T >::is_null(), ON_BAILOUT, Utils::OpenHandle(), and v8::internal::SetPrototype().

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.

Definition at line 3214 of file api.cc.

References Factory::CopyMapDropTransitions(), Deoptimizer::DeoptimizeGlobalObject(), ENTER_V8, Isolate::factory(), ON_BAILOUT, and Utils::OpenHandle().

Referenced by THREADED_TEST().


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