Brendan Eich (2013-07-16T23:56:03.000Z)
domenic at domenicdenicola.com (2013-07-18T16:32:37.604Z)
Brandon Benvie wrote: > I wonder if the current spec language is a remnant of before @@create > was added to the spec. It should be possible to detect when the > constructors are called with a receiver that is not an initializing > instance and simply create a new instance. Pseudo code: > > ```js > function Map(...args){ > if (!IsObject(this) || !%HasMapData(this)) { > // got a primitive, the global object, or some random object like from `Map.call({})` > return new Map(...args); > } else if (!%IsInitializedMap(this)) { > ``` Nit: else after return ;-). More substantive: Mark's suggestion seems better because it throws on random wrong this but supports strict calls by unqualified name.