Run `hasOwnProperty` on object

If run on global object, it will throw error in older browsers like IE8.