[whatwg] Spec for location object needs to make some properties unforgeable; need supporting WebIDL changes

Boris Zbarsky bzbarsky at MIT.EDU
Tue Sep 25 18:16:13 PDT 2012


On 9/25/12 7:58 PM, Cameron McCormack wrote:
> OK.  I propose then that we allow [Unforgeable] on the interface, which
> means:
>
> * attributes get own, non-configurable accessor properties (with setters
> if they are not readonly attributes), and no property on the prototype
> * operations get own, non-configurable, non-writable properties, and no
> property on the prototype
> * the stringifier gets an own, non-configurable, non-writable toString
> property, and no property on the prototype
> * there is an own, non-configurable, non-writable valueOf property that
> just returns this

I can live with this, but why is this better than just allowing 
[Unforgeable] on all operations and attributes and defining an "object 
valueOf(); /* returns self */ " on Location?

> This would make Location.prototype empty.  Is that OK?

It seems to already be empty in Chrome, unless I screwed up my testing. 
  And maybe in IE.  Location.prototype per se doesn't even exist in 
Safari, iirc, though location.__proto__ is nonempty...

So yeah, I think it would be OK.

-Boris




More information about the whatwg mailing list