From 96ee5e36edabb81be3e15c43dd0e2c0ee4289cc4 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sat, 29 May 2021 23:51:15 +0300 Subject: [PATCH] LibJS: Replace the broken and unused Date::year getter --- Userland/Libraries/LibJS/Runtime/Date.h | 3 +-- Userland/Libraries/LibJS/Runtime/DatePrototype.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/Date.h b/Userland/Libraries/LibJS/Runtime/Date.h index d9971e8af2..fd17c68481 100644 --- a/Userland/Libraries/LibJS/Runtime/Date.h +++ b/Userland/Libraries/LibJS/Runtime/Date.h @@ -25,14 +25,13 @@ public: int date() const { return datetime().day(); } int day() const { return datetime().weekday(); } - int full_year() const { return datetime().year(); } int hours() const { return datetime().hour(); } u16 milliseconds() const { return m_milliseconds; } int minutes() const { return datetime().minute(); } int month() const { return datetime().month() - 1; } int seconds() const { return datetime().second(); } double time() const { return datetime().timestamp() * 1000.0 + milliseconds(); } - int year() const { return datetime().day(); } + int year() const { return datetime().year(); } bool is_invalid() const { return m_is_invalid; } void set_is_invalid(bool value) { m_is_invalid = value; } diff --git a/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp b/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp index 4599da0c14..958b1b223b 100644 --- a/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/DatePrototype.cpp @@ -115,7 +115,7 @@ JS_DEFINE_NATIVE_FUNCTION(DatePrototype::get_full_year) if (this_object->is_invalid()) return js_nan(); - return Value(this_object->full_year()); + return Value(this_object->year()); } JS_DEFINE_NATIVE_FUNCTION(DatePrototype::set_full_year)