mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 09:49:21 +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
Notes:
sideshowbarker
2024-07-18 12:37:50 +09:00
Author: https://github.com/IdanHo
Commit: af58779def
Pull-request: https://github.com/SerenityOS/serenity/pull/7905
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/linusg
3 changed files with 9 additions and 15 deletions
|
@ -317,10 +317,8 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::eval)
|
|||
auto& caller_frame = vm.call_stack().at(vm.call_stack().size() - 2);
|
||||
TemporaryChange scope_change(vm.call_frame().scope, caller_frame->scope);
|
||||
|
||||
vm.interpreter().execute_statement(global_object, program);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
return vm.last_value().value_or(js_undefined());
|
||||
auto& interpreter = vm.interpreter();
|
||||
return interpreter.execute_statement(global_object, program).value_or(js_undefined());
|
||||
}
|
||||
|
||||
// 19.2.6.1.1 Encode ( string, unescapedSet )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue