-
Notifications
You must be signed in to change notification settings - Fork 476
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
search(true) fails in FireFox #169
Comments
I'm afraid I cannot reproduce your issue - the test suite passes on my Firefox 32.0.2. Running your example code in the console works fine, too. |
Alas, I'm afraid your code coverage is missing something then. I have now tested in both 32 and 33. I downloaded the non-minified URI.js and debugged it myself. This was my test page: <html>
<head>
<script type="text/javascript" src="./URI.js"></script>
</head>
<body>
<script type="text/javascript">
var uriParser = new URI(document.URL),
searchMap = null;
try {
// fails in FireFox
searchMap = uriParser.search(true);
} catch (ex) {
var match,
pl = /\+/g, // Regex for replacing addition symbol with a space
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) {
return decodeURIComponent(s.replace(pl, " "));
},
query = window.location.search.substring(1);
searchMap = {};
while (match = search.exec(query))
searchMap[decode(match[1])] = decode(match[2]);
}
</script>
</body>
</html> I then invoked the page using '?watch=1' in Chrome (succeeds using URI) and Firefox (exception as before, uses the handler to parse the parameter correctly). Using a debugger, I found the offending line in the function parseQuery on line 535 (current master). The code shouldn't get there in this case as the parameter doesn't exist in the items object yet, so line 530 is failing. In Chrome 'items[name]' returns false, but in Firefox it returns true. Using 'items[name] == true' (no ===, just to exclude falsey) instead yields the correct result. |
ah, man, … the problem is the fixed it in master… |
The following code throws a TypeError (push is not a function) in FireFox:
The text was updated successfully, but these errors were encountered: