gecko-dev/devtools/shared/defer.js
Tom Tromey e27f135b3b Bug 1277243 - rename promise_defer.js to defer.js; r=jryans
MozReview-Commit-ID: 9TSQ0Cw82B

--HG--
rename : devtools/shared/promise_defer.js => devtools/shared/defer.js
rename : devtools/shared/tests/unit/test_promise_defer.js => devtools/shared/tests/unit/test_defer.js
extra : transplant_source : %20Kh%D2%21%E9%F9%D1%17L%BD%AC%E5%29%1A%11%06%A9.%98
2016-05-27 13:08:48 -06:00

23 lines
636 B
JavaScript

/* 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/. */
"use strict";
/**
* Returns a deferred object, with a resolve and reject property.
* https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Deferred
*/
module.exports = function defer() {
let resolve, reject;
let promise = new Promise(function () {
resolve = arguments[0];
reject = arguments[1];
});
return {
resolve: resolve,
reject: reject,
promise: promise
};
};