Skip to Content
V8-wasm
API Reference

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): BigIntObject

    Wraps a raw V8-wasm handle pointer as a BigIntObject.

  • static new(isolate: Isolate, value: bigint): Value

    Binds upstream V8 C++ v8::BigIntObject::New.

Methods

  • valueOf(): V8BigInt

    Binds 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): BooleanObject

    Wraps a raw V8-wasm handle pointer as a BooleanObject.

  • static new(isolate: Isolate, value: boolean): Value

    Binds upstream V8 C++ v8::BooleanObject::New.

Methods

  • valueOf(): boolean

    Binds 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): Data

    Wraps a raw V8-wasm handle pointer as a Data.

Methods

  • isContext(): boolean

    Returns true if this data is a Context.

    Upstream C++: v8::Data::IsContext

  • isCppHeapExternal(): boolean

    Returns true if this value is a CppHeapExternal object.

    Upstream C++: v8::Data::IsCppHeapExternal

  • isDictionaryTemplate(): boolean

    Returns true if this data is a DictionaryTemplate.

    Upstream C++: v8::Data::IsDictionaryTemplate

  • isFixedArray(): boolean

    Returns tru if this data is a FixedArray

    Upstream C++: v8::Data::IsFixedArray

  • isFunctionTemplate(): boolean

    Returns true if this data is a FunctionTemplate.

    Upstream C++: v8::Data::IsFunctionTemplate

  • isModule(): boolean

    Returns true if this data is a Module.

    Upstream C++: v8::Data::IsModule

  • isModuleRequest(): boolean

    Returns true if this data is a ModuleRequest.

    Upstream C++: v8::Data::IsModuleRequest

  • isObjectTemplate(): boolean

    Returns true if this data is a ObjectTemplate.

    Upstream C++: v8::Data::IsObjectTemplate

  • isPrivate(): boolean

    Returns true if this data is a Private.

    Upstream C++: v8::Data::IsPrivate

  • isValue(): boolean

    Returns 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 stack property.

    Upstream C++: v8::Exception::CaptureStackTrace

  • static createMessage(isolate: Isolate, exception: Value): Message

    Creates 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): Value

    Binds upstream V8 C++ v8::Exception::Error.

  • static getStackTrace(exception: Value): StackTrace

    Returns 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): Value

    Binds upstream V8 C++ v8::Exception::RangeError.

  • static referenceError(message: V8String, options?: Value): Value

    Binds upstream V8 C++ v8::Exception::ReferenceError.

  • static syntaxError(message: V8String, options?: Value): Value

    Binds upstream V8 C++ v8::Exception::SyntaxError.

  • static typeError(message: V8String, options?: Value): Value

    Binds upstream V8 C++ v8::Exception::TypeError.

  • static wasmCompileError(message: V8String, options?: Value): Value

    Binds upstream V8 C++ v8::Exception::WasmCompileError.

  • static wasmLinkError(message: V8String, options?: Value): Value

    Binds upstream V8 C++ v8::Exception::WasmLinkError.

  • static wasmRuntimeError(message: V8String, options?: Value): Value

    Binds upstream V8 C++ v8::Exception::WasmRuntimeError.

  • static wasmSuspendError(message: V8String, options?: Value): Value

    Binds 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(): V8Object

    Binds upstream V8 C++ v8::ExceptionPropagationMessage::GetException.

  • getExceptionContext(): ExceptionContext

    Binds upstream V8 C++ v8::ExceptionPropagationMessage::GetExceptionContext.

  • getInterfaceName(): V8String

    Binds upstream V8 C++ v8::ExceptionPropagationMessage::GetInterfaceName.

  • getIsolate(): Isolate | null

    Binds upstream V8 C++ v8::ExceptionPropagationMessage::GetIsolate.

  • getPropertyName(): V8String

    Binds 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): External

    Wraps a raw V8-wasm handle pointer as a External.

  • static new(isolate: Isolate, value: number, tag: number): External

    Creates 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 value kExternalPointerTypeTagDefault can be used. Returns: The new External object.

    Upstream C++: v8::External::New

Methods

  • value(tag: number): number

    Returns 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 value kExternalPointerTypeTagDefault can 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): void

    Binds 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): FixedArray

    Wraps a raw V8-wasm handle pointer as a FixedArray.

