W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2013

[Bug 21295] New: overload resolution: are DOMString and sequence<T> distinguishable now?

From: <bugzilla@jessica.w3.org>
Date: Thu, 14 Mar 2013 23:53:25 +0000
To: public-script-coord@w3.org
Message-ID: <bug-21295-3890@http.www.w3.org/Bugs/Public/>

            Bug ID: 21295
           Summary: overload resolution: are DOMString and sequence<T>
                    distinguishable now?
    Classification: Unclassified
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: WebIDL
          Assignee: cam@mcc.id.au
          Reporter: travil@microsoft.com
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, public-script-coord@w3.org

In the Screen Orientation spec:

the interface specifies an overload between a sequence<DOMString> and a

  boolean lockOrientation (DOMString orientation);
  boolean lockOrientation (sequence<DOMString> orientations);

So, when an implementation gets a DOMString as a parameter, I wondered how I
could tell whether I should apply the sequence<> conversion logic, or take the
DOMString as-is? 

The sequence<T> conversion logic would seem to take a DOMString "Hi", and per
section 4.2.24:

I'd fall through to the "Any kind of object except for a native Date object or
a native RegExp object" rule.

DOMString's have a length (2 in this case), so I'd end up either taking the
DOMString as is (one viable outcome) or converting the DOMString into ["H",
"i"] per 4.2.24 (equally valid outcome). 

I think that means that these two types are not distinguishable anymore?
Somehow I don't think that's the intent...

You are receiving this mail because:
You are on the CC list for the bug.
Received on Thursday, 14 March 2013 23:53:28 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:08 UTC