feat(libSceJsc): implement WTF::StringImpl::defaultWritingDirection #19772
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19772"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by nexus7super-ship-it on 2026-11-13T22:26:02Z.
What
Implements
WTF::StringImpl::defaultWritingDirection(bool*)(libSceJsc, NIDvKObO5LG+x8), which threw throughNotImplemented_nid_no_patch.It follows the pinned WebKit StringImpl.cpp that
WtfStringSearch.cppalready derives from: for each code unit it asksu_charDirection; the first left-to-right unit returnsU_LEFT_TO_RIGHT(0), the first right-to-left or Arabic unit returnsU_RIGHT_TO_LEFT(1), and*hasStrongDirectionalityis set when the pointer is not null; with no strong unit it returns 0 and sets the flag to false. Like WebKit it walks code units, so a lone surrogate is strong left-to-right.u_charDirectioncomes from libSceIcu, which libSceJsc now links (the console's JavaScriptCore uses ICU the same way). A nullthisthrows where WebKit faults. The Unicode version gap (ICU 78 here, ICU 68 on the console) is recorded indocs/dev/debt/libSceJsc.md.#18430, #18442 and #18951 touch the same files but none adds this function.
Tested
Linux (Ubuntu, GCC), Release build with
BUILD_TESTING=ON:jsc_wtf_string_searchgains Latin, Hebrew, Arabic, neutral, empty, null-flag, surrogate and null-thiscases; all 9 libSceJsc tests,nkwebkit_jscandnkwebkit_jscapibridgepass, as dopublic_headers,conventions_*andprogress_report(129 tests).python3 tools/check_conventions.py --base origin/mainpasses. No title was run.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T03:57:49Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
ba8bdef246:tools/check_conventions.pypassed;git diff --checkclean.jsc_wtf_string_search_testsbuilt cleanly.jsc_wtf_string_search):core/libs/prx/libSceJsc/Export.cpp,core/libs/prx/libSceJsc/include/InventoryExports.hpp,core/libs/prx/libSceJsc/include/WtfStringSearchExports.hpp,core/libs/prx/libSceJsc/src/WtfStringSearch.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Generated withfooter from the description; the AI-assisted checkbox can stay.Looks Good To Me