[strawman] Symbol.thenable proposal
ljharb at gmail.com
Fri Apr 13 20:20:08 UTC 2018
`await import(path)` wouldn't ever be able to do anything besides
Promise.resolve; I'm pretty confident that this proposal, or something like
it, is the only possibility to make ModuleRecords (for modules that export
a `then` function) not be considered thenable.
On Fri, Apr 13, 2018 at 8:02 AM, Guy Bedford <guybedford at gmail.com> wrote:
> It's worth noting that the driving use case here is coming from NodeJS
> development hitting issues where the guaranteed result for dynamic import
> resolution can't be assumed to be a module namespace, although please
> correct me if I'm wrong here Gus.
> Alternatively could this mitigation be handled by creating a
> `Promise.resolveStrict` primitive that explicitly opts-out of thenable
> resolution in the promise chain?
> I'd think we are getting further and further away now from third-party
> promise implementation interops, that such approaches might make sense to
> consider at this point, in the name of returning to more well-defined
> On Fri, Apr 13, 2018 at 3:33 AM Gus Caplan <me at gus.host> wrote:
>> Hello all,
>> In an effort to curtail the interesting behavior of Promise.resolve
>> with regard to dynamic import), I have created a proposal for a well-known
>> symbol which will allow an object to not be treated as a "thenable."
>> I am privy to the current protocol proposal which might be a better fit
>> this, but due to dynamic import already being stage 3, I don't feel we
>> wait for it to come to fruition.
>> Comments and suggestions are of course quite welcome at the repo .
>> : https://github.com/devsnek/proposal-symbol-thenable
>> es-discuss mailing list
>> es-discuss at mozilla.org
> es-discuss mailing list
> es-discuss at mozilla.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss