andrewplummer/Sugar — pull request #97 by alassek (2012-01-29 01:52:43+00:00)
Title: Protect against hasOwnProperty being overwritten

See [this blog post][blog] for rationale.

Currently, Sugar is susceptible to this bug in a few places, notably Object.extended:

```javascript
Object.extended({ hasOwnProperty: true }) // TypeError: obj.hasOwnProperty is not a function
```

This PR adds `Object.has` as a shortcut to `Object.prototype.hasOwnProperty`, and replaces internal use of `Object#hasOwnProperty`.

[blog]: http://www.devthought.com/2012/01/18/an-object-is-not-a-hash/