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

[Bug 23532] Dealing with undefined

From: <bugzilla@jessica.w3.org>
Date: Wed, 23 Oct 2013 15:55:08 +0000
To: public-script-coord@w3.org
Message-ID: <bug-23532-3890-6vofveXj1t@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=23532

--- Comment #17 from Erik Arvidsson <arv@chromium.org> ---
I believe the rules in comment #0 are a bit too simplistic. For example passing
undefined to a required boolean parameter needs to coerce it to false.

I believe the following rules would work.

1. Treat all nullable and boolean trailing parameters as optional. If there are
optional parameters after a required parameter treat it as if it was optional.

  void foo(boolean b, optional T t)

would be treated as 

 void foo(optional boolean b = false, optional T t)

2. Treat all trailing nullable required parameters as optional, default to
null.
3. For nullable required parameters treat undefined as null.
4. For boolean required parameters treat undefined as false.
5. For other required parameters, undefined and missing is an error.
6. For other optional parameters, undefined triggers the default

I think this can be simplified further but the main point is that we should be
able to pass undefined to nullable and boolean parameters.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Wednesday, 23 October 2013 15:55:11 UTC

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