mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:07:36 +00:00
LibJS: Parse dynamic import calls 'import()' and 'import.meta'
For now both just throw when executing but this can be implemented when modules are implemented :^).
This commit is contained in:
parent
73eb29dabe
commit
045a42cf35
4 changed files with 125 additions and 6 deletions
|
@ -1671,6 +1671,23 @@ private:
|
|||
Type m_type;
|
||||
};
|
||||
|
||||
class ImportCall final : public Expression {
|
||||
public:
|
||||
ImportCall(SourceRange source_range, NonnullRefPtr<Expression> specifier, RefPtr<Expression> options)
|
||||
: Expression(source_range)
|
||||
, m_specifier(move(specifier))
|
||||
, m_options(move(options))
|
||||
{
|
||||
}
|
||||
|
||||
virtual void dump(int indent) const override;
|
||||
virtual Value execute(Interpreter&, GlobalObject&) const override;
|
||||
|
||||
private:
|
||||
NonnullRefPtr<Expression> m_specifier;
|
||||
RefPtr<Expression> m_options;
|
||||
};
|
||||
|
||||
class ConditionalExpression final : public Expression {
|
||||
public:
|
||||
ConditionalExpression(SourceRange source_range, NonnullRefPtr<Expression> test, NonnullRefPtr<Expression> consequent, NonnullRefPtr<Expression> alternate)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue