Standard builtins' prototypes and toString
Mark S. Miller
erights at google.com
Thu Jun 12 09:08:13 PDT 2014
If Date.prototype is a Date, then we need additional special logic to
ensure that freezing it actually makes it immutable. Otherwise, we have a
hard to plug global communications channel. This was the reason why
RegExp.prototype.compile had an [[Extensible]] check, and why we can remove
the check if RegExp.prototype is no longer a RegExp.
On Thu, Jun 12, 2014 at 8:57 AM, Erik Arvidsson <erik.arvidsson at gmail.com>
wrote:
> On Thu Jun 12 2014 at 11:28:12 AM, C. Scott Ananian <ecmascript at cscott.net>
> wrote:
>
>> It would be slightly more "JavaScripty" to have
>> Date.prototype.[[DateValue]] exist, and be set to the epoch or some
>> such.
>>
>
> +1
>
> 1. Let date be the this value.
> 2. If Type(date) is not Object then, throw a TypeError exception.
> 3. If date does not have a [[DateValue]] internal slot, then let tv be NaN
> 4. Else let tv be this time value.
> 5. Return ToDateString(tv).
>
> Allen, what is the benefit to do `super.toString()` instead?
>
>
>
>>
>> This problem actually seems to be an artifact of the way that
>> [[Construct]] works in ES6 -- but the takeaway is that prototypes of a
>> class are not themselves instances of the class. It's not surprising
>> that methods of the class thus don't work on the prototype. I'd vote
>> WONTFIX.
>> --scott
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
--
Cheers,
--MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140612/4972d6e6/attachment.html>
More information about the es-discuss
mailing list