tj / node-querystring

querystring parser for node and the browser - supporting nesting (used by Express, Connect, etc)
MIT License
455 stars 66 forks source link

Skip prototype properties #76

Closed ljharb closed 11 years ago

ljharb commented 11 years ago

To be a proper object-keys shim, it has to only iterate over own properties.

Would you be OK adding a dependency, object-keys? It's a well-tested Object.keys shim.

buschtoens commented 11 years ago

This should only occur, when people extend Object.prototype (which is a bad pratice in the first place). However this is an issue, and we should fix that. But I'm a little reluctant with adding new deps... Especially, when we could fix that with one line of code. Haha. ;)

if(obj[key] !== obj.constructor.prototype[key]) ret.push(key) What do you think about that?

tj commented 11 years ago

this should be fine, I agree it's bad practice, but people seem to do it lots :s