 <p>I'm thinking that since <code>window.location</code> is a host object, it does not obey "native" JS object semantics, and that's why you're having problems doing the same thing for <code>location</code> as you did with <code>foo</code>.</p> <p><a href="http://jibbering.com/faq/#nativeObject" rel="nofollow">http://jibbering.com/faq/#nativeObject</a></p>