mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:18:11 +00:00
LibJS: Ensure GetBy{Id,Value} never load <empty> into the accumulator
This commit is contained in:
parent
ce04c2259f
commit
3ee627909a
1 changed files with 2 additions and 2 deletions
|
@ -151,7 +151,7 @@ void SetVariable::execute_impl(Bytecode::Interpreter& interpreter) const
|
|||
void GetById::execute_impl(Bytecode::Interpreter& interpreter) const
|
||||
{
|
||||
if (auto* object = interpreter.accumulator().to_object(interpreter.global_object()))
|
||||
interpreter.accumulator() = object->get(interpreter.current_executable().get_string(m_property));
|
||||
interpreter.accumulator() = object->get(interpreter.current_executable().get_string(m_property)).value_or(js_undefined());
|
||||
}
|
||||
|
||||
void PutById::execute_impl(Bytecode::Interpreter& interpreter) const
|
||||
|
@ -328,7 +328,7 @@ void GetByValue::execute_impl(Bytecode::Interpreter& interpreter) const
|
|||
auto property_key = interpreter.accumulator().to_property_key(interpreter.global_object());
|
||||
if (interpreter.vm().exception())
|
||||
return;
|
||||
interpreter.accumulator() = object->get(property_key);
|
||||
interpreter.accumulator() = object->get(property_key).value_or(js_undefined());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue