Comparing version 3.2.0 to 3.2.1
@@ -69,3 +69,3 @@ /** @license MIT License (c) copyright 2010-2014 original author or authors */ | ||
if(s === '[object Object]' && typeof JSON !== 'undefined') { | ||
s = JSON.stringify(e); | ||
s = tryStringify(e, s); | ||
} | ||
@@ -75,3 +75,11 @@ } | ||
return e instanceof Error ? s : s + ' (WARNING: non-Error used)'; | ||
} | ||
function tryStringify(e, defaultValue) { | ||
try { | ||
return JSON.stringify(e); | ||
} catch(e) { | ||
// Ignore. Cannot JSON.stringify e, stick with String(e) | ||
return defaultValue; | ||
} | ||
} | ||
@@ -78,0 +86,0 @@ |
@@ -233,8 +233,7 @@ /** @license MIT License (c) copyright 2010-2014 original author or authors */ | ||
var resolver = new DeferredHandler(); | ||
var len = promises.length >>> 0; | ||
var pending = len; | ||
var results = []; | ||
var pending = promises.length >>> 0; | ||
var results = new Array(pending); | ||
var i, h, x; | ||
for (i = 0; i < len; ++i) { | ||
for (i = 0; i < promises.length; ++i) { | ||
x = promises[i]; | ||
@@ -258,3 +257,3 @@ | ||
} else { | ||
h.chain(resolver, void 0, resolver.reject); | ||
resolver.reject(h.value); | ||
break; | ||
@@ -261,0 +260,0 @@ } |
@@ -74,3 +74,8 @@ /** @license MIT License (c) copyright 2010-2014 original author or authors */ | ||
log = warn = function (x) { | ||
console.log(typeof x === 'string' ? x : JSON.stringify(x)); | ||
if(typeof x !== 'string') { | ||
try { | ||
x = JSON.stringify(x); | ||
} catch(e) {} | ||
} | ||
console.log(x); | ||
}; | ||
@@ -77,0 +82,0 @@ } |
{ | ||
"name": "when", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"description": "A lightweight Promises/A+ and when() implementation, plus other async goodies.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -8,3 +8,3 @@ /** @license MIT License (c) copyright 2010-2014 original author or authors */ | ||
* @author John Hann | ||
* @version 3.2.0 | ||
* @version 3.2.1 | ||
*/ | ||
@@ -11,0 +11,0 @@ (function(define) { 'use strict'; |
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
140947
4175