oguimbal/pgsql-ast-parser

Library causes crashes in Safari browser due to lack of support for lookbehind regex.

Closed this issue · 2 comments

Our team has started adopting this library for client-side query validation. We noticed that in Safari browser using this library causes our React application to crash before it has a chance to load due to an invalid regex being used in the lexer:

commentFullOpen: /(?<!\/)\/\*/,

SyntaxError: Invalid regular expression: invalid group specifier name

Unfortunately, Safari/WebKit has still not added support for lookbehind assertions in RegExp. Here is the open bug ticket.

I have validated that if we stop importing this library into our application, things function as normal in Safari.

Re-assessing the composition of this regex, which seems to be just looking for /*, should resolve this issue.

gthb commented

Duplicate of #34

yup, duplicate :)