mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibJS: Start implementing Date :^)
This adds: - A global Date object (with `length` property and `now` function) - The Date constructor (no arguments yet) - The Date prototype (with `get*` functions)
This commit is contained in:
committed by
Andreas Kling
parent
5c779c124b
commit
d4e3688f4f
Notes:
sideshowbarker
2024-07-19 08:03:11 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/d4e3688f4f5 Pull-request: https://github.com/SerenityOS/serenity/pull/1533 Reviewed-by: https://github.com/awesomekling
@@ -3,6 +3,7 @@
|
||||
#include <LibJS/Heap/Heap.h>
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibJS/Runtime/ConsoleObject.h>
|
||||
#include <LibJS/Runtime/DateConstructor.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibJS/Runtime/MathObject.h>
|
||||
#include <LibJS/Runtime/NativeFunction.h>
|
||||
@@ -17,6 +18,7 @@ GlobalObject::GlobalObject()
|
||||
put_native_function("isNaN", is_nan);
|
||||
|
||||
put("console", heap().allocate<ConsoleObject>());
|
||||
put("Date", heap().allocate<DateConstructor>());
|
||||
put("Math", heap().allocate<MathObject>());
|
||||
put("Object", heap().allocate<ObjectConstructor>());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user