-
Notifications
You must be signed in to change notification settings - Fork 25.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: escape hyphen in regexp, allow unit tests run in old browsers #13900
Conversation
@@ -12,7 +12,7 @@ const _SELECTOR_REGEXP = new RegExp( | |||
'(\\:not\\()|' + //":not(" | |||
'([-\\w]+)|' + // "tag" | |||
'(?:\\.([-\\w]+))|' + // ".class" | |||
'(?:\\[([.-\\w*]+)(?:=([^\\]]*))?\\])|' + // "[name]", "[name=value]" | |||
'(?:\\[([.\\-\\w*]+)(?:=([^\\]]*))?\\])|' + // "[name]", "[name=value]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this needs to be escaped, it is a bug in the browser, please link to so that we do not remove the \\
by accident later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean to open a issue and link to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there must be one already, please try to find it and link there.
At the very least add a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively, could you try [-.\\w*]
, ie move the -
first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it make sense, I'll do that
Also please run |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
Can't run unit tests over Karma on Firefox 31 (our environment) just because one not escaped character inside a regular expression.
What is the new behavior?
Can run the unit tests normally and get the test report.
Does this PR introduce a breaking change? (check one with "x")