v8
6.2.414 (node 8.16.2)
V8 is Google's open source JavaScript engine
|
#include <v8.h>
Public Types | |
enum | Status { kUninstantiated , kInstantiating , kInstantiated , kEvaluating , kEvaluated , kErrored } |
typedef MaybeLocal< Module >(* | ResolveCallback) (Local< Context > context, Local< String > specifier, Local< Module > referrer) |
Public Member Functions | |
Status | GetStatus () const |
Local< Value > | GetException () const |
int | GetModuleRequestsLength () const |
Local< String > | GetModuleRequest (int i) const |
Location | GetModuleRequestLocation (int i) const |
int | GetIdentityHash () const |
V8_DEPRECATED ("Use Maybe<bool> version", bool Instantiate(Local< Context > context, ResolveCallback callback)) | |
V8_WARN_UNUSED_RESULT Maybe< bool > | InstantiateModule (Local< Context > context, ResolveCallback callback) |
V8_WARN_UNUSED_RESULT MaybeLocal< Value > | Evaluate (Local< Context > context) |
Local< Value > | GetModuleNamespace () |
This is an unfinished experimental feature, and is only exposed here for internal testing purposes. DO NOT USE.
A compiled JavaScript module.
enum Status |
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate | ( | Local< Context > | context | ) |
ModuleEvaluation
Returns the completion value. TODO(neis): Be more precise or say nothing.
For a module in kErrored status, this returns the corresponding exception.
int GetIdentityHash | ( | ) | const |
Returns the identity hash for this object.
Returns the namespace object of this module. The module's status must be kEvaluated.
Returns the ith module specifier in this module. i must be < GetModuleRequestsLength() and >= 0.
Location GetModuleRequestLocation | ( | int | i | ) | const |
Returns the source location (line number and column number) of the ith module specifier's first occurrence in this module.
int GetModuleRequestsLength | ( | ) | const |
Returns the number of modules requested by this module.
Status GetStatus | ( | ) | const |
Returns the module's current status.
V8_WARN_UNUSED_RESULT Maybe<bool> InstantiateModule | ( | Local< Context > | context, |
ResolveCallback | callback | ||
) |
V8_DEPRECATED | ( | "Use Maybe<bool> version" | , |
bool | InstantiateLocal< Context > context, ResolveCallback callback | ||
) |
ModuleDeclarationInstantiation
Returns an empty Maybe<bool> if an exception occurred during instantiation. (In the case where the callback throws an exception, that exception is propagated.)