Comments (9)
It should be 'bar', based on ES6 promise specs and the draft for promises/A+ - constructors, however, this isn't actually specified by promises/A+ because promises/A+ only specifies the behavior of .then
. If all you specify is the behavior of .then
, it is impossible to distinguish between the two options. That's why this test suite probably doesn't check that case.
from promises-tests.
@ForbesLindesay well, I think it can be specified if the spec defines the interaction between the resolution process and the promise status changes (say from pending to fulfill)
from promises-tests.
Yeah, this seems more related to the fact that Promises/A+ doesn't define how promises must relate to each other. E.g. you could envision a 1.2 revision that had something like:
"If promise A is fulfilled before promise B, then all of promise A's handlers must be called before promise B's handlers"
or something. The constructor spec would define how/when promise A or promise B can be fulfilled.
from promises-tests.
I'm going to rename this issue to be a bit more descriptive and tag it/milestone it. We may want to consider a 1.2.
from promises-tests.
@lgalfaso That resolution process is not defining the resolve
method, it is defining the internal process undertaken when a promise is returned from .then
. It is not possible to return two values from a function, so I don't think this case can ever occur like that.
from promises-tests.
@domenic I think we really need to get the constructors spec finished, then we can just point to it and say "this is covered by the Promises/A+ Constructors spec (and corresponding tests)". I don't think this case is about the ordering of promise resolution as you suggest, because in the example, that order is fully deterined. p1 is first made to follow p2, then p2 is fulfilled, then p1 is fulfilled because it is following p2. The second call to p1.resolve is ignored, according to the constructor spec, but I don't think you can specify that it should be ignored within the confines of only specifying the behavior of .then
.
from promises-tests.
@ForbesLindesay you are right. We don't really specify the ordering of handlers, but this particular issue is indeed about whether the second call should be ignored or not.
from promises-tests.
I also don't see how we could specify the ordering of handlers when given two different promise implementations. We could consider doing so within a given implementation I suppose, but I'm not sure it has that much value.
from promises-tests.
Thanks for the info and as long as it is known that it is undefined what the behavior should be, then I am ok
from promises-tests.
Related Issues (20)
- 2.2.2.2 fails when resolving synchronously outside of .then's event-loop-turn HOT 12
- Help wanted: Own tests or promises-tests tests? HOT 4
- Test suite passes even if clause 2.3.2 is not implemented HOT 1
- Add test case for very nested promises HOT 1
- mocha test runner failures HOT 7
- Add tests for Promise.all and Promise.race. HOT 1
- Can you assist me in satisfying promises aplus spec 2.2.4 in NodeJS? HOT 2
- How to run tests at requirebin?
- "just create a pull request" HOT 2
- Allow to specify the timeout HOT 3
- Promise.prototype.finally tests HOT 1
- resolve then reject miss test case
- 2.3.3 numberOfTimesThenWasRetrieved should not increment in then getter HOT 1
- Please create 1.x branch
- is it still useful? HOT 5
- NPM complains about security issues HOT 1
- RFE: Clarify intent re resolve(promise) HOT 1
- 2.3.3.js `x` is an object with normal Object.prototype
- Error `require`ing adapter file D:\my-promise\my-promise.js HOT 1
- what the purpose of these code is in file 2.1.2.js?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from promises-tests.