Closed cscott closed 9 years ago
It'd be ideal to also check on #239 as part of this work.
Working on it right now (both this and #239, plus some incidental fixes to iterators).
@cscott there's another issue - see the tests in https://github.com/ljharb/es6-shim/commit/c29937b1e7da5a905e55369e97853cb3ef8a5c4c . It looks like our implementation (along with v8, Firefox, and JSC, whereas Bluebird passes) all fail these tests which are part of the spec. Mind taking a look at these too? :-)
Those tests don't look right to me at all. Can you point me at the upstream source for them?
In particular, the Promise Resolve function should execute the then
in a
PromiseResolveThenableJob, which means it should not be synchronous. Am
I misreading the spec?
You're correct - my initial commit was wrong, if you look at the latest one (comment has been updated) it tests that ".then" is called only once, as well as that the ".then" property is retrieved synchronously (es6-shim currently retrieves it asynchronously).
Fixed with 9542dda06c1812cefd14b5c6101a9f35ec1f2eda / #345
TC39 agreed to get rid of the hidden [[PromiseConstructor]] property from the spec and simplify Promise.resolve. The adopted proposal also makes
Promise.resolve
ignore "species":https://esdiscuss.org/topic/fixing-promise-resolve
Opening an issue to track es6-shim adopting the new semantics.