hermes
hermes copied to clipboard
Support for ES2018 Unicode character class escapes
Bug Description
new RegExp(/\p{P}/, 'u')
in JS code crashes React Native when using Hermes, throwing SyntaxError: Invalid RegExp: Invalid escape
; and it works fine with JSC. \p{P}
is the Unicode character class escape for punctuation.
- [x] I have run
gradle clean
and confirmed this bug does not occur with JSC
Hermes version: the one bundled with RN 0.71.10 React Native version (if any): 0.71.10 OS version (if any): Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64):
Is this new-contributor friendly? I'd be happy to implement it. Need it in my app
@mandrade2 It's difficult to gauge exactly how new-contributor friendly it is. It requires good C++, understanding of Unicode, regular expressions in general, and the Hermes regex implementation. It is not strongly coupled to the rest of the runtime, but likely requires calling internal APIs in ways that they are already used in the internal implementation.
I would say that this is a moderately complex task that would require non-trivial time commitment.
Thanks @tmikov! I'll start looking around the Hermes repo to find out if I can do it. Will post any doubts here if that works out
@tmikov unfortunately I don't think I'll be available complete this. Hope I get more time to contribute in the future!