diff options
author | Matt A. Tobin <email@mattatobin.com> | 2022-03-25 00:08:53 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2022-03-25 00:08:53 -0500 |
commit | fd5099e2cdd93490fd63ca3b2d0ed38a6e1395a6 (patch) | |
tree | 8558f7be2e5514d5a3cb98f715768018a6e54d92 /devtools/shared/deprecated-sync-thenables.js | |
parent | eae7341dcb8b7ef3f22fd9e14fa565776d162e46 (diff) | |
download | aura-central-fd5099e2cdd93490fd63ca3b2d0ed38a6e1395a6.tar.gz |
Remove Firefox Devtools as they run like shit.
If devtools/ exists by someone adding it back or cloning an independent repo into the tree mach_bootstrap will detect it like I did for the add-ons sdk
Diffstat (limited to 'devtools/shared/deprecated-sync-thenables.js')
-rw-r--r-- | devtools/shared/deprecated-sync-thenables.js | 119 |
1 files changed, 0 insertions, 119 deletions
diff --git a/devtools/shared/deprecated-sync-thenables.js b/devtools/shared/deprecated-sync-thenables.js deleted file mode 100644 index 52bf671cd..000000000 --- a/devtools/shared/deprecated-sync-thenables.js +++ /dev/null @@ -1,119 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/** - * THIS MODULE IS DEPRECATED. IMPORT "Promise.jsm" INSTEAD. - */ - -"use strict"; - -this.Promise = {}; - -if (typeof (require) === "function") { - module.exports = Promise; -} else { - this.EXPORTED_SYMBOLS = ["Promise"]; -} - -function fulfilled(value) { - return { then: function then(fulfill) { fulfill(value); } }; -} - -function rejected(reason) { - return { then: function then(fulfill, reject) { reject(reason); } }; -} - -function isPromise(value) { - return value && typeof (value.then) === "function"; -} - -function defer() { - var observers = []; - var result = null; - var promise = { - then: function then(onFulfill, onError) { - var deferred = defer(); - - function resolve(value) { - try { - deferred.resolve(onFulfill ? onFulfill(value) : value); - } catch (error) { - deferred.resolve(rejected(error)); - } - } - - function reject(reason) { - try { - if (onError) deferred.resolve(onError(reason)); - else deferred.resolve(rejected(reason)); - } catch (error) { - deferred.resolve(rejected(error)); - } - } - - if (observers) { - observers.push({ resolve: resolve, reject: reject }); - } else { - result.then(resolve, reject); - } - - return deferred.promise; - } - }; - - var deferred = { - promise: promise, - resolve: function resolve(value) { - if (!result) { - result = isPromise(value) ? value : fulfilled(value); - while (observers.length) { - var observer = observers.shift(); - result.then(observer.resolve, observer.reject); - } - observers = null; - } - }, - reject: function reject(reason) { - deferred.resolve(rejected(reason)); - } - }; - - return deferred; -} -Promise.defer = defer; - -function resolve(value) { - var deferred = defer(); - deferred.resolve(value); - return deferred.promise; -} -Promise.resolve = resolve; - -function reject(reason) { - var deferred = defer(); - deferred.reject(reason); - return deferred.promise; -} -Promise.reject = reject; - -var promised = (function () { - var call = Function.call; - var concat = Array.prototype.concat; - function execute(args) { return call.apply(call, args); } - function promisedConcat(promises, unknown) { - return promises.then(function (values) { - return resolve(unknown).then(function (value) { - return values.concat([ value ]); - }); - }); - } - return function promised(f) { - return function promised() { - return concat.apply([ f, this ], arguments). - reduce(promisedConcat, resolve([])). - then(execute); - }; - }; -})(); -Promise.all = promised(Array); |