Comparing version 0.4.0 to 0.4.1
19
p.js
@@ -753,16 +753,21 @@ /*! | ||
var promise = new Promise(); | ||
var done = false; | ||
function resolver( error, value ) { | ||
if ( error ) { | ||
d.reject( error ); | ||
if ( !done ) { | ||
done = true; | ||
} else { | ||
d.resolve( value ); | ||
if ( error ) { | ||
Reject( promise, error ); | ||
} else { | ||
Resolve( promise, value ); | ||
} | ||
} | ||
} | ||
var d = defer(); | ||
apply.call( f, this, args ); | ||
return d.promise; | ||
return promise; | ||
}; | ||
@@ -769,0 +774,0 @@ } |
@@ -1,1 +0,1 @@ | ||
(function(e){if(typeof module!=="undefined"&&module&&module.exports){module.exports=e()}else if(typeof define==="function"&&define.amd){define(e)}else{P=e()}})(function(){"use strict";var e=o(),n,t=null;function r(){var e=(new Error).stack;if(!e){return null}var n=[u(e,1)];if(t){n=n.concat(t);if(n.length===128){n.pop()}}return n}function i(e){var n=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e)||/at ([^ ]+):(\d+):(?:\d+)$/.exec(e)||/@(.+):(\d+):(?:\d+)$/.exec(e);return n?{fileName:n[1],lineNumber:Number(n[2])}:null}function o(){var e=(new Error).stack;if(!e){return 0}var t=e.split("\n");var r=t[0].indexOf("@")>0?t[1]:t[2];var o=i(r);if(!o){return 0}n=o.fileName;return o.lineNumber}function u(e,n){var t=e.split("\n");var r=[];for(var i=n|0,o=t.length;i<o;++i){var u=t[i];if(u&&!a(u)&&!f(u)){r.push(u)}}return r.join("\n")}function a(e){return e.indexOf("(module.js:")!==-1||e.indexOf("(node.js:")!==-1}function f(t){var r=i(t);return!!r&&r.fileName===n&&r.lineNumber>=e&&r.lineNumber<=vn}var l="\nFrom previous event:\n";function c(e){if(e instanceof Error&&e.stack&&e.stack.indexOf(l)===-1){e.stack=[u(e.stack,0)].concat(t||[]).join(l)}}var s=N(typeof process)&&process!=null&&{}.toString.call(process)==="[object process]",v=typeof setImmediate==="function",p=N(typeof MutationObserver)&&MutationObserver||N(typeof WebKitMutationObserver)&&WebKitMutationObserver,d=new T,h=d,_=false,m=0,y=s?A:p?I(E):M(E),b=[],w=M(S),g,x,j=N.call,k=N.apply;h.next=d;function T(){this.a=null;this.b=null;this.next=null}function N(e){return e==="object"||e==="function"}function S(){if(b.length){throw b.shift()}}function E(){while(d!==h){var e=d=d.next;if(m>=1024){h.next=h.next.next}else{++m}var n=e.a;var r=e.b;e.a=null;e.b=null;Z(n,r)}_=false;t=null}function O(e,n){var t=h.next;if(t===d){h.next=t=new T;t.next=d}else{--m}h=t;t.a=e;t.b=n;if(!_){_=true;y()}}function A(){var e=process.domain;if(e){if(!x)x=(1,require)("domain");x.active=process.domain=null}if(_&&v){setImmediate(E)}else{process.nextTick(E)}if(e){x.active=process.domain=e}}function I(e){var n=1;var t=document.createTextNode("");var r=new p(e);r.observe(t,{characterData:true});return function(){n=-n;t.data=n}}function M(e){return function(){var n=setTimeout(r,0);var t=setInterval(r,50);function r(){clearTimeout(n);clearInterval(t);e()}}}if(s){g=function(e){y();throw e}}else{g=function(e){b.push(e);w()}}var $=0;var K=1;var W=2;var q=-1;var D=-2;var F=-3;function P(e){if(z.onerror){(1,z.onerror)(e)}else{throw e}}function Y(e){if(e._state===W){if(e._domain){e._domain.enter()}g(e._value)}}function z(e){return e instanceof on?e:J(new on,e)}z.longStackSupport=false;function B(e){if(e._pending){V(e,e._op,e._pending);e._pending=null}}function C(e,n){if(e._state){return}e._state=K;e._value=n;B(e)}function G(e,n){if(e._state){return}if(t){c(n)}e._state=W;e._value=n;if(s){e._domain=process.domain}B(e)}function H(e,n){if(n._state){return}n._state=e._state;n._value=e._value;n._domain=e._domain;B(n)}function J(e,n){if(e._state){return e}if(n instanceof on){L(e,n)}else{var t=typeof n;if(t==="object"&&n!==null||t==="function"){Q(e,n)}else{C(e,n)}}return e}function L(e,n){if(n===e){G(e,new TypeError("You can't resolve a promise with itself"))}else if(n._state){H(n,e)}else{X(n,D,e)}}function Q(e,n){var t=R(e,n);if(typeof t==="function"){U(nn(e),t,n)}else{C(e,n)}}function R(e,n){try{return n.then}catch(t){G(e,t);return null}}function U(e,n,t){try{j.call(n,t,e.resolve,e.reject)}catch(r){e.reject(r)}}function V(e,n,t){if(n===q){t(e)}else if(n===D){O(e,t)}else if(n===F){for(var r=0,i=t.length;r<i;r+=2){V(e,t[r],t[r+1])}}else{t(e,n)}}function X(e,n,t){if(e._state){V(e,n,t)}else if(!e._pending){e._pending=t;e._op=n}else if(e._op===F){e._pending.push(n,t)}else{e._pending=[e._op,e._pending,n,t];e._op=F}}function Z(e,n){var r=e._domain||n._domain;t=n._trace;var i=e._state===K?n._cb:n._eb;n._cb=null;n._eb=null;n._domain=null;n._trace=null;if(i===null){H(e,n)}else if(r){if(!r._disposed){r.enter();en(n,i,e._value);r.exit()}}else{en(n,i,e._value)}}function en(e,n,t){var r;try{r=n(t)}catch(i){G(e,i);return}J(e,r)}function nn(e){var n=false;return{promise:e,resolve:function(t){if(!n){n=true;J(e,t)}},reject:function(t){if(!n){n=true;G(e,t)}}}}z.defer=tn;function tn(){return nn(new on)}z.reject=rn;function rn(e){var n=new on;G(n,e);return n}function on(){this._state=0;this._value=void 0;this._domain=null;this._cb=null;this._eb=null;this._op=0;this._pending=null;this._trace=null}on.prototype.then=function(e,n){var t=new on;t._cb=typeof e==="function"?e:null;t._eb=typeof n==="function"?n:null;if(z.longStackSupport){t._trace=r()}if(s){t._domain=process.domain}if(this._state){O(this,t)}else{X(this,D,t)}return t};on.prototype.done=function(e,n){var t=this;if(e||n){t=t.then(e,n)}t=t.then(null,P);X(t,q,Y)};on.prototype.fail=function(e){return this.then(null,e)};on.prototype.spread=function(e,n){return this.then(an).then(function(n){return k.call(e,void 0,n)},n)};on.prototype.timeout=function(e,n){var i=new on;if(this._state!==$){H(this,i)}else{var o=z.longStackSupport?r():null;var u=setTimeout(function(){t=o;G(i,new Error(n||"Timed out after "+e+" ms"))},e);X(this,q,function(e){clearTimeout(u);H(e,i)})}return i};on.prototype.delay=function(e){var n=tn();this.then(function(r){var i=t;setTimeout(function(){t=i;n.resolve(r)},e)},n.reject);return n.promise};on.prototype.all=function(){return this.then(an)};on.prototype.allSettled=function(){return this.then(un)};on.prototype.inspect=function(){switch(this._state){case $:return{state:"pending"};case K:return{state:"fulfilled",value:this._value};case W:return{state:"rejected",reason:this._value};default:throw new TypeError("invalid state")}};on.prototype.nodeify=function(e){if(e){this.done(function(n){e(null,n)},e);return void 0}else{return this}};z.allSettled=un;function un(e){var n=new on;var t=e.length;if(typeof t!=="number"){G(n,new TypeError("input not array-like"));return n}var r=new Array(t);var i=t;function o(e,t){r[t]=e.inspect();if(--i===0){C(n,r)}}for(var u=0;u<t;++u){X(z(e[u]),u,o)}if(i===0){C(n,r)}return n}z.all=an;function an(e){var n=new on;var t=e.length;if(typeof t!=="number"){G(n,new TypeError("input not array-like"));return n}var r=new Array(t);var i=t;function o(e,t){if(r!==null){if(e._state===W){r=null;H(e,n)}else{r[t]=e._value;if(--i===0){C(n,r)}}}}for(var u=0;u<t;++u){X(z(e[u]),u,o)}if(i===0){C(n,r)}return n}z.spread=fn;function fn(e,n,t){return an(e).then(function(e){return k.call(n,void 0,e)},t)}z.promised=ln;function ln(e){function n(n){return j.apply(e,n)}return function(){var e=arguments.length;var t=new Array(e+1);t[0]=this;for(var r=0;r<e;++r){t[r+1]=arguments[r]}return an(t).then(n)}}z.denodeify=cn;function cn(e){return function(){var n=arguments.length;var t=new Array(n+1);for(var r=0;r<n;++r){t[r]=arguments[r]}t[r]=i;function i(e,n){if(e){o.reject(e)}else{o.resolve(n)}}var o=tn();k.call(e,this,t);return o.promise}}z.onerror=null;z.nextTick=function pn(e){var n=new on;C(n,e);n=n.then(sn);X(n,q,Y)};function sn(e){e.call()}var vn=o();return z}); | ||
(function(e){if(typeof module!=="undefined"&&module&&module.exports){module.exports=e()}else if(typeof define==="function"&&define.amd){define(e)}else{P=e()}})(function(){"use strict";var e=o(),n,t=null;function r(){var e=(new Error).stack;if(!e){return null}var n=[u(e,1)];if(t){n=n.concat(t);if(n.length===128){n.pop()}}return n}function i(e){var n=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e)||/at ([^ ]+):(\d+):(?:\d+)$/.exec(e)||/@(.+):(\d+):(?:\d+)$/.exec(e);return n?{fileName:n[1],lineNumber:Number(n[2])}:null}function o(){var e=(new Error).stack;if(!e){return 0}var t=e.split("\n");var r=t[0].indexOf("@")>0?t[1]:t[2];var o=i(r);if(!o){return 0}n=o.fileName;return o.lineNumber}function u(e,n){var t=e.split("\n");var r=[];for(var i=n|0,o=t.length;i<o;++i){var u=t[i];if(u&&!a(u)&&!f(u)){r.push(u)}}return r.join("\n")}function a(e){return e.indexOf("(module.js:")!==-1||e.indexOf("(node.js:")!==-1}function f(t){var r=i(t);return!!r&&r.fileName===n&&r.lineNumber>=e&&r.lineNumber<=vn}var l="\nFrom previous event:\n";function c(e){if(e instanceof Error&&e.stack&&e.stack.indexOf(l)===-1){e.stack=[u(e.stack,0)].concat(t||[]).join(l)}}var s=N(typeof process)&&process!=null&&{}.toString.call(process)==="[object process]",v=typeof setImmediate==="function",p=N(typeof MutationObserver)&&MutationObserver||N(typeof WebKitMutationObserver)&&WebKitMutationObserver,d=new T,h=d,_=false,m=0,y=s?A:p?I(E):M(E),w=[],b=M(S),g,x,j=N.call,k=N.apply;h.next=d;function T(){this.a=null;this.b=null;this.next=null}function N(e){return e==="object"||e==="function"}function S(){if(w.length){throw w.shift()}}function E(){while(d!==h){var e=d=d.next;if(m>=1024){h.next=h.next.next}else{++m}var n=e.a;var r=e.b;e.a=null;e.b=null;Z(n,r)}_=false;t=null}function O(e,n){var t=h.next;if(t===d){h.next=t=new T;t.next=d}else{--m}h=t;t.a=e;t.b=n;if(!_){_=true;y()}}function A(){var e=process.domain;if(e){if(!x)x=(1,require)("domain");x.active=process.domain=null}if(_&&v){setImmediate(E)}else{process.nextTick(E)}if(e){x.active=process.domain=e}}function I(e){var n=1;var t=document.createTextNode("");var r=new p(e);r.observe(t,{characterData:true});return function(){n=-n;t.data=n}}function M(e){return function(){var n=setTimeout(r,0);var t=setInterval(r,50);function r(){clearTimeout(n);clearInterval(t);e()}}}if(s){g=function(e){y();throw e}}else{g=function(e){w.push(e);b()}}var $=0;var K=1;var W=2;var q=-1;var D=-2;var F=-3;function P(e){if(z.onerror){(1,z.onerror)(e)}else{throw e}}function Y(e){if(e._state===W){if(e._domain){e._domain.enter()}g(e._value)}}function z(e){return e instanceof on?e:J(new on,e)}z.longStackSupport=false;function B(e){if(e._pending){V(e,e._op,e._pending);e._pending=null}}function C(e,n){if(e._state){return}e._state=K;e._value=n;B(e)}function G(e,n){if(e._state){return}if(t){c(n)}e._state=W;e._value=n;if(s){e._domain=process.domain}B(e)}function H(e,n){if(n._state){return}n._state=e._state;n._value=e._value;n._domain=e._domain;B(n)}function J(e,n){if(e._state){return e}if(n instanceof on){L(e,n)}else{var t=typeof n;if(t==="object"&&n!==null||t==="function"){Q(e,n)}else{C(e,n)}}return e}function L(e,n){if(n===e){G(e,new TypeError("You can't resolve a promise with itself"))}else if(n._state){H(n,e)}else{X(n,D,e)}}function Q(e,n){var t=R(e,n);if(typeof t==="function"){U(nn(e),t,n)}else{C(e,n)}}function R(e,n){try{return n.then}catch(t){G(e,t);return null}}function U(e,n,t){try{j.call(n,t,e.resolve,e.reject)}catch(r){e.reject(r)}}function V(e,n,t){if(n===q){t(e)}else if(n===D){O(e,t)}else if(n===F){for(var r=0,i=t.length;r<i;r+=2){V(e,t[r],t[r+1])}}else{t(e,n)}}function X(e,n,t){if(e._state){V(e,n,t)}else if(!e._pending){e._pending=t;e._op=n}else if(e._op===F){e._pending.push(n,t)}else{e._pending=[e._op,e._pending,n,t];e._op=F}}function Z(e,n){var r=e._domain||n._domain;t=n._trace;var i=e._state===K?n._cb:n._eb;n._cb=null;n._eb=null;n._domain=null;n._trace=null;if(i===null){H(e,n)}else if(r){if(!r._disposed){r.enter();en(n,i,e._value);r.exit()}}else{en(n,i,e._value)}}function en(e,n,t){var r;try{r=n(t)}catch(i){G(e,i);return}J(e,r)}function nn(e){var n=false;return{promise:e,resolve:function(t){if(!n){n=true;J(e,t)}},reject:function(t){if(!n){n=true;G(e,t)}}}}z.defer=tn;function tn(){return nn(new on)}z.reject=rn;function rn(e){var n=new on;G(n,e);return n}function on(){this._state=0;this._value=void 0;this._domain=null;this._cb=null;this._eb=null;this._op=0;this._pending=null;this._trace=null}on.prototype.then=function(e,n){var t=new on;t._cb=typeof e==="function"?e:null;t._eb=typeof n==="function"?n:null;if(z.longStackSupport){t._trace=r()}if(s){t._domain=process.domain}if(this._state){O(this,t)}else{X(this,D,t)}return t};on.prototype.done=function(e,n){var t=this;if(e||n){t=t.then(e,n)}t=t.then(null,P);X(t,q,Y)};on.prototype.fail=function(e){return this.then(null,e)};on.prototype.spread=function(e,n){return this.then(an).then(function(n){return k.call(e,void 0,n)},n)};on.prototype.timeout=function(e,n){var i=new on;if(this._state!==$){H(this,i)}else{var o=z.longStackSupport?r():null;var u=setTimeout(function(){t=o;G(i,new Error(n||"Timed out after "+e+" ms"))},e);X(this,q,function(e){clearTimeout(u);H(e,i)})}return i};on.prototype.delay=function(e){var n=tn();this.then(function(r){var i=t;setTimeout(function(){t=i;n.resolve(r)},e)},n.reject);return n.promise};on.prototype.all=function(){return this.then(an)};on.prototype.allSettled=function(){return this.then(un)};on.prototype.inspect=function(){switch(this._state){case $:return{state:"pending"};case K:return{state:"fulfilled",value:this._value};case W:return{state:"rejected",reason:this._value};default:throw new TypeError("invalid state")}};on.prototype.nodeify=function(e){if(e){this.done(function(n){e(null,n)},e);return void 0}else{return this}};z.allSettled=un;function un(e){var n=new on;var t=e.length;if(typeof t!=="number"){G(n,new TypeError("input not array-like"));return n}var r=new Array(t);var i=t;function o(e,t){r[t]=e.inspect();if(--i===0){C(n,r)}}for(var u=0;u<t;++u){X(z(e[u]),u,o)}if(i===0){C(n,r)}return n}z.all=an;function an(e){var n=new on;var t=e.length;if(typeof t!=="number"){G(n,new TypeError("input not array-like"));return n}var r=new Array(t);var i=t;function o(e,t){if(r!==null){if(e._state===W){r=null;H(e,n)}else{r[t]=e._value;if(--i===0){C(n,r)}}}}for(var u=0;u<t;++u){X(z(e[u]),u,o)}if(i===0){C(n,r)}return n}z.spread=fn;function fn(e,n,t){return an(e).then(function(e){return k.call(n,void 0,e)},t)}z.promised=ln;function ln(e){function n(n){return j.apply(e,n)}return function(){var e=arguments.length;var t=new Array(e+1);t[0]=this;for(var r=0;r<e;++r){t[r+1]=arguments[r]}return an(t).then(n)}}z.denodeify=cn;function cn(e){return function(){var n=arguments.length;var t=new Array(n+1);for(var r=0;r<n;++r){t[r]=arguments[r]}t[r]=u;var i=new on;var o=false;function u(e,n){if(!o){o=true;if(e){G(i,e)}else{J(i,n)}i=null}}k.call(e,this,t);return i}}z.onerror=null;z.nextTick=function pn(e){var n=new on;C(n,e);n=n.then(sn);X(n,q,Y)};function sn(e){e.call()}var vn=o();return z}); |
{ | ||
"name": "p-promise", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "A simple Promises/A+ library.", | ||
@@ -5,0 +5,0 @@ "author": "Robert Katić <robert.katic@gmail.com> (https://github.com/rkatic)", |
@@ -1,2 +0,2 @@ | ||
--- AUTO GENERATED CONTENT --- (2014/6/28 7:3:54) | ||
--- AUTO GENERATED CONTENT --- (2014/6/29 0:31:18) | ||
getTrace : not optimized : 0 | ||
@@ -3,0 +3,0 @@ getFileNameAndLineNumber : not optimized : 0 |
@@ -753,16 +753,21 @@ /*! | ||
var promise = new Promise(); | ||
var done = false; | ||
TRACE_FUNCTIONS.fn = resolver; function resolver( error, value ) { | ||
if ( error ) { | ||
d.reject( error ); | ||
if ( !done ) { | ||
done = true; | ||
} else { | ||
d.resolve( value ); | ||
if ( error ) { | ||
Reject( promise, error ); | ||
} else { | ||
Resolve( promise, value ); | ||
} | ||
} | ||
} | ||
var d = defer(); | ||
apply.call( f, this, args ); | ||
return d.promise; | ||
return promise; | ||
}; | ||
@@ -769,0 +774,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
2177646
2807