LibJS+LibWeb: Add a custom host hook to log unparsed date strings

This lets us log when our Date.parse implementation was unable to handle
a string found on the web.
This commit is contained in:
Timothy Flynn 2024-09-08 11:15:07 -04:00 committed by Andreas Kling
commit 8d6f36f8d6
Notes: github-actions[bot] 2024-09-08 16:25:58 +00:00
4 changed files with 13 additions and 3 deletions

View file

@ -545,6 +545,10 @@ ErrorOr<void> initialize_main_thread_vm(HTML::EventLoop::Type type)
HTML::fetch_single_imported_module_script(realm, url.release_value(), *fetch_client, destination, fetch_options, *settings_object, fetch_referrer, module_request, perform_fetch, on_single_fetch_complete);
};
s_main_thread_vm->host_unrecognized_date_string = [](StringView date) {
dbgln("Unable to parse date string: \"{}\"", date);
};
return {};
}