But... why?
I mean, every constructor can determine if it is called without `new` (that "this instanceof" check on top of every other constructor). So `new` keyword can really be removed from everywhere except in constructors themselves.
Using `new` does create issues. For example, you can't write "new require('something').Constructor(blah)", and I don't even remember how to put brackets right.
Why make people use it?
20.08.2014, 18:27, "Andrea Giammarchi" <[email protected]>:
Yep, I was rather talking about a more generic approach with constructors, I've picked the wrong one for the example.Thanks for clarification,On Wed, Aug 20, 2014 at 2:56 PM, Boris Zbarsky <[email protected]> wrote:On 8/20/14, 9:45 AM, Andrea Giammarchi wrote:This won't work correctly, since 'p' won't have the right internal slots. So http://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise step 3 will throw.Alex I think the new direction is to throw whenever a constructor is
meant to be used as such. If you don't want to use new you can `var p =
Object.create(Promise.prototype); Promise.call(p, executor);`
-Boris
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

