chemdemo / promisea Goto Github PK
View Code? Open in Web Editor NEWA simple Promises/A+ implementation.
A simple Promises/A+ implementation.
It seems it can't pass the tests of all.js.
/promiseA/lib/Promise.js:133
p.then(function(v) {
^
TypeError: Cannot call method 'then' of undefined
function resolvePromise(promise1, promise2) {
var status = promise2.status;
if('pending' === status) {
promise2.then(promise1.resolve.bind(promise1), promise1.reject.bind(promise1));
}
if('resolved' === status) promise1.resolve(promise2.value);
if('rejected' === status) promise1.reject(promise2.reason);
return promise;
};
the return value is undefined;
And what's more ,could you please explain the code to me. Because It seems hard to me . Thank u .
==最近在研究博主你的这个promise。貌似第172行,console没有去掉==提醒下
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.