[Bug 23853] Please clarify the interpretation of the WebIDL undefined Date in the File constructor

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23853

--- Comment #5 from Boris Zbarsky <bzbarsky@mit.edu> ---
> So "lastModifiedDate" would return a... number?

Yes.  Number of milliseconds since the epoch. 

I don't have strong feelings about naming it.

> Am I wrong?

You are.  The relevant spec here is http://heycam.github.io/webidl/#es-Date and
in particular this bit:

  Otherwise, return a newly constructed ECMAScript Date object that represents
  the same millisecond as V.

so if you have IDL saying your return value is a Date, you get a new Date
object every time.

Has to be done this way, because if the same object were returned every time
the page could directly mutate the lastModifiedDate of the file by doing things
like:

  file.lastModifiedDate.setFullYear(1999);

or whatnot, no?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 18 November 2013 18:06:38 UTC