1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:38:11 +00:00

LibJS: Use Identifier to represent name of ClassExpression

By using Identifier class to represent the name of a class expression,
it becomes possible to consistently store information within the
identifier object, indicating whether the name refers to a local
variable or not.
This commit is contained in:
Aliaksandr Kalenik 2023-06-30 16:51:39 +03:00 committed by Andreas Kling
parent 4a83fb1b12
commit c734f2b5e6
4 changed files with 20 additions and 14 deletions

View file

@ -2323,7 +2323,7 @@ Bytecode::CodeGenerationErrorOr<void> ClassExpression::generate_bytecode_with_lh
if (has_name() || !lhs_name.has_value()) {
// NOTE: Step 3.a is not a part of NewClass instruction because it is assumed to be done before super class expression evaluation
auto interned_index = generator.intern_identifier(m_name);
auto interned_index = generator.intern_identifier(name());
generator.emit<Bytecode::Op::CreateVariable>(interned_index, Bytecode::Op::EnvironmentMode::Lexical, true);
}