Isn’t the name of that operation misleading? How about the following changes?
Rename CreateFromConstructor to CreateViaCreateAction.
Throw an exception in step 3.
CreateFromConstructor is only used in two locations:
7.3.18 Construct (F, argumentsList)
Change step 2 so that CreateViaCreateAction is called if F has a property [[CreateAction]] and OrdinaryCreateFromConstructor otherwise.
25.4.1.6 NewPromiseCapability ( C )
CreateFromConstructor being used here effectively means that you must subclass Promise (the note sounds like that is desired). CreatePromiseCapabilityRecord re-implements the constructor protocol. I’d prefer it if that duplication of functionality didn’t happen and (e.g.) Construct() could be used, but that may be too complicated a change.
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-createfromconstructor <https://people.mozilla.org/~jorendorff/es6-draft.html#sec-createfromconstructor>
Isn’t the name of that operation misleading? How about the following changes?
* Rename `CreateFromConstructor` to `CreateViaCreateAction`.
* Throw an exception in step 3.
CreateFromConstructor is only used in two locations:
* 7.3.18 Construct (F, argumentsList)
* Change step 2 so that `CreateViaCreateAction` is called if `F` has a property `[[CreateAction]]` and `OrdinaryCreateFromConstructor` otherwise.
* 25.4.1.6 NewPromiseCapability ( C )
* `CreateFromConstructor` being used here effectively means that you must subclass `Promise` (the note sounds like that is desired). `CreatePromiseCapabilityRecord` re-implements the constructor protocol. I’d prefer it if that duplication of functionality didn’t happen and (e.g.) `Construct()` could be used, but that may be too complicated a change.
--
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141102/e476cb10/attachment.html>
people.mozilla.org/~jorendorff/es6-draft.html#sec-createfromconstructor, people.mozilla.org/~jorendorff/es6-draft.html#sec-createfromconstructor
Isn’t the name of that operation misleading? How about the following changes?
CreateFromConstructor
toCreateViaCreateAction
.CreateFromConstructor is only used in two locations:
CreateViaCreateAction
is called ifF
has a property[[CreateAction]]
andOrdinaryCreateFromConstructor
otherwise.CreateFromConstructor
being used here effectively means that you must subclassPromise
(the note sounds like that is desired).CreatePromiseCapabilityRecord
re-implements the constructor protocol. I’d prefer it if that duplication of functionality didn’t happen and (e.g.)Construct()
could be used, but that may be too complicated a change.