Commit graph

3 commits

Author SHA1 Message Date
Charlie Gordon
648a8f5be1
Improve Date.parse (#289)
* Improve `Date.parse()`

- rewrite `Date.parse()` with separate parsers
- return `NaN` for out of bounds field values as specified
- add `js_tzabbr` and `string_get_tzabbr` to handle timezone abbreviations
- improve `string_get_milliseconds` readability
- accept up to 9 decimals for millisecond fraction but truncate at 3
- accept many more alternative date/time formats
- add test cases in **tests/test_builtin.js**
- produce readable output for `Date` objects in repl 
- use `JSON.stringify` to output `Date` and `string` values in **repl.js**
- remove `String.prototype.__quote`
- add `minimum_length` macro to specify argument array sizes (C99 except MSVC)
- v8.js: parse all environment variables and output them, update **v8.txt**
2024-03-10 10:34:26 +01:00
Charlie Gordon
7dd2868856
Improve Number.prototype.toString for radix other than 10 (#284)
- fix the conversions for integers and exact fractions
- approximate approach for other cases.
- bypass floating point conversions for JS_TAG_INT values
- avoid divisions for base 10 integer conversions

Fixes: https://github.com/quickjs-ng/quickjs/issues/242
2024-03-01 17:49:46 +01:00
Ben Noordhuis
4b138c8923
Run V8 spec conformance test suite (#243)
The shell script runs the tests and diffs stdout against v8.txt.
Lines added/removed means tests were broken/fixed.

Future work is to a) fix failing tests, and b) enable more tests.

A number are disabled for various reasons and mjsunit subdirectories are
currently skipped. Need to decide on a case-by-case basis what is and
isn't relevant to us.

At the moment about 430 tests are run of which approx. 80% pass.
2024-01-02 07:47:40 +01:00