Use hasOwnProperty instead of 'key in obj'

Change-Id: I1c558388505a902d5b048f51d551c7ec09742c2b
Merge "Use hasOwnProperty instead of 'key in obj'"