vendor/assets/javascripts/promise.js in es6-promise-rails-2.3.0 vs vendor/assets/javascripts/promise.js in es6-promise-rails-3.0.2
- old
+ new
@@ -1,11 +1,11 @@
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
- * @version 2.3.0
+ * @version 3.0.2
*/
(function() {
"use strict";
function lib$es6$promise$utils$$objectOrFunction(x) {
@@ -69,19 +69,14 @@
typeof importScripts !== 'undefined' &&
typeof MessageChannel !== 'undefined';
// node
function lib$es6$promise$asap$$useNextTick() {
- var nextTick = process.nextTick;
// node version 0.10.x displays a deprecation warning when nextTick is used recursively
- // setImmediate should be used instead instead
- var version = process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);
- if (Array.isArray(version) && version[1] === '0' && version[2] === '10') {
- nextTick = setImmediate;
- }
+ // see https://github.com/cujojs/when/issues/410 for details
return function() {
- nextTick(lib$es6$promise$asap$$flush);
+ process.nextTick(lib$es6$promise$asap$$flush);
};
}
// vertx
function lib$es6$promise$asap$$useVertxTimer() {
@@ -129,11 +124,11 @@
}
lib$es6$promise$asap$$len = 0;
}
- function lib$es6$promise$asap$$attemptVertex() {
+ function lib$es6$promise$asap$$attemptVertx() {
try {
var r = require;
var vertx = r('vertx');
lib$es6$promise$asap$$vertxNext = vertx.runOnLoop || vertx.runOnContext;
return lib$es6$promise$asap$$useVertxTimer();
@@ -149,11 +144,11 @@
} else if (lib$es6$promise$asap$$BrowserMutationObserver) {
lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMutationObserver();
} else if (lib$es6$promise$asap$$isWorker) {
lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMessageChannel();
} else if (lib$es6$promise$asap$$browserWindow === undefined && typeof require === 'function') {
- lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertex();
+ lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertx();
} else {
lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useSetTimeout();
}
function lib$es6$promise$$internal$$noop() {}
@@ -162,11 +157,11 @@
var lib$es6$promise$$internal$$FULFILLED = 1;
var lib$es6$promise$$internal$$REJECTED = 2;
var lib$es6$promise$$internal$$GET_THEN_ERROR = new lib$es6$promise$$internal$$ErrorObject();
- function lib$es6$promise$$internal$$selfFullfillment() {
+ function lib$es6$promise$$internal$$selfFulfillment() {
return new TypeError("You cannot resolve a promise with itself");
}
function lib$es6$promise$$internal$$cannotReturnOwn() {
return new TypeError('A promises callback cannot return that same promise.');
@@ -246,10 +241,10 @@
}
}
function lib$es6$promise$$internal$$resolve(promise, value) {
if (promise === value) {
- lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFullfillment());
+ lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFulfillment());
} else if (lib$es6$promise$utils$$objectOrFunction(value)) {
lib$es6$promise$$internal$$handleMaybeThenable(promise, value);
} else {
lib$es6$promise$$internal$$fulfill(promise, value);
}