react 0.6.1 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/.travis.yml +5 -2
  2. package/README.md +15 -3
  3. package/browser-test/dist.html +1 -0
  4. package/browser-test/index.html +1 -0
  5. package/browser-test/min.html +1 -0
  6. package/dist/react.js +370 -322
  7. package/dist/react.min.js +22 -1
  8. package/doc/advanced.md +11 -2
  9. package/lib/base-task.js +16 -19
  10. package/lib/cb-task.js +5 -5
  11. package/lib/core.js +5 -5
  12. package/lib/dsl.js +29 -29
  13. package/lib/error.js +4 -4
  14. package/lib/event-collector.js +6 -6
  15. package/lib/event-manager.js +7 -3
  16. package/lib/eventemitter.js +3 -3
  17. package/lib/finalcb-first-task.js +4 -4
  18. package/lib/finalcb-task.js +4 -4
  19. package/lib/id.js +3 -3
  20. package/lib/input-parser.js +10 -10
  21. package/lib/log-events.js +23 -14
  22. package/lib/parse.js +3 -3
  23. package/lib/promise-resolve.js +4 -4
  24. package/lib/promise-task.js +4 -4
  25. package/lib/react.js +7 -7
  26. package/lib/ret-task.js +4 -4
  27. package/lib/sprintf.js +4 -4
  28. package/lib/status.js +3 -3
  29. package/lib/task.js +12 -12
  30. package/lib/track-tasks.js +4 -4
  31. package/lib/validate.js +8 -8
  32. package/lib/vcon.js +28 -5
  33. package/lib/when-task.js +7 -8
  34. package/package.json +17 -7
  35. package/test/ast.mocha.js +4 -4
  36. package/test/cb-task.mocha.js +17 -17
  37. package/test/core-deferred.mocha.js +8 -8
  38. package/test/core-when.mocha.js +7 -7
  39. package/test/core.mocha.js +52 -52
  40. package/test/dsl.mocha.js +45 -43
  41. package/test/event-manager.mocha.js +2 -2
  42. package/test/exec-options.mocha.js +4 -4
  43. package/test/finalcb-task.mocha.js +6 -6
  44. package/test/input-parser.mocha.js +1 -1
  45. package/test/log-events.mocha.js +88 -0
  46. package/test/module-use.mocha.js +24 -7
  47. package/test/promise-auto-resolve.mocha.js +4 -4
  48. package/test/ret-task.mocha.js +18 -18
  49. package/test/task.mocha.js +3 -3
  50. package/test/validate-cb-task.mocha.js +11 -11
  51. package/test/validate-ret-task.mocha.js +14 -14
  52. package/test/validate.mocha.js +57 -57
  53. package/test/vcon.mocha.js +13 -13
  54. package/vendor/chai/chai.js +3371 -1158
  55. package/vendor/requirejs/require.js +1447 -1455
  56. package/vendor/requirejs/require.min.js +31 -28
  57. package/vendor/mocha/mocha.css +0 -135
  58. package/vendor/mocha/mocha.js +0 -3589
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
  /*global define:true */
3
2
 
4
3
  if (typeof define !== 'function') {
@@ -7,12 +6,13 @@ if (typeof define !== 'function') {
7
6
 
8
7
  define(['./sprintf', 'util', './status', './event-manager'],
9
8
  function (sprintf, util, STATUS, EventManager) {
9
+ 'use strict';
10
10
 
11
11
  var OUTTASK_A_REQ = 'ast.outTask.a should be an array of string param names';
12
12
 
13
13
  function FinalCbTask(outTaskOptions) {
14
- var taskDef = outTaskOptions.taskDef;
15
- if (typeof(outTaskOptions.cbFunc) !== 'function') throw new Error('callback is not a function');
14
+ var taskDef = outTaskOptions.taskDef;
15
+ if (typeof(outTaskOptions.cbFunc) !== 'function') throw new Error('callback is not a function');
16
16
  var self = this;
17
17
  for (var k in taskDef) {
18
18
  if (true) self[k] = taskDef[k]; // if to make jshint happy
@@ -62,4 +62,4 @@ define(['./sprintf', 'util', './status', './event-manager'],
62
62
 
63
63
  return FinalCbTask;
64
64
 
65
- });
65
+ });
package/lib/id.js CHANGED
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
  /*global define:true */
3
2
 
4
3
  if (typeof define !== 'function') {
@@ -6,7 +5,8 @@ if (typeof define !== 'function') {
6
5
  }
7
6
 
8
7
  define([], function () {
9
-
8
+ 'use strict';
9
+
10
10
  var startingId = 0;
11
11
 
12
12
  function createUniqueId() {
@@ -19,4 +19,4 @@ define([], function () {
19
19
  createUniqueId: createUniqueId
20
20
  };
21
21
 
22
- });
22
+ });
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
  /*global define:true */
3
2
 
4
3
  if (typeof define !== 'function') {
@@ -6,16 +5,17 @@ if (typeof define !== 'function') {
6
5
  }
7
6
 
8
7
  define(['./event-manager'], function (EventManager) {
8
+ 'use strict';
9
9
 
10
10
  var defaultExecOptions = {
11
11
  reactExecOptions: true,
12
12
  outputStyle: 'cb',
13
13
  };
14
14
 
15
- var OUTPUT_STYLES = {
16
- CALLBACK: 'cb',
17
- NONE: 'none'
18
- };
15
+ var OUTPUT_STYLES = {
16
+ CALLBACK: 'cb',
17
+ NONE: 'none'
18
+ };
19
19
 
20
20
  function isExecOptions(x) { return (x && x.reactExecOptions); }
21
21
  function execOptionsFilter(x) { return isExecOptions(x); }
@@ -31,16 +31,16 @@ define(['./event-manager'], function (EventManager) {
31
31
  if (style === OUTPUT_STYLES.CALLBACK && args.length) result.cb = args.shift(); // next take the cb
32
32
  result.extra = args; // these remaining were after the callback
33
33
  return result;
34
- }
35
-
34
+ }
35
+
36
36
  function inputParser(inputArgs, ast) {
37
37
  var parsedInput = { };
38
38
  var execOptionsArr = inputArgs.filter(execOptionsFilter);
39
39
  execOptionsArr.unshift(defaultExecOptions);
40
40
  parsedInput.options = execOptionsArr.reduce(mergeExecOptions, {});
41
41
 
42
- var args = inputArgs.filter(nonExecOptionsFilter);
43
- var splitResult = splitArgs(args, ast.inParams, parsedInput.options.outputStyle);
42
+ var args = inputArgs.filter(nonExecOptionsFilter);
43
+ var splitResult = splitArgs(args, ast.inParams, parsedInput.options.outputStyle);
44
44
  parsedInput.args = splitResult.args;
45
45
  parsedInput.cb = splitResult.cb;
46
46
  if (splitResult.outputStyle) parsedInput.options.outputStyle = splitResult.outputStyle;
@@ -53,4 +53,4 @@ define(['./event-manager'], function (EventManager) {
53
53
  inputParser.defaultExecOptions = defaultExecOptions;
54
54
  return inputParser;
55
55
 
56
- });
56
+ });
package/lib/log-events.js CHANGED
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
  /*global define:true */
3
2
 
4
3
  if (typeof define !== 'function') {
@@ -6,9 +5,10 @@ if (typeof define !== 'function') {
6
5
  }
7
6
 
8
7
  define(['util'], function (util) { // TODO replace util.inspect with something portable to browser
8
+ 'use strict';
9
9
 
10
10
  var logEventsMod = { };
11
-
11
+
12
12
  /**
13
13
  Log events to console.error
14
14
 
@@ -20,31 +20,31 @@ define(['util'], function (util) { // TODO replace util.inspect with something p
20
20
  react.logEvents(flowFn, 'flow.*'); // log all flow events on flowFn only
21
21
  */
22
22
 
23
- var ALL_FLOW_EVENTS = 'flow.*';
23
+ var ALL_FLOW_EVENTS = 'flow.*';
24
24
  var ALL_TASK_EVENTS = 'task.*';
25
25
  var FLOW_RE = /^flow\./;
26
26
 
27
27
  function flowLog(obj) {
28
28
  /*jshint validthis: true */
29
29
  var time = new Date();
30
- time.setTime(obj.time);
30
+ time.setTime(obj.startTime);
31
31
  var argsNoCb = obj.args.filter(function (a) { return (typeof(a) !== 'function'); });
32
32
  var eventTimeStr = time.toISOString();
33
33
  if (this.event === 'flow.complete') {
34
- var env = obj;
34
+ var env = obj;
35
35
  console.error('%s: %s \tmsecs: %s \n\targs: %s \n\tresults: %s\n',
36
- this.event, env.name, env.elapsedTime, util.inspect(argsNoCb), util.inspect(env.results));
36
+ this.event, env.name, env.elapsedTime, util.inspect(argsNoCb), util.inspect(env.results));
37
37
  } else {
38
38
  var name = obj.name;
39
39
  var args = obj.args;
40
40
  console.error('%s: %s \n\targs: %s\n', this.event, name, util.inspect(argsNoCb));
41
- }
41
+ }
42
42
  }
43
43
 
44
44
  function taskLog(obj) {
45
45
  /*jshint validthis: true */
46
46
  var time = new Date();
47
- time.setTime(obj.time);
47
+ time.setTime(obj.startTime);
48
48
  var argsNoCb = obj.args.filter(function (a) { return (typeof(a) !== 'function'); });
49
49
  var eventTimeStr = time.toISOString();
50
50
  if (this.event === 'task.complete') {
@@ -56,37 +56,46 @@ define(['util'], function (util) { // TODO replace util.inspect with something p
56
56
  var args = obj.args;
57
57
  console.error('%s: %s:%s \n\targs: %s\n', this.event, obj.env.name, obj.name, util.inspect(argsNoCb));
58
58
  }
59
-
59
+
60
60
  }
61
61
 
62
62
  /**
63
63
  Log flow and task events for a flowFn or all of react.
64
64
  If called multiple times, remove previous listener (if any) before
65
65
  adding.
66
-
66
+
67
67
  @example
68
68
  var react = require('react');
69
69
  react.logEvents(flowFn, eventWildcard); //log events on flowfn matching wildcard
70
-
70
+
71
71
  @param flowFn Flow function or global react object
72
72
  @param eventWildcard wildcarded event type, if not provided use flow.* and task.*
73
73
  */
74
74
  function logEvents(flowFn, eventWildcard) {
75
75
  if (!flowFn) throw new Error('flowFn is required');
76
- if (eventWildcard && eventWildcard !== '*') {
76
+ if (!flowFn.events._loggingEvents) flowFn.events._loggingEvents = [];
77
+ if (eventWildcard === false) { // turn off logging
78
+ flowFn.events._loggingEvents.forEach(function (evt) {
79
+ flowFn.events.removeAllListeners(evt);
80
+ });
81
+ flowFn.events._loggingEvents.length = 0; // clear
82
+ } else if (eventWildcard && eventWildcard !== '*') {
77
83
  var logFn = (FLOW_RE.test(eventWildcard)) ? flowLog : taskLog;
78
84
  flowFn.events.removeListener(eventWildcard, logFn);
79
85
  flowFn.events.on(eventWildcard, logFn);
86
+ flowFn.events._loggingEvents.push(eventWildcard);
80
87
  } else { // none provided, use flow.* and task.*
81
88
  //output events as tasks start and complete
82
89
  flowFn.events.removeListener(ALL_FLOW_EVENTS, flowLog);
83
90
  flowFn.events.on(ALL_FLOW_EVENTS, flowLog);
91
+ flowFn.events._loggingEvents.push(ALL_FLOW_EVENTS);
84
92
  flowFn.events.removeListener(ALL_TASK_EVENTS, taskLog);
85
- flowFn.events.on(ALL_TASK_EVENTS, taskLog);
93
+ flowFn.events.on(ALL_TASK_EVENTS, taskLog);
94
+ flowFn.events._loggingEvents.push(ALL_TASK_EVENTS);
86
95
  }
87
96
  }
88
97
 
89
98
  logEventsMod.logEvents = logEvents;
90
99
  return logEventsMod;
91
100
 
92
- });
101
+ });
package/lib/parse.js CHANGED
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
  /*global define:true */
3
2
 
4
3
  if (typeof define !== 'function') {
@@ -6,6 +5,7 @@ if (typeof define !== 'function') {
6
5
  }
7
6
 
8
7
  define(['./sprintf'], function (sprintf) {
8
+ 'use strict';
9
9
 
10
10
  function splitTrimFilterArgs(commaSepArgs) { //parse 'one, two' into ['one', 'two']
11
11
  if (!commaSepArgs) return [];
@@ -30,7 +30,7 @@ define(['./sprintf'], function (sprintf) {
30
30
  return result;
31
31
  } else { // no match
32
32
  throw new Error(sprintf(errStr, str));
33
- }
33
+ }
34
34
  }
35
35
 
36
36
  return {
@@ -38,4 +38,4 @@ define(['./sprintf'], function (sprintf) {
38
38
  parseStr: parseStr
39
39
  };
40
40
 
41
- });
41
+ });
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
  /*global define:true */
3
2
 
4
3
  if (typeof define !== 'function') {
@@ -6,6 +5,7 @@ if (typeof define !== 'function') {
6
5
  }
7
6
 
8
7
  define([], function () {
8
+ 'use strict';
9
9
 
10
10
  /**
11
11
  Auto resolve promises passed in as arguments to the flow
@@ -17,9 +17,9 @@ define([], function () {
17
17
  */
18
18
 
19
19
 
20
- var PROMISE_SUFFIX = '__promise'; // added to param names that are promises
20
+ var PROMISE_SUFFIX = '__promise'; // added to param names that are promises
21
21
 
22
- var resolvingPromises = false;
22
+ var resolvingPromises = false;
23
23
 
24
24
  function resolvePromises(react) {
25
25
  if (resolvingPromises) return; // already resolving
@@ -47,4 +47,4 @@ define([], function () {
47
47
 
48
48
  return resolvePromises;
49
49
 
50
- });
50
+ });
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
  /*global define:true */
3
2
 
4
3
  if (typeof define !== 'function') {
@@ -6,6 +5,7 @@ if (typeof define !== 'function') {
6
5
  }
7
6
 
8
7
  define(['util', './sprintf', './base-task'], function (util, sprintf, BaseTask) {
8
+ 'use strict';
9
9
 
10
10
  /**
11
11
  PromiseTask is a task which executes a fn that returns a promise
@@ -42,7 +42,7 @@ define(['util', './sprintf', './base-task'], function (util, sprintf, BaseTask)
42
42
  taskDef.a.every(function (x) { return (typeof(x) === 'string'); }))) {
43
43
  errors.push(format_error(A_REQ, taskDef));
44
44
  }
45
- if (! (Array.isArray(taskDef.out) && taskDef.out.length <= 1 &&
45
+ if (! (Array.isArray(taskDef.out) && taskDef.out.length <= 1 &&
46
46
  taskDef.out.every(function (x) { return (typeof(x) === 'string'); }))) {
47
47
  errors.push(format_error(OUT_REQ, taskDef));
48
48
  }
@@ -85,9 +85,9 @@ define(['util', './sprintf', './base-task'], function (util, sprintf, BaseTask)
85
85
  }
86
86
  } catch (err) { //catch and handle the task error, calling final cb
87
87
  handleError(this, err);
88
- }
88
+ }
89
89
  };
90
90
 
91
91
  return PromiseTask;
92
92
 
93
- });
93
+ });
package/lib/react.js CHANGED
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
  /*global define:true */
3
2
 
4
3
  if (typeof define !== 'function') {
@@ -7,9 +6,10 @@ if (typeof define !== 'function') {
7
6
 
8
7
  define(['./core', './dsl', './track-tasks', './log-events', './promise-resolve', './event-collector'],
9
8
  function (core, dsl, trackTasksFn, logEventsMod, resolvePromisesFn, eventCollectorFactory) {
9
+ 'use strict';
10
10
 
11
11
  var react = dsl; // core + default dsl
12
-
12
+
13
13
  /**
14
14
  Enable detection of promises and resolution
15
15
  */
@@ -23,8 +23,8 @@ define(['./core', './dsl', './track-tasks', './log-events', './promise-resolve',
23
23
  */
24
24
  function trackTasks() {
25
25
  trackTasksFn(react);
26
- }
27
-
26
+ }
27
+
28
28
  /**
29
29
  If called, load the built-in plugin for log events and invoke
30
30
 
@@ -32,7 +32,7 @@ define(['./core', './dsl', './track-tasks', './log-events', './promise-resolve',
32
32
  @param eventWildcard [string] pattern to log events for
33
33
  */
34
34
  function logEvents(flowFn, eventWildcard) {
35
- if (!eventWildcard && typeof(flowFn) === 'string') { // only wildcard provided
35
+ if (typeof(flowFn) !== 'function') { // only wildcard provided
36
36
  eventWildcard = flowFn;
37
37
  flowFn = undefined;
38
38
  }
@@ -53,7 +53,7 @@ define(['./core', './dsl', './track-tasks', './log-events', './promise-resolve',
53
53
  react.logEvents = logEvents; // enable event logging
54
54
  react.resolvePromises = resolvePromises; // enable promise resolution
55
55
  react.trackTasks = trackTasks; // enable tracking of tasks
56
- react.createEventCollector = createEventCollector; // create instance of EventCollector
56
+ react.createEventCollector = createEventCollector; // create instance of EventCollector
57
57
  return react;
58
-
58
+
59
59
  });
package/lib/ret-task.js CHANGED
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
  /*global define:true */
3
2
 
4
3
  if (typeof define !== 'function') {
@@ -6,7 +5,8 @@ if (typeof define !== 'function') {
6
5
  }
7
6
 
8
7
  define(['util', './sprintf', './base-task'], function (util, sprintf, BaseTask) {
9
-
8
+ 'use strict';
9
+
10
10
  function format_error(errmsg, obj) {
11
11
  return sprintf('%s - %s', errmsg, util.inspect(obj));
12
12
  }
@@ -50,7 +50,7 @@ define(['util', './sprintf', './base-task'], function (util, sprintf, BaseTask)
50
50
  RetTask.prototype.exec = function exec(vCon, handleError, contExec) {
51
51
  try {
52
52
  var args = this.a.map(function (k) { return vCon.getVar(k); }); //get args from vCon
53
- this.start(args); //note the start time, args
53
+ this.start(args); //note the start time, args
54
54
  var func = this.f;
55
55
  var bindObj = vCon.getVar('this'); //global space or the original this
56
56
  if (this.isMethodCall()) { //if method call then reset func and bindObj
@@ -68,4 +68,4 @@ define(['util', './sprintf', './base-task'], function (util, sprintf, BaseTask)
68
68
 
69
69
  return RetTask;
70
70
 
71
- });
71
+ });
package/lib/sprintf.js CHANGED
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
  /*global define:true sprint:true */
3
2
 
4
3
  if (typeof define !== 'function') {
@@ -6,13 +5,14 @@ if (typeof define !== 'function') {
6
5
  }
7
6
 
8
7
  define(['util'], function (util) {
8
+ 'use strict';
9
9
 
10
10
  /**
11
11
  Abstract the details of getting a sprintf function.
12
12
  Currently using the simple format capabilities of node's util.format
13
13
  */
14
-
14
+
15
15
  var sprintf = util.format;
16
16
  return sprintf;
17
-
18
- });
17
+
18
+ });
package/lib/status.js CHANGED
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
  /*global define:true */
3
2
 
4
3
  if (typeof define !== 'function') {
@@ -6,9 +5,10 @@ if (typeof define !== 'function') {
6
5
  }
7
6
 
8
7
  define([], function () {
9
-
8
+ 'use strict';
9
+
10
10
  var STATUS = { READY: 'ready', RUNNING: 'running', ERRORED: 'errored', COMPLETE: 'complete' };
11
11
 
12
12
  return STATUS;
13
13
 
14
- });
14
+ });
package/lib/task.js CHANGED
@@ -1,4 +1,3 @@
1
- 'use strict';
2
1
  /*global define:true */
3
2
 
4
3
  if (typeof define !== 'function') {
@@ -11,7 +10,8 @@ define(['util', './sprintf', 'ensure-array', './cb-task', './promise-task',
11
10
  function (util, sprintf, array, CbTask, PromiseTask,
12
11
  RetTask, WhenTask, FinalCbTask, FinalCbFirstSuccTask,
13
12
  STATUS, error, VContext, EventManager) {
14
-
13
+ 'use strict';
14
+
15
15
  var TASK_TYPES = {
16
16
  cb: CbTask,
17
17
  ret: RetTask,
@@ -46,13 +46,13 @@ function (util, sprintf, array, CbTask, PromiseTask,
46
46
  */
47
47
  function setMissingType(taskDef) {
48
48
  if (taskDef.type) return taskDef; //already set, return
49
- taskDef.type = 'cb';
49
+ taskDef.type = 'cb';
50
50
  return taskDef;
51
51
  }
52
52
 
53
53
  function setMissingOutTaskType(taskDef) {
54
54
  if (!taskDef.type) taskDef.type = Object.keys(OUT_TASK_TYPES)[0]; //use first outTask type as default
55
- }
55
+ }
56
56
 
57
57
  function ensureAfterArrStrings(taskDef) { // convert any fn to str, and make sure is array
58
58
  if (!taskDef.after) return;
@@ -65,14 +65,14 @@ function (util, sprintf, array, CbTask, PromiseTask,
65
65
  @returns array of errors for taskDef, could be empty
66
66
  */
67
67
  function validate(taskDef) {
68
- if (!taskDef || typeof(taskDef) !== 'object') {
68
+ if (!taskDef || typeof(taskDef) !== 'object') {
69
69
  return [format_error(TASKDEF_IS_OBJECT, taskDef)];
70
70
  }
71
71
  setMissingType(taskDef);
72
72
  ensureAfterArrStrings(taskDef);
73
73
  var errors = [];
74
74
  errors = errors.concat(validateTaskType(taskDef));
75
- errors = errors.concat(validateTask(taskDef));
75
+ errors = errors.concat(validateTask(taskDef));
76
76
  return errors;
77
77
  }
78
78
 
@@ -99,13 +99,13 @@ function (util, sprintf, array, CbTask, PromiseTask,
99
99
  setMissingOutTaskType(taskDef);
100
100
  var taskCons = OUT_TASK_TYPES[taskDef.type];
101
101
  errors = errors.concat(taskCons.validate(taskDef));
102
- return errors;
102
+ return errors;
103
103
  }
104
104
 
105
105
 
106
106
  function validateLocalFunctions(inParams, taskDefs, locals) {
107
107
  var errors = [];
108
- function foo() { } //used to mock args as fns for validation check
108
+ function foo() { } //used to mock args as fns for validation check
109
109
  var mock_args = inParams.map(function (p) { return foo; }); //mock args with fns
110
110
  var vCon = VContext.create(mock_args, inParams, locals);
111
111
  var tasks = taskDefs.map(create);
@@ -178,7 +178,7 @@ function (util, sprintf, array, CbTask, PromiseTask,
178
178
  var TaskConstructor = outTaskOptions.TaskConstructor; // hook could have changed
179
179
  return new TaskConstructor(outTaskOptions);
180
180
  }
181
-
181
+
182
182
  function createErrorHandler(vCon, outTask) {
183
183
  return function handleError(task, err) {
184
184
  task.status = STATUS.ERRORED;
@@ -196,7 +196,7 @@ function (util, sprintf, array, CbTask, PromiseTask,
196
196
 
197
197
  function execTasks(tasksReady, vCon, handleError, contExec) {
198
198
  tasksReady.forEach(function (t) { t.status = STATUS.READY; }); //set ready first, no double exec
199
- tasksReady.forEach(function (t) { t.exec(vCon, handleError, contExec); });
199
+ tasksReady.forEach(function (t) { t.exec(vCon, handleError, contExec); });
200
200
  }
201
201
 
202
202
  /**
@@ -227,7 +227,7 @@ function (util, sprintf, array, CbTask, PromiseTask,
227
227
 
228
228
  function serializeTasks(tasks) { // conveniently set after for each task idx > 0
229
229
  nameTasks(tasks);
230
- tasks.forEach(function (t, idx, arr) { if (idx !== 0) t.after = [arr[idx - 1].name]; });
230
+ tasks.forEach(function (t, idx, arr) { if (idx !== 0) t.after = [arr[idx - 1].name]; });
231
231
  return tasks;
232
232
  }
233
233
 
@@ -248,4 +248,4 @@ function (util, sprintf, array, CbTask, PromiseTask,
248
248
  findReadyAndExec: findReadyAndExec
249
249
  };
250
250
 
251
- });
251
+ });