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:
Linus Groh
2020-03-30 00:21:56 +01:00
committed by Andreas Kling
parent 5c779c124b
commit d4e3688f4f
25 changed files with 567 additions and 5 deletions

View File

@@ -58,7 +58,7 @@ String Value::to_string() const
return "NaN";
// FIXME: This needs improvement.
return String::number((i32)as_double());
return String::format("%f", as_double());
}
if (is_object())