mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
LibJS: Return undefined from a with statement if no value was generated
Co-authored-by: Linus Groh <mail@linusgroh.de>
This commit is contained in:
parent
98897ff676
commit
af58779def
3 changed files with 9 additions and 15 deletions
|
@ -302,7 +302,7 @@ Value WithStatement::execute(Interpreter& interpreter, GlobalObject& global_obje
|
|||
|
||||
auto* with_scope = interpreter.heap().allocate<WithScope>(global_object, *object, interpreter.vm().call_frame().scope);
|
||||
TemporaryChange<ScopeObject*> scope_change(interpreter.vm().call_frame().scope, with_scope);
|
||||
return interpreter.execute_statement(global_object, m_body);
|
||||
return interpreter.execute_statement(global_object, m_body).value_or(js_undefined());
|
||||
}
|
||||
|
||||
Value WhileStatement::execute(Interpreter& interpreter, GlobalObject& global_object) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue