Closed domenic closed 10 years ago
@allenwb, what do you think of the above strategy ("For example... perhaps we associate...")? Alternately, could I just assign new internal data properties to the thenables, i.e. Upon learning more about internal data properties that seems like a really dumb idea, nevermind.thenable.[[Promise]]
? I don't think anything else in the spec does that, but I think it would be the same...
Closing in favor of the work going on in #62. See https://github.com/domenic/promises-unwrapping/tree/bring-back-thenable-coercions#the-thenable-coercions-weak-map for my new take on how to specify this. I anticipate using the caller function's [[Realm]] internal property as the first argument to ThenableCoercionsGet/ThenableCoercionsSet.
The ES-type notation at the very least is not going to fly. It might suffice to just define three abstract operations,
ThenableCoercionsHas(thenable)
,ThenableCoercionsGet(thenable)
, andThenableCoercionsSet(thenable, promise)
.Specifying their behavior also needs to get a bit better. For example, it should probably be a per-realm weak map. Perhaps we associate a
%ThenableCoercions% intrinsic to the realm's global, then treat it like a[[ThenableCoercions]]
internal property[[WeakMapData]]
.The actual weakness can be explained in a line or two of prose referring to weak map objects.