mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:27:46 +00:00
LibJS+LibWeb: Move JS::ModuleRequest to its own header file
This allows us to not include LibJS/AST.h in a couple more places.
This commit is contained in:
parent
38c7fdaac1
commit
3503c658fb
7 changed files with 47 additions and 29 deletions
|
@ -23,6 +23,7 @@
|
|||
#include <LibJS/Runtime/Completion.h>
|
||||
#include <LibJS/Runtime/EnvironmentCoordinate.h>
|
||||
#include <LibJS/Runtime/FunctionKind.h>
|
||||
#include <LibJS/Runtime/ModuleRequest.h>
|
||||
#include <LibJS/Runtime/PropertyKey.h>
|
||||
#include <LibJS/Runtime/Reference.h>
|
||||
#include <LibJS/Runtime/Value.h>
|
||||
|
@ -273,31 +274,6 @@ private:
|
|||
NonnullRefPtrVector<FunctionDeclaration> m_functions_hoistable_with_annexB_extension;
|
||||
};
|
||||
|
||||
// 2.9 ModuleRequest Records, https://tc39.es/proposal-import-assertions/#sec-modulerequest-record
|
||||
struct ModuleRequest {
|
||||
struct Assertion {
|
||||
String key;
|
||||
String value;
|
||||
};
|
||||
|
||||
ModuleRequest() = default;
|
||||
|
||||
explicit ModuleRequest(FlyString specifier)
|
||||
: module_specifier(move(specifier))
|
||||
{
|
||||
}
|
||||
|
||||
ModuleRequest(FlyString module_specifier, Vector<Assertion> assertions);
|
||||
|
||||
void add_assertion(String key, String value)
|
||||
{
|
||||
assertions.empend(move(key), move(value));
|
||||
}
|
||||
|
||||
FlyString module_specifier; // [[Specifier]]
|
||||
Vector<Assertion> assertions; // [[Assertions]]
|
||||
};
|
||||
|
||||
// ImportEntry Record, https://tc39.es/ecma262/#table-importentry-record-fields
|
||||
struct ImportEntry {
|
||||
FlyString import_name; // [[ImportName]] if a String
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue