Browse Source

amberc.js: remove obsolete async_map()

replaced by Promise.all()
Manfred Kroehnert 11 years ago
parent
commit
0de5d61932
1 changed files with 0 additions and 25 deletions
  1. 0 25
      cli/support/amberc.js

+ 0 - 25
cli/support/amberc.js

@@ -10,30 +10,6 @@
  * Execute 'node compiler.js' without arguments or with -h / --help for help.
  */
 
-/**
- * Map the async filter function onto array and evaluate callback, once all have finished.
- * Taken from: http://howtonode.org/control-flow-part-iii
- */
-function async_map(array, filter, callback) {
-	if (0 === array.length) {
-		callback(null, null);
-		return;
-	}
-	var counter = array.length;
-	var new_array = [];
-	array.forEach(function (item, index) {
-		filter(item, function (err, result) {
-			if (err) { callback(err); return; }
-			new_array[index] = result;
-			counter--;
-			if (counter === 0) {
-				callback(null, new_array);
-			}
-		});
-	});
-}
-
-
 /**
  * Always evaluates the callback parameter.
  * Used by Combo blocks to always call the next function,
@@ -648,4 +624,3 @@ function compose_js_files(configuration) {
 module.exports.Compiler = AmberC;
 module.exports.createDefaults = createDefaults;
 module.exports.Combo = Combo;
-module.exports.map = async_map;