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:
parent
4a83fb1b12
commit
c734f2b5e6
4 changed files with 20 additions and 14 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue