This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16607 - Errors in type conversion to nullable types
Summary: Errors in type conversion to nullable types
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-03 09:33 UTC by Ms2ger
Modified: 2012-04-06 08:50 UTC (History)
2 users (show)

See Also:


Attachments

Description Ms2ger 2012-04-03 09:33:38 UTC
The first step is

1. If V is undefined and the IDL type being converted to is DOMString?,
   then:
   1. If the conversion to an IDL value is being performed due to any
      of the following:
      ([TreatUndefinedAs])
      then:
      (do stuff)
2. Otherwise...

Which means nothing happens if [TreatUndefinedAs] isn't present; to allow for fallback, it should say something more like

1. If V is undefined, the IDL type being converted to is DOMString?, and
   the conversion to an IDL value is being performed due to any of the
   following, then:
   (do stuff)
2. Otherwise...


Step 1.1, first bullet: "V is being passed as an operation argument that is annotated with the [TreatUndefinedAs],": s/the//


Step 2: "Otherwise, if the result of calling IsCallable(V) is true, then:" s/true/false/. Also, the same error as in step 1. (Note that this special case reinforces my points about TreatNonCallableAsNull.)
Comment 1 Cameron McCormack 2012-04-06 01:32:09 UTC
(In reply to comment #0)
> Which means nothing happens if [TreatUndefinedAs] isn't present; to allow for
> fallback, it should say something more like
> 
> 1. If V is undefined, the IDL type being converted to is DOMString?, and
>    the conversion to an IDL value is being performed due to any of the
>    following, then:
>    (do stuff)
> 2. Otherwise...

Ah yes, good catch.

> Step 1.1, first bullet: "V is being passed as an operation argument that is
> annotated with the [TreatUndefinedAs],": s/the//

Fixed.

> Step 2: "Otherwise, if the result of calling IsCallable(V) is true, then:"
> s/true/false/.

Fixed.

> Also, the same error as in step 1.

Fixed.

> (Note that this special case reinforces my points about
> TreatNonCallableAsNull.)

Don't understand this, sorry.  Just that this is a special case, and we should try to minimise the number of special cases?
Comment 2 Ms2ger 2012-04-06 08:50:57 UTC
Thanks.