馬老師數(shù)據(jù)結(jié)構(gòu)與算法
const reject = (reason) => {
? ? ?this.#status = 'rejected';
? ? ?const f1f2 = this.queue.shift();
? ? ?if (!f1f2 || !f1f2[1]) return;
? ? ?const x = f1f2[1].call(undefined, reason);
? ? ?if (x instanceof Promise2) {
? ? ? ?x.then(data => resolve(data), reason => reject(reason));
? ? ?} else {
? ? ? ?resolve(x);
? ? ?}
標(biāo)簽: