mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-13 20:41:53 +00:00
LibJS: Respect declaration kind for variables inside functions
This commit is contained in:
parent
65e083ed36
commit
913fd8de13
Notes:
sideshowbarker
2024-07-18 21:54:35 +09:00
Author: https://github.com/speles
Commit: 913fd8de13
Pull-request: https://github.com/SerenityOS/serenity/pull/5527
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