Commit graph

8 commits

Author SHA1 Message Date
Andreas Kling
fca08bd000 LibJS: Move builtin prototypes to the global object
This moves us towards being able to run JavaScript in different global
objects without allocating a separate GC heap.
2020-04-18 13:24:45 +02:00
Andreas Kling
f6d57c82f6 LibJS: Pass prototype to Function constructors 2020-04-18 10:28:22 +02:00
Andreas Kling
0df4d2823a LibJS: Pass prototype to Date constructor 2020-04-18 10:28:22 +02:00
Stephan Unverwerth
bbd592cb6c LibJS: Tweak FunctionPrototype::to_string and constructors
The output of FunctionPrototype::to_string is now more in line
with the output in Firefox. The builtin constructors have been
extended to include their function name in the output.
2020-04-13 01:14:21 +02:00
Andreas Kling
faac43597a LibJS: Add js_string(Interpreter&, String) 2020-04-04 12:58:05 +02:00
Andreas Kling
1549c5c48b LibJS: Make Value::as_object() return Object&
Let's move towards using references over pointers in LibJS as well.
I had originally steered away from it because that's how I've seen
things done in other engines. But this is not the other engines. :^)
2020-04-01 22:18:47 +02:00
Linus Groh
849e2c77e4 LibJS: Implement constructor/non-constructor function calls
This adds Function::construct() for constructor function calls via `new`
keyword. NativeFunction doesn't have constructor behaviour by default,
ScriptFunction simply calls call() in construct()
2020-04-01 20:18:36 +02:00
Linus Groh
d4e3688f4f 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)
2020-03-30 14:11:54 +02:00