v8 10.2.154 (node 18.16.0)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
ModuleRequest Class Reference

#include <v8-script.h>

Inheritance diagram for ModuleRequest:
Collaboration diagram for ModuleRequest:

Public Member Functions

Local< StringGetSpecifier () const
 
int GetSourceOffset () const
 
Local< FixedArrayGetImportAssertions () const
 
- Public Member Functions inherited from Data
bool IsValue () const
 
bool IsModule () const
 
bool IsFixedArray () const
 
bool IsPrivate () const
 
bool IsObjectTemplate () const
 
bool IsFunctionTemplate () const
 
bool IsContext () const
 

Static Public Member Functions

static V8_INLINE ModuleRequestCast (Data *data)
 

Detailed Description

Definition at line 109 of file v8-script.h.

Member Function Documentation

◆ Cast()

ModuleRequest * Cast ( Data data)
static

Definition at line 732 of file v8-script.h.

◆ GetImportAssertions()

Local< FixedArray > GetImportAssertions ( ) const

Contains the import assertions for this request in the form: [key1, value1, source_offset1, key2, value2, source_offset2, ...]. The keys and values are of type v8::String, and the source offsets are of type Int32. Use Module::SourceOffsetToLocation to convert the source offsets to Locations with line/column numbers.

All assertions present in the module request will be supplied in this list, regardless of whether they are supported by the host. Per https://tc39.es/proposal-import-assertions/#sec-hostgetsupportedimportassertions, hosts are expected to ignore assertions that they do not support (as opposed to, for example, triggering an error if an unsupported assertion is present).

◆ GetSourceOffset()

int GetSourceOffset ( ) const

Returns the source code offset of this module request. Use Module::SourceOffsetToLocation to convert this to line/column numbers.

◆ GetSpecifier()

Local< String > GetSpecifier ( ) const

Returns the module specifier for this ModuleRequest.


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