Commit graph

13 commits

Author SHA1 Message Date
Linus Groh
8137f40b73 LibJS: Add Value::is_integer() 2020-05-08 20:06:49 +02:00
mattco98
23ec578a01 LibJS: Implement correct attributes for (almost) all properties
Added the ability to include a u8 attributes parameter with all of the
various put methods in the Object class. They can be omitted, in which
case it defaults to "Writable | Enumerable | Configurable", just like
before this commit.

All of the attribute values for each property were gathered from
SpiderMonkey in the Firefox console. Some properties (e.g. all of the
canvas element properties) have undefined property descriptors... not
quite sure what that means. Those were left as the default specified
above.
2020-04-28 09:29:50 +02:00
Linus Groh
14c7988eea LibJS: Implement Number.isInteger() 2020-04-26 20:36:59 +02:00
Linus Groh
7bd6b58b29 LibJS: Implement Number.isNaN()
Like the global isNaN() without the number coercion.
2020-04-26 20:36:59 +02:00
Linus Groh
c350f5ae67 LibJS: Implement Number.isFinite()
Like the global isFinite() without the number coercion.
2020-04-26 20:36:59 +02:00
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
cf702a13b9 LibJS: Pass prototype to NumberObject 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
Linus Groh
97de93eed1 LibJS: Add js_negative_infinity()
Value(-js_infinity().as_double()) is kind of awkward.
2020-04-12 14:39:38 +02:00
Linus Groh
5ecc7e6a1c LibJS: Add Number.isSafeInteger() 2020-04-07 21:28:43 +02:00
Linus Groh
b7032b4972 LibJS: Add Number constants 2020-04-07 21:28:43 +02:00
Linus Groh
f631f6a2e6 LibJS: Add Number() 2020-04-07 17:25:50 +02:00