V8 Project
|
A JavaScript object (ECMA-262, 4.3.3) More...
#include <v8.h>
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< Value > | Get (Handle< Value > key) |
Local< Value > | Get (uint32_t index) |
PropertyAttribute | GetPropertyAttributes (Handle< Value > key) |
Gets the property attributes of a property which can be None or any combination of ReadOnly, DontEnum and DontDelete. More... | |
Local< Value > | GetOwnPropertyDescriptor (Local< String > key) |
Returns Object.getOwnPropertyDescriptor as per ES5 section 15.2.3.3. More... | |
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 | SetAccessor (Handle< Name > name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=0, Handle< Value > data=Handle< Value >(), AccessControl settings=DEFAULT, PropertyAttribute attribute=None) |
bool | SetDeclaredAccessor (Local< Name > name, Local< DeclaredAccessorDescriptor > descriptor, PropertyAttribute attribute=None, AccessControl settings=DEFAULT) |
void | SetAccessorProperty (Local< Name > name, Local< Function > getter, Handle< Function > setter=Handle< Function >(), PropertyAttribute attribute=None, AccessControl settings=DEFAULT) |
bool | HasPrivate (Handle< Private > key) |
Functionality for private properties. More... | |
bool | SetPrivate (Handle< Private > key, Handle< Value > value) |
bool | DeletePrivate (Handle< Private > key) |
Local< Value > | GetPrivate (Handle< Private > key) |
Local< Array > | GetPropertyNames () |
Returns an array containing the names of the enumerable properties of this object, including properties from prototype objects. More... | |
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. More... | |
Local< Value > | GetPrototype () |
Get the prototype object. More... | |
bool | SetPrototype (Handle< Value > prototype) |
Set the prototype object. More... | |
Local< Object > | FindInstanceInPrototypeChain (Handle< FunctionTemplate > tmpl) |
Finds an instance of the given function template in the prototype chain. More... | |
Local< String > | ObjectProtoToString () |
Call builtin Object.prototype.toString on this object. More... | |
Local< String > | GetConstructorName () |
Returns the name of the function invoked as a constructor for this object. More... | |
int | InternalFieldCount () |
Gets the number of internal fields for this Object. More... | |
Local< Value > | GetInternalField (int index) |
Gets the value from an internal field. More... | |
void | SetInternalField (int index, Handle< Value > value) |
Sets the value in an internal field. More... | |
void * | GetAlignedPointerFromInternalField (int index) |
Gets a 2-byte-aligned native pointer from an internal field. More... | |
void | SetAlignedPointerInInternalField (int index, void *value) |
Sets a 2-byte-aligned native pointer in an internal field. More... | |
bool | HasOwnProperty (Handle< String > key) |
bool | HasRealNamedProperty (Handle< String > key) |
bool | HasRealIndexedProperty (uint32_t index) |
bool | HasRealNamedCallbackProperty (Handle< String > key) |
Local< Value > | GetRealNamedPropertyInPrototypeChain (Handle< String > key) |
If result.IsEmpty() no real property was located in the prototype chain. More... | |
Local< Value > | GetRealNamedProperty (Handle< String > key) |
If result.IsEmpty() no real property was located on the object or in the prototype chain. More... | |
bool | HasNamedLookupInterceptor () |
Tests for a named lookup interceptor. More... | |
bool | HasIndexedLookupInterceptor () |
Tests for an index lookup interceptor. More... | |
void | TurnOnAccessCheck () |
Turns on access check on the object if the object is an instance of a template that has access check callbacks. More... | |
int | GetIdentityHash () |
Returns the identity hash for this object. More... | |
bool | SetHiddenValue (Handle< String > key, Handle< Value > value) |
Access hidden properties on JavaScript objects. More... | |
Local< Value > | GetHiddenValue (Handle< String > key) |
bool | DeleteHiddenValue (Handle< String > key) |
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. More... | |
Local< Object > | Clone () |
Clone this object with a fast but shallow copy. More... | |
Local< Context > | CreationContext () |
Returns the context in which the object was created. More... | |
void | SetIndexedPropertiesToPixelData (uint8_t *data, int length) |
Set the backing store of the indexed properties to be managed by the embedding layer. More... | |
bool | HasIndexedPropertiesInPixelData () |
uint8_t * | GetIndexedPropertiesPixelData () |
int | GetIndexedPropertiesPixelDataLength () |
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. More... | |
bool | HasIndexedPropertiesInExternalArrayData () |
void * | GetIndexedPropertiesExternalArrayData () |
ExternalArrayType | GetIndexedPropertiesExternalArrayDataType () |
int | GetIndexedPropertiesExternalArrayDataLength () |
bool | IsCallable () |
Checks whether a callback is set by the ObjectTemplate::SetCallAsFunctionHandler method. More... | |
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. More... | |
Local< Value > | CallAsConstructor (int argc, Handle< Value > argv[]) |
Call an Object as a constructor if a callback is set by the ObjectTemplate::SetCallAsFunctionHandler method. More... | |
![]() | |
bool | IsUndefined () const |
Returns true if this value is the undefined value. More... | |
bool | IsNull () const |
Returns true if this value is the null value. More... | |
bool | IsTrue () const |
Returns true if this value is true. More... | |
bool | IsFalse () const |
Returns true if this value is false. More... | |
bool | IsName () const |
Returns true if this value is a symbol or a string. More... | |
bool | IsString () const |
Returns true if this value is an instance of the String type. More... | |
bool | IsSymbol () const |
Returns true if this value is a symbol. More... | |
bool | IsFunction () const |
Returns true if this value is a function. More... | |
bool | IsArray () const |
Returns true if this value is an array. More... | |
bool | IsObject () const |
Returns true if this value is an object. More... | |
bool | IsBoolean () const |
Returns true if this value is boolean. More... | |
bool | IsNumber () const |
Returns true if this value is a number. More... | |
bool | IsExternal () const |
Returns true if this value is external. More... | |
bool | IsInt32 () const |
Returns true if this value is a 32-bit signed integer. More... | |
bool | IsUint32 () const |
Returns true if this value is a 32-bit unsigned integer. More... | |
bool | IsDate () const |
Returns true if this value is a Date. More... | |
bool | IsArgumentsObject () const |
Returns true if this value is an Arguments object. More... | |
bool | IsBooleanObject () const |
Returns true if this value is a Boolean object. More... | |
bool | IsNumberObject () const |
Returns true if this value is a Number object. More... | |
bool | IsStringObject () const |
Returns true if this value is a String object. More... | |
bool | IsSymbolObject () const |
Returns true if this value is a Symbol object. More... | |
bool | IsNativeError () const |
Returns true if this value is a NativeError. More... | |
bool | IsRegExp () const |
Returns true if this value is a RegExp. More... | |
bool | IsGeneratorFunction () const |
Returns true if this value is a Generator function. More... | |
bool | IsGeneratorObject () const |
Returns true if this value is a Generator object (iterator). More... | |
bool | IsPromise () const |
Returns true if this value is a Promise. More... | |
bool | IsMap () const |
Returns true if this value is a Map. More... | |
bool | IsSet () const |
Returns true if this value is a Set. More... | |
bool | IsWeakMap () const |
Returns true if this value is a WeakMap. More... | |
bool | IsWeakSet () const |
Returns true if this value is a WeakSet. More... | |
bool | IsArrayBuffer () const |
Returns true if this value is an ArrayBuffer. More... | |
bool | IsArrayBufferView () const |
Returns true if this value is an ArrayBufferView. More... | |
bool | IsTypedArray () const |
Returns true if this value is one of TypedArrays. More... | |
bool | IsUint8Array () const |
Returns true if this value is an Uint8Array. More... | |
bool | IsUint8ClampedArray () const |
Returns true if this value is an Uint8ClampedArray. More... | |
bool | IsInt8Array () const |
Returns true if this value is an Int8Array. More... | |
bool | IsUint16Array () const |
Returns true if this value is an Uint16Array. More... | |
bool | IsInt16Array () const |
Returns true if this value is an Int16Array. More... | |
bool | IsUint32Array () const |
Returns true if this value is an Uint32Array. More... | |
bool | IsInt32Array () const |
Returns true if this value is an Int32Array. More... | |
bool | IsFloat32Array () const |
Returns true if this value is a Float32Array. More... | |
bool | IsFloat64Array () const |
Returns true if this value is a Float64Array. More... | |
bool | IsDataView () const |
Returns true if this value is a DataView. More... | |
Local< Boolean > | ToBoolean () const |
Local< Number > | ToNumber () const |
Local< String > | ToString () const |
Local< String > | ToDetailString () const |
Local< Object > | ToObject () const |
Local< Integer > | ToInteger () const |
Local< Uint32 > | ToUint32 () const |
Local< Int32 > | ToInt32 () const |
Local< Uint32 > | ToArrayIndex () const |
Attempts to convert a string to an array index. More... | |
bool | BooleanValue () const |
double | NumberValue () const |
int64_t | IntegerValue () const |
uint32_t | Uint32Value () const |
int32_t | Int32Value () const |
bool | Equals (Handle< Value > that) const |
JS ==. More... | |
bool | StrictEquals (Handle< Value > that) const |
bool | SameValue (Handle< Value > that) const |
Static Public Member Functions | |
static int | InternalFieldCount (const PersistentBase< Object > &object) |
Same as above, but works for Persistents. More... | |
static void * | GetAlignedPointerFromInternalField (const PersistentBase< Object > &object, int index) |
Same as above, but works for Persistents. More... | |
static Local< Object > | New (Isolate *isolate) |
static Object * | Cast (Value *obj) |
![]() | |
template<class T > | |
static Value * | Cast (T *value) |
Private Member Functions | |
Object () | |
Local< Value > | SlowGetInternalField (int index) |
void * | SlowGetAlignedPointerFromInternalField (int index) |
Static Private Member Functions | |
static void | CheckCast (Value *obj) |
|
private |
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.
Definition at line 4024 of file api.cc.
References v8::internal::Handle< T >::cast(), v8::internal::HandleScope::CloseAndEscape(), DCHECK, ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_BAILOUT_CHECK_DO_CALLBACK, EXCEPTION_PREAMBLE, LOG_API, ON_BAILOUT, v8::Utils::OpenHandle(), STATIC_ASSERT, and v8::Utils::ToLocal().
Local< v8::Value > v8::Object::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.
Definition at line 3989 of file api.cc.
References v8::internal::Handle< T >::cast(), v8::internal::HandleScope::CloseAndEscape(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_BAILOUT_CHECK_DO_CALLBACK, EXCEPTION_PREAMBLE, LOG_API, ON_BAILOUT, v8::Utils::OpenHandle(), STATIC_ASSERT, and v8::Utils::ToLocal().
|
staticprivate |
Definition at line 2706 of file api.cc.
References v8::Utils::ApiCheck(), and v8::Utils::OpenHandle().
Local< v8::Object > 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 3733 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::Isolate::factory(), v8::internal::Handle< T >::is_null(), ON_BAILOUT, v8::Utils::OpenHandle(), and v8::Utils::ToLocal().
Local< v8::Context > v8::Object::CreationContext | ( | ) |
Returns the context in which the object was created.
Definition at line 3746 of file api.cc.
References ENTER_V8, ON_BAILOUT, v8::Utils::OpenHandle(), and v8::Utils::ToLocal().
bool v8::Object::Delete | ( | v8::Handle< Value > | key | ) |
Definition at line 3441 of file api.cc.
References v8::internal::Runtime::DeleteObjectProperty(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::JSReceiver::NORMAL_DELETION, ON_BAILOUT, and v8::Utils::OpenHandle().
Definition at line 3484 of file api.cc.
References v8::internal::JSReceiver::DeleteElement(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, ON_BAILOUT, and v8::Utils::OpenHandle().
Definition at line 3800 of file api.cc.
References v8::internal::JSObject::DeleteHiddenProperty(), ENTER_V8, v8::internal::Isolate::factory(), ON_BAILOUT, and v8::Utils::OpenHandle().
bool v8::Object::DeletePrivate | ( | v8::Handle< Private > | key | ) |
Local< Object > v8::Object::FindInstanceInPrototypeChain | ( | v8::Handle< FunctionTemplate > | tmpl | ) |
Finds an instance of the given function template in the prototype chain.
Definition at line 3310 of file api.cc.
References v8::internal::PrototypeIterator::Advance(), ENTER_V8, v8::internal::PrototypeIterator::GetCurrent(), v8::internal::handle(), v8::internal::PrototypeIterator::IsAtEnd(), v8::internal::FunctionTemplateInfo::IsTemplateFor(), ON_BAILOUT, v8::Utils::OpenHandle(), v8::internal::PrototypeIterator::START_AT_RECEIVER, and v8::Utils::ToLocal().
bool v8::Object::ForceDelete | ( | v8::Handle< Value > | key | ) |
Definition at line 3178 of file api.cc.
References v8::internal::Runtime::DeleteObjectProperty(), v8::internal::Deoptimizer::DeoptimizeAll(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::JSReceiver::FORCE_DELETION, ON_BAILOUT, and v8::Utils::OpenHandle().
bool v8::Object::ForceSet | ( | v8::Handle< Value > | key, |
v8::Handle< Value > | value, | ||
v8::PropertyAttribute | attribs = None |
||
) |
Definition at line 3151 of file api.cc.
References v8::internal::Runtime::DefineObjectProperty(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, ON_BAILOUT, and v8::Utils::OpenHandle().
Local< Value > v8::Object::Get | ( | v8::Handle< Value > | key | ) |
Definition at line 3203 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::Runtime::GetObjectProperty(), ON_BAILOUT, v8::Utils::OpenHandle(), and v8::Utils::ToLocal().
Definition at line 3218 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::Object::GetElement(), ON_BAILOUT, v8::Utils::OpenHandle(), and v8::Utils::ToLocal().
|
inlinestatic |
|
inline |
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 6445 of file v8.h.
References I, v8::internal::kApiPointerSize, and V8_LIKELY.
Returns the name of the function invoked as a constructor for this object.
Definition at line 3430 of file api.cc.
References ENTER_V8, name, ON_BAILOUT, v8::Utils::OpenHandle(), and v8::Utils::ToLocal().
Definition at line 3785 of file api.cc.
References ENTER_V8, v8::internal::Isolate::factory(), ON_BAILOUT, v8::Utils::OpenHandle(), and v8::Utils::ToLocal().
int v8::Object::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 3757 of file api.cc.
References ENTER_V8, v8::internal::JSReceiver::GetOrCreateIdentityHash(), ON_BAILOUT, and v8::Utils::OpenHandle().
void * v8::Object::GetIndexedPropertiesExternalArrayData | ( | ) |
Definition at line 3936 of file api.cc.
References NULL, ON_BAILOUT, and v8::Utils::OpenHandle().
int v8::Object::GetIndexedPropertiesExternalArrayDataLength | ( | ) |
Definition at line 3966 of file api.cc.
References ON_BAILOUT, and v8::Utils::OpenHandle().
ExternalArrayType v8::Object::GetIndexedPropertiesExternalArrayDataType | ( | ) |
Definition at line 3949 of file api.cc.
References INSTANCE_TYPE_TO_ARRAY_TYPE, ON_BAILOUT, v8::Utils::OpenHandle(), and TYPED_ARRAYS.
uint8_t * v8::Object::GetIndexedPropertiesPixelData | ( | ) |
Definition at line 3879 of file api.cc.
References NULL, ON_BAILOUT, and v8::Utils::OpenHandle().
int v8::Object::GetIndexedPropertiesPixelDataLength | ( | ) |
Definition at line 3892 of file api.cc.
References ON_BAILOUT, and v8::Utils::OpenHandle().
Gets the value from an internal field.
Definition at line 6426 of file v8.h.
References v8::HandleScope::CreateHandle(), I, and v8::internal::kApiPointerSize.
Returns Object.getOwnPropertyDescriptor as per ES5 section 15.2.3.3.
Definition at line 3262 of file api.cc.
References arraysize, v8::CallV8HeapFunction(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::Isolate::factory(), ON_BAILOUT, v8::Utils::OpenHandle(), and v8::Utils::ToLocal().
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 3353 of file api.cc.
References v8::internal::HandleScope::CloseAndEscape(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::Isolate::factory(), v8::internal::JSReceiver::GetKeys(), ON_BAILOUT, v8::Utils::OpenHandle(), v8::internal::JSReceiver::OWN_ONLY, and v8::Utils::ToLocal().
Local< Value > v8::Object::GetPrivate | ( | v8::Handle< Private > | key | ) |
PropertyAttribute v8::Object::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 3237 of file api.cc.
References ABSENT, v8::internal::Handle< T >::cast(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::JSReceiver::GetPropertyAttributes(), v8::Maybe< T >::has_value, NONE, ON_BAILOUT, v8::Utils::OpenHandle(), and v8::Maybe< T >::value.
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 3331 of file api.cc.
References v8::internal::HandleScope::CloseAndEscape(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::Isolate::factory(), v8::internal::JSReceiver::GetKeys(), v8::internal::JSReceiver::INCLUDE_PROTOS, ON_BAILOUT, v8::Utils::OpenHandle(), and v8::Utils::ToLocal().
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 3282 of file api.cc.
References ENTER_V8, v8::internal::PrototypeIterator::GetCurrent(), ON_BAILOUT, v8::Utils::OpenHandle(), and v8::Utils::ToLocal().
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 3695 of file api.cc.
References ENTER_V8, v8::GetPropertyByLookup(), ON_BAILOUT, and v8::Utils::OpenHandle().
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 3677 of file api.cc.
References ENTER_V8, v8::internal::PrototypeIterator::GetCurrent(), v8::GetPropertyByLookup(), v8::internal::PrototypeIterator::IsAtEnd(), ON_BAILOUT, and v8::Utils::OpenHandle().
bool v8::Object::Has | ( | v8::Handle< Value > | key | ) |
Definition at line 3462 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::Runtime::HasObjectProperty(), ON_BAILOUT, and v8::Utils::OpenHandle().
Definition at line 3501 of file api.cc.
References EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::JSReceiver::HasElement(), v8::maybe(), ON_BAILOUT, and v8::Utils::OpenHandle().
bool v8::Object::HasIndexedLookupInterceptor | ( | ) |
Tests for an index lookup interceptor.
Definition at line 3657 of file api.cc.
References ON_BAILOUT, and v8::Utils::OpenHandle().
bool v8::Object::HasIndexedPropertiesInExternalArrayData | ( | ) |
Definition at line 3927 of file api.cc.
References ON_BAILOUT, and v8::Utils::OpenHandle().
bool v8::Object::HasIndexedPropertiesInPixelData | ( | ) |
Definition at line 3871 of file api.cc.
References ON_BAILOUT, and v8::Utils::OpenHandle().
bool v8::Object::HasNamedLookupInterceptor | ( | ) |
Tests for a named lookup interceptor.
Definition at line 3649 of file api.cc.
References ON_BAILOUT, and v8::Utils::OpenHandle().
Definition at line 3595 of file api.cc.
References EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::JSReceiver::HasOwnProperty(), v8::maybe(), ON_BAILOUT, and v8::Utils::OpenHandle().
bool v8::Object::HasPrivate | ( | v8::Handle< Private > | key | ) |
Definition at line 3621 of file api.cc.
References EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::JSObject::HasRealElementProperty(), v8::maybe(), ON_BAILOUT, and v8::Utils::OpenHandle().
Definition at line 3634 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::JSObject::HasRealNamedCallbackProperty(), v8::maybe(), ON_BAILOUT, and v8::Utils::OpenHandle().
Definition at line 3608 of file api.cc.
References EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::JSObject::HasRealNamedProperty(), v8::maybe(), ON_BAILOUT, and v8::Utils::OpenHandle().
int v8::Object::InternalFieldCount | ( | ) |
Gets the number of internal fields for this Object.
Definition at line 4986 of file api.cc.
References v8::Utils::OpenHandle().
|
inlinestatic |
bool v8::Object::IsCallable | ( | ) |
Checks whether a callback is set by the ObjectTemplate::SetCallAsFunctionHandler method.
When an Object is callable this method returns true.
Definition at line 3979 of file api.cc.
References ENTER_V8, ON_BAILOUT, and v8::Utils::OpenHandle().
bool v8::Object::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 3728 of file api.cc.
References v8::Utils::OpenHandle().
|
static |
Definition at line 5610 of file api.cc.
References ENTER_V8, v8::internal::Isolate::factory(), LOG_API, and v8::Utils::ToLocal().
Referenced by v8::internal::StatisticsExtension::GetCounters().
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 3375 of file api.cc.
References v8::internal::Handle< T >::cast(), ENTER_V8, v8::internal::String::Equals(), v8::internal::Isolate::factory(), v8::Value::IsString(), v8::internal::kCharSize, v8::String::kNormalString, v8::internal::MemCopy(), name, v8::String::NewFromUtf8(), ON_BAILOUT, v8::Utils::OpenHandle(), v8::internal::Vector< T >::start(), v8::internal::StrLength(), and v8::Utils::ToLocal().
bool v8::Object::Set | ( | v8::Handle< Value > | key, |
v8::Handle< Value > | value | ||
) |
Definition at line 3119 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, ON_BAILOUT, v8::Utils::OpenHandle(), v8::internal::Runtime::SetObjectProperty(), and v8::internal::SLOPPY.
bool v8::Object::Set | ( | uint32_t | index, |
v8::Handle< Value > | value | ||
) |
Definition at line 3136 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, NONE, ON_BAILOUT, v8::Utils::OpenHandle(), v8::internal::JSObject::SetElement(), and v8::internal::SLOPPY.
bool v8::Object::SetAccessor | ( | Handle< Name > | name, |
AccessorNameGetterCallback | getter, | ||
AccessorNameSetterCallback | setter = 0 , |
||
v8::Handle< Value > | data = Handle<Value>() , |
||
AccessControl | settings = DEFAULT , |
||
PropertyAttribute | attribute = None |
||
) |
Definition at line 3552 of file api.cc.
References name, and v8::ObjectSetAccessor().
bool v8::Object::SetAccessor | ( | Handle< String > | name, |
AccessorGetterCallback | getter, | ||
AccessorSetterCallback | setter = 0 , |
||
v8::Handle< Value > | data = Handle<Value>() , |
||
AccessControl | settings = DEFAULT , |
||
PropertyAttribute | attribute = None |
||
) |
Definition at line 3541 of file api.cc.
References name, and v8::ObjectSetAccessor().
void v8::Object::SetAccessorProperty | ( | Local< Name > | name, |
Local< Function > | getter, | ||
Handle< Function > | setter = Handle<Function>() , |
||
PropertyAttribute | attribute = None , |
||
AccessControl | settings = DEFAULT |
||
) |
Definition at line 3573 of file api.cc.
References DCHECK_EQ, v8::DEFAULT, v8::internal::JSObject::DefineAccessor(), ENTER_V8, v8::internal::Isolate::factory(), v8::internal::Handle< T >::is_null(), name, ON_BAILOUT, and v8::Utils::OpenHandle().
void v8::Object::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.
Definition at line 5028 of file api.cc.
References DCHECK_EQ, v8::EncodeAlignedAsSmi(), v8::InternalFieldOK(), and v8::Utils::OpenHandle().
bool v8::Object::SetDeclaredAccessor | ( | Local< Name > | name, |
Local< DeclaredAccessorDescriptor > | descriptor, | ||
PropertyAttribute | attribute = None , |
||
AccessControl | settings = DEFAULT |
||
) |
Definition at line 3563 of file api.cc.
References name, NULL, and v8::ObjectSetAccessor().
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 3767 of file api.cc.
References ENTER_V8, v8::internal::Isolate::factory(), v8::Handle< T >::IsEmpty(), ON_BAILOUT, v8::Utils::OpenHandle(), and v8::internal::JSObject::SetHiddenProperty().
void v8::Object::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 3904 of file api.cc.
References v8::Utils::ApiCheck(), ENTER_V8, ON_BAILOUT, v8::Utils::OpenHandle(), and v8::anonymous_namespace{api.cc}::PrepareExternalArrayElements().
void v8::Object::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 3850 of file api.cc.
References v8::Utils::ApiCheck(), ENTER_V8, v8::kExternalUint8ClampedArray, ON_BAILOUT, v8::Utils::OpenHandle(), and v8::anonymous_namespace{api.cc}::PrepareExternalArrayElements().
void v8::Object::SetInternalField | ( | int | index, |
v8::Handle< Value > | value | ||
) |
Sets the value in an internal field.
Definition at line 5010 of file api.cc.
References DCHECK_EQ, v8::InternalFieldOK(), and v8::Utils::OpenHandle().
bool v8::Object::SetPrivate | ( | v8::Handle< Private > | key, |
v8::Handle< Value > | value | ||
) |
Definition at line 3172 of file api.cc.
References v8::DontEnum.
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 3292 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::MaybeHandle< T >::is_null(), ON_BAILOUT, v8::Utils::OpenHandle(), and v8::internal::JSObject::SetPrototype().
|
private |
Definition at line 5020 of file api.cc.
References v8::DecodeSmiToAligned(), v8::InternalFieldOK(), NULL, and v8::Utils::OpenHandle().
Definition at line 5001 of file api.cc.
References v8::InternalFieldOK(), v8::Utils::OpenHandle(), and v8::Utils::ToLocal().
void v8::Object::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 3711 of file api.cc.
References v8::internal::Map::Copy(), v8::internal::Deoptimizer::DeoptimizeGlobalObject(), ENTER_V8, v8::internal::JSObject::MigrateToMap(), ON_BAILOUT, and v8::Utils::OpenHandle().