[Webkit-unassigned] [Bug 148871] Indexing an object with an integer that is not a supported property index should not call the named property getter

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 23 16:14:11 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=148871

Chris Dumez <cdumez at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|form.elements should        |Indexing an object with an
                   |include elements whose name |integer that is not a
                   |starts with a number        |supported property index
                   |                            |should not call the named
                   |                            |property getter
                URL|                            |https://heycam.github.io/we
                   |                            |bidl/#idl-named-properties
             Status|NEW                         |ASSIGNED
           Assignee|webkit-unassigned at lists.web |cdumez at apple.com
                   |kit.org                     |

--- Comment #3 from Chris Dumez <cdumez at apple.com> ---
Note
Note that if an indexed property getter or setter is specified using an operation with an identifier, then indexing an object with an integer that is not a supported property index does not necessarily elicit the same behavior as invoking the operation with that index. The actual behavior in this case is language binding specific.

In the ECMAScript language binding, a regular property lookup is done. For example, take the following IDL:

IDL
interface A {
  getter DOMString toWord(unsigned long index);
};
Assume that an object implementing A has supported property indices in the range 0 ≤ index < 2. Also assume that toWord is defined to return its argument converted into an English word. The behavior when invoking the operation with an out of range index is different from indexing the object directly:

ECMAScript
var a = getA();

a.toWord(0);  // Evalautes to "zero".
a[0];         // Also evaluates to "zero".

a.toWord(5);  // Evaluates to "five".
a[5];         // Evaluates to undefined, since there is no property "5".

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20151023/0b1f5c10/attachment-0001.html>


More information about the webkit-unassigned mailing list