V8 Primitives, Values & Exceptions
V8 Data, Value, Primitives, Strings, Symbols, Numbers, BigInt, Date, RegExp, External, Exceptions, and Messages
Generated TypeScript bindings for V8 Data, Value, primitive types, boxed primitive objects, Date, RegExp, External, Exception, and Message, documented from upstream V8 C++ headers.
Contains 38 classes and 246 bound methods. Inherited WasmHandle base methods (ptr, isNull(), as()) are documented on Core Runtime & Realms.
BigIntObject
class BigIntObject extends V8Object
A BigInt object (https://tc39.es/proposal-bigint)
Upstream C++: v8::BigIntObject (v8-primitive-object.h)
Static Methods
-
static fromPtr(ptr: number): BigIntObjectWraps a raw V8-wasm handle pointer as a
BigIntObject. -
static new(isolate: Isolate, value: bigint): ValueBinds upstream V8 C++
v8::BigIntObject::New.
Methods
-
valueOf(): V8BigIntBinds upstream V8 C++
v8::BigIntObject::ValueOf.
BooleanObject
class BooleanObject extends V8Object
A Boolean object (ECMA-262, 4.3.15).
Upstream C++: v8::BooleanObject (v8-primitive-object.h)
Static Methods
-
static fromPtr(ptr: number): BooleanObjectWraps a raw V8-wasm handle pointer as a
BooleanObject. -
static new(isolate: Isolate, value: boolean): ValueBinds upstream V8 C++
v8::BooleanObject::New.
Methods
-
valueOf(): booleanBinds upstream V8 C++
v8::BooleanObject::ValueOf.
Data
class Data extends WasmHandle
The superclass of objects that can reside on V8's heap.
Upstream C++: v8::Data (v8-data.h)
Static Methods
-
static fromPtr(ptr: number): DataWraps a raw V8-wasm handle pointer as a
Data.
Methods
-
isContext(): booleanReturns true if this data is a
Context.Upstream C++:
v8::Data::IsContext -
isCppHeapExternal(): booleanReturns true if this value is a
CppHeapExternalobject.Upstream C++:
v8::Data::IsCppHeapExternal -
isDictionaryTemplate(): booleanReturns true if this data is a
DictionaryTemplate.Upstream C++:
v8::Data::IsDictionaryTemplate -
isFixedArray(): booleanReturns tru if this data is a
FixedArrayUpstream C++:
v8::Data::IsFixedArray -
isFunctionTemplate(): booleanReturns true if this data is a
FunctionTemplate.Upstream C++:
v8::Data::IsFunctionTemplate -
isModule(): booleanReturns true if this data is a
Module.Upstream C++:
v8::Data::IsModule -
isModuleRequest(): booleanReturns true if this data is a
ModuleRequest.Upstream C++:
v8::Data::IsModuleRequest -
isObjectTemplate(): booleanReturns true if this data is a
ObjectTemplate.Upstream C++:
v8::Data::IsObjectTemplate -
isPrivate(): booleanReturns true if this data is a
Private.Upstream C++:
v8::Data::IsPrivate -
isValue(): booleanReturns true if this data is a
Value.Upstream C++:
v8::Data::IsValue
Exception
class Exception extends WasmHandle
Create new error objects by calling the corresponding error object constructor with the message.
Upstream C++: v8::Exception (v8-exception.h)
Static Methods
-
static captureStackTrace(context: Context, object: V8Object): Maybe<boolean>Captures the current stack trace and attaches it to the given object in the form of
stackproperty.Upstream C++:
v8::Exception::CaptureStackTrace -
static createMessage(isolate: Isolate, exception: Value): MessageCreates an error message for the given exception. Will try to reconstruct the original stack trace from the exception value, or capture the current stack trace if not available.
Upstream C++:
v8::Exception::CreateMessage -
static error(message: V8String, options?: Value): ValueBinds upstream V8 C++
v8::Exception::Error. -
static getStackTrace(exception: Value): StackTraceReturns the original stack trace that was captured at the creation time of a given exception, or an empty handle if not available.
Upstream C++:
v8::Exception::GetStackTrace -
static rangeError(message: V8String, options?: Value): ValueBinds upstream V8 C++
v8::Exception::RangeError. -
static referenceError(message: V8String, options?: Value): ValueBinds upstream V8 C++
v8::Exception::ReferenceError. -
static syntaxError(message: V8String, options?: Value): ValueBinds upstream V8 C++
v8::Exception::SyntaxError. -
static typeError(message: V8String, options?: Value): ValueBinds upstream V8 C++
v8::Exception::TypeError. -
static wasmCompileError(message: V8String, options?: Value): ValueBinds upstream V8 C++
v8::Exception::WasmCompileError. -
static wasmLinkError(message: V8String, options?: Value): ValueBinds upstream V8 C++
v8::Exception::WasmLinkError. -
static wasmRuntimeError(message: V8String, options?: Value): ValueBinds upstream V8 C++
v8::Exception::WasmRuntimeError. -
static wasmSuspendError(message: V8String, options?: Value): ValueBinds upstream V8 C++
v8::Exception::WasmSuspendError.
ExceptionPropagationMessage
class ExceptionPropagationMessage extends WasmHandle
This is a part of experimental Api and might be changed without further notice. Do not use it.
Upstream C++: v8::ExceptionPropagationMessage (v8-exception.h)
Methods
-
getException(): V8ObjectBinds upstream V8 C++
v8::ExceptionPropagationMessage::GetException. -
getExceptionContext(): ExceptionContextBinds upstream V8 C++
v8::ExceptionPropagationMessage::GetExceptionContext. -
getInterfaceName(): V8StringBinds upstream V8 C++
v8::ExceptionPropagationMessage::GetInterfaceName. -
getIsolate(): Isolate | nullBinds upstream V8 C++
v8::ExceptionPropagationMessage::GetIsolate. -
getPropertyName(): V8StringBinds upstream V8 C++
v8::ExceptionPropagationMessage::GetPropertyName.
External
class External extends Value
A JavaScript value that wraps a C++ void*. This type of value is mainly used to associate C++ data structures with JavaScript objects.
Upstream C++: v8::External (v8-external.h)
Static Methods
-
static fromPtr(ptr: number): ExternalWraps a raw V8-wasm handle pointer as a
External. -
static new(isolate: Isolate, value: number, tag: number): ExternalCreates a new External object.
isolate: The isolate for the external object.value: The C++ pointer value.tag: The type tag of the external pointer. If type tags are not used in the embedder, the default valuekExternalPointerTypeTagDefaultcan be used. Returns: The new External object.
Upstream C++:
v8::External::New
Methods
-
value(tag: number): numberReturns the value of the external pointer.
tag: The type tag of the external pointer. If type tags are not used in the embedder, the default valuekExternalPointerTypeTagDefaultcan be used. Returns: The value of the external pointer.
Upstream C++:
v8::External::Value
ExternalResourceVisitor
class ExternalResourceVisitor extends WasmHandle
Interface for iterating through all external resources in the heap.
Upstream C++: v8::ExternalResourceVisitor (v8-primitive.h)
Methods
-
visitExternalString(string: V8String): voidBinds upstream V8 C++
v8::ExternalResourceVisitor::VisitExternalString.
FixedArray
class FixedArray extends Data
A fixed-sized array with elements of type Data.
Upstream C++: v8::FixedArray (v8-data.h)
Static Methods
-
static fromPtr(ptr: number): FixedArrayWraps a raw V8-wasm handle pointer as a
FixedArray.
Methods
-
get(i: number): DataBinds upstream V8 C++
v8::FixedArray::Get. -
length(): numberBinds upstream V8 C++
v8::FixedArray::Length.
Int32
class Int32 extends Integer
A JavaScript value representing a 32-bit signed integer.
Upstream C++: v8::Int32 (v8-primitive.h)
Static Methods
-
static fromPtr(ptr: number): Int32Wraps a raw V8-wasm handle pointer as a
Int32.
Methods
-
value(): numberBinds upstream V8 C++
v8::Int32::Value.
Integer
class Integer extends V8Number
A JavaScript value representing a signed integer.
Upstream C++: v8::Integer (v8-primitive.h)
Static Methods
-
static fromPtr(ptr: number): IntegerWraps a raw V8-wasm handle pointer as a
Integer. -
static new(isolate: Isolate, value: number): IntegerBinds upstream V8 C++
v8::Integer::New. -
static newFromUnsigned(isolate: Isolate, value: number): IntegerBinds upstream V8 C++
v8::Integer::NewFromUnsigned.
Methods
-
getIntegerValue(): bigintBinds upstream V8 C++
v8::Integer::Value.
Message
class Message extends WasmHandle
An error message.
Upstream C++: v8::Message (v8-message.h)
Static Methods
-
static fromPtr(ptr: number): MessageWraps a raw V8-wasm handle pointer as a
Message.
Methods
-
errorLevel(): numberReturns the error level of the message.
Upstream C++:
v8::Message::ErrorLevel -
get(): V8StringBinds upstream V8 C++
v8::Message::Get. -
getEndColumn(): numberReturns the index within the line of the last character where the error occurred.
Upstream C++:
v8::Message::GetEndColumn -
getEndColumn2(context: Context): Maybe<number>Returns the index within the line of the last character where the error occurred.
Upstream C++:
v8::Message::GetEndColumn -
getEndPosition(): numberReturns the index within the script of the last character where the error occurred. This is best effort and not guaranteed. It may be -1 or even < StartPosition in some cases.
Upstream C++:
v8::Message::GetEndPosition -
getLineNumber(context: Context): Maybe<number>Returns the number, 1-based, of the line where the error occurred.
Upstream C++:
v8::Message::GetLineNumber -
getScriptResourceName(): ValueReturns the resource name for the script from where the function causing the error originates.
Upstream C++:
v8::Message::GetScriptResourceName -
getSource(context: Context): MaybeLocal<V8String>Binds upstream V8 C++
v8::Message::GetSource. -
getSourceLine(context: Context): MaybeLocal<V8String>Binds upstream V8 C++
v8::Message::GetSourceLine. -
getStackTrace(): StackTraceException stack trace. By default stack traces are not captured for uncaught exceptions. SetCaptureStackTraceForUncaughtExceptions allows to change this option.
Upstream C++:
v8::Message::GetStackTrace -
getStartColumn(): numberReturns the index within the line of the first character where the error occurred.
Upstream C++:
v8::Message::GetStartColumn -
getStartColumn2(context: Context): Maybe<number>Returns the index within the line of the first character where the error occurred.
Upstream C++:
v8::Message::GetStartColumn -
getStartPosition(): numberReturns the index within the script of the first character where the error occurred. This is best effort and not guaranteed. It may be -1 or even > EndPosition in some cases.
Upstream C++:
v8::Message::GetStartPosition -
getWasmFunctionIndex(): numberReturns the Wasm function index where the error occurred. Returns -1 if message is not from a Wasm script.
Upstream C++:
v8::Message::GetWasmFunctionIndex -
isOpaque(): booleanBinds upstream V8 C++
v8::Message::IsOpaque. -
isSharedCrossOrigin(): booleanPasses on the value set by the embedder when it fed the script from which this Message was generated to V8.
Upstream C++:
v8::Message::IsSharedCrossOrigin
Name
class Name extends Primitive
A superclass for symbols and strings.
Upstream C++: v8::Name (v8-primitive.h)
Static Methods
-
static fromPtr(ptr: number): NameWraps a raw V8-wasm handle pointer as a
Name.
Methods
-
getIdentityHash(): numberReturns the identity hash for this object. The current implementation uses an inline property on the object to store the identity hash.
The return value will never be 0. Also, it is not guaranteed to be unique.
Upstream C++:
v8::Name::GetIdentityHash
NumberObject
class NumberObject extends V8Object
A Number object (ECMA-262, 4.3.21).
Upstream C++: v8::NumberObject (v8-primitive-object.h)
Static Methods
-
static fromPtr(ptr: number): NumberObjectWraps a raw V8-wasm handle pointer as a
NumberObject. -
static new(isolate: Isolate, value: number): ValueBinds upstream V8 C++
v8::NumberObject::New.
Methods
-
valueOf(): numberBinds upstream V8 C++
v8::NumberObject::ValueOf.
Numeric
class Numeric extends Primitive
A JavaScript numeric value (either Number or BigInt). https://tc39.es/ecma262/#sec-numeric-types
Upstream C++: v8::Numeric (v8-primitive.h)
Static Methods
-
static fromPtr(ptr: number): NumericWraps a raw V8-wasm handle pointer as a
Numeric.
Primitive
class Primitive extends Value
The superclass of primitive values. See ECMA-262 4.3.2.
Upstream C++: v8::Primitive (v8-primitive.h)
Static Methods
-
static fromPtr(ptr: number): PrimitiveWraps a raw V8-wasm handle pointer as a
Primitive.
PrimitiveArray
class PrimitiveArray extends Data
An array to hold Primitive values. This is used by the embedder to pass host defined options to the ScriptOptions during compilation.
This is passed back to the embedder as part of HostImportModuleDynamicallyCallback for module loading.
Upstream C++: v8::PrimitiveArray (v8-primitive.h)
Static Methods
-
static fromPtr(ptr: number): PrimitiveArrayWraps a raw V8-wasm handle pointer as a
PrimitiveArray. -
static new(isolate: Isolate, length: number): PrimitiveArrayBinds upstream V8 C++
v8::PrimitiveArray::New.
Methods
-
get(isolate: Isolate, index: number): PrimitiveBinds upstream V8 C++
v8::PrimitiveArray::Get. -
length(): numberBinds upstream V8 C++
v8::PrimitiveArray::Length. -
set(isolate: Isolate, index: number, item: Primitive): voidBinds upstream V8 C++
v8::PrimitiveArray::Set.
ScriptOrigin
class ScriptOrigin extends WasmHandle
The origin, within a file, of a script.
Upstream C++: v8::ScriptOrigin (v8-message.h)
Methods
-
columnOffset(): numberBinds upstream V8 C++
v8::ScriptOrigin::ColumnOffset. -
getHostDefinedOptions(): DataBinds upstream V8 C++
v8::ScriptOrigin::GetHostDefinedOptions. -
lineOffset(): numberBinds upstream V8 C++
v8::ScriptOrigin::LineOffset. -
resourceName(): ValueBinds upstream V8 C++
v8::ScriptOrigin::ResourceName. -
scriptId(): numberBinds upstream V8 C++
v8::ScriptOrigin::ScriptId. -
sourceMapUrl(): ValueBinds upstream V8 C++
v8::ScriptOrigin::SourceMapUrl.
ScriptOriginOptions
class ScriptOriginOptions extends WasmHandle
The optional attributes of ScriptOrigin.
Upstream C++: v8::ScriptOriginOptions (v8-message.h)
Methods
-
flags(): numberBinds upstream V8 C++
v8::ScriptOriginOptions::Flags. -
isModule(): booleanBinds upstream V8 C++
v8::ScriptOriginOptions::IsModule. -
isOpaque(): booleanBinds upstream V8 C++
v8::ScriptOriginOptions::IsOpaque. -
isSharedCrossOrigin(): booleanBinds upstream V8 C++
v8::ScriptOriginOptions::IsSharedCrossOrigin. -
isWasm(): booleanBinds upstream V8 C++
v8::ScriptOriginOptions::IsWasm.
StringExternalOneByteStringResource
class StringExternalOneByteStringResource extends StringExternalStringResourceBase
Upstream V8 C++ class v8::String::ExternalOneByteStringResource (v8-primitive.h).
Methods
-
cached_data(): string | nullReturns the cached data from the underlying buffer. If the resource is uncacheable or if UpdateDataCache() was not called before, it has undefined behaviour.
Upstream C++:
v8::String::ExternalOneByteStringResource::cached_data -
data(): string | nullThe string data from the underlying buffer. If the resource is cacheable then data() must return the same value for all invocations.
Upstream C++:
v8::String::ExternalOneByteStringResource::data -
length(): numberThe number of Latin-1 characters in the string.
Upstream C++:
v8::String::ExternalOneByteStringResource::length -
updateDataCache(): voidUpdate {cached_data_} with the data from the underlying buffer. This can be called only for cacheable resources.
Upstream C++:
v8::String::ExternalOneByteStringResource::UpdateDataCache
StringExternalStringResource
class StringExternalStringResource extends StringExternalStringResourceBase
An ExternalStringResource is a wrapper around a two-byte string buffer that resides outside V8's heap. Implement an ExternalStringResource to manage the life cycle of the underlying buffer. Note that the string data must be immutable.
Upstream C++: v8::String::ExternalStringResource (v8-primitive.h)
Methods
-
cached_data(): numberReturns the cached data from the underlying buffer. This method can be called only for cacheable resources (i.e. IsCacheable() == true) and only after UpdateDataCache() was called.
Upstream C++:
v8::String::ExternalStringResource::cached_data -
data(): numberThe string data from the underlying buffer. If the resource is cacheable then data() must return the same value for all invocations.
Upstream C++:
v8::String::ExternalStringResource::data -
length(): numberThe length of the string. That is, the number of two-byte characters.
Upstream C++:
v8::String::ExternalStringResource::length -
updateDataCache(): voidUpdate {cached_data_} with the data from the underlying buffer. This can be called only for cacheable resources.
Upstream C++:
v8::String::ExternalStringResource::UpdateDataCache
StringExternalStringResourceBase
class StringExternalStringResourceBase extends WasmHandle
Upstream V8 C++ class v8::String::ExternalStringResourceBase (v8-primitive.h).
Methods
-
estimateMemoryUsage(): numberReturns an estimate of the memory occupied by this external string, to be used by V8 when producing a heap snapshot. If this function returns kDefaultMemoryEstimate, then V8 will estimate the external size based on the string length. This function should return only memory that is uniquely owned by this resource. If the resource has shared ownership of a secondary allocation, it can report that memory by implementing EstimateSharedMemoryUsage.
Upstream C++:
v8::String::ExternalStringResourceBase::EstimateMemoryUsage -
estimateSharedMemoryUsage(recorder: StringExternalStringResourceBaseSharedMemoryUsageRecorder): voidEstimates memory that this string resource may share with other string resources, to be used by V8 when producing a heap snapshot.
Upstream C++:
v8::String::ExternalStringResourceBase::EstimateSharedMemoryUsage -
isCacheable(): booleanIf a string is cacheable, the value returned by
ExternalStringResource.data()may be cached, otherwise it is not expected to be stable beyond the current top-level task.Upstream C++:
v8::String::ExternalStringResourceBase::IsCacheable -
unaccount(isolate: Isolate): voidInternally V8 will call this Unaccount method when the external string resource should be unaccounted for. This method can be overridden in subclasses to control how allocated external bytes are accounted.
Upstream C++:
v8::String::ExternalStringResourceBase::Unaccount
StringExternalStringResourceBaseSharedMemoryUsageRecorder
class StringExternalStringResourceBaseSharedMemoryUsageRecorder extends WasmHandle
Upstream V8 C++ class v8::String::ExternalStringResourceBase::SharedMemoryUsageRecorder (v8-primitive.h).
Methods
-
recordSharedMemoryUsage(location: number, size: number): voidRecord that a shared allocation at the given location has the given size.
Upstream C++:
v8::String::ExternalStringResourceBase::SharedMemoryUsageRecorder::RecordSharedMemoryUsage
StringObject
class StringObject extends V8Object
A String object (ECMA-262, 4.3.18).
Upstream C++: v8::StringObject (v8-primitive-object.h)
Static Methods
-
static fromPtr(ptr: number): StringObjectWraps a raw V8-wasm handle pointer as a
StringObject. -
static new(isolate: Isolate, value: V8String): ValueBinds upstream V8 C++
v8::StringObject::New.
Methods
-
valueOf(): V8StringBinds upstream V8 C++
v8::StringObject::ValueOf.
StringUtf8Value
class StringUtf8Value extends WasmHandle
Converts an object to a null-terminated UTF-8-encoded character array.
Useful if you want to print the object. If conversion to a string fails
(e.g. due to an exception in the toString() method of the object) then the
length() method returns 0 and the * operator returns null.
WARNING: This will unconditionally copy the contents of the JavaScript string, and should be avoided in situations where performance is a concern. Consider using WriteUtf8() instead.
Upstream C++: v8::String::Utf8Value (v8-primitive.h)
Methods
-
length(): numberBinds upstream V8 C++
v8::String::Utf8Value::length.
StringValue
class StringValue extends WasmHandle
Converts an object to a two-byte (UTF-16-encoded) string.
If conversion to a string fails (eg. due to an exception in the toString()
method of the object) then the length() method returns 0 and the * operator
returns null.
WARNING: This will unconditionally copy the contents of the JavaScript string, and should be avoided in situations where performance is a concern.
Upstream C++: v8::String::Value (v8-primitive.h)
Methods
-
length(): numberBinds upstream V8 C++
v8::String::Value::length.
StringValueView
class StringValueView extends WasmHandle
Returns a view onto a string's contents.
WARNING: This does not copy the string's contents, and will therefore be invalidated if the GC can move the string while the ValueView is alive. It is therefore required that no GC or allocation can happen while there is an active ValueView. This requirement may be relaxed in the future.
V8 strings are either encoded as one-byte or two-bytes per character.
Upstream C++: v8::String::ValueView (v8-primitive.h)
Methods
-
data16(): numberBinds upstream V8 C++
v8::String::ValueView::data16. -
data8(): numberBinds upstream V8 C++
v8::String::ValueView::data8. -
is_one_byte(): booleanBinds upstream V8 C++
v8::String::ValueView::is_one_byte. -
length(): numberBinds upstream V8 C++
v8::String::ValueView::length.
StringWriteFlags
class StringWriteFlags extends WasmHandle
Upstream V8 C++ struct v8::String::WriteFlags (v8-primitive.h).
SymbolObject
class SymbolObject extends V8Object
A Symbol object (ECMA-262 edition 6).
Upstream C++: v8::SymbolObject (v8-primitive-object.h)
Static Methods
-
static fromPtr(ptr: number): SymbolObjectWraps a raw V8-wasm handle pointer as a
SymbolObject. -
static new(isolate: Isolate, value: V8Symbol): ValueBinds upstream V8 C++
v8::SymbolObject::New.
Methods
-
valueOf(): V8SymbolBinds upstream V8 C++
v8::SymbolObject::ValueOf.
TypecheckWitness
class TypecheckWitness extends WasmHandle
Can be used to avoid repeated expensive type checks for groups of objects that are expected to be similar (e.g. when Blink converts a bunch of JavaScript objects to "ScriptWrappable" after a "HasInstance" check) by making use of V8-internal "hidden classes". An object that has passed the full check can be remembered via {Update}; further objects can be queried using {Matches}. Note that the answer will be conservative/"best-effort": when {Matches} returns true, then the {candidate} can be relied upon to have the same shape/constructor/prototype/etc. as the {baseline}. Otherwise, no reliable statement can be made (the objects might still have indistinguishable shapes for all intents and purposes, but this mechanism, being optimized for speed, couldn't determine that quickly).
Upstream C++: v8::TypecheckWitness (v8-value.h)
Methods
-
matches(candidate: Value): booleanChecks whether {candidate} can cheaply be identified as being "similar" to the {baseline} that was passed to {Update} earlier. It's safe to call this on an uninitialized {TypecheckWitness} instance: it will then return {false} for any input.
Upstream C++:
v8::TypecheckWitness::Matches -
update(baseline: Value): voidRemembers a new baseline for future {Matches} queries.
Upstream C++:
v8::TypecheckWitness::Update
Uint32
class Uint32 extends Integer
A JavaScript value representing a 32-bit unsigned integer.
Upstream C++: v8::Uint32 (v8-primitive.h)
Static Methods
-
static fromPtr(ptr: number): Uint32Wraps a raw V8-wasm handle pointer as a
Uint32.
Methods
-
value(): numberBinds upstream V8 C++
v8::Uint32::Value.
V8BigInt
class V8BigInt extends Numeric
A JavaScript BigInt value (https://tc39.es/proposal-bigint)
Upstream C++: v8::BigInt (v8-primitive.h)
Static Methods
-
static fromPtr(ptr: number): V8BigIntWraps a raw V8-wasm handle pointer as a
V8BigInt. -
static new(isolate: Isolate, value: bigint): V8BigIntBinds upstream V8 C++
v8::BigInt::New. -
static newFromUnsigned(isolate: Isolate, value: bigint): V8BigIntBinds upstream V8 C++
v8::BigInt::NewFromUnsigned.
Methods
-
wordCount(): numberReturns the number of 64-bit words needed to store the result of ToWordsArray().
Upstream C++:
v8::BigInt::WordCount
V8Boolean
class V8Boolean extends Primitive
A primitive boolean value (ECMA-262, 4.3.14). Either the true or false value.
Upstream C++: v8::Boolean (v8-primitive.h)
Static Methods
-
static fromPtr(ptr: number): V8BooleanWraps a raw V8-wasm handle pointer as a
V8Boolean. -
static new(isolate: Isolate, value: boolean): V8BooleanBinds upstream V8 C++
v8::Boolean::New.
Methods
-
value(): booleanBinds upstream V8 C++
v8::Boolean::Value.
V8Date
class V8Date extends V8Object
An instance of the built-in Date constructor (ECMA-262, 15.9).
Upstream C++: v8::Date (v8-date.h)
Static Methods
-
static fromPtr(ptr: number): V8DateWraps a raw V8-wasm handle pointer as a
V8Date. -
static new(context: Context, time: number): MaybeLocal<Value>Binds upstream V8 C++
v8::Date::New. -
static parse(context: Context, date_string: V8String): MaybeLocal<Value>Binds upstream V8 C++
v8::Date::Parse.
Methods
-
toISOString(): V8StringGenerates ISO string representation.
Upstream C++:
v8::Date::ToISOString -
toUTCString(): V8StringGenerates UTC string representation.
Upstream C++:
v8::Date::ToUTCString -
valueOf(): numberA specialization of
Value.NumberValuethat is more efficient because we know the structure of this object.Upstream C++:
v8::Date::ValueOf
V8Number
class V8Number extends Numeric
A JavaScript number value (ECMA-262, 4.3.20)
Upstream C++: v8::Number (v8-primitive.h)
Static Methods
-
static fromPtr(ptr: number): V8NumberWraps a raw V8-wasm handle pointer as a
V8Number. -
static newNumber(isolate: Isolate, value: number): V8NumberBinds upstream V8 C++
v8::Number::New.
Methods
-
value(): numberBinds upstream V8 C++
v8::Number::Value.
V8RegExp
class V8RegExp extends V8Object
An instance of the built-in RegExp constructor (ECMA-262, 15.10).
Upstream C++: v8::RegExp (v8-regexp.h)
Static Methods
-
static fromPtr(ptr: number): V8RegExpWraps a raw V8-wasm handle pointer as a
V8RegExp. -
static new(context: Context, pattern: V8String, flags: RegExpFlags): MaybeLocal<V8RegExp>Creates a regular expression from the given pattern string and the flags bit field. May throw a JavaScript exception as described in ECMA-262, 15.10.4.1.
For example,
RegExp.New(String.New("foo"),static_cast<RegExp.Flags>(kGlobal | kMultiline)) is equivalent to evaluating "/foo/gm".Upstream C++:
v8::RegExp::New -
static newWithBacktrackLimit(context: Context, pattern: V8String, flags: RegExpFlags, backtrack_limit: number): MaybeLocal<V8RegExp>Like New, but additionally specifies a backtrack limit. If the number of backtracks done in one Exec call hits the limit, a match failure is immediately returned.
Upstream C++:
v8::RegExp::NewWithBacktrackLimit
Methods
-
exec(context: Context, subject: V8String): MaybeLocal<V8Object>Executes the current RegExp instance on the given subject string. Equivalent to RegExp.prototype.exec as described in
https://tc39.es/ecma262/#sec-regexp.prototype.exec
On success, an Array containing the matched strings is returned. On failure, returns Null.
Note: modifies global context state, accessible e.g. through RegExp.input.
Upstream C++:
v8::RegExp::Exec -
getFlags(): RegExpFlagsReturns the flags bit field.
Upstream C++:
v8::RegExp::GetFlags -
getSource(): V8StringReturns the value of the source property: a string representing the regular expression.
Upstream C++:
v8::RegExp::GetSource
V8String
class V8String extends Name
A JavaScript string value (ECMA-262, 4.3.17).
Upstream C++: v8::String (v8-primitive.h)
Static Methods
-
static concat(isolate: Isolate, left: V8String, right: V8String): V8StringCreates a new string by concatenating the left and the right strings passed in as parameters.
Upstream C++:
v8::String::Concat -
static empty(isolate: Isolate): V8StringA zero length string.
Upstream C++:
v8::String::Empty -
static fromPtr(ptr: number): V8StringWraps a raw V8-wasm handle pointer as a
V8String. -
static newExternalOneByte(isolate: Isolate, resource: StringExternalOneByteStringResource): MaybeLocal<V8String>Creates a new external string using the one-byte data defined in the given resource. When the external string is no longer live on V8's heap the resource will be disposed by calling its Dispose method. The caller of this function should not otherwise delete or modify the resource. Neither should the underlying buffer be deallocated or modified except through the destructor of the external string resource.
Upstream C++:
v8::String::NewExternalOneByte -
static newExternalTwoByte(isolate: Isolate, resource: StringExternalStringResource): MaybeLocal<V8String>Creates a new external string using the data defined in the given resource. When the external string is no longer live on V8's heap the resource will be disposed by calling its Dispose method. The caller of this function should not otherwise delete or modify the resource. Neither should the underlying buffer be deallocated or modified except through the destructor of the external string resource.
Upstream C++:
v8::String::NewExternalTwoByte -
static newFromOneByte(isolate: Isolate, data: number, type_: NewStringType, length: number): MaybeLocal<V8String>Allocates a new string from Latin-1 data. Only returns an empty value when length > kMaxLength. *
Upstream C++:
v8::String::NewFromOneByte -
static newFromTwoByte(isolate: Isolate, data: number, type_: NewStringType, length: number): MaybeLocal<V8String>Allocates a new string from UTF-16 data. Only returns an empty value when length > kMaxLength. *
Upstream C++:
v8::String::NewFromTwoByte -
static newFromUtf8(isolate: Isolate, data: string | null, type_: NewStringType, length: number): MaybeLocal<V8String>Allocates a new string from UTF-8 data. Only returns an empty value when length > kMaxLength. *
Upstream C++:
v8::String::NewFromUtf8
Methods
-
canMakeExternal(encoding: StringEncoding): booleanReturns true if this string can be made external, given the encoding for the external string resource.
Upstream C++:
v8::String::CanMakeExternal -
containsOnlyOneByte(): booleanReturns whether this string contain only one byte data, i.e. ISO-8859-1 code points. Will read the entire string in some cases.
Upstream C++:
v8::String::ContainsOnlyOneByte -
getExternalOneByteStringResource(): StringExternalOneByteStringResource | nullGet the ExternalOneByteStringResource for an external one-byte string. Returns
nullif IsExternalOneByte() doesn't return true.Upstream C++:
v8::String::GetExternalOneByteStringResource -
getExternalStringResource(): StringExternalStringResource | nullTODO(pthier): Change return type to const ExternalStringResource*.
Upstream C++:
v8::String::GetExternalStringResource -
internalizeString(isolate: Isolate): V8StringReturns the internalized string. See
NewStringType.kInternalizedfor details on internalized strings.Upstream C++:
v8::String::InternalizeString -
isExternal(): booleanReturns true if the string is external.
Upstream C++:
v8::String::IsExternal -
isExternalOneByte(): booleanReturns true if the string is both external and one-byte.
Upstream C++:
v8::String::IsExternalOneByte -
isExternalTwoByte(): booleanReturns true if the string is both external and two-byte.
Upstream C++:
v8::String::IsExternalTwoByte -
isInStringTable(isolate: Isolate): booleanReturns true if the string is already in the string table of the isolate.
Upstream C++:
v8::String::IsInStringTable -
isOneByte(): booleanReturns whether this string is known to contain only one byte data, i.e. ISO-8859-1 code points. Does not read the string. False negatives are possible.
Upstream C++:
v8::String::IsOneByte -
length(): numberReturns the number of characters (UTF-16 code units) in this string.
Upstream C++:
v8::String::Length -
makeExternal(resource: StringExternalStringResource): booleanAssociate an external string resource with this string by transforming it in place so that existing references to this string in the JavaScript heap will use the external string resource. The external string resource's character contents need to be equivalent to this string. Returns true if the string has been changed to be an external string. The string is not modified if the operation fails. See NewExternal for information on the lifetime of the resource.
Upstream C++:
v8::String::MakeExternal -
makeExternal2(isolate: Isolate, resource: StringExternalStringResource): booleanAssociate an external string resource with this string by transforming it in place so that existing references to this string in the JavaScript heap will use the external string resource. The external string resource's character contents need to be equivalent to this string. Returns true if the string has been changed to be an external string. The string is not modified if the operation fails. See NewExternal for information on the lifetime of the resource.
Upstream C++:
v8::String::MakeExternal -
makeExternal3(resource: StringExternalOneByteStringResource): booleanAssociate an external string resource with this string by transforming it in place so that existing references to this string in the JavaScript heap will use the external string resource. The external string resource's character contents need to be equivalent to this string. Returns true if the string has been changed to be an external string. The string is not modified if the operation fails. See NewExternal for information on the lifetime of the resource.
Upstream C++:
v8::String::MakeExternal -
makeExternal4(isolate: Isolate, resource: StringExternalOneByteStringResource): booleanAssociate an external string resource with this string by transforming it in place so that existing references to this string in the JavaScript heap will use the external string resource. The external string resource's character contents need to be equivalent to this string. Returns true if the string has been changed to be an external string. The string is not modified if the operation fails. See NewExternal for information on the lifetime of the resource.
Upstream C++:
v8::String::MakeExternal -
stringEquals(str: V8String): booleanReturns true if the strings values are equal. Same as JS ==/===.
Upstream C++:
v8::String::StringEquals -
utf8Length(isolate: Isolate): numberReturns the number of bytes needed for the Utf8 encoding of this string.
Upstream C++:
v8::String::Utf8Length -
utf8LengthV2(isolate: Isolate): numberTODO(http://crbug.com/373485796): deprecate and remove.
Upstream C++:
v8::String::Utf8LengthV2 -
write(isolate: Isolate, offset: number, length: number, buffer: number, flags: number): voidWrite the contents of the string to an external buffer.
Copies length characters into the output buffer starting at offset. The output buffer must have sufficient space for all characters and the null terminator if null termination is requested through the flags.
offset: The position within the string at which copying begins.length: The number of characters to copy from the string.buffer: The buffer into which the string will be copied.flags: Various flags that influence the behavior of this operation.
Upstream C++:
v8::String::Write -
writeOneByte(isolate: Isolate, offset: number, length: number, buffer: number, flags: number): voidBinds upstream V8 C++
v8::String::WriteOneByte. -
writeOneByteV2(isolate: Isolate, offset: number, length: number, buffer: number, flags: number): voidTODO(http://crbug.com/373485796): deprecate and remove.
Upstream C++:
v8::String::WriteOneByteV2 -
writeV2(isolate: Isolate, offset: number, length: number, buffer: number, flags: number): voidTODO(http://crbug.com/373485796): deprecate and remove.
Upstream C++:
v8::String::WriteV2
V8Symbol
class V8Symbol extends Name
A JavaScript symbol (ECMA-262 edition 6)
Upstream C++: v8::Symbol (v8-primitive.h)
Static Methods
-
static for(isolate: Isolate, description: V8String): V8SymbolAccess global symbol registry. Note that symbols created this way are never collected, so they should only be used for statically fixed properties. Also, there is only one global name space for the descriptions used as keys. To minimize the potential for clashes, use qualified names as keys.
Upstream C++:
v8::Symbol::For -
static forApi(isolate: Isolate, description: V8String): V8SymbolRetrieve a global symbol. Similar to
For, but using a separate registry that is not accessible by (and cannot clash with) JavaScript code.Upstream C++:
v8::Symbol::ForApi -
static fromPtr(ptr: number): V8SymbolWraps a raw V8-wasm handle pointer as a
V8Symbol. -
static getAsyncDispose(isolate: Isolate): V8SymbolBinds upstream V8 C++
v8::Symbol::GetAsyncDispose. -
static getAsyncIterator(isolate: Isolate): V8SymbolWell-known symbols
Upstream C++:
v8::Symbol::GetAsyncIterator -
static getDispose(isolate: Isolate): V8SymbolBinds upstream V8 C++
v8::Symbol::GetDispose. -
static getHasInstance(isolate: Isolate): V8SymbolBinds upstream V8 C++
v8::Symbol::GetHasInstance. -
static getIsConcatSpreadable(isolate: Isolate): V8SymbolBinds upstream V8 C++
v8::Symbol::GetIsConcatSpreadable. -
static getIterator(isolate: Isolate): V8SymbolBinds upstream V8 C++
v8::Symbol::GetIterator. -
static getMatch(isolate: Isolate): V8SymbolBinds upstream V8 C++
v8::Symbol::GetMatch. -
static getReplace(isolate: Isolate): V8SymbolBinds upstream V8 C++
v8::Symbol::GetReplace. -
static getSearch(isolate: Isolate): V8SymbolBinds upstream V8 C++
v8::Symbol::GetSearch. -
static getSplit(isolate: Isolate): V8SymbolBinds upstream V8 C++
v8::Symbol::GetSplit. -
static getToPrimitive(isolate: Isolate): V8SymbolBinds upstream V8 C++
v8::Symbol::GetToPrimitive. -
static getToStringTag(isolate: Isolate): V8SymbolBinds upstream V8 C++
v8::Symbol::GetToStringTag. -
static getUnscopables(isolate: Isolate): V8SymbolBinds upstream V8 C++
v8::Symbol::GetUnscopables. -
static new(isolate: Isolate, description?: V8String): V8SymbolCreate a symbol. If description is not empty, it will be used as the description.
Upstream C++:
v8::Symbol::New
Methods
-
description(isolate: Isolate): ValueReturns the description string of the symbol, or undefined if none.
Upstream C++:
v8::Symbol::Description
Value
class Value extends Data
The superclass of all JavaScript values and objects.
Upstream C++: v8::Value (v8-value.h)
Static Methods
-
static fromPtr(ptr: number): ValueWraps a raw V8-wasm handle pointer as a
Value.
Methods
-
booleanValue(isolate: Isolate): booleanReturns the equivalent of
ToBoolean()->Value().Upstream C++:
v8::Value::BooleanValue -
equals(context: Context, that: Value): Maybe<boolean>JS ==
Upstream C++:
v8::Value::Equals -
getHash(): numberGet the hash of this value. The hash is not guaranteed to be unique. For
ObjectandNameinstances the result is equal toGetIdentityHash. Hashes are not guaranteed to be stable across different isolates or processes.Upstream C++:
v8::Value::GetHash -
instanceOf(context: Context, object: V8Object): Maybe<boolean>Binds upstream V8 C++
v8::Value::InstanceOf. -
int32Value(context: Context): Maybe<number>Returns the equivalent of
ToInt32()->Value().Upstream C++:
v8::Value::Int32Value -
integerValue(context: Context): Maybe<bigint>Returns the equivalent of
ToInteger()->Value().Upstream C++:
v8::Value::IntegerValue -
isArgumentsObject(): booleanReturns true if this value is an Arguments object.
Upstream C++:
v8::Value::IsArgumentsObject -
isArray(): booleanReturns true if this value is an array. Note that it will return false for an Proxy for an array.
Upstream C++:
v8::Value::IsArray -
isArrayBuffer(): booleanReturns true if this value is an ArrayBuffer.
Upstream C++:
v8::Value::IsArrayBuffer -
isArrayBufferView(): booleanReturns true if this value is an ArrayBufferView.
Upstream C++:
v8::Value::IsArrayBufferView -
isAsyncFunction(): booleanReturns true if this value is an async function.
Upstream C++:
v8::Value::IsAsyncFunction -
isBigInt(): booleanReturns true if this value is a bigint.
This is equivalent to
typeof value === 'bigint'in JS.Upstream C++:
v8::Value::IsBigInt -
isBigInt64Array(): booleanReturns true if this value is a BigInt64Array.
Upstream C++:
v8::Value::IsBigInt64Array -
isBigIntObject(): booleanReturns true if this value is a BigInt object.
Upstream C++:
v8::Value::IsBigIntObject -
isBigUint64Array(): booleanReturns true if this value is a BigUint64Array.
Upstream C++:
v8::Value::IsBigUint64Array -
isBoolean(): booleanReturns true if this value is boolean.
This is equivalent to
typeof value === 'boolean'in JS.Upstream C++:
v8::Value::IsBoolean -
isBooleanObject(): booleanReturns true if this value is a Boolean object.
Upstream C++:
v8::Value::IsBooleanObject -
isDataView(): booleanReturns true if this value is a DataView.
Upstream C++:
v8::Value::IsDataView -
isDate(): booleanReturns true if this value is a Date.
Upstream C++:
v8::Value::IsDate -
isExternal(): booleanReturns true if this value is an
Externalobject.Upstream C++:
v8::Value::IsExternal -
isFalse(): booleanReturns true if this value is false.
This is not the same as
!BooleanValue(). The latter performs a conversion to boolean, i.e. the result of!Boolean(value)in JS, whereas this checksvalue === false.Upstream C++:
v8::Value::IsFalse -
isFloat16Array(): booleanReturns true if this value is a Float16Array.
Upstream C++:
v8::Value::IsFloat16Array -
isFloat32Array(): booleanReturns true if this value is a Float32Array.
Upstream C++:
v8::Value::IsFloat32Array -
isFloat64Array(): booleanReturns true if this value is a Float64Array.
Upstream C++:
v8::Value::IsFloat64Array -
isFunction(): booleanReturns true if this value is a function.
This is equivalent to
typeof value === 'function'in JS.Upstream C++:
v8::Value::IsFunction -
isGeneratorFunction(): booleanReturns true if this value is a Generator function.
Upstream C++:
v8::Value::IsGeneratorFunction -
isGeneratorObject(): booleanReturns true if this value is a Generator object (iterator).
Upstream C++:
v8::Value::IsGeneratorObject -
isInt16Array(): booleanReturns true if this value is an Int16Array.
Upstream C++:
v8::Value::IsInt16Array -
isInt32(): booleanReturns true if this value is a 32-bit signed integer.
Upstream C++:
v8::Value::IsInt32 -
isInt32Array(): booleanReturns true if this value is an Int32Array.
Upstream C++:
v8::Value::IsInt32Array -
isInt8Array(): booleanReturns true if this value is an Int8Array.
Upstream C++:
v8::Value::IsInt8Array -
isMap(): booleanReturns true if this value is a Map.
Upstream C++:
v8::Value::IsMap -
isMapIterator(): booleanReturns true if this value is a Map Iterator.
Upstream C++:
v8::Value::IsMapIterator -
isModuleNamespaceObject(): booleanReturns true if the value is a Module Namespace Object.
Upstream C++:
v8::Value::IsModuleNamespaceObject -
isName(): booleanReturns true if this value is a symbol or a string.
This is equivalent to
typeof value === 'string' || typeof value === 'symbol'in JS.Upstream C++:
v8::Value::IsName -
isNativeError(): booleanReturns true if this value is a NativeError.
Upstream C++:
v8::Value::IsNativeError -
isNull(): booleanReturns true if this value is the null value. See ECMA-262 4.3.11.
This is equivalent to
value === nullin JS.Upstream C++:
v8::Value::IsNull -
isNullOrUndefined(): booleanReturns true if this value is either the null or the undefined value. See ECMA-262 4.3.11. and 4.3.12
This is equivalent to
value == nullin JS.Upstream C++:
v8::Value::IsNullOrUndefined -
isNumber(): booleanReturns true if this value is a number.
This is equivalent to
typeof value === 'number'in JS.Upstream C++:
v8::Value::IsNumber -
isNumberObject(): booleanReturns true if this value is a Number object.
Upstream C++:
v8::Value::IsNumberObject -
isObject(): booleanReturns true if this value is an object.
Upstream C++:
v8::Value::IsObject -
isPrimitive(): booleanReturns true if the value is a primitive.
Upstream C++:
v8::Value::IsPrimitive -
isPromise(): booleanReturns true if this value is a Promise.
Upstream C++:
v8::Value::IsPromise -
isProxy(): booleanReturns true if this value is a JavaScript Proxy.
Upstream C++:
v8::Value::IsProxy -
isRegExp(): booleanReturns true if this value is a RegExp.
Upstream C++:
v8::Value::IsRegExp -
isSet(): booleanReturns true if this value is a Set.
Upstream C++:
v8::Value::IsSet -
isSetIterator(): booleanReturns true if this value is a Set Iterator.
Upstream C++:
v8::Value::IsSetIterator -
isSharedArrayBuffer(): booleanReturns true if this value is a SharedArrayBuffer.
Upstream C++:
v8::Value::IsSharedArrayBuffer -
isString(): booleanReturns true if this value is an instance of the String type. See ECMA-262 8.4.
This is equivalent to
typeof value === 'string'in JS.Upstream C++:
v8::Value::IsString -
isStringObject(): booleanReturns true if this value is a String object.
Upstream C++:
v8::Value::IsStringObject -
isSymbol(): booleanReturns true if this value is a symbol.
This is equivalent to
typeof value === 'symbol'in JS.Upstream C++:
v8::Value::IsSymbol -
isSymbolObject(): booleanReturns true if this value is a Symbol object.
Upstream C++:
v8::Value::IsSymbolObject -
isTrue(): booleanReturns true if this value is true.
This is not the same as
BooleanValue(). The latter performs a conversion to boolean, i.e. the result ofBoolean(value)in JS, whereas this checksvalue === true.Upstream C++:
v8::Value::IsTrue -
isTypedArray(): booleanReturns true if this value is one of TypedArrays.
Upstream C++:
v8::Value::IsTypedArray -
isUint16Array(): booleanReturns true if this value is an Uint16Array.
Upstream C++:
v8::Value::IsUint16Array -
isUint32(): booleanReturns true if this value is a 32-bit unsigned integer.
Upstream C++:
v8::Value::IsUint32 -
isUint32Array(): booleanReturns true if this value is an Uint32Array.
Upstream C++:
v8::Value::IsUint32Array -
isUint8Array(): booleanReturns true if this value is an Uint8Array.
Upstream C++:
v8::Value::IsUint8Array -
isUint8ClampedArray(): booleanReturns true if this value is an Uint8ClampedArray.
Upstream C++:
v8::Value::IsUint8ClampedArray -
isUndefined(): booleanReturns true if this value is the undefined value. See ECMA-262 4.3.10.
This is equivalent to
value === undefinedin JS.Upstream C++:
v8::Value::IsUndefined -
isWasmMemoryObject(): booleanReturns true if this value is a WasmMemoryObject.
Upstream C++:
v8::Value::IsWasmMemoryObject -
isWasmModuleObject(): booleanReturns true if this value is a WasmModuleObject.
Upstream C++:
v8::Value::IsWasmModuleObject -
isWasmNull(): booleanReturns true if this value is the WasmNull object.
Upstream C++:
v8::Value::IsWasmNull -
isWeakMap(): booleanReturns true if this value is a WeakMap.
Upstream C++:
v8::Value::IsWeakMap -
isWeakRef(): booleanReturns true if this value is a WeakRef.
Upstream C++:
v8::Value::IsWeakRef -
isWeakSet(): booleanReturns true if this value is a WeakSet.
Upstream C++:
v8::Value::IsWeakSet -
numberValue(context: Context): Maybe<number>Returns the equivalent of
ToNumber()->Value().Upstream C++:
v8::Value::NumberValue -
sameValue(that: Value): booleanBinds upstream V8 C++
v8::Value::SameValue. -
strictEquals(that: Value): booleanBinds upstream V8 C++
v8::Value::StrictEquals. -
toArrayIndex(context: Context): MaybeLocal<Uint32>Attempts to convert a string to an array index. Returns an empty handle if the conversion fails.
Upstream C++:
v8::Value::ToArrayIndex -
toBigInt(context: Context): MaybeLocal<V8BigInt>Perform the equivalent of
BigInt(value)in JS.Upstream C++:
v8::Value::ToBigInt -
toBoolean(isolate: Isolate): V8BooleanPerform the equivalent of
Boolean(value)in JS. This can never fail.Upstream C++:
v8::Value::ToBoolean -
toDetailString(context: Context): MaybeLocal<V8String>Provide a string representation of this value usable for debugging. This operation has no observable side effects and will succeed unless e.g. execution is being terminated.
Upstream C++:
v8::Value::ToDetailString -
toInt32(context: Context): MaybeLocal<Int32>Perform the equivalent of
Number(value)in JS and convert the result to a signed 32-bit integer by performing the steps in https://tc39.es/ecma262/#sec-toint32.Upstream C++:
v8::Value::ToInt32 -
toInteger(context: Context): MaybeLocal<Integer>Perform the equivalent of
Number(value)in JS and convert the result to an integer. Negative values are rounded up, positive values are rounded down. NaN is converted to 0. Infinite values yield undefined results.Upstream C++:
v8::Value::ToInteger -
toNumber(context: Context): MaybeLocal<V8Number>Perform the equivalent of
Number(value)in JS.Upstream C++:
v8::Value::ToNumber -
toNumeric(context: Context): MaybeLocal<Numeric>Perform
ToNumeric(value)as specified in: https://tc39.es/ecma262/#sec-tonumeric.Upstream C++:
v8::Value::ToNumeric -
toObject(context: Context): MaybeLocal<V8Object>Perform the equivalent of
Tagged<Object>(value)in JS.Upstream C++:
v8::Value::ToObject -
toPrimitive(context: Context): MaybeLocal<Primitive>Perform
ToPrimitive(value)as specified in: https://tc39.es/ecma262/#sec-toprimitive.Upstream C++:
v8::Value::ToPrimitive -
toString(context: Context): MaybeLocal<V8String>Perform the equivalent of
String(value)in JS.Upstream C++:
v8::Value::ToString -
toUint32(context: Context): MaybeLocal<Uint32>Perform the equivalent of
Number(value)in JS and convert the result to an unsigned 32-bit integer by performing the steps in https://tc39.es/ecma262/#sec-touint32.Upstream C++:
v8::Value::ToUint32 -
typeOf(arg0: Isolate): V8StringBinds upstream V8 C++
v8::Value::TypeOf. -
uint32Value(context: Context): Maybe<number>Returns the equivalent of
ToUint32()->Value().Upstream C++:
v8::Value::Uint32Value