mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibJS: Fix bogus bytecode codegen for "catch" parameters
Add a missing '!' so that catch clauses with a named parameter actually generate a SetVariable opcode.
This commit is contained in:
@@ -1200,7 +1200,7 @@ void TryStatement::generate_bytecode(Bytecode::Generator& generator) const
|
||||
generator.emit<Bytecode::Op::LeaveUnwindContext>();
|
||||
m_handler->parameter().visit(
|
||||
[&](FlyString const& parameter) {
|
||||
if (parameter.is_empty()) {
|
||||
if (!parameter.is_empty()) {
|
||||
// FIXME: We need a separate DeclarativeEnvironment here
|
||||
generator.emit<Bytecode::Op::SetVariable>(generator.intern_identifier(parameter));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user