mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
LibWeb: Add non const global object getter to EnvironmentSettingsObject
And sneak in a as_if tidyup too.
This commit is contained in:
committed by
Shannon Booth
parent
9e7aa878bc
commit
8d099b9cec
Notes:
github-actions[bot]
2026-02-26 06:24:02 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/8d099b9cec2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8144 Reviewed-by: https://github.com/tcl3 ✅
@@ -547,10 +547,9 @@ JS::Object& entry_global_object()
|
||||
bool is_secure_context(Environment const& environment)
|
||||
{
|
||||
// 1. If environment is an environment settings object, then:
|
||||
if (is<EnvironmentSettingsObject>(environment)) {
|
||||
if (auto const* environment_settings_object = as_if<EnvironmentSettingsObject>(environment)) {
|
||||
// 1. Let global be environment's global object.
|
||||
// FIXME: Add a const global_object() getter to ESO
|
||||
auto& global = static_cast<EnvironmentSettingsObject&>(const_cast<Environment&>(environment)).global_object();
|
||||
auto const& global = environment_settings_object->global_object();
|
||||
|
||||
// 2. If global is a WorkerGlobalScope, then:
|
||||
if (auto const* worker = as_if<WorkerGlobalScope>(global)) {
|
||||
|
||||
Reference in New Issue
Block a user