mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibJS: NewClass bytecode instruction
This adds a the NewClass bytecode instruction, enough of it is implemented for it to show it in the bytecode (js -d).
This commit is contained in:
committed by
Andreas Kling
parent
3694b8b690
commit
f6028c2534
Notes:
sideshowbarker
2024-07-19 17:26:41 +09:00
Author: https://github.com/jdahlin 🔰 Commit: https://github.com/SerenityOS/serenity/commit/f6028c25348 Pull-request: https://github.com/SerenityOS/serenity/pull/8343
@@ -1300,4 +1300,10 @@ void SwitchStatement::generate_bytecode(Bytecode::Generator& generator) const
|
||||
generator.switch_to_basic_block(end_block);
|
||||
}
|
||||
|
||||
void ClassDeclaration::generate_bytecode(Bytecode::Generator& generator) const
|
||||
{
|
||||
generator.emit<Bytecode::Op::NewClass>(m_class_expression);
|
||||
generator.emit<Bytecode::Op::SetVariable>(generator.intern_string(m_class_expression.ptr()->name()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user