Passing the wrong object to hasOwnProperty method.

The correct object is 'foo' but it was 'obj' instead.