LibWeb: Don't store reference to temporary in resolve_module_specifier

An environment settings object will return a copy to the URL. From a
quick glance, we could probably make an environment settings object
return a reference to one, but let's just change this code to make
a copy since its not safe to rely on that.
This commit is contained in:
Shannon Booth 2024-11-25 09:48:23 +13:00 committed by Andrew Kaster
parent 7b678d3e1f
commit 43f75dcba0
Notes: github-actions[bot] 2024-11-24 22:31:00 +00:00

View file

@ -85,8 +85,8 @@ ByteString module_type_from_module_request(JS::ModuleRequest const& module_reque
WebIDL::ExceptionOr<URL::URL> resolve_module_specifier(Optional<Script&> referring_script, ByteString const& specifier)
{
// 1. Let settingsObject and baseURL be null.
Optional<EnvironmentSettingsObject&> settings_object;
Optional<URL::URL const&> base_url;
GC::Ptr<EnvironmentSettingsObject> settings_object;
Optional<URL::URL> base_url;
// 2. If referringScript is not null, then:
if (referring_script.has_value()) {