You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...but since endOfLinediscards existing suffixes (where there is a capture group close parenthesis from .or), it leaves the capture group open, resulting in:
/^(aaa|bbb$/
The text was updated successfully, but these errors were encountered:
The same error here: SyntaxError: Invalid regular expression: /^(?:(?:aaa))|(?:(?:bbb)$/: Unterminated group
The .or() function generates the capture group's open parenthesis in _prefixes: '^(?:', the corresponding capture group's close parenthesis in source: _source: '(?:aaa))' before the .or() function, but the capture group's close parenthesis of the .or function is generated by the suffixes variable => _suffixes: ')$'. So then, the problem is when we use endOfLine, it generates an empty prefixes _prefixes: '' and the suffixes _suffixes: '$' which deletes the previous suffixes which includes the capture group's close parenthesis generated by the .or function.
My solution for now was the following below:
In the endOfLine function I've added the addition assignment operator+= to the _suffixes variable instead of the assignment operator = so that we add instead of rewrite the _suffixes variable. example:
Before adding addition assignment operator to the _suffixes variable:
From using:
I'd expect it to compile to something like:
...but since
endOfLine
discards existing suffixes (where there is a capture group close parenthesis from.or
), it leaves the capture group open, resulting in:The text was updated successfully, but these errors were encountered: