mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 15:19:42 +00:00
LibJS: Fix assignment of const variable on declaration
We were previously assuming that we were reassigning a variable even when we were not, oops, my bad. :/
This commit is contained in:
parent
2a32330257
commit
7aad10d984
Notes:
sideshowbarker
2024-07-19 08:17:03 +09:00
Author: https://github.com/0xtechnobabble
Commit: 7aad10d984
Pull-request: https://github.com/SerenityOS/serenity/pull/1470
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/oriko1010
3 changed files with 4 additions and 4 deletions
|
@ -535,7 +535,7 @@ Value VariableDeclaration::execute(Interpreter& interpreter) const
|
|||
interpreter.declare_variable(name().string(), m_declaration_type);
|
||||
if (m_initializer) {
|
||||
auto initalizer_result = m_initializer->execute(interpreter);
|
||||
interpreter.set_variable(name().string(), initalizer_result);
|
||||
interpreter.set_variable(name().string(), initalizer_result, true);
|
||||
}
|
||||
|
||||
return js_undefined();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue