diff options
author | Linus Groh <mail@linusgroh.de> | 2022-08-22 19:00:49 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-08-23 13:58:30 +0100 |
commit | b345a0acca725d1b4e4d6df26fc602d69e97f073 (patch) | |
tree | c1a1b7936505373fc3be8cb7b6f0ced444d05d63 /Userland/Libraries/LibJS/Console.cpp | |
parent | e3895e6c808d4606f02b26b1eaad3a3a803bba12 (diff) | |
download | serenity-b345a0acca725d1b4e4d6df26fc602d69e97f073.zip |
LibJS+LibWeb: Reduce use of GlobalObject as an intermediary
- Prefer VM::current_realm() over GlobalObject::associated_realm()
- Prefer VM::heap() over GlobalObject::heap()
- Prefer Cell::vm() over Cell::global_object()
- Prefer Wrapper::vm() over Wrapper::global_object()
- Inline Realm::global_object() calls used to access intrinsics as they
will later perform a direct lookup without going through the global
object
Diffstat (limited to 'Userland/Libraries/LibJS/Console.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Console.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Console.cpp b/Userland/Libraries/LibJS/Console.cpp index 74544e19c7..95847eb636 100644 --- a/Userland/Libraries/LibJS/Console.cpp +++ b/Userland/Libraries/LibJS/Console.cpp @@ -500,7 +500,6 @@ VM& ConsoleClient::vm() // 2.1. Logger(logLevel, args), https://console.spec.whatwg.org/#logger ThrowCompletionOr<Value> ConsoleClient::logger(Console::LogLevel log_level, MarkedVector<Value> const& args) { - auto& global_object = this->global_object(); auto& vm = this->vm(); // 1. If args is empty, return. @@ -515,7 +514,7 @@ ThrowCompletionOr<Value> ConsoleClient::logger(Console::LogLevel log_level, Mark // 4. If rest is empty, perform Printer(logLevel, ยซ first ยป) and return. if (rest_size == 0) { - MarkedVector<Value> first_as_vector { global_object.heap() }; + MarkedVector<Value> first_as_vector { vm.heap() }; first_as_vector.append(first); return printer(log_level, move(first_as_vector)); } |