[Webkit-unassigned] [Bug 31683] New: JSC bindings for HasIndexGetter generates incorrect code.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Nov 19 13:51:23 PST 2009
https://bugs.webkit.org/show_bug.cgi?id=31683
Summary: JSC bindings for HasIndexGetter generates incorrect
code.
Product: WebKit
Version: 528+ (Nightly build)
Platform: PC
OS/Version: Mac OS X 10.5
Status: NEW
Severity: Normal
Priority: P2
Component: WebCore JavaScript
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: arv at chromium.org
CC: sam at webkit.org
When the IDL has an index getter that is also set to convert null strings we
return undefined even though we should return null.
This happens with MediaList.idl and CSSStyleDeclaration.idl
The generated code looks like this:
bool ok;
unsigned index = propertyName.toUInt32(&ok, false);
if (ok && index < static_cast<MediaList*>(impl())->length()) {
slot.setCustomIndex(this, index, indexGetter);
return true;
}
return getStaticValueSlot<JSMediaList, Base>(exec, &JSMediaListTable, this,
propertyName, slot);
http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html#StyleSheets-MediaList
says this about item
Returns the indexth in the list. If index is greater than or equal to the
number of media in the list, this returns null.
One way to solve this is to always call the index getter if |ok| is true but
that might expose bugs in the existing code. Another option is to not check the
length if ConvertNullStringTo is present. That will solve my cases but it feels
a bit hacky.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list