You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.2.4 onFulfilled or onRejected must not be called until the execution context stack contains only platform code
3.1 Here “platform code” means engine, environment, and promise implementation code. In practice, this requirement ensures that onFulfilled and onRejected execute asynchronously, after the event loop turn in which then is called, and with a fresh stack. This can be implemented with either a “macro-task” mechanism such as setTimeout or setImmediate, or with a “micro-task” mechanism such as MutationObserver or process.nextTick. Since the promise implementation is considered platform code, it may itself contain a task-scheduling queue or “trampoline” in which the handlers are called.
But I can't get it passing this promises aplus test. I am using the bog standard JavaScript Promises library (which on its own passes the tests) documented at ...
There seems to be a lot of talk on the Internet but not many code examples of how to comply. Can anyone provide a code sample please on how to satisfy this test and how you would use nextTick or another suitable solution?
Worthing mentioning I have another call to reject within an HTTP error handler within the executor function;
Many thanks
The text was updated successfully, but these errors were encountered:
I am writing an HTTP Promises package for nodeJS. I need it to be promises aplus compliant. I am using promises-aplus-tests - https://www.npmjs.com/package/promises-aplus-tests
I have created an adapter as follows ..
My tests are failin on https://promisesaplus.com/#point-34 ... with further help on https://promisesaplus.com/#point-67
But I can't get it passing this promises aplus test. I am using the bog standard JavaScript Promises library (which on its own passes the tests) documented at ...
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise
new Promise(executor);
new Promise(function(resolve, reject) { ... });
In the executor I have tried ...
and also ...
There seems to be a lot of talk on the Internet but not many code examples of how to comply. Can anyone provide a code sample please on how to satisfy this test and how you would use nextTick or another suitable solution?
Worthing mentioning I have another call to reject within an HTTP error handler within the executor function;
Many thanks
The text was updated successfully, but these errors were encountered: