mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 20:05:07 +00:00
LibJS: Respect declaration kind for variables inside functions
This commit is contained in:
parent
65e083ed36
commit
913fd8de13
1 changed files with 1 additions and 1 deletions
|
@ -97,7 +97,7 @@ LexicalEnvironment* ScriptFunction::create_environment()
|
|||
if (is<ScopeNode>(body())) {
|
||||
for (auto& declaration : static_cast<const ScopeNode&>(body()).variables()) {
|
||||
for (auto& declarator : declaration.declarations()) {
|
||||
variables.set(declarator.id().string(), { js_undefined(), DeclarationKind::Var });
|
||||
variables.set(declarator.id().string(), { js_undefined(), declaration.declaration_kind() });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue