1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 03:37:35 +00:00
serenity/Userland/Libraries/LibJS
Timothy Flynn d83ce7dd0b LibJS: Re-implement the Date constructor / prototype for spec compliance
First, this adds a constructor to the Date object to be created from a
plain double. This is a first step to removing Core::DateTime as the
basis for the Date object. A subsequent commit will remove the now-
unused data from the object.

Next, this implements the constructor in accordance to the spec. The
constructor when NewTarget is undefined no longer allocates a Date on
the heap. The other constructor properly uses recently created AOs to
handle time zone and ensure the created [[DateValue]] is valid. Other
methods on the constructor (Date.now) have not been touched yet.

Last, the prototype is reimplemented. Again, we use other AOs to handle
time zones and time clipping. Not all prototypes are fixed; most of them
are, but a few (e.g. Date.prototype.getTimezoneOffset) were not fixed,
but left in a mostly unimplemented state for another commit.

In all of the above, spec comments are added. This is a rather large
change; but it's tough to do any of these parts individually without
breaking everything else.
2022-01-15 20:13:48 +01:00
..
Bytecode LibJS: Implement proper Iterator records 2022-01-09 22:02:43 +01:00
Heap LibJS: Add Handle specialisation for Value 2022-01-05 11:21:38 +01:00
Runtime LibJS: Re-implement the Date constructor / prototype for spec compliance 2022-01-15 20:13:48 +01:00
Tests LibJS: Re-implement the Date constructor / prototype for spec compliance 2022-01-15 20:13:48 +01:00
AST.cpp AK+Everywhere: Make Variant::visit() respect the Variant's constness 2022-01-14 11:35:40 +03:30
AST.h LibJS: Replace the custom unwind mechanism with completions :^) 2022-01-06 12:36:23 +01:00
CMakeLists.txt LibJS: Support non-UTC time zones in Temporal :^) 2022-01-11 22:17:39 +01:00
Console.cpp LibJS: Implement console.time/timeLog/timeEnd() methods 2021-12-27 21:44:07 +01:00
Console.h LibJS: Implement console.time/timeLog/timeEnd() methods 2021-12-27 21:44:07 +01:00
Forward.h LibJS: Add MarkedVector<T> 2021-12-16 22:48:17 +01:00
Interpreter.cpp LibJS: Remove now unused VM::{set_,}last_value() 2022-01-08 23:43:03 +01:00
Interpreter.h LibJS: Convert Interpreter::run() to ThrowCompletionOr<Value> 2022-01-08 23:43:03 +01:00
Lexer.cpp LibJS: Detect invalid unicode and stop lexing at that point 2021-12-29 16:57:23 +01:00
Lexer.h LibJS: Detect invalid unicode and stop lexing at that point 2021-12-29 16:57:23 +01:00
MarkupGenerator.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
MarkupGenerator.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Module.cpp LibJS: Add a barebones Module class 2021-09-14 21:41:51 +02:00
Module.h LibJS: Add a barebones Module class 2021-09-14 21:41:51 +02:00
Parser.cpp LibJS: Replace the custom unwind mechanism with completions :^) 2022-01-06 12:36:23 +01:00
Parser.h LibJS: Replace the custom unwind mechanism with completions :^) 2022-01-06 12:36:23 +01:00
Script.cpp LibJS+LibWeb: Move script parse time logging from JS::Script to LibWeb 2021-09-14 21:41:51 +02:00
Script.h LibJS+LibWeb: Let JS::Script::parse() return a list of errors (on error) 2021-09-14 21:41:51 +02:00
SourceRange.h LibJS: Add missing headers 2021-10-06 23:52:40 +01:00
SourceTextModule.cpp LibJS: Add a barebones SourceTextModule class 2021-09-14 21:41:51 +02:00
SourceTextModule.h LibJS: Add a barebones SourceTextModule class 2021-09-14 21:41:51 +02:00
SyntaxHighlighter.cpp LibJS: Remove unused header includes 2021-08-01 08:10:16 +02:00
SyntaxHighlighter.h LibWeb+LibSyntax: Implement nested syntax highlighters 2021-06-07 14:45:49 +04:30
Token.cpp LibJS: Disallow '\8' and '\9' in strict mode due to being octal escapes 2021-11-30 17:05:32 +00:00
Token.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00