Comparing version 3.4.6 to 3.5.0
@@ -431,2 +431,3 @@ !function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.Promise=e():"undefined"!=typeof global?global.Promise=e():"undefined"!=typeof self&&(self.Promise=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
/** | ||
* @deprecated | ||
* Issue a progress event, notifying all progress listeners | ||
@@ -575,4 +576,3 @@ * @param {*} x progress event payload to pass to all listeners | ||
} else { | ||
unreportRemaining(promises, i+1, h); | ||
resolver.become(h); | ||
resolveAndObserveRemaining(promises, i+1, h, resolver); | ||
break; | ||
@@ -602,3 +602,5 @@ } | ||
function unreportRemaining(promises, start, rejectedHandler) { | ||
function resolveAndObserveRemaining(promises, start, handler, resolver) { | ||
resolver.become(handler); | ||
var i, h, x; | ||
@@ -609,4 +611,3 @@ for(i=start; i<promises.length; ++i) { | ||
h = getHandlerMaybeThenable(x); | ||
if(h !== rejectedHandler) { | ||
if(h !== handler) { | ||
h.visit(h, void 0, h._unreport); | ||
@@ -639,11 +640,19 @@ } | ||
var h = new Pending(); | ||
var i, x; | ||
var resolver = new Pending(); | ||
var i, x, h; | ||
for(i=0; i<promises.length; ++i) { | ||
x = promises[i]; | ||
if (x !== void 0 && i in promises) { | ||
getHandler(x).visit(h, h.resolve, h.reject); | ||
if (x === void 0 && !(i in promises)) { | ||
continue; | ||
} | ||
h = getHandler(x); | ||
if(h.state() !== 0) { | ||
resolveAndObserveRemaining(promises, i+1, h, resolver); | ||
break; | ||
} | ||
h.visit(resolver, resolver.resolve, resolver.reject); | ||
} | ||
return new Promise(Handler, h); | ||
return new Promise(Handler, resolver); | ||
} | ||
@@ -700,3 +709,3 @@ | ||
= Handler.prototype.become | ||
= Handler.prototype.notify | ||
= Handler.prototype.notify // deprecated | ||
= Handler.prototype.fail | ||
@@ -844,2 +853,5 @@ = Handler.prototype._unreport | ||
/** | ||
* @deprecated | ||
*/ | ||
Pending.prototype.notify = function(x) { | ||
@@ -1117,2 +1129,5 @@ if(!this.resolved) { | ||
/** | ||
* @deprecated | ||
*/ | ||
function runNotify(f, x, h, receiver, next) { | ||
@@ -1152,2 +1167,3 @@ if(typeof f !== 'function') { | ||
/** | ||
* @deprecated | ||
* Return f.call(thisArg, x), or if it throws, *return* the exception | ||
@@ -1185,2 +1201,6 @@ */ | ||
// Check for vertx environment by attempting to load vertx module. | ||
// Doing the check in two steps ensures compatibility with RaveJS, | ||
// which will return an empty module when browser: { vertx: false } | ||
// is set in package.json | ||
cjsRequire = require; | ||
@@ -1190,4 +1210,5 @@ | ||
vertx = cjsRequire('vertx'); | ||
} catch (e) { } | ||
} catch (ignored) {} | ||
// If vertx loaded and has the timer features we expect, try to support it | ||
if (vertx && typeof vertx.setTimer === 'function') { | ||
@@ -1194,0 +1215,0 @@ setTimer = function (f, ms) { return vertx.setTimer(ms, f); }; |
@@ -18,2 +18,3 @@ /** @license MIT License (c) copyright 2010-2014 original author or authors */ | ||
/** | ||
* @deprecated Use github.com/cujojs/most streams and most.iterate | ||
* Generate a (potentially infinite) stream of promised values: | ||
@@ -36,2 +37,3 @@ * x, f(x), f(f(x)), etc. until condition(x) returns true | ||
/** | ||
* @deprecated Use github.com/cujojs/most streams and most.unfold | ||
* Generate a (potentially infinite) stream of promised values | ||
@@ -38,0 +40,0 @@ * by applying handler(generator(seed)) iteratively until |
@@ -11,2 +11,3 @@ /** @license MIT License (c) copyright 2010-2014 original author or authors */ | ||
/** | ||
* @deprecated | ||
* Register a progress handler for this promise | ||
@@ -13,0 +14,0 @@ * @param {function} onProgress |
@@ -63,2 +63,3 @@ /** @license MIT License (c) copyright 2010-2014 original author or authors */ | ||
/** | ||
* @deprecated | ||
* Issue a progress event, notifying all progress listeners | ||
@@ -207,4 +208,3 @@ * @param {*} x progress event payload to pass to all listeners | ||
} else { | ||
unreportRemaining(promises, i+1, h); | ||
resolver.become(h); | ||
resolveAndObserveRemaining(promises, i+1, h, resolver); | ||
break; | ||
@@ -234,3 +234,5 @@ } | ||
function unreportRemaining(promises, start, rejectedHandler) { | ||
function resolveAndObserveRemaining(promises, start, handler, resolver) { | ||
resolver.become(handler); | ||
var i, h, x; | ||
@@ -241,4 +243,3 @@ for(i=start; i<promises.length; ++i) { | ||
h = getHandlerMaybeThenable(x); | ||
if(h !== rejectedHandler) { | ||
if(h !== handler) { | ||
h.visit(h, void 0, h._unreport); | ||
@@ -271,11 +272,19 @@ } | ||
var h = new Pending(); | ||
var i, x; | ||
var resolver = new Pending(); | ||
var i, x, h; | ||
for(i=0; i<promises.length; ++i) { | ||
x = promises[i]; | ||
if (x !== void 0 && i in promises) { | ||
getHandler(x).visit(h, h.resolve, h.reject); | ||
if (x === void 0 && !(i in promises)) { | ||
continue; | ||
} | ||
h = getHandler(x); | ||
if(h.state() !== 0) { | ||
resolveAndObserveRemaining(promises, i+1, h, resolver); | ||
break; | ||
} | ||
h.visit(resolver, resolver.resolve, resolver.reject); | ||
} | ||
return new Promise(Handler, h); | ||
return new Promise(Handler, resolver); | ||
} | ||
@@ -332,3 +341,3 @@ | ||
= Handler.prototype.become | ||
= Handler.prototype.notify | ||
= Handler.prototype.notify // deprecated | ||
= Handler.prototype.fail | ||
@@ -476,2 +485,5 @@ = Handler.prototype._unreport | ||
/** | ||
* @deprecated | ||
*/ | ||
Pending.prototype.notify = function(x) { | ||
@@ -749,2 +761,5 @@ if(!this.resolved) { | ||
/** | ||
* @deprecated | ||
*/ | ||
function runNotify(f, x, h, receiver, next) { | ||
@@ -784,2 +799,3 @@ if(typeof f !== 'function') { | ||
/** | ||
* @deprecated | ||
* Return f.call(thisArg, x), or if it throws, *return* the exception | ||
@@ -786,0 +802,0 @@ */ |
@@ -10,2 +10,6 @@ /** @license MIT License (c) copyright 2010-2014 original author or authors */ | ||
// Check for vertx environment by attempting to load vertx module. | ||
// Doing the check in two steps ensures compatibility with RaveJS, | ||
// which will return an empty module when browser: { vertx: false } | ||
// is set in package.json | ||
cjsRequire = require; | ||
@@ -15,4 +19,5 @@ | ||
vertx = cjsRequire('vertx'); | ||
} catch (e) { } | ||
} catch (ignored) {} | ||
// If vertx loaded and has the timer features we expect, try to support it | ||
if (vertx && typeof vertx.setTimer === 'function') { | ||
@@ -19,0 +24,0 @@ setTimer = function (f, ms) { return vertx.setTimer(ms, f); }; |
{ | ||
"name": "when", | ||
"version": "3.4.6", | ||
"version": "3.5.0", | ||
"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.4.6 | ||
* @version 3.5.0 | ||
*/ | ||
@@ -43,4 +43,4 @@ (function(define) { 'use strict'; | ||
when.iterate = Promise.iterate; // Generate a stream of promises | ||
when.unfold = Promise.unfold; // Generate a stream of promises | ||
when.iterate = Promise.iterate; // DEPRECATED (use cujojs/most streams) Generate a stream of promises | ||
when.unfold = Promise.unfold; // DEPRECATED (use cujojs/most streams) Generate a stream of promises | ||
@@ -47,0 +47,0 @@ when.join = join; // Join 2 or more promises |
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
147519
4392