mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibWeb: Obtain basename before passing base_url to ClassicScript::create
This would previously crash because it depended on a specific order for evaluating function arguments, which is undefined.
This commit is contained in:
parent
6452bfb612
commit
27b1d94e04
Notes:
github-actions[bot]
2024-10-12 13:00:59 +00:00
Author: https://github.com/sin-ack
Commit: 27b1d94e04
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1742
1 changed files with 2 additions and 1 deletions
|
@ -377,7 +377,8 @@ i32 WindowOrWorkerGlobalScopeMixin::run_timer_initialization_steps(TimerHandler
|
|||
|
||||
// 7. Let script be the result of creating a classic script given handler, settings object, base URL, and fetch options.
|
||||
// FIXME: Pass fetch options.
|
||||
auto script = ClassicScript::create(base_url.basename(), source, settings_object, move(base_url));
|
||||
auto basename = base_url.basename();
|
||||
auto script = ClassicScript::create(basename, source, settings_object, move(base_url));
|
||||
|
||||
// 8. Run the classic script script.
|
||||
(void)script->run();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue