Open ghost opened 4 years ago
RegExp support is at ES5.1 level at present.
Makes sense - what is the likely timeline for adding this support?
Thanks again!
The RegExp sticky tag was added as part of ECMAScript 2015 (E6). I am also interested in getting support for es2015 RegExp. I have a workaround for the moment, but if this is in the roadmap/near future I might change my implementation.
I was using commit 0e4d5044dcdb764165cc5b6117c5aa09a7f5ed65 from master from June 7th.
After I transpiled @fluent/bundle: https://www.npmjs.com/package/@fluent/bundle
to ES2015 - Duktape got to line 949 (of 1539 lines) and got stuck on this: var RE_ATTRIBUTE_START = new RegExp("\.([a-zA-Z][\w-]) = *", "y");
Duktape Error: SyntaxError: invalid regexp flags at [anon] (/duktape/dist/src-custom/duktape.c:90076) internal at RegExp () native strict construct preventsyield at [anon] (@fluent/bundle:949) strict at [anon] (@fluent/bundle:49) strict at main (@fluent/bundle:1539) strict preventsyield at require () native strict preventsyield at [anon] (eval:4) preventsyield
So it seems Duktape doesn't support the "sticky" flag in Regexp: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/sticky
Thanks!
Tim