diff options
| author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 | 
|---|---|---|
| committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 | 
| commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
| tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/promise/lib | |
| parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) | |
update packages
Diffstat (limited to 'node_modules/promise/lib')
| -rw-r--r-- | node_modules/promise/lib/core.js | 78 | ||||
| -rw-r--r-- | node_modules/promise/lib/es6-extensions.js | 14 | ||||
| -rw-r--r-- | node_modules/promise/lib/finally.js | 2 | ||||
| -rw-r--r-- | node_modules/promise/lib/rejection-tracking.js | 28 | ||||
| -rw-r--r-- | node_modules/promise/lib/synchronous.js | 20 | 
5 files changed, 71 insertions, 71 deletions
| diff --git a/node_modules/promise/lib/core.js b/node_modules/promise/lib/core.js index 2e575265b..17f724f5f 100644 --- a/node_modules/promise/lib/core.js +++ b/node_modules/promise/lib/core.js @@ -58,16 +58,16 @@ function Promise(fn) {    if (typeof fn !== 'function') {      throw new TypeError('Promise constructor\'s argument is not a function');    } -  this._75 = 0; -  this._83 = 0; -  this._18 = null; -  this._38 = null; +  this._h = 0; +  this._i = 0; +  this._j = null; +  this._k = null;    if (fn === noop) return;    doResolve(fn, this);  } -Promise._47 = null; -Promise._71 = null; -Promise._44 = noop; +Promise._l = null; +Promise._m = null; +Promise._n = noop;  Promise.prototype.then = function(onFulfilled, onRejected) {    if (this.constructor !== Promise) { @@ -86,24 +86,24 @@ function safeThen(self, onFulfilled, onRejected) {    });  }  function handle(self, deferred) { -  while (self._83 === 3) { -    self = self._18; +  while (self._i === 3) { +    self = self._j;    } -  if (Promise._47) { -    Promise._47(self); +  if (Promise._l) { +    Promise._l(self);    } -  if (self._83 === 0) { -    if (self._75 === 0) { -      self._75 = 1; -      self._38 = deferred; +  if (self._i === 0) { +    if (self._h === 0) { +      self._h = 1; +      self._k = deferred;        return;      } -    if (self._75 === 1) { -      self._75 = 2; -      self._38 = [self._38, deferred]; +    if (self._h === 1) { +      self._h = 2; +      self._k = [self._k, deferred];        return;      } -    self._38.push(deferred); +    self._k.push(deferred);      return;    }    handleResolved(self, deferred); @@ -111,16 +111,16 @@ function handle(self, deferred) {  function handleResolved(self, deferred) {    asap(function() { -    var cb = self._83 === 1 ? deferred.onFulfilled : deferred.onRejected; +    var cb = self._i === 1 ? deferred.onFulfilled : deferred.onRejected;      if (cb === null) { -      if (self._83 === 1) { -        resolve(deferred.promise, self._18); +      if (self._i === 1) { +        resolve(deferred.promise, self._j);        } else { -        reject(deferred.promise, self._18); +        reject(deferred.promise, self._j);        }        return;      } -    var ret = tryCallOne(cb, self._18); +    var ret = tryCallOne(cb, self._j);      if (ret === IS_ERROR) {        reject(deferred.promise, LAST_ERROR);      } else { @@ -148,8 +148,8 @@ function resolve(self, newValue) {        then === self.then &&        newValue instanceof Promise      ) { -      self._83 = 3; -      self._18 = newValue; +      self._i = 3; +      self._j = newValue;        finale(self);        return;      } else if (typeof then === 'function') { @@ -157,29 +157,29 @@ function resolve(self, newValue) {        return;      }    } -  self._83 = 1; -  self._18 = newValue; +  self._i = 1; +  self._j = newValue;    finale(self);  }  function reject(self, newValue) { -  self._83 = 2; -  self._18 = newValue; -  if (Promise._71) { -    Promise._71(self, newValue); +  self._i = 2; +  self._j = newValue; +  if (Promise._m) { +    Promise._m(self, newValue);    }    finale(self);  }  function finale(self) { -  if (self._75 === 1) { -    handle(self, self._38); -    self._38 = null; +  if (self._h === 1) { +    handle(self, self._k); +    self._k = null;    } -  if (self._75 === 2) { -    for (var i = 0; i < self._38.length; i++) { -      handle(self, self._38[i]); +  if (self._h === 2) { +    for (var i = 0; i < self._k.length; i++) { +      handle(self, self._k[i]);      } -    self._38 = null; +    self._k = null;    }  } diff --git a/node_modules/promise/lib/es6-extensions.js b/node_modules/promise/lib/es6-extensions.js index e6d92aa60..5046e2367 100644 --- a/node_modules/promise/lib/es6-extensions.js +++ b/node_modules/promise/lib/es6-extensions.js @@ -16,9 +16,9 @@ var ZERO = valuePromise(0);  var EMPTYSTRING = valuePromise('');  function valuePromise(value) { -  var p = new Promise(Promise._44); -  p._83 = 1; -  p._18 = value; +  var p = new Promise(Promise._n); +  p._i = 1; +  p._j = value;    return p;  }  Promise.resolve = function (value) { @@ -55,11 +55,11 @@ Promise.all = function (arr) {      function res(i, val) {        if (val && (typeof val === 'object' || typeof val === 'function')) {          if (val instanceof Promise && val.then === Promise.prototype.then) { -          while (val._83 === 3) { -            val = val._18; +          while (val._i === 3) { +            val = val._j;            } -          if (val._83 === 1) return res(i, val._18); -          if (val._83 === 2) reject(val._18); +          if (val._i === 1) return res(i, val._j); +          if (val._i === 2) reject(val._j);            val.then(function (val) {              res(i, val);            }, reject); diff --git a/node_modules/promise/lib/finally.js b/node_modules/promise/lib/finally.js index f5ee0b98a..3f8a6b7a1 100644 --- a/node_modules/promise/lib/finally.js +++ b/node_modules/promise/lib/finally.js @@ -3,7 +3,7 @@  var Promise = require('./core.js');  module.exports = Promise; -Promise.prototype['finally'] = function (f) { +Promise.prototype.finally = function (f) {    return this.then(function (value) {      return Promise.resolve(f()).then(function () {        return value; diff --git a/node_modules/promise/lib/rejection-tracking.js b/node_modules/promise/lib/rejection-tracking.js index 11d7f3154..56e4bd669 100644 --- a/node_modules/promise/lib/rejection-tracking.js +++ b/node_modules/promise/lib/rejection-tracking.js @@ -12,8 +12,8 @@ var enabled = false;  exports.disable = disable;  function disable() {    enabled = false; -  Promise._47 = null; -  Promise._71 = null; +  Promise._l = null; +  Promise._m = null;  }  exports.enable = enable; @@ -24,27 +24,27 @@ function enable(options) {    var id = 0;    var displayId = 0;    var rejections = {}; -  Promise._47 = function (promise) { +  Promise._l = function (promise) {      if ( -      promise._83 === 2 && // IS REJECTED -      rejections[promise._56] +      promise._i === 2 && // IS REJECTED +      rejections[promise._o]      ) { -      if (rejections[promise._56].logged) { -        onHandled(promise._56); +      if (rejections[promise._o].logged) { +        onHandled(promise._o);        } else { -        clearTimeout(rejections[promise._56].timeout); +        clearTimeout(rejections[promise._o].timeout);        } -      delete rejections[promise._56]; +      delete rejections[promise._o];      }    }; -  Promise._71 = function (promise, err) { -    if (promise._75 === 0) { // not yet handled -      promise._56 = id++; -      rejections[promise._56] = { +  Promise._m = function (promise, err) { +    if (promise._h === 0) { // not yet handled +      promise._o = id++; +      rejections[promise._o] = {          displayId: null,          error: err,          timeout: setTimeout( -          onUnhandled.bind(null, promise._56), +          onUnhandled.bind(null, promise._o),            // For reference errors and type errors, this almost always            // means the programmer made a mistake, so log them after just            // 100ms diff --git a/node_modules/promise/lib/synchronous.js b/node_modules/promise/lib/synchronous.js index 93ee503c9..79f4eeee9 100644 --- a/node_modules/promise/lib/synchronous.js +++ b/node_modules/promise/lib/synchronous.js @@ -17,38 +17,38 @@ Promise.enableSynchronous = function () {    };    Promise.prototype.getValue = function () { -    if (this._83 === 3) { -      return this._18.getValue(); +    if (this._i === 3) { +      return this._j.getValue();      }      if (!this.isFulfilled()) {        throw new Error('Cannot get a value of an unfulfilled promise.');      } -    return this._18; +    return this._j;    };    Promise.prototype.getReason = function () { -    if (this._83 === 3) { -      return this._18.getReason(); +    if (this._i === 3) { +      return this._j.getReason();      }      if (!this.isRejected()) {        throw new Error('Cannot get a rejection reason of a non-rejected promise.');      } -    return this._18; +    return this._j;    };    Promise.prototype.getState = function () { -    if (this._83 === 3) { -      return this._18.getState(); +    if (this._i === 3) { +      return this._j.getState();      } -    if (this._83 === -1 || this._83 === -2) { +    if (this._i === -1 || this._i === -2) {        return 0;      } -    return this._83; +    return this._i;    };  }; | 
