{"issue":{"pull_request":{"diff_url":"https://github.com/cjohansen/Sinon.JS/pull/54.diff","html_url":"https://github.com/cjohansen/Sinon.JS/pull/54","patch_url":"https://github.com/cjohansen/Sinon.JS/pull/54.patch"},"state":"open","milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/23968f0ca75b13463d2db5343e5c2096?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"23968f0ca75b13463d2db5343e5c2096","url":"https://api.github.com/users/felixge","login":"felixge","id":15000},"labels":[],"updated_at":"2011-11-18T08:03:07Z","assignee":null,"comments":4,"closed_at":null,"url":"https://api.github.com/repos/cjohansen/Sinon.JS/issues/54","body":"This is incredibly useful if you work with named constructors and\r\nprototype methods.\r\n\r\nAll my classes look like this:\r\n\r\n```js\r\nfunction MyClass() {}\r\n\r\nMyClass.prototype.myFunc = function() {};\r\n```\r\n\r\nWithout this patch `sinon.stub(new MyClass)` does not stub my prototype methods.\r\n\r\nLet me know what you think!","html_url":"https://github.com/cjohansen/Sinon.JS/issues/54","title":"Make stub work for prototype methods","number":54,"id":2266447,"created_at":"2011-11-17T08:35:25Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/6e7ddb6784d284c385f3f0f307ebf90d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"6e7ddb6784d284c385f3f0f307ebf90d","url":"https://api.github.com/users/cjohansen","login":"cjohansen","id":32871},"updated_at":"2011-11-18T08:03:07Z","url":"https://api.github.com/repos/cjohansen/Sinon.JS/issues/comments/2786756","body":"I think I agree. I'm not entirely sure why the hasOwnProperty check is in there. What I don't want Sinon to do is to fake non-existing properties (i.e. `sinon.stub(obj, \"nonExistentProperty\")`). I don't actually mind faking inherited methods.\r\n\r\nPull out the filter, and I'll pull it!","id":2786756,"created_at":"2011-11-18T08:03:07Z"}}