[Pkg-javascript-commits] [node-array-parallel] 03/04: Imported Upstream version 0.1.4

Thorsten Alteholz alteholz at moszumanska.debian.org
Thu Feb 4 19:01:40 UTC 2016


This is an automated email from the git hooks/post-receive script.

alteholz pushed a commit to branch master
in repository node-array-parallel.

commit a5b7119ca32f21cfbab1ab616da55827739ec41a
Author: Thorsten Alteholz <debian at alteholz.de>
Date:   Thu Feb 4 20:01:30 2016 +0100

    Imported Upstream version 0.1.4
---
 .travis.yml    |  5 ++---
 component.json |  9 ++++++---
 index.js       |  8 ++++----
 package.json   |  2 +-
 test.html      | 11 +++++++++++
 test.js        | 10 +++++++---
 6 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 8150243..fc59ade 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,5 @@
 language: node_js
 node_js:
-  - "0.4"
-  - "0.6"
   - "0.8"
-  - "0.10"
\ No newline at end of file
+  - "0.10"
+  - "0.12"
diff --git a/component.json b/component.json
index 2a4a859..940fc1d 100644
--- a/component.json
+++ b/component.json
@@ -2,10 +2,13 @@
   "name": "array-parallel",
   "description": "Call an array of asynchronous functions in parallel",
   "repo": "array-parallel",
-  "version": "0.1.3",
+  "version": "0.1.4",
   "main": "index.js",
   "scripts": [
     "index.js"
   ],
-  "license": "MIT"
-}
\ No newline at end of file
+  "license": "MIT",
+  "development": {
+    "component/assert": "*"
+  }
+}
diff --git a/index.js b/index.js
index ccd193e..1e0ae09 100644
--- a/index.js
+++ b/index.js
@@ -14,11 +14,11 @@ module.exports = function parallel(fns, context, callback) {
   var finished = false
   var results = new Array(pending)
 
-  fns.forEach(context ? function (fn, i) {
+
+  for (var i = 0, l = fns.length; i < l; i++) {
+    var fn = fns[i]
     fn.call(context, maybeDone(i))
-  } : function (fn, i) {
-    fn(maybeDone(i))
-  })
+  }
 
   function maybeDone(i) {
     return function (err, result) {
diff --git a/package.json b/package.json
index 12e1f26..054f385 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
   "name": "array-parallel",
   "description": "Call an array of asynchronous functions in parallel",
-  "version": "0.1.3",
+  "version": "0.1.4",
   "scripts": {
     "test": "node test"
   },
diff --git a/test.html b/test.html
new file mode 100644
index 0000000..8434081
--- /dev/null
+++ b/test.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset='utf8'>
+    <title>array-parallel tests</title>
+  </head>
+  <body>
+    <script src='build/build.js'></script>
+    <script src='test.js'></script>
+  </body>
+</html>
diff --git a/test.js b/test.js
index d2266ce..ad20e60 100644
--- a/test.js
+++ b/test.js
@@ -1,5 +1,9 @@
 var assert = require('assert')
-var parallel = require('./')
+try {
+  var parallel = require('array-parallel')
+} catch (e) {
+  var parallel = require('./')
+}
 
 var a, b, c
 parallel([
@@ -57,6 +61,6 @@ parallel([function (done) {
   done()
 }])
 
-process.nextTick(function () {
+setTimeout(function () {
   assert.equal(f, true)
-})
\ No newline at end of file
+})

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-array-parallel.git



More information about the Pkg-javascript-commits mailing list