V8 Project
|
The superclass of all JavaScript values and objects. More...
#include <v8.h>
Public Member Functions | |
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 | |
template<class T > | |
static Value * | Cast (T *value) |
Private Member Functions | |
bool | QuickIsUndefined () const |
bool | QuickIsNull () const |
bool | QuickIsString () const |
bool | FullIsUndefined () const |
bool | FullIsNull () const |
bool | FullIsString () const |
bool v8::Value::BooleanValue | ( | ) | const |
Definition at line 2895 of file api.cc.
References v8::Utils::OpenHandle().
JS ==.
Definition at line 3025 of file api.cc.
References v8::Utils::ApiCheck(), arraysize, v8::CallV8HeapFunction(), ENTER_V8, v8::internal::EQUAL, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::Smi::FromInt(), v8::internal::Handle< T >::is_null(), v8::Handle< T >::IsEmpty(), LOG_API, and v8::Utils::OpenHandle().
Referenced by CheckEqualsHelper(), and CheckNonEqualsHelper().
|
private |
Definition at line 2392 of file api.cc.
References DCHECK_EQ, v8::Utils::OpenHandle(), and QuickIsNull().
|
private |
Definition at line 2419 of file api.cc.
References DCHECK_EQ, v8::Utils::OpenHandle(), and QuickIsString().
|
private |
Definition at line 2385 of file api.cc.
References DCHECK_EQ, v8::Utils::OpenHandle(), and QuickIsUndefined().
int32_t v8::Value::Int32Value | ( | ) | const |
Definition at line 3004 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, LOG_API, and v8::Utils::OpenHandle().
Referenced by v8::internal::JSObject::GetElementAttributeWithInterceptor(), and v8::internal::JSObject::GetPropertyAttributesWithInterceptor().
int64_t v8::Value::IntegerValue | ( | ) | const |
Definition at line 2918 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, LOG_API, and v8::Utils::OpenHandle().
bool v8::Value::IsArray | ( | ) | const |
Returns true if this value is an array.
Definition at line 2431 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsArrayBuffer | ( | ) | const |
Returns true if this value is an ArrayBuffer.
This is an experimental feature.
Definition at line 2436 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsArrayBufferView | ( | ) | const |
Returns true if this value is an ArrayBufferView.
This is an experimental feature.
Definition at line 2441 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsBoolean | ( | ) | const |
Returns true if this value is boolean.
Definition at line 2500 of file api.cc.
References v8::Utils::OpenHandle().
Referenced by v8::internal::JSObject::DeleteElementWithInterceptor(), and v8::internal::JSObject::DeletePropertyWithInterceptor().
bool v8::Value::IsDataView | ( | ) | const |
Returns true if this value is a DataView.
This is an experimental feature.
Definition at line 2463 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsExternal | ( | ) | const |
Returns true if this value is external.
Definition at line 2505 of file api.cc.
References v8::Utils::OpenHandle().
Referenced by v8::External::CheckCast().
bool v8::Value::IsFalse | ( | ) | const |
Returns true if this value is false.
Definition at line 2404 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsFloat32Array | ( | ) | const |
Returns true if this value is a Float32Array.
This is an experimental feature.
bool v8::Value::IsFloat64Array | ( | ) | const |
Returns true if this value is a Float64Array.
This is an experimental feature.
bool v8::Value::IsFunction | ( | ) | const |
Returns true if this value is a function.
Definition at line 2409 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsGeneratorFunction | ( | ) | const |
Returns true if this value is a Generator function.
This is an experimental feature.
Definition at line 2571 of file api.cc.
References v8::internal::Handle< T >::cast(), and v8::Utils::OpenHandle().
bool v8::Value::IsGeneratorObject | ( | ) | const |
Returns true if this value is a Generator object (iterator).
This is an experimental feature.
Definition at line 2579 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsInt16Array | ( | ) | const |
Returns true if this value is an Int16Array.
This is an experimental feature.
bool v8::Value::IsInt32 | ( | ) | const |
Returns true if this value is a 32-bit signed integer.
Definition at line 2510 of file api.cc.
References v8::internal::IsInt32Double(), and v8::Utils::OpenHandle().
Referenced by v8::internal::JSObject::GetPropertyAttributesWithInterceptor().
bool v8::Value::IsInt32Array | ( | ) | const |
Returns true if this value is an Int32Array.
This is an experimental feature.
bool v8::Value::IsInt8Array | ( | ) | const |
Returns true if this value is an Int8Array.
This is an experimental feature.
bool v8::Value::IsMap | ( | ) | const |
Returns true if this value is a Map.
This is an experimental feature.
bool v8::Value::IsName | ( | ) | const |
Returns true if this value is a symbol or a string.
This is an experimental feature.
Definition at line 2414 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsNativeError | ( | ) | const |
Returns true if this value is a NativeError.
Definition at line 2547 of file api.cc.
References v8::CheckConstructor(), and v8::Utils::OpenHandle().
|
inline |
bool v8::Value::IsNumber | ( | ) | const |
Returns true if this value is a number.
Definition at line 2473 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsObject | ( | ) | const |
Returns true if this value is an object.
Definition at line 2468 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsPromise | ( | ) | const |
Returns true if this value is a Promise.
This is an experimental feature.
Definition at line 5852 of file api.cc.
References arraysize, v8::internal::Handle< T >::cast(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::Isolate::factory(), LOG_API, and v8::Utils::OpenHandle().
Referenced by v8::Promise::Resolver::CheckCast(), and v8::Promise::CheckCast().
bool v8::Value::IsRegExp | ( | ) | const |
Returns true if this value is a RegExp.
Definition at line 2565 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsSet | ( | ) | const |
Returns true if this value is a Set.
This is an experimental feature.
|
inline |
Returns true if this value is an instance of the String type.
See ECMA-262 8.4.
Definition at line 6552 of file v8.h.
Referenced by v8::Object::ObjectProtoToString().
bool v8::Value::IsSymbol | ( | ) | const |
Returns true if this value is a symbol.
This is an experimental feature.
Definition at line 2426 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsSymbolObject | ( | ) | const |
Returns true if this value is a Symbol object.
This is an experimental feature.
bool v8::Value::IsTrue | ( | ) | const |
Returns true if this value is true.
Definition at line 2399 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsTypedArray | ( | ) | const |
Returns true if this value is one of TypedArrays.
This is an experimental feature.
Definition at line 2446 of file api.cc.
References v8::Utils::OpenHandle().
bool v8::Value::IsUint16Array | ( | ) | const |
Returns true if this value is an Uint16Array.
This is an experimental feature.
bool v8::Value::IsUint32 | ( | ) | const |
Returns true if this value is a 32-bit unsigned integer.
Definition at line 2520 of file api.cc.
References v8::internal::FastD2UI(), v8::internal::FastUI2D(), v8::internal::IsMinusZero(), v8::internal::kMaxUInt32, and v8::Utils::OpenHandle().
bool v8::Value::IsUint32Array | ( | ) | const |
Returns true if this value is an Uint32Array.
This is an experimental feature.
bool v8::Value::IsUint8Array | ( | ) | const |
Returns true if this value is an Uint8Array.
This is an experimental feature.
bool v8::Value::IsUint8ClampedArray | ( | ) | const |
Returns true if this value is an Uint8ClampedArray.
This is an experimental feature.
|
inline |
bool v8::Value::IsWeakMap | ( | ) | const |
Returns true if this value is a WeakMap.
This is an experimental feature.
bool v8::Value::IsWeakSet | ( | ) | const |
Returns true if this value is a WeakSet.
This is an experimental feature.
double v8::Value::NumberValue | ( | ) | const |
Definition at line 2900 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, LOG_API, v8::base::OS::nan_value(), v8::Utils::OpenHandle(), and v8::internal::ToNumber().
|
inlineprivate |
Definition at line 6542 of file v8.h.
References I.
Referenced by FullIsNull().
|
inlineprivate |
Definition at line 6560 of file v8.h.
References I.
Referenced by FullIsString().
|
inlineprivate |
Definition at line 6524 of file v8.h.
References I.
Referenced by FullIsUndefined().
Definition at line 3085 of file api.cc.
References v8::Utils::ApiCheck(), v8::internal::Handle< T >::is_null(), v8::Handle< T >::IsEmpty(), and v8::Utils::OpenHandle().
Definition at line 3052 of file api.cc.
References v8::Utils::ApiCheck(), v8::internal::String::Equals(), v8::internal::Handle< T >::is_null(), v8::Handle< T >::IsEmpty(), LOG_API, v8::Utils::OpenHandle(), and v8::base::internal::y.
Attempts to convert a string to an array index.
Returns an empty handle if the conversion fails.
Definition at line 2975 of file api.cc.
References v8::internal::Handle< T >::cast(), ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, v8::internal::Isolate::factory(), v8::internal::Smi::FromInt(), v8::internal::Smi::kMaxValue, LOG_API, v8::Utils::OpenHandle(), and v8::Utils::Uint32ToLocal().
Definition at line 2638 of file api.cc.
References ENTER_V8, v8::internal::Isolate::factory(), LOG_API, and v8::Utils::OpenHandle().
Definition at line 2602 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, LOG_API, and v8::Utils::OpenHandle().
Definition at line 2940 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, LOG_API, and v8::Utils::OpenHandle().
Definition at line 2671 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, LOG_API, and v8::Utils::OpenHandle().
Definition at line 2653 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, LOG_API, v8::Utils::OpenHandle(), and v8::internal::ToNumber().
Local< v8::Object > v8::Value::ToObject | ( | ) | const |
Definition at line 2620 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, LOG_API, and v8::Utils::OpenHandle().
Definition at line 2584 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, LOG_API, and v8::Utils::OpenHandle().
Referenced by v8::String::Utf8Value::Utf8Value(), and v8::String::Value::Value().
Definition at line 2957 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, LOG_API, and v8::Utils::OpenHandle().
uint32_t v8::Value::Uint32Value | ( | ) | const |
Definition at line 3097 of file api.cc.
References ENTER_V8, EXCEPTION_BAILOUT_CHECK, EXCEPTION_PREAMBLE, LOG_API, and v8::Utils::OpenHandle().