فهرست منبع

LibJS: Replace the broken and unused Date::year getter

Idan Horowitz 4 سال پیش
والد
کامیت
96ee5e36ed
2فایلهای تغییر یافته به همراه2 افزوده شده و 3 حذف شده
  1. 1 2
      Userland/Libraries/LibJS/Runtime/Date.h
  2. 1 1
      Userland/Libraries/LibJS/Runtime/DatePrototype.cpp

+ 1 - 2
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; }

+ 1 - 1
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)