Methods

  • get(i: number): Data

    Binds upstream V8 C++ v8::FixedArray::Get.

  • length(): number

    Binds 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): Int32

    Wraps a raw V8-wasm handle pointer as a Int32.

Methods

  • value(): number

    Binds 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): Integer

    Wraps a raw V8-wasm handle pointer as a Integer.

  • static new(isolate: Isolate, value: number): Integer

    Binds upstream V8 C++ v8::Integer::New.

  • static newFromUnsigned(isolate: Isolate, value: number): Integer

    Binds upstream V8 C++ v8::Integer::NewFromUnsigned.

Methods

  • getIntegerValue(): bigint

    Binds 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): Message

    Wraps a raw V8-wasm handle pointer as a Message.

Methods

  • errorLevel(): number

    Returns the error level of the message.

    Upstream C++: v8::Message::ErrorLevel

  • get(): V8String

    Binds upstream V8 C++ v8::Message::Get.

  • getEndColumn(): number

    Returns 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(): number

    Returns 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(): Value

    Returns 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(): StackTrace

    Exception stack trace. By default stack traces are not captured for uncaught exceptions. SetCaptureStackTraceForUncaughtExceptions allows to change this option.

    Upstream C++: v8::Message::GetStackTrace

  • getStartColumn(): number

    Returns 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(): number

    Returns 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(): number

    Returns the Wasm function index where the error occurred. Returns -1 if message is not from a Wasm script.

    Upstream C++: v8::Message::GetWasmFunctionIndex

  • isOpaque(): boolean

    Binds upstream V8 C++ v8::Message::IsOpaque.

  • isSharedCrossOrigin(): boolean

    Passes 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): Name

    Wraps a raw V8-wasm handle pointer as a Name.

Methods

  • getIdentityHash(): number

    Returns 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): NumberObject

    Wraps a raw V8-wasm handle pointer as a NumberObject.

  • static new(isolate: Isolate, value: number): Value

    Binds upstream V8 C++ v8::NumberObject::New.

Methods

  • valueOf(): number

    Binds 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): Numeric

    Wraps 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): Primitive

    Wraps 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): PrimitiveArray

    Wraps a raw V8-wasm handle pointer as a PrimitiveArray.

  • static new(isolate: Isolate, length: number): PrimitiveArray

    Binds upstream V8 C++ v8::PrimitiveArray::New.

Methods

  • get(isolate: Isolate, index: number): Primitive

    Binds upstream V8 C++ v8::PrimitiveArray::Get.

  • length(): number

    Binds upstream V8 C++ v8::PrimitiveArray::Length.

  • set(isolate: Isolate, index: number, item: Primitive): void

    Binds 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(): number

    Binds upstream V8 C++ v8::ScriptOrigin::ColumnOffset.

  • getHostDefinedOptions(): Data

    Binds upstream V8 C++ v8::ScriptOrigin::GetHostDefinedOptions.

  • lineOffset(): number

    Binds upstream V8 C++ v8::ScriptOrigin::LineOffset.

  • resourceName(): Value

    Binds upstream V8 C++ v8::ScriptOrigin::ResourceName.

  • scriptId(): number

    Binds upstream V8 C++ v8::ScriptOrigin::ScriptId.

  • sourceMapUrl(): Value

    Binds 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(): number

    Binds upstream V8 C++ v8::ScriptOriginOptions::Flags.

  • isModule(): boolean

    Binds upstream V8 C++ v8::ScriptOriginOptions::IsModule.

  • isOpaque(): boolean

    Binds upstream V8 C++ v8::ScriptOriginOptions::IsOpaque.

  • isSharedCrossOrigin(): boolean

    Binds upstream V8 C++ v8::ScriptOriginOptions::IsSharedCrossOrigin.

  • isWasm(): boolean

    Binds 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 | null

    Returns 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 | null

    The 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(): number

    The number of Latin-1 characters in the string.

    Upstream C++: v8::String::ExternalOneByteStringResource::length

  • updateDataCache(): void

    Update {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(): number

    Returns 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(): number

    The 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(): number

    The length of the string. That is, the number of two-byte characters.

    Upstream C++: v8::String::ExternalStringResource::length

  • updateDataCache(): void

    Update {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(): number

    Returns 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): void

    Estimates 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(): boolean

    If 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): void

    Internally 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): void

    Record 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): StringObject

    Wraps a raw V8-wasm handle pointer as a StringObject.

  • static new(isolate: Isolate, value: V8String): Value

    Binds upstream V8 C++ v8::StringObject::New.

