IsConstructor
C. Scott Ananian
ecmascript at cscott.net
Fri Jun 13 08:05:36 PDT 2014
On Fri, Jun 13, 2014 at 6:33 AM, Tom Van Cutsem <tomvc.be at gmail.com> wrote:
> Jason proposes:
> new C(...args) => C[Symbol.new](...args)
>
> Allen proposes:
> new C(...args) => C.apply(C[Symbol.create](), args)
Consider also the way the spec could read. For example, for the
'Error' object, instead of having "19.5.1.1 Error ( message )" and
"19.5.1.2 new Error ( ...argumentsList )", in Jason's formulation
section 19.5.1.2 would just be "Error[ @@new ]]", aka an ordinary
method definition. "If Error is implemented as an ECMAScript function
object, its inherited implementation of @@new will perform the above
steps."
--scott
More information about the es-discuss
mailing list