mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
LibWeb: Implement the "error to rethrow" mechanism in HTML::Script
This allows JS module loads to fail and throw without crashing the WebContent process due to a TODO() assertion.
This commit is contained in:
parent
2959c2f2eb
commit
819fb39a87
Notes:
sideshowbarker
2024-07-17 22:01:16 +09:00
Author: https://github.com/awesomekling
Commit: 819fb39a87
Pull-request: https://github.com/SerenityOS/serenity/pull/18909
6 changed files with 47 additions and 22 deletions
|
@ -619,9 +619,10 @@ void fetch_descendants_of_and_link_a_module_script(JavaScriptModuleScript& modul
|
|||
// 2. Perform record.Link().
|
||||
auto linking_result = const_cast<JS::SourceTextModule&>(record).link(result->vm());
|
||||
|
||||
// TODO: If this throws an exception, set result's error to rethrow to that exception.
|
||||
if (linking_result.is_error())
|
||||
TODO();
|
||||
// If this throws an exception, set result's error to rethrow to that exception.
|
||||
if (linking_result.is_throw_completion()) {
|
||||
result->set_error_to_rethrow(linking_result.release_error().value().value());
|
||||
}
|
||||
} else {
|
||||
// FIXME: 4. Otherwise, set result's error to rethrow to parse error.
|
||||
TODO();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue