Closed domenic closed 11 years ago
When I brought this up with Allen, he was okay with not everything mapping to [[Invoke]]. Seemed weird to me to have a non-primitive as trap.
I guess most traps are non-primitives in a way.
@domenic We should only use [[Invoke]] for unconditional method calls. It is only observable when the unconditional method call is to an object whose type is not already known by the logic of the promise spec, such that it might be a proxy. Note that invoking a thenable's .then doesn't apply because that isn't unconditional, so it must be coded as a [[Get]] followed by a [[Call]] anyway. Invoking a known-promise's .then using [[Invoke]] is perhaps good style, but isn't observably different since we know it isn't a proxy.
So where would this make an observable difference? If none, we can leave the stylistic cleanup to tc39 separately, since it would cause no incompatibility with this spec.
@annevk Yes, primitive traps are known as "fundamental traps". The others are known as "derived traps".
@erights yeah, but the linked es-discuss thread keeps floating ideas for some new trap or similar that handles the conditional invocation case. I guess we could close this pending any outcome there.
Yes. I just had a long chat with @tvcutsem and we convinced each other that the status quo on [[Invoke]] is superior to all the alternative discussed on es-discuss as well as all the alternatives we privately discussed. This doesn't mean it is settled yet. Tom will be making our arguments soon on es-discuss. But let's assume the status quo on [[Invoke]] until a dramatic surprise to the contrary.
Given that [[Invoke]] is assumed to be only unconditional, in the absence of any observable difference, I am closing this.
http://esdiscuss.org/topic/invoke-and-implicit-method-calls