V8 API Reference, 7.2.502.16 (for Deno 0.2.4)
|
Typedefs | |
typedef uint32_t | SnapshotObjectId |
typedef uintptr_t | PersistentContainerValue |
template<class T > | |
using | Handle = Local< T > |
template<class T > | |
using | UniquePersistent = Global< T > |
typedef void(* | AccessorGetterCallback) (Local< String > property, const PropertyCallbackInfo< Value > &info) |
typedef void(* | AccessorNameGetterCallback) (Local< Name > property, const PropertyCallbackInfo< Value > &info) |
typedef void(* | AccessorSetterCallback) (Local< String > property, Local< Value > value, const PropertyCallbackInfo< void > &info) |
typedef void(* | AccessorNameSetterCallback) (Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info) |
typedef void(* | FunctionCallback) (const FunctionCallbackInfo< Value > &info) |
typedef void(* | GenericNamedPropertyGetterCallback) (Local< Name > property, const PropertyCallbackInfo< Value > &info) |
typedef void(* | GenericNamedPropertySetterCallback) (Local< Name > property, Local< Value > value, const PropertyCallbackInfo< Value > &info) |
typedef void(* | GenericNamedPropertyQueryCallback) (Local< Name > property, const PropertyCallbackInfo< Integer > &info) |
typedef void(* | GenericNamedPropertyDeleterCallback) (Local< Name > property, const PropertyCallbackInfo< Boolean > &info) |
typedef void(* | GenericNamedPropertyEnumeratorCallback) (const PropertyCallbackInfo< Array > &info) |
typedef void(* | GenericNamedPropertyDefinerCallback) (Local< Name > property, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info) |
typedef void(* | GenericNamedPropertyDescriptorCallback) (Local< Name > property, const PropertyCallbackInfo< Value > &info) |
typedef void(* | IndexedPropertyGetterCallback) (uint32_t index, const PropertyCallbackInfo< Value > &info) |
typedef void(* | IndexedPropertySetterCallback) (uint32_t index, Local< Value > value, const PropertyCallbackInfo< Value > &info) |
typedef void(* | IndexedPropertyQueryCallback) (uint32_t index, const PropertyCallbackInfo< Integer > &info) |
typedef void(* | IndexedPropertyDeleterCallback) (uint32_t index, const PropertyCallbackInfo< Boolean > &info) |
typedef void(* | IndexedPropertyEnumeratorCallback) (const PropertyCallbackInfo< Array > &info) |
typedef void(* | IndexedPropertyDefinerCallback) (uint32_t index, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info) |
typedef void(* | IndexedPropertyDescriptorCallback) (uint32_t index, const PropertyCallbackInfo< Value > &info) |
typedef bool(* | AccessCheckCallback) (Local< Context > accessing_context, Local< Object > accessed_object, Local< Value > data) |
typedef double | async_id_t |
typedef std::unordered_map< const char *, Counter *, CStringHasher, i::StringEquals > | CounterMap |
Enumerations | |
enum | CpuProfilingMode { kLeafNodeLineNumbers, kCallerLineNumbers } |
enum | CodeEventType { kUnknownType } |
enum | PersistentContainerCallbackType { kNotWeak, kWeakWithParameter, kWeakWithInternalFields } |
enum | WeakCallbackType { kParameter, kInternalFields, kFinalizer } |
enum | StateTag { JS, GC, PARSER, BYTECODE_COMPILER, COMPILER, OTHER, EXTERNAL, IDLE } |
enum | NewStringType { NewStringType::kNormal, NewStringType::kInternalized } |
enum | PropertyAttribute { None = 0, ReadOnly = 1 << 0, DontEnum = 1 << 1, DontDelete = 1 << 2 } |
enum | AccessControl { DEFAULT = 0, ALL_CAN_READ = 1, ALL_CAN_WRITE = 1 << 1, PROHIBITS_OVERWRITING = 1 << 2 } |
enum | PropertyFilter { ALL_PROPERTIES = 0, ONLY_WRITABLE = 1, ONLY_ENUMERABLE = 2, ONLY_CONFIGURABLE = 4, SKIP_STRINGS = 8, SKIP_SYMBOLS = 16 } |
enum | SideEffectType { kHasSideEffect, kHasNoSideEffect, kHasSideEffectToReceiver } |
enum | KeyCollectionMode { kOwnOnly, kIncludePrototypes } |
enum | IndexFilter { kIncludeIndices, kSkipIndices } |
enum | KeyConversionMode { kConvertToString, kKeepNumbers } |
enum | IntegrityLevel { kFrozen, kSealed } |
enum | ConstructorBehavior { kThrow, kAllow } |
enum | ArrayBufferCreationMode { kInternalized, kExternalized } |
enum | Intrinsic |
enum | AccessType { ACCESS_GET, ACCESS_SET, ACCESS_HAS, ACCESS_DELETE, ACCESS_KEYS } |
enum | PropertyHandlerFlags { PropertyHandlerFlags::kNone = 0, PropertyHandlerFlags::kAllCanRead = 1, PropertyHandlerFlags::kNonMasking = 1 << 1, PropertyHandlerFlags::kOnlyInterceptStrings = 1 << 2, PropertyHandlerFlags::kHasNoSideEffect = 1 << 3 } |
Functions | |
constexpr uint32_t | CurrentValueSerializerFormatVersion () |
bool | TryHandleWebAssemblyTrapPosix (int sig_code, siginfo_t *info, void *context) |
bool | TryHandleWebAssemblyTrapWindows (EXCEPTION_POINTERS *exception) |
V8_EXPORT | length_ (0) |
ExternalOneByteStringResourceImpl (const char *data, size_t length) | |
const char * | data () const override |
size_t | length () const override |
template<typename T > | |
T | ToCData (v8::internal::Object *obj) |
template<> | |
v8::internal::Address | ToCData (v8::internal::Object *obj) |
template<typename T > | |
v8::internal::Handle< v8::internal::Object > | FromCData (v8::internal::Isolate *isolate, T obj) |
template<> | |
v8::internal::Handle< v8::internal::Object > | FromCData (v8::internal::Isolate *isolate, v8::internal::Address obj) |
MAKE_TO_LOCAL (ToLocal, BigInt, BigInt) | |
void | SetResourceConstraints (i::Isolate *isolate, const ResourceConstraints &constraints) |
STATIC_ASSERT (i::Internals::kEmbedderDataSlotSize==i::kEmbedderDataSlotSize) | |
Local< Context > | NewContext (v8::Isolate *external_isolate, v8::ExtensionConfiguration *extensions, v8::MaybeLocal< ObjectTemplate > global_template, v8::MaybeLocal< Value > global_object, size_t context_snapshot_index, v8::DeserializeInternalFieldsCallback embedder_fields_deserializer) |
REGEXP_FLAG_ASSERT_EQ (kNone) | |
REGEXP_FLAG_ASSERT_EQ (kGlobal) | |
REGEXP_FLAG_ASSERT_EQ (kIgnoreCase) | |
REGEXP_FLAG_ASSERT_EQ (kMultiline) | |
REGEXP_FLAG_ASSERT_EQ (kSticky) | |
REGEXP_FLAG_ASSERT_EQ (kUnicode) | |
void | WasmMemoryDeleter (void *buffer, size_t lenght, void *info) |
void | ArrayBufferDeleter (void *buffer, size_t length, void *info) |
CALLBACK_SETTER (AllowCodeGenerationFromStringsCallback, AllowCodeGenerationFromStringsCallback, allow_code_gen_callback) CALLBACK_SETTER(AllowWasmCodeGenerationCallback | |
allow_wasm_code_gen_callback | CALLBACK_SETTER (WasmCompileStreamingCallback, ApiImplementationCallback, wasm_compile_streaming_callback) CALLBACK_SETTER(WasmStreamingCallback |
allow_wasm_code_gen_callback wasm_streaming_callback | CALLBACK_SETTER (WasmThreadsEnabledCallback, WasmThreadsEnabledCallback, wasm_threads_enabled_callback) void Isolate |
template<class T > | |
T * | ToApi (v8::internal::Handle< v8::internal::Object > obj) |
template<class T > | |
v8::Local< T > | ToApiHandle (v8::internal::Handle< v8::internal::Object > obj) |
template<class T > | |
bool | ToLocal (v8::internal::MaybeHandle< v8::internal::Object > maybe, Local< T > *local) |
std::unique_ptr< Platform > | MakePredictablePlatform (std::unique_ptr< Platform > platform) |
std::unique_ptr< Platform > | MakeDelayedTasksPlatform (std::unique_ptr< Platform > platform, int64_t random_seed) |
void | WriteToFile (FILE *file, const v8::FunctionCallbackInfo< v8::Value > &args) |
void | WriteAndFlush (FILE *file, const v8::FunctionCallbackInfo< v8::Value > &args) |
bool | operator< (const CounterAndKey &lhs, const CounterAndKey &rhs) |
bool | ends_with (const char *input, const char *suffix) |
Variables | |
V8_EXPORT | ExternalOneByteStringResourceImpl |
Profiler support for the V8 JavaScript engine.
Testing support for the V8 JavaScript engine.
Support for Persistent containers.
C++11 embedders can use STL containers with Global values, but pre-C++11 does not support the required move semantic and hence may want these container classes.
Compile-time constants.
This header provides access to information about the value serializer at compile time, without declaring or defining any symbols that require linking to V8.
The v8 JavaScript engine.
typedef void(* v8::AccessorGetterCallback) (Local< String > property, const PropertyCallbackInfo< Value > &info) |
Accessor[Getter|Setter] are used as callback functions when setting|getting a particular property. See Object and ObjectTemplate's method SetAccessor.
typedef void(* v8::GenericNamedPropertyDefinerCallback) (Local< Name > property, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info) |
Interceptor for defineProperty requests on an object.
Use info.GetReturnValue()
to indicate whether the request was intercepted or not. If the definer successfully intercepts the request, i.e., if the request should not be further executed, call info.GetReturnValue().Set(value)
. If the definer did not intercept the request, i.e., if the request should be handled as if no interceptor is present, do not not call Set()
.
property | The name of the property for which the request was intercepted. |
desc | The property descriptor which is used to define the property if the request is not intercepted. |
info | Information about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. See PropertyCallbackInfo`. |
See also ObjectTemplate::SetHandler
.
typedef void(* v8::GenericNamedPropertyDeleterCallback) (Local< Name > property, const PropertyCallbackInfo< Boolean > &info) |
Interceptor for delete requests on an object.
Use info.GetReturnValue()
to indicate whether the request was intercepted or not. If the deleter successfully intercepts the request, i.e., if the request should not be further executed, call info.GetReturnValue().Set(value)
with a boolean value
. The value
is used as the return value of delete
.
property | The name of the property for which the request was intercepted. |
info | Information about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. See PropertyCallbackInfo`. |
delete
, i.e., throw in strict mode instead of returning false, use info.ShouldThrowOnError()
to determine if you are in strict mode.See also ObjectTemplate::SetHandler.
typedef void(* v8::GenericNamedPropertyDescriptorCallback) (Local< Name > property, const PropertyCallbackInfo< Value > &info) |
Interceptor for getOwnPropertyDescriptor requests on an object.
Use info.GetReturnValue().Set()
to set the return value of the intercepted request. The return value must be an object that can be converted to a PropertyDescriptor, e.g., a v8::value
returned from v8::Object::getOwnPropertyDescriptor
.
property | The name of the property for which the request was intercepted. Information about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. See PropertyCallbackInfo`. |
See also ObjectTemplate::SetHandler
.
typedef void(* v8::GenericNamedPropertyEnumeratorCallback) (const PropertyCallbackInfo< Array > &info) |
typedef void(* v8::GenericNamedPropertyGetterCallback) (Local< Name > property, const PropertyCallbackInfo< Value > &info) |
Interceptor for get requests on an object.
Use info.GetReturnValue().Set()
to set the return value of the intercepted get request.
property | The name of the property for which the request was intercepted. |
info | Information about the intercepted request, such as isolate, receiver, return value, or whether running in 'use strict ' mode. See PropertyCallbackInfo . |
See also ObjectTemplate::SetHandler
.
typedef void(* v8::GenericNamedPropertyQueryCallback) (Local< Name > property, const PropertyCallbackInfo< Integer > &info) |
Intercepts all requests that query the attributes of the property, e.g., getOwnPropertyDescriptor(), propertyIsEnumerable(), and defineProperty().
Use info.GetReturnValue().Set(value)
to set the property attributes. The value is an integer encoding a v8::PropertyAttribute
.
property | The name of the property for which the request was intercepted. |
info | Information about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. See PropertyCallbackInfo`. |
hasOwnProperty()
can trigger this interceptor depending on the state of the object.See also ObjectTemplate::SetHandler.
typedef void(* v8::GenericNamedPropertySetterCallback) (Local< Name > property, Local< Value > value, const PropertyCallbackInfo< Value > &info) |
Interceptor for set requests on an object.
Use info.GetReturnValue()
to indicate whether the request was intercepted or not. If the setter successfully intercepts the request, i.e., if the request should not be further executed, call info.GetReturnValue().Set(value)
. If the setter did not intercept the request, i.e., if the request should be handled as if no interceptor is present, do not not call Set()
.
property | The name of the property for which the request was intercepted. |
value | The value which the property will have if the request is not intercepted. |
info | Information about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. See PropertyCallbackInfo`. |
See also ObjectTemplate::SetHandler.
typedef void(* v8::IndexedPropertyDefinerCallback) (uint32_t index, const PropertyDescriptor &desc, const PropertyCallbackInfo< Value > &info) |
typedef void(* v8::IndexedPropertyDeleterCallback) (uint32_t index, const PropertyCallbackInfo< Boolean > &info) |
typedef void(* v8::IndexedPropertyDescriptorCallback) (uint32_t index, const PropertyCallbackInfo< Value > &info) |
typedef void(* v8::IndexedPropertyEnumeratorCallback) (const PropertyCallbackInfo< Array > &info) |
typedef void(* v8::IndexedPropertyGetterCallback) (uint32_t index, const PropertyCallbackInfo< Value > &info) |
typedef void(* v8::IndexedPropertyQueryCallback) (uint32_t index, const PropertyCallbackInfo< Integer > &info) |
typedef void(* v8::IndexedPropertySetterCallback) (uint32_t index, Local< Value > value, const PropertyCallbackInfo< Value > &info) |
enum v8::AccessControl |
Access control specifications.
Some accessors should be accessible across contexts. These accessors have an explicit access control parameter which specifies the kind of cross-context access that should be allowed.
TODO(dcarney): Remove PROHIBITS_OVERWRITING as it is now unused.
enum v8::AccessType |
enum v8::CodeEventType |
Note that this enum may be extended in the future. Please include a default case if this enum is used in a switch statement.
Definition at line 1064 of file v8-profiler.h.
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
A flag describing different modes of string creation.
Aside from performance implications there are no differences between the two creation modes.
enum v8::PropertyFilter |
|
strong |
Configuration flags for v8::NamedPropertyHandlerConfiguration or v8::IndexedPropertyHandlerConfiguration.
|
strong |
Options for marking whether callbacks may trigger JS-observable side effects. Side-effect-free callbacks are whitelisted during debug evaluation with throwOnSideEffect. It applies when calling a Function, FunctionTemplate, or an Accessor callback. For Interceptors, please see PropertyHandlerFlags's kHasNoSideEffect. Callbacks that only cause side effects to the receiver are whitelisted if invoked on receiver objects that are created within the same debug-evaluate call, as these objects are temporary and the side effect does not escape.
This function determines whether a memory access violation has been an out-of-bounds memory access in WebAssembly. If so, it will modify the context parameter and add a return address where the execution can continue after the signal handling, and return true. Otherwise, false will be returned.
The parameters to this function correspond to those passed to a Posix signal handler. Use this function only on Linux and Mac.
sig_code | The signal code, e.g. SIGSEGV. |
info | A pointer to the siginfo_t struct provided to the signal handler. |
context | A pointer to a ucontext_t struct provided to the signal handler. |
bool v8::TryHandleWebAssemblyTrapWindows | ( | EXCEPTION_POINTERS * | exception | ) |
This function determines whether a memory access violation has been an out-of-bounds memory access in WebAssembly. If so, it will modify the exception parameter and add a return address where the execution can continue after the exception handling, and return true. Otherwise the return value will be false.
The parameter to this function corresponds to the one passed to a Windows vectored exception handler. Use this function only on Windows.
exception | An EXCEPTION_POINTERS* as provided to the exception handler. |