flutter_js icon indicating copy to clipboard operation
flutter_js copied to clipboard

BUG: Cannot handle escaped `-` in capturing groups when unicode flag is enabled

Open jeswr opened this issue 2 years ago • 1 comments

The following evaluation fails with the error invalid escape sequence in regular expression despite being a valid regular expression in JS as of ES6

flutterJs.evaluate("const x = /[\-a]/u;")

This problem occurs on Linux - Debian Buster

jeswr avatar Feb 16 '22 12:02 jeswr

If indeed you are using QuickJS, then yes, it is an upstream issue and flutter_js can do nothing about it. Here is me trying to run your code with the official quickjs CLI:

image

So unfortunately I would consider closing this issue here, as nothing can be done. You could consider using JScore instead.

shilangyu avatar Nov 05 '22 17:11 shilangyu