mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibJS: Prepare yield object before re-routing it through finally
This commit is contained in:
parent
2447a25753
commit
1de475b404
Notes:
sideshowbarker
2024-07-16 22:54:10 +09:00
Author: https://github.com/Hendiadyoin1
Commit: 1de475b404
Pull-request: https://github.com/SerenityOS/serenity/pull/24362
Issue: https://github.com/SerenityOS/serenity/issues/24356
6 changed files with 102 additions and 14 deletions
|
@ -2214,6 +2214,31 @@ private:
|
|||
Operand m_value;
|
||||
};
|
||||
|
||||
class PrepareYield final : public Instruction {
|
||||
public:
|
||||
explicit PrepareYield(Operand dest, Operand value)
|
||||
: Instruction(Type::PrepareYield)
|
||||
, m_dest(dest)
|
||||
, m_value(value)
|
||||
{
|
||||
}
|
||||
|
||||
void execute_impl(Bytecode::Interpreter&) const;
|
||||
ByteString to_byte_string_impl(Bytecode::Executable const&) const;
|
||||
void visit_operands_impl(Function<void(Operand&)> visitor)
|
||||
{
|
||||
visitor(m_dest);
|
||||
visitor(m_value);
|
||||
}
|
||||
|
||||
Operand destination() const { return m_dest; }
|
||||
Operand value() const { return m_value; }
|
||||
|
||||
private:
|
||||
Operand m_dest;
|
||||
Operand m_value;
|
||||
};
|
||||
|
||||
class Await final : public Instruction {
|
||||
public:
|
||||
constexpr static bool IsTerminator = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue