Comparing version 2.7.1 to 2.8.0
{ | ||
"name": "when", | ||
"main": "when.js", | ||
"version": "2.7.1", | ||
"version": "2.8.0", | ||
"description": "A lightweight Promises/A+ and when() implementation, plus other async goodies.", | ||
@@ -6,0 +6,0 @@ "keywords": ["Promises/A+", "promises-aplus", "promise", "promises", "deferred", "deferreds", "when", "async", "asynchronous", "cujo"], |
@@ -1,3 +0,7 @@ | ||
### 2.7.0 | ||
### 2.8.0 | ||
* Experimental [ES6 generator support](docs/api.md#es6-generators) via new `when/generator` module, with `lift`, `call`, `apply`. | ||
### 2.7.1 | ||
* Internal changes to reduce overall memory usage, along with minor performance improvements. | ||
@@ -4,0 +8,0 @@ |
@@ -56,3 +56,2 @@ /** @license MIT License (c) copyright 2010-2013 original author or authors */ | ||
if(this.key in promises) { | ||
try { | ||
@@ -59,0 +58,0 @@ throw new Error(reason && reason.message || reason); |
{ | ||
"name": "when", | ||
"version": "2.7.1", | ||
"version": "2.8.0", | ||
"description": "A lightweight Promises/A+ and when() implementation, plus other async goodies.", | ||
@@ -5,0 +5,0 @@ "keywords": ["Promises/A+", "promises-aplus", "promise", "promises", "deferred", "deferreds", "when", "async", "asynchronous", "cujo", "ender"], |
<a href="http://promises-aplus.github.com/promises-spec"><img src="http://promises-aplus.github.com/promises-spec/assets/logo-small.png" alt="Promises/A+ logo" align="right" /></a> | ||
[![Build Status](https://secure.travis-ci.org/cujojs/when.png)](http://travis-ci.org/cujojs/when) | ||
[![Build Status](https://travis-ci.org/cujojs/when.png?branch=master)](https://travis-ci.org/cujojs/when) | ||
@@ -5,0 +5,0 @@ # when.js |
28
when.js
@@ -12,3 +12,3 @@ /** @license MIT License (c) copyright 2011-2013 original author or authors */ | ||
* @author John Hann | ||
* @version 2.7.1 | ||
* @version 2.8.0 | ||
*/ | ||
@@ -126,4 +126,4 @@ (function(define) { 'use strict'; | ||
value = coerce(self, val); | ||
enqueue(function () { | ||
value = coerce(self, val); | ||
if(status) { | ||
@@ -283,8 +283,8 @@ updateStatus(value, status); | ||
* In contract to cast(x), this always creates a new Promise | ||
* @param {*} value | ||
* @param {*} x | ||
* @return {Promise} | ||
*/ | ||
function resolve(value) { | ||
function resolve(x) { | ||
return promise(function(resolve) { | ||
resolve(value); | ||
resolve(x); | ||
}); | ||
@@ -300,7 +300,9 @@ } | ||
* - promiseOrValue's reason after it is rejected | ||
* @param {*} promiseOrValue the rejected value of the returned {@link Promise} | ||
* @return {Promise} rejected {@link Promise} | ||
* @deprecated The behavior of when.reject in 3.0 will be to reject | ||
* with x VERBATIM | ||
* @param {*} x the rejected value of the returned promise | ||
* @return {Promise} rejected promise | ||
*/ | ||
function reject(promiseOrValue) { | ||
return when(promiseOrValue, function(e) { | ||
function reject(x) { | ||
return when(x, function(e) { | ||
return new RejectedPromise(e); | ||
@@ -413,3 +415,9 @@ }); | ||
return promise(function (resolve, reject) { | ||
fcall(untrustedThen, x, resolve, reject); | ||
enqueue(function() { | ||
try { | ||
fcall(untrustedThen, x, resolve, reject); | ||
} catch(e) { | ||
reject(e); | ||
} | ||
}); | ||
}); | ||
@@ -416,0 +424,0 @@ } |
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
122982
36
3049