[Bug 25458] [Shadow]: The return type of Event.path should be EventTarget[], instead of NodeList

https://www.w3.org/Bugs/Public/show_bug.cgi?id=25458

--- Comment #9 from Boris Zbarsky <bzbarsky@mit.edu> ---
> this event listener should print the following as example:

If event.path is a frozen array, this event listener will throw an exception on
the "p.pop()" line.

> the current WebIDL implementation of blink for `readonly attribute T[]` behaves
> like that.

I'm not aware of Blink having any support for "attribute T[]" in IDL, readonly
or not.  What it does instead is fake it with interfaces with indexed
getters/setters.  For example, event.path in Blink is a NodeList.

That said Array.prototype.pop.call(someNonemptyNodeList), as currently specced,
would land us in http://heycam.github.io/webidl/#delete which would return
false, since there is no deleter defined.  And then
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-deletepropertyorthrow
would throw.  This is in fact what happens in Firefox, though Blink seems to
get this wrong.

And if Blink _did_ implement IDL arrays as currently specced for some reason,
then you'd land in http://heycam.github.io/webidl/#platform-array-object-delete
and once again throw, if the IDL array is not empty.

I have no idea where the "3" in your suggested log output came from, by the
way, unless you think event.path should return a new object on every get (so
that event.path == event.path always tests false)....

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 28 April 2014 07:25:08 UTC