Given: var event = document.createEvent('Event'); JSON.stringify(Object.getOwnPropertyDescriptor(event, 'currentTarget')) returns {"value":null,"writable":true,"enumerable":true,"configurable":true} But the Event.idl file says readonly attribute EventTarget currentTarget; Safari + JSC returns {"value":null,"writable":false,"enumerable":true,"configurable":false}
Rico did a lot of work on getOwnPropertyDescriptor, so he is probably the best guy to solve it. Alas, we have two options to control not-writeability of API callbacks (currentTarget is API callback that is thing like getter where getter is implemented in C++): property attributes and absence of a setter. Currently v8 believes into attributes (see src/runtime.cc ln. 77 as of bleeding edge@63542) while DOM bindings use missing setter (see third_party/WebKit/WebCore/bindings/scripts/CodeGeneratorV8.pm, ln. 1535 as of @70305). If memory serves, v8 treats callback properties without setter as readonly anyway (at least it ignores any attempts to write, but we need to double check how it correlates with const), so I think the problem should be fixed on v8 part (checking if a setter is missing). Rico, any thoughts? Erik, this issue doesn't look of very high priority and could probably wait a bit (Rico is on paternity leave). And I cannot just cc Rico, so I am forwarding this bug to him cc'ing this bug cc list instead.
Note that per bug 49739 these attributes should be on Event.prototype. But the bug is still valid re: writable: true, configurable: true being invalid.
Actually, per the Web IDL working draft <http://www.w3.org/TR/2010/WD-WebIDL-20101021/#es-attributes> readonly attributes should be attribute getters and setters.
*** Bug 71113 has been marked as a duplicate of this bug. ***
V8 is gone