Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
v8::Module Class Reference

#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< ValueGetException () const
 
int GetModuleRequestsLength () const
 
Local< StringGetModuleRequest (int i) const
 
Location GetModuleRequestLocation (int i) const
 
int GetIdentityHash () const
 
bool Instantiate (Local< Context > context, ResolveCallback callback)
 
Maybe< bool > InstantiateModule (Local< Context > context, ResolveCallback callback)
 
MaybeLocal< ValueEvaluate (Local< Context > context)
 
Local< ValueGetModuleNamespace ()
 

Detailed Description

This is an unfinished experimental feature, and is only exposed here for internal testing purposes. DO NOT USE.

A compiled JavaScript module.

Member Typedef Documentation

◆ ResolveCallback

typedef MaybeLocal< Module >(* v8::Module::ResolveCallback) (Local< Context > context, Local< String > specifier, Local< Module > referrer)

Member Enumeration Documentation

◆ Status

The different states a module can be in.

Enumerator
kUninstantiated 
kInstantiating 
kInstantiated 
kEvaluating 
kEvaluated 
kErrored 

Member Function Documentation

◆ Evaluate()

MaybeLocal< Value > v8::Module::Evaluate ( Local< Context context)

ModuleEvaluation

Returns the completion value. TODO(neis): Be more precise or say nothing.

◆ GetException()

Local< Value > v8::Module::GetException ( ) const

For a module in kErrored status, this returns the corresponding exception.

◆ GetIdentityHash()

int v8::Module::GetIdentityHash ( ) const

Returns the identity hash for this object.

◆ GetModuleNamespace()

Local< Value > v8::Module::GetModuleNamespace ( )

Returns the namespace object of this module. The module's status must be kEvaluated.

◆ GetModuleRequest()

Local< String > v8::Module::GetModuleRequest ( int  i) const

Returns the ith module specifier in this module. i must be < GetModuleRequestsLength() and >= 0.

◆ GetModuleRequestLocation()

Location v8::Module::GetModuleRequestLocation ( int  i) const

Returns the source location (line number and column number) of the ith module specifier's first occurrence in this module.

◆ GetModuleRequestsLength()

int v8::Module::GetModuleRequestsLength ( ) const

Returns the number of modules requested by this module.

◆ GetStatus()

Status v8::Module::GetStatus ( ) const

Returns the module's current status.

◆ Instantiate()

bool v8::Module::Instantiate ( Local< 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.)

◆ InstantiateModule()

Maybe< bool > v8::Module::InstantiateModule ( Local< Context context,
ResolveCallback  callback 
)

The documentation for this class was generated from the following file: