hermes icon indicating copy to clipboard operation
hermes copied to clipboard

Support for ES2018 Unicode character class escapes

Open birdofpreyru opened this issue 1 year ago • 4 comments

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):

birdofpreyru avatar Jun 11 '23 22:06 birdofpreyru

Is this new-contributor friendly? I'd be happy to implement it. Need it in my app

mandrade2 avatar Oct 26 '23 22:10 mandrade2

@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.

tmikov avatar Oct 26 '23 23:10 tmikov

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

mandrade2 avatar Oct 27 '23 01:10 mandrade2

@tmikov unfortunately I don't think I'll be available complete this. Hope I get more time to contribute in the future!

mandrade2 avatar Nov 07 '23 23:11 mandrade2