From 6fc3c14b7ab67d492819cb57fd88f45b6b4abf03 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 24 Oct 2021 22:46:54 +0200 Subject: LibJS: Fix bogus bytecode codegen for "catch" parameters Add a missing '!' so that catch clauses with a named parameter actually generate a SetVariable opcode. --- Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp index 679025af80..b55a79dddd 100644 --- a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp +++ b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp @@ -1200,7 +1200,7 @@ void TryStatement::generate_bytecode(Bytecode::Generator& generator) const generator.emit(); m_handler->parameter().visit( [&](FlyString const& parameter) { - if (parameter.is_empty()) { + if (!parameter.is_empty()) { // FIXME: We need a separate DeclarativeEnvironment here generator.emit(generator.intern_identifier(parameter)); } -- cgit v1.2.3