mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +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:
committed by
Andreas Kling
parent
4a83fb1b12
commit
c734f2b5e6
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user