Comparing version 1.4.2 to 1.4.3
{ | ||
"name": "when", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"description": "A lightweight Promise and when() implementation, plus other async goodies.", | ||
@@ -5,0 +5,0 @@ "keywords": ["promises", "when", "async", "cujo"], |
@@ -12,2 +12,6 @@ # when.js [![Build Status](https://secure.travis-ci.org/cujojs/when.png)](http://travis-ci.org/cujojs/when) | ||
### 1.4.3 | ||
* Fix for infinite promise coercion between when.js and Q (See [#50](https://github.com/cujojs/when/issues/50)). Thanks [@kriskowal](https://github.com/kriskowal) and [@domenic](https://github.com/domenic) | ||
### 1.4.2 | ||
@@ -14,0 +18,0 @@ |
18
when.js
@@ -10,3 +10,3 @@ /** @license MIT License (c) copyright B Cavalier & J Hann */ | ||
* | ||
* @version 1.4.2 | ||
* @version 1.4.3 | ||
*/ | ||
@@ -83,2 +83,13 @@ | ||
// Some promises, particularly Q promises, provide a valueOf method that | ||
// attempts to synchronously return the fulfilled value of the promise, or | ||
// returns the unresolved promise itself. Attempting to break a fulfillment | ||
// value out of a promise appears to be necessary to break cycles between | ||
// Q and When attempting to coerce each-other's promises in an infinite loop. | ||
// For promises that do not implement "valueOf", the Object#valueOf is harmless. | ||
// See: https://github.com/kriskowal/q/issues/106 | ||
if (promiseOrValue != null && typeof promiseOrValue.valueOf === "function") { | ||
promiseOrValue = promiseOrValue.valueOf(); | ||
} | ||
if(isPromise(promiseOrValue)) { | ||
@@ -701,3 +712,6 @@ // It looks like a thenable, but we don't know where it came from, | ||
i = 0; | ||
arr = new Object(this); | ||
// This generates a jshint warning, despite being valid | ||
// "Missing 'new' prefix when invoking a constructor." | ||
// See https://github.com/jshint/jshint/issues/392 | ||
arr = Object(this); | ||
len = arr.length >>> 0; | ||
@@ -704,0 +718,0 @@ args = arguments; |
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
97
47493
12
1138