diff options
author | Luke Wilde <lukew@serenityos.org> | 2022-05-07 00:20:22 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-05-07 01:22:09 +0200 |
commit | 05748ed607bfd14301a45bb34bb62e14e0b51d28 (patch) | |
tree | e4dada0dc5fcc20656d7e9114716ee5ed3065516 /Userland/Utilities | |
parent | f04911e777ced0f1910b548983af3f4a972fa05c (diff) | |
download | serenity-05748ed607bfd14301a45bb34bb62e14e0b51d28.zip |
LibJS: Convert Console to use MarkedVector<Value>
Using a Vector<Value> is unsafe as GC cannot see the stored values.
This is then vended to outside users of ConsoleClient, e.g. LibWeb and
WebContent, which is then outside of LibJS's control.
An example issue is if the client stores it for later use and forgets
to visit the stored values, meaning they can be destroyed at any time.
We can save the client from this by vending a MarkedVector<Value> to
them.
Diffstat (limited to 'Userland/Utilities')
-rw-r--r-- | Userland/Utilities/js.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index bd840cbfcb..37c10bde7a 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -1374,7 +1374,7 @@ public: return JS::js_undefined(); } - auto output = String::join(" ", arguments.get<Vector<JS::Value>>()); + auto output = String::join(" ", arguments.get<JS::MarkedVector<JS::Value>>()); m_console.output_debug_message(log_level, output); switch (log_level) { |