Promise() vs. new Promise()

C. Scott Ananian ecmascript at
Thu Aug 21 08:51:44 PDT 2014

On Thu, Aug 21, 2014 at 3:22 AM, Salvador de la Puente González
<salva at> wrote:
> The only problem I see here is you can not emulate completely `new` with ES.
> Why Promise add some internal slots when called with new and it does not
> make the same when writing `var p = Object.create(Promise.prototype);
>, fn);`?

Not true.  See, for example:

It's super-annoying, but you can actually write ES5 code that will
properly inherit the new internal slots in ES6.

I'm a big fan of ``, though.  And I think
`` is not all that terrible, if you want to
pass around a constructor as a function.  (And there's another
es-discuss thread about trying to unify `new` as an "ordinary"
function call in proxies as well.)


More information about the es-discuss mailing list