mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:17:42 +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:
parent
ac1cac286b
commit
6fc3c14b7a
1 changed files with 1 additions and 1 deletions
|
@ -1200,7 +1200,7 @@ void TryStatement::generate_bytecode(Bytecode::Generator& generator) const
|
||||||
generator.emit<Bytecode::Op::LeaveUnwindContext>();
|
generator.emit<Bytecode::Op::LeaveUnwindContext>();
|
||||||
m_handler->parameter().visit(
|
m_handler->parameter().visit(
|
||||||
[&](FlyString const& parameter) {
|
[&](FlyString const& parameter) {
|
||||||
if (parameter.is_empty()) {
|
if (!parameter.is_empty()) {
|
||||||
// FIXME: We need a separate DeclarativeEnvironment here
|
// FIXME: We need a separate DeclarativeEnvironment here
|
||||||
generator.emit<Bytecode::Op::SetVariable>(generator.intern_identifier(parameter));
|
generator.emit<Bytecode::Op::SetVariable>(generator.intern_identifier(parameter));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue