Commit graph

7 commits

Author SHA1 Message Date
Charlie Gordon
8b56215cc2
Fix more v8 errors (#336)
- change error message for `Object.create` invalid property descriptor
- disable v8 test cases for deprecated legacy RegExp static properties
  and invalid left hand side error type
- update v8.txt
- fix v8.sh behavior for single tests
2024-03-30 13:11:37 +01:00
Charlie Gordon
5e5b00c48c
Improve string parsing and JSON parsing (#316)
* Improve string parsing and JSON parsing

- fix JSON parsing of non ASCII string contents
- more precise string parsing errors
- more precise JSON parsing errors
- add `JS_ParseState::buf_start` to compute line/column
- fix HTML comment detection at start of source code
- improve v8 Failure messages (pulled and modified `formatFailureText` from **mjsunit.js**) 
- ignore more v8 tests
2024-03-22 11:19:36 +01:00
Ben Noordhuis
5d2202cad0
Pin Ubuntu CI images to 20.04 (#315)
GitHub recently upgraded the ubuntu-latest images and I suspect that is
the cause of the linux-asan and linux-msan failures. Pin to the old LTS
for now.

Fixes: https://github.com/quickjs-ng/quickjs/issues/314
2024-03-15 10:49:33 +01:00
Charlie Gordon
45f8dc247c
Improve JSON parser conformity (#303)
- add JSON specific parsers for strings and numbers
- update JSON parse error messages
- fix `JSON.stringify` handling of boxed objects
- parse Flags in v8 mjsunit test files
- update v8.txt
2024-03-14 08:19:11 +01:00
Charlie Gordon
aaa208ac8f
Improve error handling (#297)
* Improve error handling

- throw RangeError for invalid string length
- throw RangeError for stack overflow with updated message
- fix case for `BigInt` error messages
- refine stack check for `next_token` and `json_next_token`
- throw SyntaxError for too many variables, arguments, parameters...
- v8.js: disable v8 specific tests
- v8.js: disable Realm object tests
- v8.js: disable MODULE tests
- v8.js: disable RegExp static properties tests
- use more precise error messages
- reorder property lookup in `js_obj_to_desc()` according to ECMA
- set global object's [Symbol.toStringTag] to "global"
- fix error message for duplicate parameter name in strict mode
2024-03-10 17:04:06 +01:00
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
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