[Webkit-unassigned] [Bug 85326] WebIDL: overloaded methods prevent number -> string conversion

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 19 12:03:00 PDT 2012


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





--- Comment #2 from Joshua Bell <jsbell at chromium.org>  2012-07-19 12:02:59 PST ---
In lieu of implementing http://dev.w3.org/2006/webapi/WebIDL/#dfn-overload-resolution-algorithm we could:

* Enable StrictTypeChecking as a parameter attribute
* Mark existing overload DOMString parameters with [StrictTypeChecking]
* Change (using V8 as example) GenerateParametersCheckExpression:

old:
        if ($codeGenerator->IsStringType($type)) {
            push(@andExpression, "(${value}->IsNull() || ${value}->IsUndefined() || ${value}->IsString() || ${value}->IsObject())");

new:
        if ($codeGenerator->IsStringType($type)) {
            if ($parameter->extendedAttributes->{"StrictTypeChecking"}) {
                push(@andExpression, "(${value}->IsNull() || ${value}->IsUndefined() || ${value}->IsString() || ${value}->IsObject())");

This would get us the "anything can coerce to DOMString" behavior that non-overloaded methods have. This isn't urgent - we work around this in IndexedDB by having duplicate overloads for e.g. numbers and strings; it just multiplies the number of overloads in the IDL and impl which is a maintenance issue.

-- 
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