]> git.kaiwu.me - quickjs.git/commit
Rewrite `set_date_fields` to match the ECMA specification
authorCharlie Gordon <github@chqrlie.org>
Wed, 21 Feb 2024 20:22:10 +0000 (21:22 +0100)
committerCharlie Gordon <github@chqrlie.org>
Wed, 21 Feb 2024 20:22:10 +0000 (21:22 +0100)
commitb70e764427c885603b0285c8a64a218ae6361b1d
treecb77f25a0850540547d205500732772c95302efd
parentb91a2aec67aace092fd4f8bdbaa49487fce86960
Rewrite `set_date_fields` to match the ECMA specification

- use `double` arithmetic where necessary to match the spec
- use `volatile` to ensure correct order of evaluation
  and prevent FMA code generation
- reject some border cases.
- avoid undefined behavior in `double` -> `int64_t` conversions
- improved tests/test_builtin.js `assert` function to compare
  values more reliably.
- added some tests in `test_date()`
- disable some of these tests on win32 and cygwin targets
Makefile
quickjs.c
tests/test_builtin.js