1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 08:57:35 +00:00

LibJS: Identify global variables during parsing

Identifying global variables during parsing will make it possible to
generate special optimized instruction to access them in upcoming
changes.
This commit is contained in:
Aliaksandr Kalenik 2023-07-12 04:02:27 +02:00 committed by Andreas Kling
parent 73f1c7a030
commit b0a533dbc0
5 changed files with 75 additions and 20 deletions

View file

@ -2717,6 +2717,8 @@ void Identifier::dump(int indent) const
print_indent(indent);
if (is_local()) {
outln("Identifier \"{}\" is_local=(true) index=({})", m_string, m_local_variable_index);
} else if (is_global()) {
outln("Identifier \"{}\" is_global=(true)", m_string);
} else {
outln("Identifier \"{}\"", m_string);
}