archives

« Bugzilla Issues Index

#2719 — 7.5.3 PromiseOf: Apply same optimization as in Promise.resolve?


7.5.3 PromiseOf (value) Abstaction Operation.

The NOTE describes PromiseOf to be functionally equivalent to Promise.resolve, but Promise.resolve does the same Promise constructor optimization which is not performed in PromiseOf.
Does this optimization also need to be applied to PromiseOf? Or does the note need to be updated?


fixed in rev25 editor's draft

non of the internal uses of PromiseOf should be passing a Promise as the argument to PromiseOf. Added an assert concerning this to PromiseOf


(In reply to comment #1)
> non of the internal uses of PromiseOf should be passing a Promise as the
> argument to PromiseOf. Added an assert concerning this to PromiseOf

What about 26.3.3.11 Reflect.Loader.prototype.module? The input argument "source" is directly passed to PromiseOf.

Test case: https://github.com/anba/es6draft/blob/master/src/test/scripts/suite/regress/bug2719.js


maybe, but I don't consider any of the module loader stuff to be final enough to really draw any conclusions from it. If it really can be a promise and that's the only case where that occurs. I may do a IsPromise check in Module.

I'll eave this bug open as a reminder to come back and check it after some module progress.


PromiseOf is long gone.