mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02:00
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.
This commit is contained in:
@@ -29,7 +29,7 @@ NonnullGCPtr<Error> Error::create(Realm& realm, DeprecatedString const& message)
|
||||
}
|
||||
|
||||
Error::Error(Object& prototype)
|
||||
: Object(prototype)
|
||||
: Object(ConstructWithPrototypeTag::Tag, prototype)
|
||||
{
|
||||
populate_stack();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user