feat(libSceNKWebKit): implement DoubleToStringConverter::EcmaScriptConverter and ToExponential #18533

Merged
adriaespii merged 1 commit from upstream-pr/18533 into main 2026-11-12 12:40:58 +00:00
adriaespii commented 2026-11-11 20:37:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriaespii on 2026-11-11T20:37:33Z.


What

  • Implements WTF::double_conversion::DoubleToStringConverter::EcmaScriptConverter and DoubleToStringConverter::ToExponential in DoubleToStringConverter.cpp, with typed ABI structs (DoubleToStringConverter and DoubleConversionStringBuilder) and APS5_VABI declarations in DoubleConversionExports.hpp, matching the pinned PS5-WebKit-11.x double-conversion.h, double-conversion.cc, and utils.h.
  • Handles NaN, +Inf/-Inf (including returning false when nanSymbol/infinitySymbol is null), UNIQUE_ZERO vs signed -0.0, EMIT_POSITIVE_EXPONENT_SIGN, custom exponentCharacter, shortest mode (requested_digits == -1), fixed fractional digit counts (0..100), out-of-range requested_digits (false), and null/invalid/overflowing StringBuilder guards.
  • Adds focused unit coverage in core/libs/prx/libSceNKWebKit/tests/DoubleToStringConverter.cpp and updates docs/dev/debt/libSceNKWebKit.md (5997 -> 5995).

Tested

  • python tools/check_conventions.py --base origin/main -> All conventions checks passed.
  • cmake --build build --target libSceNKWebKit nkwebkit_doubletostringconverter_tests nkwebkit_base_tests -j 8
  • ctest --test-dir build -R "(nkwebkit|public_headers|unbuilt_exports)" --output-on-failure -> 129/129 passed (100% tests passed, 0 tests failed out of 129, including nkwebkit_doubletostringconverter, unbuilt_exports, public_headers, and all public_headers_compile_* targets).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5266445517 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18533). Originally posted by [adriaespii](https://github.com/adriaespii) on 2026-11-11T20:37:33Z. --- ### What - Implements `WTF::double_conversion::DoubleToStringConverter::EcmaScriptConverter` and `DoubleToStringConverter::ToExponential` in [DoubleToStringConverter.cpp](https://github.com/adriaespii/AnyPS5/blob/feat/nkwebkit-double-to-string/core/libs/prx/libSceNKWebKit/src/DoubleToStringConverter.cpp), with typed ABI structs (`DoubleToStringConverter` and `DoubleConversionStringBuilder`) and `APS5_VABI` declarations in [DoubleConversionExports.hpp](https://github.com/adriaespii/AnyPS5/blob/feat/nkwebkit-double-to-string/core/libs/prx/libSceNKWebKit/include/DoubleConversionExports.hpp), matching the pinned `PS5-WebKit-11.x` `double-conversion.h`, `double-conversion.cc`, and `utils.h`. - Handles `NaN`, `+Inf`/`-Inf` (including returning `false` when `nanSymbol`/`infinitySymbol` is null), `UNIQUE_ZERO` vs signed `-0.0`, `EMIT_POSITIVE_EXPONENT_SIGN`, custom `exponentCharacter`, shortest mode (`requested_digits == -1`), fixed fractional digit counts (`0..100`), out-of-range `requested_digits` (`false`), and null/invalid/overflowing `StringBuilder` guards. - Adds focused unit coverage in `core/libs/prx/libSceNKWebKit/tests/DoubleToStringConverter.cpp` and updates `docs/dev/debt/libSceNKWebKit.md` (`5997 -> 5995`). ### Tested - `python tools/check_conventions.py --base origin/main` -> `All conventions checks passed.` - `cmake --build build --target libSceNKWebKit nkwebkit_doubletostringconverter_tests nkwebkit_base_tests -j 8` - `ctest --test-dir build -R "(nkwebkit|public_headers|unbuilt_exports)" --output-on-failure` -> `129/129` passed (`100% tests passed, 0 tests failed out of 129`, including `nkwebkit_doubletostringconverter`, `unbuilt_exports`, `public_headers`, and all `public_headers_compile_*` targets). ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!18533
No description provided.