mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
LibJS: Add PutById bytecode instruction for object property assignment
Note that this is only used for non-computed accesses. Computed access is not yet implemented. :^)
This commit is contained in:
parent
bea6e31ddc
commit
14cfc44855
3 changed files with 44 additions and 0 deletions
|
@ -174,6 +174,25 @@ private:
|
|||
FlyString m_identifier;
|
||||
};
|
||||
|
||||
class PutById final : public Instruction {
|
||||
public:
|
||||
PutById(Register base, FlyString property, Register src)
|
||||
: m_base(base)
|
||||
, m_property(move(property))
|
||||
, m_src(src)
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~PutById() override { }
|
||||
virtual void execute(Bytecode::Interpreter&) const override;
|
||||
virtual String to_string() const override;
|
||||
|
||||
private:
|
||||
Register m_base;
|
||||
FlyString m_property;
|
||||
Register m_src;
|
||||
};
|
||||
|
||||
class Jump final : public Instruction {
|
||||
public:
|
||||
explicit Jump(Label target)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue