mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:17:35 +00:00
LibJS: Split parsing program to script and module separately
This allows us to only perform checks like export bindings existing only for modules. Also this makes it easier to set strict and other state variables with TemporaryChanges.
This commit is contained in:
parent
22174d3b7b
commit
b7c7d54167
3 changed files with 74 additions and 10 deletions
|
@ -260,8 +260,8 @@ public:
|
|||
|
||||
ExportEntry(String export_name, String local_name)
|
||||
: kind(LocalExport)
|
||||
, export_name(export_name)
|
||||
, local_or_import_name(local_name)
|
||||
, export_name(move(export_name))
|
||||
, local_or_import_name(move(local_name))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
@ -279,6 +279,9 @@ public:
|
|||
|
||||
bool has_export(StringView export_name) const;
|
||||
|
||||
bool has_statement() const { return m_statement; }
|
||||
Vector<ExportEntry> const& entries() const { return m_entries; }
|
||||
|
||||
private:
|
||||
RefPtr<ASTNode> m_statement;
|
||||
Vector<ExportEntry> m_entries;
|
||||
|
@ -1218,6 +1221,8 @@ public:
|
|||
|
||||
virtual bool is_lexical_declaration() const override { return true; }
|
||||
|
||||
StringView name() const { return m_class_expression->name(); }
|
||||
|
||||
private:
|
||||
NonnullRefPtr<ClassExpression> m_class_expression;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue