From 9f399f7341ecef5c6a1c2d423c062730a7558213 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Thu, 4 Jun 2020 20:35:23 +0100 Subject: LibJS: Remove reduntant set_prototype() calls If we're inheriting from Object() we already call its constructor which sets the prototype - no need to do it again. --- Libraries/LibJS/Runtime/Date.cpp | 1 - Libraries/LibJS/Runtime/Error.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/Libraries/LibJS/Runtime/Date.cpp b/Libraries/LibJS/Runtime/Date.cpp index 6b22c98fdf..49ea57cb61 100644 --- a/Libraries/LibJS/Runtime/Date.cpp +++ b/Libraries/LibJS/Runtime/Date.cpp @@ -42,7 +42,6 @@ Date::Date(Core::DateTime datetime, u16 milliseconds, Object& prototype) , m_datetime(datetime) , m_milliseconds(milliseconds) { - set_prototype(&prototype); } Date::~Date() diff --git a/Libraries/LibJS/Runtime/Error.cpp b/Libraries/LibJS/Runtime/Error.cpp index 1d2b32fd3c..1c6439ab19 100644 --- a/Libraries/LibJS/Runtime/Error.cpp +++ b/Libraries/LibJS/Runtime/Error.cpp @@ -41,7 +41,6 @@ Error::Error(const FlyString& name, const String& message, Object& prototype) , m_name(name) , m_message(message) { - set_prototype(&prototype); } Error::~Error() -- cgit v1.2.3