News for hackers. Stuff that matters.
Re:An Object is not a Hash by breck on Tuesday October 09, 2012 @02:01AM (#4630206)
> Our program, however, is still susceptible to potential misbehaving. Let’s say our user decides to call his blog post "hasOwnProperty".

This will virtually never happen. If you're worried about it, put an early return (if (name === 'hasOwnProperty') return). End of story.

Re:An Object is not a Hash by mtts on Tuesday October 09, 2012 @02:25AM (#4630269)
Downvoted because "this will virtually never happen" is, uhm, for want of a better term, incredibly stupid.

Allow what you want to allow and disallow everything else.

Re:An Object is not a Hash by breck on Tuesday October 09, 2012 @02:35AM (#4630293)
Sorry, this will happen 00.0001% of the time. Orders of magnitude less than dozens of other more pressing problems.
Re:An Object is not a Hash by riffraff on Tuesday October 09, 2012 @04:09AM (#4630506)
downvoted for assuming that "chance of happening in random usage" has any correlation to what a determinated user will actually try to do.

This is like saying "oh, but nobody will ever insert SQL in our forms!"

Re:An Object is not a Hash by breck on Tuesday October 09, 2012 @02:52PM (#4633331)
good point.
Re:An Object is not a Hash by Groxx on Tuesday October 09, 2012 @02:31AM (#4630283)
Unless you run a blogging platform which is used by JS programmers.