mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 18:19:03 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
40
Libraries/LibJS/SyntheticModule.h
Normal file
40
Libraries/LibJS/SyntheticModule.h
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) 2022, David Tuin <davidot@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibJS/Module.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
// 1.2 Synthetic Module Records, https://tc39.es/proposal-json-modules/#sec-synthetic-module-records
|
||||
class SyntheticModule final : public Module {
|
||||
JS_CELL(SyntheticModule, Module);
|
||||
JS_DECLARE_ALLOCATOR(SyntheticModule);
|
||||
|
||||
public:
|
||||
using EvaluationFunction = Function<ThrowCompletionOr<void>(SyntheticModule&)>;
|
||||
|
||||
static NonnullGCPtr<SyntheticModule> create_default_export_synthetic_module(Value default_export, Realm& realm, StringView filename);
|
||||
|
||||
ThrowCompletionOr<void> set_synthetic_module_export(DeprecatedFlyString const& export_name, Value export_value);
|
||||
|
||||
virtual ThrowCompletionOr<void> link(VM& vm) override;
|
||||
virtual ThrowCompletionOr<Promise*> evaluate(VM& vm) override;
|
||||
virtual ThrowCompletionOr<Vector<DeprecatedFlyString>> get_exported_names(VM& vm, Vector<Module*> export_star_set) override;
|
||||
virtual ThrowCompletionOr<ResolvedBinding> resolve_export(VM& vm, DeprecatedFlyString const& export_name, Vector<ResolvedBinding> resolve_set) override;
|
||||
virtual PromiseCapability& load_requested_modules(GCPtr<GraphLoadingState::HostDefined>) override;
|
||||
|
||||
private:
|
||||
SyntheticModule(Vector<DeprecatedFlyString> export_names, EvaluationFunction evaluation_steps, Realm& realm, StringView filename);
|
||||
|
||||
Vector<DeprecatedFlyString> m_export_names; // [[ExportNames]]
|
||||
EvaluationFunction m_evaluation_steps; // [[EvaluationSteps]]
|
||||
};
|
||||
|
||||
ThrowCompletionOr<NonnullGCPtr<Module>> parse_json_module(StringView source_text, Realm& realm, StringView filename);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue