Killing `Promise.fulfill`

Domenic Denicola domenic at
Wed Aug 21 19:13:12 PDT 2013

From: Tab Atkins Jr. [mailto:jackalmage at]

> Unless you wanted promise-likes to return fresh objects too? 

Yes, that is largely the use case for `Q`/``/whatever. Handing it untrusted input, possible a non-promise, possibly a promise-like, possibly a promise, and getting back a trusted promise.

> The only way to have a completely reliable type test is to use a WeakSet to keep track of instances

I believe this is what Mark's makeQ.js does.

> Do you consider WeakMaps sufficient for polyfillability?

I believe makeQ.js uses a WeakMap polyfill, so yes.

More information about the es-discuss mailing list