mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
LibJS: Treat passing undefined as no argument for console labels
- Affects time, timeLog, timeEnd, count, and countReset functions
This commit is contained in:
parent
0ca5675d59
commit
8545756d17
Notes:
github-actions[bot]
2024-08-09 10:03:23 +00:00
Author: https://github.com/GasimGasimzada 🔰
Commit: 8545756d17
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1016
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 1 additions and 1 deletions
|
@ -203,7 +203,7 @@ ThrowCompletionOr<Value> Console::dir()
|
||||||
|
|
||||||
static ThrowCompletionOr<String> label_or_fallback(VM& vm, StringView fallback)
|
static ThrowCompletionOr<String> label_or_fallback(VM& vm, StringView fallback)
|
||||||
{
|
{
|
||||||
return vm.argument_count() > 0
|
return vm.argument_count() > 0 && !vm.argument(0).is_undefined()
|
||||||
? vm.argument(0).to_string(vm)
|
? vm.argument(0).to_string(vm)
|
||||||
: TRY_OR_THROW_OOM(vm, String::from_utf8(fallback));
|
: TRY_OR_THROW_OOM(vm, String::from_utf8(fallback));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue