Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

issue-21.js 475B

12345678910111213141516171819202122232425
  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. function doStuff(_, callback)
  10. {
  11. count++;
  12. setImmediate(callback);
  13. }
  14. funcs = [ doStuff, doStuff, doStuff ];
  15. vasync.pipeline({
  16. 'funcs': funcs
  17. }, function (err) {
  18. assert.ok(!err);
  19. assert.ok(count === 3);
  20. });
  21. funcs.push(doStuff);