mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibJS: Implement Date.valueOf()
It does exactly the same thing as Date.getTime().
This commit is contained in:
parent
064159d215
commit
c8cf465174
Notes:
sideshowbarker
2024-07-19 03:21:31 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/c8cf4651742 Pull-request: https://github.com/SerenityOS/serenity/pull/3241
1 changed files with 7 additions and 0 deletions
|
@ -73,6 +73,13 @@ void DatePrototype::initialize(GlobalObject& global_object)
|
|||
define_native_function("toLocaleTimeString", to_locale_time_string, 0, attr);
|
||||
define_native_function("toTimeString", to_time_string, 0, attr);
|
||||
define_native_function("toString", to_string, 0, attr);
|
||||
|
||||
// Aliases.
|
||||
define_native_function("valueOf", get_time, 0, attr);
|
||||
// toJSON() isn't quite an alias for toISOString():
|
||||
// - it returns null instead of throwing RangeError
|
||||
// - its .length is 1, not 0
|
||||
// - it can be transferred to other prototypes
|
||||
}
|
||||
|
||||
DatePrototype::~DatePrototype()
|
||||
|
|
Loading…
Add table
Reference in a new issue