diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /js/src/builtin/ModuleObject.h | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/builtin/ModuleObject.h')
-rw-r--r-- | js/src/builtin/ModuleObject.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/js/src/builtin/ModuleObject.h b/js/src/builtin/ModuleObject.h index cb74d67c40..3533201675 100644 --- a/js/src/builtin/ModuleObject.h +++ b/js/src/builtin/ModuleObject.h @@ -50,6 +50,21 @@ class ModuleObject; class PromiseObject; class ScriptSourceObject; +class ImportAttribute { + const HeapPtr<JSAtom*> key_; + const HeapPtr<JSString*> value_; + + public: + ImportAttribute(Handle<JSAtom*> key, Handle<JSString*> value); + + JSAtom* key() const { return key_; } + JSString* value() const { return value_; } + + void trace(JSTracer* trc); +}; + +using ImportAttributeVector = GCVector<ImportAttribute, 0, SystemAllocPolicy>; + class ModuleRequestObject : public NativeObject { public: enum { SpecifierSlot = 0, AttributesSlot, SlotCount }; @@ -58,10 +73,10 @@ class ModuleRequestObject : public NativeObject { static bool isInstance(HandleValue value); [[nodiscard]] static ModuleRequestObject* create( JSContext* cx, Handle<JSAtom*> specifier, - Handle<ArrayObject*> maybeAttributes); + MutableHandle<UniquePtr<ImportAttributeVector>> maybeAttributes); JSAtom* specifier() const; - ArrayObject* attributes() const; + mozilla::Span<const ImportAttribute> attributes() const; bool hasAttributes() const; static bool getModuleType(JSContext* cx, const Handle<ModuleRequestObject*> moduleRequest, |