1 | /*
|
2 | * Tests that if the user modifies the list of functions passed to
|
3 | * vasync.pipeline, vasync ignores the changes and does not crash.
|
4 | */
|
5 | var assert = require('assert');
|
6 | var vasync = require('../lib/vasync');
|
7 | var count = 0;
|
8 | var funcs;
|
9 |
|
10 | function doStuff(_, callback)
|
11 | {
|
12 | count++;
|
13 | setImmediate(callback);
|
14 | }
|
15 |
|
16 | funcs = [ doStuff, doStuff, doStuff ];
|
17 |
|
18 | vasync.pipeline({
|
19 | 'funcs': funcs
|
20 | }, function (err) {
|
21 | assert.ok(!err);
|
22 | assert.ok(count === 3);
|
23 | });
|
24 |
|
25 | funcs.push(doStuff);
|