summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin van Zonneveld <kevin@transloadit.com>2013-10-14 18:42:33 +0200
committerKevin van Zonneveld <kevin@transloadit.com>2013-10-14 18:42:33 +0200
commit93c536b3abef27d08f4f6dc89edb93e338e3656d (patch)
tree041c017c7dbb83c0e09c51a677e23803f92609a6
parentd8601a17ab0bc6a1572227998b6e9182637f37b6 (diff)
downloadasync-93c536b3abef27d08f4f6dc89edb93e338e3656d.tar.gz
Passing an object to .series() may lead to unexpected behavior
Just a friendly reminder for devs that pass an object to `series()`. There are platforms that will execute the functions in seemingly random order. If you or your testsuite rely on order of execution, it's better to just use an array of functions.
-rw-r--r--README.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/README.md b/README.md
index 31cfbab..00f326b 100644
--- a/README.md
+++ b/README.md
@@ -594,6 +594,14 @@ run as a function and the results will be passed to the final callback as an obj
instead of an array. This can be a more readable way of handling results from
async.series.
+**Note** that while many implementations preserve the order of object properties, the
+[ECMAScript Language Specifcation](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
+explicitly states that
+
+> The mechanics and order of enumerating the properties is not specified.
+
+So if you rely on the order in which your series of functions are executed, and want
+this to work on all platforms, consider using an array.
__Arguments__