Bug 1224545 - Remove async-utils/async method and use Task.async instead. r=jryans
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user