mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:48:12 +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
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