1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:37:45 +00:00

LibJS: Add a NewObject bytecode instruction for ObjectExpression :^)

This commit is contained in:
Andreas Kling 2021-06-04 20:30:23 +02:00
parent f2863b5a89
commit bea6e31ddc
4 changed files with 38 additions and 0 deletions

View file

@ -125,6 +125,21 @@ private:
String m_string;
};
class NewObject final : public Instruction {
public:
explicit NewObject(Register dst)
: m_dst(dst)
{
}
virtual ~NewObject() override { }
virtual void execute(Bytecode::Interpreter&) const override;
virtual String to_string() const override;
private:
Register m_dst;
};
class SetVariable final : public Instruction {
public:
SetVariable(FlyString identifier, Register src)