Methods

  • valueOf(): V8String

    Binds 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(): number

    Binds 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(): number

    Binds 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(): number

    Binds upstream V8 C++ v8::String::ValueView::data16.

  • data8(): number

    Binds upstream V8 C++ v8::String::ValueView::data8.

  • is_one_byte(): boolean

    Binds upstream V8 C++ v8::String::ValueView::is_one_byte.

  • length(): number

    Binds 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): SymbolObject

    Wraps a raw V8-wasm handle pointer as a SymbolObject.

  • static new(isolate: Isolate, value: V8Symbol): Value

    Binds upstream V8 C++ v8::SymbolObject::New.

Methods

  • valueOf(): V8Symbol

    Binds 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): boolean

    Checks 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): void

    Remembers 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): Uint32

    Wraps a raw V8-wasm handle pointer as a Uint32.

Methods

  • value(): number

    Binds 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): V8BigInt

    Wraps a raw V8-wasm handle pointer as a V8BigInt.

  • static new(isolate: Isolate, value: bigint): V8BigInt

    Binds upstream V8 C++ v8::BigInt::New.

  • static newFromUnsigned(isolate: Isolate, value: bigint): V8BigInt

    Binds upstream V8 C++ v8::BigInt::NewFromUnsigned.

Methods

  • wordCount(): number

    Returns 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): V8Boolean

    Wraps a raw V8-wasm handle pointer as a V8Boolean.

  • static new(isolate: Isolate, value: boolean): V8Boolean

    Binds upstream V8 C++ v8::Boolean::New.

Methods

  • value(): boolean

    Binds 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): V8Date

    Wraps 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(): V8String

    Generates ISO string representation.

    Upstream C++: v8::Date::ToISOString

  • toUTCString(): V8String

    Generates UTC string representation.

    Upstream C++: v8::Date::ToUTCString

  • valueOf(): number

    A specialization of Value.NumberValue that 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): V8Number

    Wraps a raw V8-wasm handle pointer as a V8Number.

  • static newNumber(isolate: Isolate, value: number): V8Number

    Binds upstream V8 C++ v8::Number::New.

