Summary: | Indexing an object with an integer that is not a supported property index should not call the named property getter | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ryosuke Niwa <rniwa> | ||||
Component: | Forms | Assignee: | Chris Dumez <cdumez> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | benjamin, cdumez, commit-queue, darin, ggaren, rniwa, sam, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
URL: | https://heycam.github.io/webidl/#idl-indexed-properties | ||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=153599 | ||||||
Attachments: |
|
Description
Ryosuke Niwa
2015-09-04 19:24:00 PDT
Both Firefox and Chrome pass this test. 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". Firefox and Chrome follow the Web IDL specification here. Created attachment 263986 [details]
Patch
Comment on attachment 263986 [details] Patch Clearing flags on attachment: 263986 Committed r191587: <http://trac.webkit.org/changeset/191587> All reviewed patches have been landed. Closing bug. |