This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
If it is intended that WebIDL readonly attribute keyword be mapped to the ECMAScript ReadOnly property attribute, then it should say so. Specifically, it should permit answering the question raised by what ECMAScript does for "It is language binding specific whether assignment is simply disallowed by the language, ignored or an exception is thrown."
This is perfectly well defined http://dev.w3.org/2006/webapi/WebIDL/#es-attributes which says that the property descriptor looks like this: { [[Get]]: G, [[Set]]: S, [[Enumerable]]: true, [[Configurable]]: configurable } where S is undefined if the attribute is readonly. So when you're setting a readonly attribute, you end up in ECMA-262 section 8.12.5, call [[CanPut]] which lands you in 8.12.4, get to step 2, IsAccessorDescriptor returns true in step 2a, desc.[[Set]] is undefined, so [[CanPut]] returns false. Back in [[Put]], this means that the set is silently ignored if "Throw" is false, otherwise a TypeError is thrown. If you care to unwind some more, basically in strict mode TypeError is thrown an otherwise the set silently does nothing. > mapped to the ECMAScript ReadOnly property attribute There is no such thing. There is a [[Writable]] property attribute, but it only applies to data descriptors, not accessor descriptors. Setting it in an accessor descriptor is an error.
(In reply to comment #1) > This is perfectly well defined > http://dev.w3.org/2006/webapi/WebIDL/#es-attributes which says that the > property descriptor looks like this: got it; thanks for deconstructing the flow; if i had searched for 'read only' instead of 'readonly' i would have found the paragraph at the end of 4.4.6: "Note that attempting to assign to a property corresponding to a read only attribute ..." > > > mapped to the ECMAScript ReadOnly property attribute > > There is no such thing. There is if one is reading EMCA-262 3rd Ed. Now that I see WebIDL references 5.1 Ed, I see that property attribute has been removed.