Bug 1224545 - Remove async-utils/async method and use Task.async instead. r=jryans

This commit is contained in:
Patrick Brosset
2015-11-13 16:54:09 +01:00
parent 9b1329c7ed
commit 029e2d9dce
3 changed files with 16 additions and 31 deletions

View File

@@ -17,20 +17,6 @@ var {Cu} = require("chrome");
var {Task} = require("resource://gre/modules/Task.jsm");
var Promise = require("promise");
/**
* Create an async function from a generator function.
*
* @param Function func
* The generator function that to wrap as an async function.
* @return Function
* The async function.
*/
exports.async = function async(func) {
return function(...args) {
return Task.spawn(func.apply(this, args));
};
};
/**
* Create an async function that only executes once per instance of an object.
* Once called on a given object, the same promise will be returned for any