mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
LibJS: Use GlobalObject::associated_realm() for function object realms
As outlined in the previous commit, this should be more reliable than Interpreter::realm(), as we don't always have access to an Interpreter.
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 02:22:12 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/0241071ca22 Pull-request: https://github.com/SerenityOS/serenity/pull/10474 Reviewed-by: https://github.com/awesomekling ✅
@@ -43,7 +43,7 @@ ECMAScriptFunctionObject::ECMAScriptFunctionObject(FlyString name, Statement con
|
||||
, m_environment(parent_scope)
|
||||
, m_formal_parameters(move(formal_parameters))
|
||||
, m_ecmascript_code(ecmascript_code)
|
||||
, m_realm(vm().interpreter_if_exists() ? &vm().interpreter().realm() : nullptr)
|
||||
, m_realm(global_object().associated_realm())
|
||||
, m_strict(strict)
|
||||
, m_name(move(name))
|
||||
, m_function_length(function_length)
|
||||
|
||||
Reference in New Issue
Block a user