Brendan Eich wrote:
> On Sep 26, 2009, at 6:08 PM, Maciej Stachowiak wrote:
> 
>> This may provide a way to implement some of these behaviors in pure
>> ECMAScript. The current proposal does allow [[Construct]] without
>> [[Call]], but not [[Call]] and [[Construct]] that both exist but with
>> different behavior.
> 
> Date needs the latter.

That can already be done in ES5. As I've previously suggested:

  function Date(yearOrValue, month, date, hours, minutes, seconds, ms) {
    "use strict";
    if (this === undefined) {
      return TimeToString(CurrentTime());
    }
    // constructor behaviour
    ...
  }

-- 
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to