Bug 16539 - The undefined date type
The undefined date type
Status: RESOLVED INVALID
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL
unspecified
PC All
: P2 normal
: ---
Assigned To: Cameron McCormack
public-webapps-bugzilla
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-27 16:50 UTC by Marcos Caceres
Modified: 2012-03-30 18:55 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos Caceres 2012-03-27 16:50:56 UTC
in 4.2.26. Date, it sez: 

"If the time value of V is NaN, then return the undefined IDL Date value."

Does that mean "return undefined"? or "return new Date(undefined)"? or something else? 

It's not really clear to me how the following is represented:

"An additional value that this type can represent is one that indicates an indeterminate or undefined time, which we write as undefined."
Comment 1 Cameron McCormack 2012-03-27 23:07:29 UTC
This is the algorithm from converting from a JS value to an IDL value of type Date.  It doesn't mean "return undefined" or "return new Date(undefined)" -- it doesn't really make sense to think about returning JS values here.

The IDL Date type has values that correspond to all of the possibly time values that JS Date objects can represent, including the time value that does not represent a specific point in time (which in a JS Date object is one that could be created by for example evaluating `new Date("")`).  In space of IDL Date type values, I just call that value "undefined".