mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 23:38:11 +00:00
LibJS: Allow SpreadExpressions to generate bytecode
This commit is contained in:
parent
9662eec388
commit
ab763a56f6
2 changed files with 8 additions and 0 deletions
|
@ -1436,6 +1436,7 @@ public:
|
||||||
|
|
||||||
virtual Completion execute(Interpreter&) const override;
|
virtual Completion execute(Interpreter&) const override;
|
||||||
virtual void dump(int indent) const override;
|
virtual void dump(int indent) const override;
|
||||||
|
virtual Bytecode::CodeGenerationErrorOr<void> generate_bytecode(Bytecode::Generator&) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NonnullRefPtr<Expression> m_target;
|
NonnullRefPtr<Expression> m_target;
|
||||||
|
|
|
@ -1959,6 +1959,13 @@ Bytecode::CodeGenerationErrorOr<void> ClassExpression::generate_bytecode(Bytecod
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bytecode::CodeGenerationErrorOr<void> SpreadExpression::generate_bytecode(Bytecode::Generator& generator) const
|
||||||
|
{
|
||||||
|
// NOTE: All users of this should handle the behaviour of this on their own,
|
||||||
|
// assuming it returns an Array-like object
|
||||||
|
return m_target->generate_bytecode(generator);
|
||||||
|
}
|
||||||
|
|
||||||
Bytecode::CodeGenerationErrorOr<void> ThisExpression::generate_bytecode(Bytecode::Generator& generator) const
|
Bytecode::CodeGenerationErrorOr<void> ThisExpression::generate_bytecode(Bytecode::Generator& generator) const
|
||||||
{
|
{
|
||||||
generator.emit<Bytecode::Op::ResolveThisBinding>();
|
generator.emit<Bytecode::Op::ResolveThisBinding>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue