mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
f87041bf3a
Resulting in a massive rename across almost everywhere! Alongside the namespace change, we now have the following names: * JS::NonnullGCPtr -> GC::Ref * JS::GCPtr -> GC::Ptr * JS::HeapFunction -> GC::Function * JS::CellImpl -> GC::Cell * JS::Handle -> GC::Root
47 lines
1.1 KiB
C++
47 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2021-2022, David Tuin <davidot@serenityos.org>
|
|
* Copyright (c) 2023, networkException <networkexception@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/DeprecatedFlyString.h>
|
|
#include <AK/Vector.h>
|
|
#include <LibJS/Module.h>
|
|
|
|
namespace JS {
|
|
|
|
struct ModuleWithSpecifier {
|
|
ByteString specifier; // [[Specifier]]
|
|
GC::Ref<Module> module; // [[Module]]
|
|
};
|
|
|
|
// https://tc39.es/proposal-import-attributes/#importattribute-record
|
|
struct ImportAttribute {
|
|
ByteString key;
|
|
ByteString value;
|
|
};
|
|
|
|
// https://tc39.es/proposal-import-attributes/#modulerequest-record
|
|
struct ModuleRequest {
|
|
ModuleRequest() = default;
|
|
|
|
explicit ModuleRequest(DeprecatedFlyString specifier)
|
|
: module_specifier(move(specifier))
|
|
{
|
|
}
|
|
|
|
ModuleRequest(DeprecatedFlyString specifier, Vector<ImportAttribute> attributes);
|
|
|
|
void add_attribute(ByteString key, ByteString value)
|
|
{
|
|
attributes.empend(move(key), move(value));
|
|
}
|
|
|
|
DeprecatedFlyString module_specifier; // [[Specifier]]
|
|
Vector<ImportAttribute> attributes; // [[Attributes]]
|
|
};
|
|
|
|
}
|