Methods

  • value(): number

    Binds 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): V8RegExp

    Wraps 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(): RegExpFlags

    Returns the flags bit field.

    Upstream C++: v8::RegExp::GetFlags

  • getSource(): V8String

    Returns 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): V8String

    Creates a new string by concatenating the left and the right strings passed in as parameters.

    Upstream C++: v8::String::Concat

  • static empty(isolate: Isolate): V8String

    A zero length string.

    Upstream C++: v8::String::Empty

  • static fromPtr(ptr: number): V8String

    Wraps 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): boolean

    Returns true if this string can be made external, given the encoding for the external string resource.

    Upstream C++: v8::String::CanMakeExternal

  • containsOnlyOneByte(): boolean

    Returns 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 | null

    Get the ExternalOneByteStringResource for an external one-byte string. Returns null if IsExternalOneByte() doesn't return true.

    Upstream C++: v8::String::GetExternalOneByteStringResource

  • getExternalStringResource(): StringExternalStringResource | null

    TODO(pthier): Change return type to const ExternalStringResource*.

    Upstream C++: v8::String::GetExternalStringResource

  • internalizeString(isolate: Isolate): V8String

    Returns the internalized string. See NewStringType.kInternalized for details on internalized strings.

    Upstream C++: v8::String::InternalizeString

  • isExternal(): boolean

    Returns true if the string is external.

    Upstream C++: v8::String::IsExternal

  • isExternalOneByte(): boolean

    Returns true if the string is both external and one-byte.

    Upstream C++: v8::String::IsExternalOneByte

  • isExternalTwoByte(): boolean

    Returns true if the string is both external and two-byte.

    Upstream C++: v8::String::IsExternalTwoByte

  • isInStringTable(isolate: Isolate): boolean

    Returns true if the string is already in the string table of the isolate.

    Upstream C++: v8::String::IsInStringTable

  • isOneByte(): boolean

    Returns 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(): number

    Returns the number of characters (UTF-16 code units) in this string.

    Upstream C++: v8::String::Length

  • makeExternal(resource: StringExternalStringResource): boolean

    Associate 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): boolean

    Associate 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): boolean

    Associate 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): boolean

    Associate 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): boolean

    Returns true if the strings values are equal. Same as JS ==/===.

    Upstream C++: v8::String::StringEquals

  • utf8Length(isolate: Isolate): number

    Returns the number of bytes needed for the Utf8 encoding of this string.

    Upstream C++: v8::String::Utf8Length

  • utf8LengthV2(isolate: Isolate): number

    TODO(http://crbug.com/373485796): deprecate and remove.

    Upstream C++: v8::String::Utf8LengthV2

  • write(isolate: Isolate, offset: number, length: number, buffer: number, flags: number): void

    Write 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): void

    Binds upstream V8 C++ v8::String::WriteOneByte.

  • writeOneByteV2(isolate: Isolate, offset: number, length: number, buffer: number, flags: number): void

    TODO(http://crbug.com/373485796): deprecate and remove.

    Upstream C++: v8::String::WriteOneByteV2

  • writeV2(isolate: Isolate, offset: number, length: number, buffer: number, flags: number): void

    TODO(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): V8Symbol

    Access 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): V8Symbol

    Retrieve 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): V8Symbol

    Wraps a raw V8-wasm handle pointer as a V8Symbol.

  • static getAsyncDispose(isolate: Isolate): V8Symbol

    Binds upstream V8 C++ v8::Symbol::GetAsyncDispose.

  • static getAsyncIterator(isolate: Isolate): V8Symbol

    Well-known symbols

    Upstream C++: v8::Symbol::GetAsyncIterator

  • static getDispose(isolate: Isolate): V8Symbol

    Binds upstream V8 C++ v8::Symbol::GetDispose.

  • static getHasInstance(isolate: Isolate): V8Symbol

    Binds upstream V8 C++ v8::Symbol::GetHasInstance.

  • static getIsConcatSpreadable(isolate: Isolate): V8Symbol

    Binds upstream V8 C++ v8::Symbol::GetIsConcatSpreadable.

  • static getIterator(isolate: Isolate): V8Symbol

    Binds upstream V8 C++ v8::Symbol::GetIterator.

  • static getMatch(isolate: Isolate): V8Symbol

    Binds upstream V8 C++ v8::Symbol::GetMatch.

  • static getReplace(isolate: Isolate): V8Symbol

    Binds upstream V8 C++ v8::Symbol::GetReplace.

  • static getSearch(isolate: Isolate): V8Symbol

    Binds upstream V8 C++ v8::Symbol::GetSearch.

  • static getSplit(isolate: Isolate): V8Symbol

    Binds upstream V8 C++ v8::Symbol::GetSplit.

  • static getToPrimitive(isolate: Isolate): V8Symbol

    Binds upstream V8 C++ v8::Symbol::GetToPrimitive.

  • static getToStringTag(isolate: Isolate): V8Symbol

    Binds upstream V8 C++ v8::Symbol::GetToStringTag.

  • static getUnscopables(isolate: Isolate): V8Symbol

    Binds upstream V8 C++ v8::Symbol::GetUnscopables.

  • static new(isolate: Isolate, description?: V8String): V8Symbol

    Create a symbol. If description is not empty, it will be used as the description.

    Upstream C++: v8::Symbol::New

Methods

  • description(isolate: Isolate): Value

    Returns 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): Value

    Wraps a raw V8-wasm handle pointer as a Value.

Methods

  • booleanValue(isolate: Isolate): boolean

    Returns the equivalent of ToBoolean()->Value().

    Upstream C++: v8::Value::BooleanValue

  • equals(context: Context, that: Value): Maybe<boolean>

    JS ==

    Upstream C++: v8::Value::Equals

  • getHash(): number

    Get the hash of this value. The hash is not guaranteed to be unique. For Object and Name instances the result is equal to GetIdentityHash. 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(): boolean

    Returns true if this value is an Arguments object.

    Upstream C++: v8::Value::IsArgumentsObject

  • isArray(): boolean

    Returns 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(): boolean

    Returns true if this value is an ArrayBuffer.

    Upstream C++: v8::Value::IsArrayBuffer

  • isArrayBufferView(): boolean

    Returns true if this value is an ArrayBufferView.

    Upstream C++: v8::Value::IsArrayBufferView

  • isAsyncFunction(): boolean

    Returns true if this value is an async function.

    Upstream C++: v8::Value::IsAsyncFunction

  • isBigInt(): boolean

    Returns true if this value is a bigint.

    This is equivalent to typeof value === 'bigint' in JS.

    Upstream C++: v8::Value::IsBigInt

  • isBigInt64Array(): boolean

    Returns true if this value is a BigInt64Array.

    Upstream C++: v8::Value::IsBigInt64Array

  • isBigIntObject(): boolean

    Returns true if this value is a BigInt object.

    Upstream C++: v8::Value::IsBigIntObject

  • isBigUint64Array(): boolean

    Returns true if this value is a BigUint64Array.

    Upstream C++: v8::Value::IsBigUint64Array

  • isBoolean(): boolean

    Returns true if this value is boolean.

    This is equivalent to typeof value === 'boolean' in JS.

    Upstream C++: v8::Value::IsBoolean

  • isBooleanObject(): boolean

    Returns true if this value is a Boolean object.

    Upstream C++: v8::Value::IsBooleanObject

  • isDataView(): boolean

    Returns true if this value is a DataView.

    Upstream C++: v8::Value::IsDataView

  • isDate(): boolean

    Returns true if this value is a Date.

    Upstream C++: v8::Value::IsDate

  • isExternal(): boolean

    Returns true if this value is an External object.

    Upstream C++: v8::Value::IsExternal

  • isFalse(): boolean

    Returns 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 checks value === false.

    Upstream C++: v8::Value::IsFalse

  • isFloat16Array(): boolean

    Returns true if this value is a Float16Array.

    Upstream C++: v8::Value::IsFloat16Array

  • isFloat32Array(): boolean

    Returns true if this value is a Float32Array.

    Upstream C++: v8::Value::IsFloat32Array

  • isFloat64Array(): boolean

    Returns true if this value is a Float64Array.

    Upstream C++: v8::Value::IsFloat64Array

  • isFunction(): boolean

    Returns true if this value is a function.

    This is equivalent to typeof value === 'function' in JS.

    Upstream C++: v8::Value::IsFunction

  • isGeneratorFunction(): boolean

    Returns true if this value is a Generator function.

    Upstream C++: v8::Value::IsGeneratorFunction

  • isGeneratorObject(): boolean

    Returns true if this value is a Generator object (iterator).

    Upstream C++: v8::Value::IsGeneratorObject

  • isInt16Array(): boolean

    Returns true if this value is an Int16Array.

    Upstream C++: v8::Value::IsInt16Array

  • isInt32(): boolean

    Returns true if this value is a 32-bit signed integer.

    Upstream C++: v8::Value::IsInt32

  • isInt32Array(): boolean

    Returns true if this value is an Int32Array.

    Upstream C++: v8::Value::IsInt32Array

  • isInt8Array(): boolean

    Returns true if this value is an Int8Array.

    Upstream C++: v8::Value::IsInt8Array

  • isMap(): boolean

    Returns true if this value is a Map.

    Upstream C++: v8::Value::IsMap

  • isMapIterator(): boolean

    Returns true if this value is a Map Iterator.

    Upstream C++: v8::Value::IsMapIterator

  • isModuleNamespaceObject(): boolean

    Returns true if the value is a Module Namespace Object.

    Upstream C++: v8::Value::IsModuleNamespaceObject

  • isName(): boolean

    Returns 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(): boolean

    Returns true if this value is a NativeError.

    Upstream C++: v8::Value::IsNativeError

  • isNull(): boolean

    Returns true if this value is the null value. See ECMA-262 4.3.11.

    This is equivalent to value === null in JS.

    Upstream C++: v8::Value::IsNull

  • isNullOrUndefined(): boolean

    Returns 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 == null in JS.

    Upstream C++: v8::Value::IsNullOrUndefined

  • isNumber(): boolean

    Returns true if this value is a number.

    This is equivalent to typeof value === 'number' in JS.

    Upstream C++: v8::Value::IsNumber

  • isNumberObject(): boolean

    Returns true if this value is a Number object.

    Upstream C++: v8::Value::IsNumberObject

  • isObject(): boolean

    Returns true if this value is an object.

    Upstream C++: v8::Value::IsObject

  • isPrimitive(): boolean

    Returns true if the value is a primitive.

    Upstream C++: v8::Value::IsPrimitive

  • isPromise(): boolean

    Returns true if this value is a Promise.

    Upstream C++: v8::Value::IsPromise

  • isProxy(): boolean

    Returns true if this value is a JavaScript Proxy.

    Upstream C++: v8::Value::IsProxy

  • isRegExp(): boolean

    Returns true if this value is a RegExp.

    Upstream C++: v8::Value::IsRegExp

  • isSet(): boolean

    Returns true if this value is a Set.

    Upstream C++: v8::Value::IsSet

  • isSetIterator(): boolean

    Returns true if this value is a Set Iterator.

    Upstream C++: v8::Value::IsSetIterator

  • isSharedArrayBuffer(): boolean

    Returns true if this value is a SharedArrayBuffer.

    Upstream C++: v8::Value::IsSharedArrayBuffer

  • isString(): boolean

    Returns 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(): boolean

    Returns true if this value is a String object.

    Upstream C++: v8::Value::IsStringObject

  • isSymbol(): boolean

    Returns true if this value is a symbol.

    This is equivalent to typeof value === 'symbol' in JS.

    Upstream C++: v8::Value::IsSymbol

  • isSymbolObject(): boolean

    Returns true if this value is a Symbol object.

    Upstream C++: v8::Value::IsSymbolObject

  • isTrue(): boolean

    Returns true if this value is true.

    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 checks value === true.

    Upstream C++: v8::Value::IsTrue

  • isTypedArray(): boolean

    Returns true if this value is one of TypedArrays.

    Upstream C++: v8::Value::IsTypedArray

  • isUint16Array(): boolean

    Returns true if this value is an Uint16Array.

    Upstream C++: v8::Value::IsUint16Array

  • isUint32(): boolean

    Returns true if this value is a 32-bit unsigned integer.

    Upstream C++: v8::Value::IsUint32

  • isUint32Array(): boolean

    Returns true if this value is an Uint32Array.

    Upstream C++: v8::Value::IsUint32Array

  • isUint8Array(): boolean

    Returns true if this value is an Uint8Array.

    Upstream C++: v8::Value::IsUint8Array

  • isUint8ClampedArray(): boolean

    Returns true if this value is an Uint8ClampedArray.

    Upstream C++: v8::Value::IsUint8ClampedArray

  • isUndefined(): boolean

    Returns true if this value is the undefined value. See ECMA-262 4.3.10.

    This is equivalent to value === undefined in JS.

    Upstream C++: v8::Value::IsUndefined

  • isWasmMemoryObject(): boolean

    Returns true if this value is a WasmMemoryObject.

    Upstream C++: v8::Value::IsWasmMemoryObject

  • isWasmModuleObject(): boolean

    Returns true if this value is a WasmModuleObject.

    Upstream C++: v8::Value::IsWasmModuleObject

  • isWasmNull(): boolean

    Returns true if this value is the WasmNull object.

    Upstream C++: v8::Value::IsWasmNull

  • isWeakMap(): boolean

    Returns true if this value is a WeakMap.

    Upstream C++: v8::Value::IsWeakMap

  • isWeakRef(): boolean

    Returns true if this value is a WeakRef.

    Upstream C++: v8::Value::IsWeakRef

  • isWeakSet(): boolean

    Returns 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): boolean

    Binds upstream V8 C++ v8::Value::SameValue.

  • strictEquals(that: Value): boolean

    Binds 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): V8Boolean

    Perform 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): V8String

    Binds upstream V8 C++ v8::Value::TypeOf.

  • uint32Value(context: Context): Maybe<number>

    Returns the equivalent of ToUint32()->Value().

    Upstream C++: v8::Value::Uint32Value

On this page