Comparing version 7.0.1 to 7.0.2
@@ -61,5 +61,5 @@ 'use strict'; | ||
} | ||
this._32 = 0; | ||
this._8 = null; | ||
this._89 = []; | ||
this._67 = 0; | ||
this._7 = null; | ||
this._20 = []; | ||
if (fn === noop) return; | ||
@@ -87,20 +87,20 @@ doResolve(fn, this); | ||
function handle(self, deferred) { | ||
while (self._32 === 3) { | ||
self = self._8; | ||
while (self._67 === 3) { | ||
self = self._7; | ||
} | ||
if (self._32 === 0) { | ||
self._89.push(deferred); | ||
if (self._67 === 0) { | ||
self._20.push(deferred); | ||
return; | ||
} | ||
asap(function() { | ||
var cb = self._32 === 1 ? deferred.onFulfilled : deferred.onRejected; | ||
var cb = self._67 === 1 ? deferred.onFulfilled : deferred.onRejected; | ||
if (cb === null) { | ||
if (self._32 === 1) { | ||
resolve(deferred.promise, self._8); | ||
if (self._67 === 1) { | ||
resolve(deferred.promise, self._7); | ||
} else { | ||
reject(deferred.promise, self._8); | ||
reject(deferred.promise, self._7); | ||
} | ||
return; | ||
} | ||
var ret = tryCallOne(cb, self._8); | ||
var ret = tryCallOne(cb, self._7); | ||
if (ret === IS_ERROR) { | ||
@@ -133,4 +133,4 @@ reject(deferred.promise, LAST_ERROR); | ||
) { | ||
self._32 = 3; | ||
self._8 = newValue; | ||
self._67 = 3; | ||
self._7 = newValue; | ||
finale(self); | ||
@@ -143,4 +143,4 @@ return; | ||
} | ||
self._32 = 1; | ||
self._8 = newValue; | ||
self._67 = 1; | ||
self._7 = newValue; | ||
finale(self); | ||
@@ -150,11 +150,11 @@ } | ||
function reject(self, newValue) { | ||
self._32 = 2; | ||
self._8 = newValue; | ||
self._67 = 2; | ||
self._7 = newValue; | ||
finale(self); | ||
} | ||
function finale(self) { | ||
for (var i = 0; i < self._89.length; i++) { | ||
handle(self, self._89[i]); | ||
for (var i = 0; i < self._20.length; i++) { | ||
handle(self, self._20[i]); | ||
} | ||
self._89 = null; | ||
self._20 = null; | ||
} | ||
@@ -161,0 +161,0 @@ |
@@ -21,4 +21,4 @@ 'use strict'; | ||
var p = new Promise(Promise._83); | ||
p._32 = 1; | ||
p._8 = value; | ||
p._67 = 1; | ||
p._7 = value; | ||
return p; | ||
@@ -60,7 +60,7 @@ } | ||
if (val instanceof Promise && val.then === Promise.prototype.then) { | ||
while (val._32 === 3) { | ||
val = val._8; | ||
while (val._67 === 3) { | ||
val = val._7; | ||
} | ||
if (val._32 === 1) return res(i, val._8); | ||
if (val._32 === 2) reject(val._8); | ||
if (val._67 === 1) return res(i, val._7); | ||
if (val._67 === 2) reject(val._7); | ||
val.then(function (val) { | ||
@@ -67,0 +67,0 @@ res(i, val); |
@@ -61,5 +61,5 @@ 'use strict'; | ||
} | ||
this._32 = 0; | ||
this._8 = null; | ||
this._89 = []; | ||
this._67 = 0; | ||
this._7 = null; | ||
this._20 = []; | ||
if (fn === noop) return; | ||
@@ -87,20 +87,20 @@ doResolve(fn, this); | ||
function handle(self, deferred) { | ||
while (self._32 === 3) { | ||
self = self._8; | ||
while (self._67 === 3) { | ||
self = self._7; | ||
} | ||
if (self._32 === 0) { | ||
self._89.push(deferred); | ||
if (self._67 === 0) { | ||
self._20.push(deferred); | ||
return; | ||
} | ||
asap(function() { | ||
var cb = self._32 === 1 ? deferred.onFulfilled : deferred.onRejected; | ||
var cb = self._67 === 1 ? deferred.onFulfilled : deferred.onRejected; | ||
if (cb === null) { | ||
if (self._32 === 1) { | ||
resolve(deferred.promise, self._8); | ||
if (self._67 === 1) { | ||
resolve(deferred.promise, self._7); | ||
} else { | ||
reject(deferred.promise, self._8); | ||
reject(deferred.promise, self._7); | ||
} | ||
return; | ||
} | ||
var ret = tryCallOne(cb, self._8); | ||
var ret = tryCallOne(cb, self._7); | ||
if (ret === IS_ERROR) { | ||
@@ -133,4 +133,4 @@ reject(deferred.promise, LAST_ERROR); | ||
) { | ||
self._32 = 3; | ||
self._8 = newValue; | ||
self._67 = 3; | ||
self._7 = newValue; | ||
finale(self); | ||
@@ -143,4 +143,4 @@ return; | ||
} | ||
self._32 = 1; | ||
self._8 = newValue; | ||
self._67 = 1; | ||
self._7 = newValue; | ||
finale(self); | ||
@@ -150,11 +150,11 @@ } | ||
function reject(self, newValue) { | ||
self._32 = 2; | ||
self._8 = newValue; | ||
self._67 = 2; | ||
self._7 = newValue; | ||
finale(self); | ||
} | ||
function finale(self) { | ||
for (var i = 0; i < self._89.length; i++) { | ||
handle(self, self._89[i]); | ||
for (var i = 0; i < self._20.length; i++) { | ||
handle(self, self._20[i]); | ||
} | ||
self._89 = null; | ||
self._20 = null; | ||
} | ||
@@ -161,0 +161,0 @@ |
@@ -21,4 +21,4 @@ 'use strict'; | ||
var p = new Promise(Promise._83); | ||
p._32 = 1; | ||
p._8 = value; | ||
p._67 = 1; | ||
p._7 = value; | ||
return p; | ||
@@ -60,7 +60,7 @@ } | ||
if (val instanceof Promise && val.then === Promise.prototype.then) { | ||
while (val._32 === 3) { | ||
val = val._8; | ||
while (val._67 === 3) { | ||
val = val._7; | ||
} | ||
if (val._32 === 1) return res(i, val._8); | ||
if (val._32 === 2) reject(val._8); | ||
if (val._67 === 1) return res(i, val._7); | ||
if (val._67 === 2) reject(val._7); | ||
val.then(function (val) { | ||
@@ -67,0 +67,0 @@ res(i, val); |
{ | ||
"name": "promise", | ||
"version": "7.0.1", | ||
"version": "7.0.2", | ||
"description": "Bare bones Promises/A+ implementation", | ||
@@ -33,4 +33,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"asap": "~2.0.1" | ||
"asap": "~2.0.3" | ||
} | ||
} |
@@ -104,2 +104,6 @@ <a href="https://promisesaplus.com/"><img src="https://promisesaplus.com/assets/logo-small.png" align="right" /></a> | ||
#### Promise.reject(value) | ||
Returns a rejected promise with the given value. | ||
#### Promise.all(array) | ||
@@ -106,0 +110,0 @@ |
@@ -61,5 +61,5 @@ 'use strict'; | ||
} | ||
this._32 = 0; | ||
this._8 = null; | ||
this._89 = []; | ||
this._67 = 0; | ||
this._7 = null; | ||
this._20 = []; | ||
if (fn === noop) return; | ||
@@ -87,20 +87,20 @@ doResolve(fn, this); | ||
function handle(self, deferred) { | ||
while (self._32 === 3) { | ||
self = self._8; | ||
while (self._67 === 3) { | ||
self = self._7; | ||
} | ||
if (self._32 === 0) { | ||
self._89.push(deferred); | ||
if (self._67 === 0) { | ||
self._20.push(deferred); | ||
return; | ||
} | ||
setImmediate(function() { | ||
var cb = self._32 === 1 ? deferred.onFulfilled : deferred.onRejected; | ||
var cb = self._67 === 1 ? deferred.onFulfilled : deferred.onRejected; | ||
if (cb === null) { | ||
if (self._32 === 1) { | ||
resolve(deferred.promise, self._8); | ||
if (self._67 === 1) { | ||
resolve(deferred.promise, self._7); | ||
} else { | ||
reject(deferred.promise, self._8); | ||
reject(deferred.promise, self._7); | ||
} | ||
return; | ||
} | ||
var ret = tryCallOne(cb, self._8); | ||
var ret = tryCallOne(cb, self._7); | ||
if (ret === IS_ERROR) { | ||
@@ -133,4 +133,4 @@ reject(deferred.promise, LAST_ERROR); | ||
) { | ||
self._32 = 3; | ||
self._8 = newValue; | ||
self._67 = 3; | ||
self._7 = newValue; | ||
finale(self); | ||
@@ -143,4 +143,4 @@ return; | ||
} | ||
self._32 = 1; | ||
self._8 = newValue; | ||
self._67 = 1; | ||
self._7 = newValue; | ||
finale(self); | ||
@@ -150,11 +150,11 @@ } | ||
function reject(self, newValue) { | ||
self._32 = 2; | ||
self._8 = newValue; | ||
self._67 = 2; | ||
self._7 = newValue; | ||
finale(self); | ||
} | ||
function finale(self) { | ||
for (var i = 0; i < self._89.length; i++) { | ||
handle(self, self._89[i]); | ||
for (var i = 0; i < self._20.length; i++) { | ||
handle(self, self._20[i]); | ||
} | ||
self._89 = null; | ||
self._20 = null; | ||
} | ||
@@ -161,0 +161,0 @@ |
@@ -21,4 +21,4 @@ 'use strict'; | ||
var p = new Promise(Promise._83); | ||
p._32 = 1; | ||
p._8 = value; | ||
p._67 = 1; | ||
p._7 = value; | ||
return p; | ||
@@ -60,7 +60,7 @@ } | ||
if (val instanceof Promise && val.then === Promise.prototype.then) { | ||
while (val._32 === 3) { | ||
val = val._8; | ||
while (val._67 === 3) { | ||
val = val._7; | ||
} | ||
if (val._32 === 1) return res(i, val._8); | ||
if (val._32 === 2) reject(val._8); | ||
if (val._67 === 1) return res(i, val._7); | ||
if (val._67 === 2) reject(val._7); | ||
val.then(function (val) { | ||
@@ -67,0 +67,0 @@ res(i, val); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
181651
202
0
Updatedasap@~2.0.3