-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Flags undefined in tokenize #986
Comments
Hi @isglass, Thanks for reporting this. I cannot see how 'xxx'.match(/[imuy]*$/)[0];
''.match(/[imuy]*$/)[0];
RegExp('', '').toString().match(/[imuy]*$/)[0]; And if The following is the only way I can think of, that would cause this bug: RegExp.prototype.toString = function() {
return {
match: function() { return [] }
}
} I think we should get to the root of this problem. Could you provide more details for this bug? What browser did you use? Maybe a simple online demo that reproduces it? Thanks! |
For https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match
|
Hi @zeitgeist87 , Unfortunately I can't reproduce it, have only noticed it in our "visitor-exception-logs" over the last couple of days. All I have got is their user agent:
And a stack trace:
And exception message:
|
The user-agent would suggest, that it is a 64bit Linux system running Chromium 47.0.2526.80 which is over a year old now. Do all these users have the same user-agent? Could it be some kind of crawler that uses a fake user-agent? The only way for Maybe you could add some debug code to your site that provides more information: if (flags === undefined) {
console.log(pattern, pattern.pattern, pattern.pattern.toString(), pattern.pattern.toString().match(/[imuy]*$/));
} |
What other scripts are you using? Perhaps one of them is overwriting native methods, and making match() return an empty array? |
Please reopen if you can provide more information regarding this issue. |
Hi,
Can't reproduce it properly, but sometimes when using FileHighlighter plugin we get flags undefined in tokenize. Which leads to RegExp exception, it tries undefinedg.
Since I can't reproduce when debugging i propose the following:
Replaced with:
Regards,
Johan
The text was updated successfully, but these errors were encountered: