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
Issue in piwik.js function logEvent #13165
Comments
I do not have time to provide a PR atm, but this should be fixxed really simple. if (category === undefined || action === undefined || trim(String(category)).length === 0 || trim(String(action)).length === 0) { ... |
@fdellwing just fyi to make JSLint in the tests happy we will need to use something like |
Maybe not the right place for that, you can DM me in the forums with an answer if you want: I'm not experienced with JSLint, what is it's problem with ˋvalue === undefinedˋ? This is perfectly valid JS, isn't it? |
It definitely is valid. It's just when the JS tests run, there is a test to check if JSLint is "happy" and it usually complains about it. |
whats about |
Never use something like To make it more clear what I mean, check the output of the following lines (both being empty strings): ("") ? "truthey" : "falsey";
(new String("")) ? "truthey" : "falsey"; |
If you call the function
without parameter it shout gives an error.
But it doesn’t. Because the line
will not work. String(category) returns always 9 (the length of the word undefined) when categorie is empty
So the error will never been showed.
The text was updated successfully, but these errors were encountered: