]> git.kaiwu.me - njs.git/commit
Using printing and parsing library from QuickJS.
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 24 Oct 2025 03:06:42 +0000 (20:06 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 18 Nov 2025 02:56:11 +0000 (18:56 -0800)
commitc7bd5f4a4579c03212e773ed976272352f02829d
tree475c6ced040b09f3db887dac6320cf7a280ce700
parente7caa46d8b11410de0df0bc30f3c6014d1ba6fb9
Using printing and parsing library from QuickJS.

- Number.prototype.toString(radix)
    Improved accuracy for edge cases
    Reimplemented using njs_dtoa2() with JS_DTOA_FORMAT_FREE | JS_DTOA_EXP_DISABLED
- Number.prototype.toFixed(frac)
    Reimplemented using njs_dtoa2() with JS_DTOA_FORMAT_FIXED
    Removed old njs_fixed_dtoa() implementation
- Number.prototype.toPrecision(prec)
    Reimplemented using njs_dtoa2() with precision format
    Removed old njs_dtoa_precision() implementation
- Number.prototype.toExponential(frac)
    Reimplemented using njs_dtoa2() with exponential format
    Removed old njs_dtoa_exponential() implementation
- parseInt()
    Simplified parsing implementation
    Removed custom njs_number_radix_parse() helper
- parseFloat()
    Simplified parsing implementation

Removed custom njs_number_bin_parse(), njs_number_oct_parse(),
njs_number_dec_parse() and njs_strtod.c module Better handling of large
numbers and denormal floats and invalid inputs.
23 files changed:
auto/clang
auto/sources
auto/types
external/njs_shell.c
src/njs.h
src/njs_clang.h
src/njs_cutils.h [new file with mode: 0644]
src/njs_diyfp.c [deleted file]
src/njs_diyfp.h [deleted file]
src/njs_dtoa.c
src/njs_dtoa.h
src/njs_dtoa_fixed.c [deleted file]
src/njs_dtoa_fixed.h [deleted file]
src/njs_json.c
src/njs_lexer.c
src/njs_main.h
src/njs_number.c
src/njs_number.h
src/njs_string.c
src/njs_strtod.c [deleted file]
src/njs_strtod.h [deleted file]
src/njs_types.h
src/test/njs_unit_test.c