Skip to content
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

Doesn't sanitize for in loops #6

Closed
davidlukerice opened this issue Jul 30, 2014 · 2 comments
Closed

Doesn't sanitize for in loops #6

davidlukerice opened this issue Jul 30, 2014 · 2 comments

Comments

@davidlukerice
Copy link

All the for (var j in x) loops don't check x.hasOwnProperty(j). This breaks rstats whenever an app also uses a library that extends the array prototype. Or just iterating using a normal for loop works as well.

@spite
Copy link
Owner

spite commented Jul 30, 2014

Fixed with 7868e05

Normal for loops or array.forEach are not good when using arrays as maps, since I need the key and the value. And it's debatable if people should go around messing with the native objects prototypes!

Anyway, easily fixed.

@spite spite closed this as completed Jul 30, 2014
@davidlukerice
Copy link
Author

Thanks for the quick fix! Although I agree messing with the prototype is a bad idea, I'm currently reliant on a library that does this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants