1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +00:00
Commit graph

359 commits

Author SHA1 Message Date
Andreas Kling
6a5cd32205 LibJS: The global isNaN() should coerce to number before testing NaN
For stricter NaN checking, we'll have to implement Number.isNaN().
2020-03-27 12:59:41 +01:00
Andreas Kling
c60dc84a33 LibJS: Allow function calls with missing arguments
We were interpreting "undefined" as a variable lookup failure in some
cases and throwing a ReferenceError exception instead of treating it
as the valid value "undefined".

This patch wraps the result of variable lookup in Optional<>, which
allows us to only throw ReferenceError when lookup actually fails.
2020-03-27 12:56:05 +01:00
Andreas Kling
04ced9e24a LibJS: Add global isNaN() function 2020-03-27 12:45:36 +01:00
Andreas Kling
9a78b4af2c LibJS: Basic NaN support
This patch adds js_nan() for constructing a NaN value. You can check
if a Value is NaN with Value::is_nan().
2020-03-27 12:40:22 +01:00
Andreas Kling
6c9d2cfa5e LibJS: Handle "for" statements with empty initializer and updater 2020-03-25 16:14:51 +01:00
Andreas Kling
30d24af54a LibJS: Add a basic test for the "throw" keyword 2020-03-25 16:09:23 +01:00
Andreas Kling
9e8d3d6287 LibJS: Rename some tests
"feature-basic" is a bit more logical than having a ton of
"basic-feature" (when it comes to the visual overview of it all.)
2020-03-25 15:57:18 +01:00
Andreas Kling
78923d986e LibJS: Tweak run-tests output a bit 2020-03-25 15:52:17 +01:00
Andreas Kling
45488401b1 LibJS: Add a very basic test runner (shell script) + some tests 2020-03-25 15:32:17 +01:00