diff options
author | Andreas Kling <kling@serenityos.org> | 2022-12-14 12:17:58 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-14 15:11:57 +0100 |
commit | 4abdb68655340b66ee0d2b63cd384d46edd00d56 (patch) | |
tree | 0c657357a3a57e0eee379144926bea5e6e2cc7b6 /Userland/Libraries/LibJS/Runtime/ReflectObject.cpp | |
parent | 42b5c896e86b0d77d62ecae0ec78802aaff285a1 (diff) | |
download | serenity-4abdb68655340b66ee0d2b63cd384d46edd00d56.zip |
LibJS: Remove Object(Object& prototype) footgun
This constructor was easily confused with a copy constructor, and it was
possible to accidentally copy-construct Objects in at least one way that
we dicovered (via generic ThrowCompletionOr construction).
This patch adds a mandatory ConstructWithPrototypeTag parameter to the
constructor to disambiguate it.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/ReflectObject.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/ReflectObject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp index 2c679de90d..6134c40fa5 100644 --- a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp @@ -16,7 +16,7 @@ namespace JS { ReflectObject::ReflectObject(Realm& realm) - : Object(*realm.intrinsics().object_prototype()) + : Object(ConstructWithPrototypeTag::Tag, *realm.intrinsics().object_prototype()) { } |