Rick Waldron (2013-07-16T23:41:16.000Z)
On Tue, Jul 16, 2013 at 7:10 PM, Erik Arvidsson <erik.arvidsson at gmail.com>wrote:

> All of the new constructors, Map, Set, WeakMap and WeakSet should fail
> when called as a function unless `this` already has a certain internal
> property, ie [[MapData]]. This is so that sub classing works as
> expected.
>
> However, all JS engines that supports Map, Set and WeakMap are future
> hostile and they all return a new instance when called as a function.
> For example, here is the V8 code:
>
> function MapConstructor() {
>   if (%_IsConstructCall()) {
>     %MapInitialize(this);
>   } else {
>     return new $Map();
>   }
> }
>
> I understand that fully supporting @@create requires a lot of work but
> until then we should at least throw when called as function to allow
> us to get out of this mess eventually.
>

It's painful, but I agree. This will prevent a build up of incorrect code
that may hold @@create semantics hostage.

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130716/c796c8f0/attachment.html>
domenic at domenicdenicola.com (2013-07-18T16:30:55.602Z)
It's painful, but I agree. This will prevent a build up of incorrect code
that may hold @@create semantics hostage.