1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 18:37:36 +00:00

LibJS: Track whether a program has a top level await statement

This commit is contained in:
davidot 2022-01-18 18:55:19 +01:00 committed by Linus Groh
parent aca427fc8c
commit 99edf5b25a
2 changed files with 21 additions and 0 deletions

View file

@ -426,6 +426,9 @@ public:
NonnullRefPtrVector<ImportStatement> const& imports() const { return m_imports; }
NonnullRefPtrVector<ExportStatement> const& exports() const { return m_exports; }
bool has_top_level_await() const { return m_has_top_level_await; }
void set_has_top_level_await() { m_has_top_level_await = true; }
ThrowCompletionOr<void> global_declaration_instantiation(Interpreter& interpreter, GlobalObject& global_object, GlobalEnvironment& global_environment) const;
private:
@ -436,6 +439,7 @@ private:
NonnullRefPtrVector<ImportStatement> m_imports;
NonnullRefPtrVector<ExportStatement> m_exports;
bool m_has_top_level_await { false };
};
class BlockStatement final : public ScopeNode {