react 0.3.5 → 0.6.0

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 (310) hide show
  1. package/.npmignore +2 -1
  2. package/.travis.yml +4 -0
  3. package/Jakefile.js +34 -3
  4. package/README.md +34 -174
  5. package/browser-test/dist.html +90 -0
  6. package/browser-test/index.html +86 -0
  7. package/browser-test/min.html +90 -0
  8. package/dist/react.js +3291 -0
  9. package/dist/react.min.js +1 -0
  10. package/doc/advanced.md +166 -0
  11. package/doc/color-def.graffle +938 -0
  12. package/doc/color-def.png +0 -0
  13. package/doc/simple.dot +25 -0
  14. package/doc/simple.png +0 -0
  15. package/examples/{default1.js → longer-example.js} +0 -0
  16. package/examples/{default-simple.js → simple.js} +0 -0
  17. package/examples/{ast1.js → using-ast-directly.js} +4 -0
  18. package/examples/{default-events1.js → using-events1.js} +1 -1
  19. package/examples/{default-log-events.js → using-log-events.js} +1 -1
  20. package/lib/base-task.js +116 -110
  21. package/lib/cb-task.js +71 -67
  22. package/lib/core.js +120 -109
  23. package/lib/dsl.js +120 -115
  24. package/lib/error.js +44 -36
  25. package/lib/event-collector.js +81 -0
  26. package/lib/event-manager.js +66 -55
  27. package/lib/eventemitter.js +20 -0
  28. package/lib/finalcb-first-task.js +56 -53
  29. package/lib/finalcb-task.js +55 -51
  30. package/lib/id.js +18 -6
  31. package/lib/input-parser.js +49 -41
  32. package/lib/log-events.js +81 -60
  33. package/lib/parse.js +34 -25
  34. package/lib/promise-resolve.js +50 -0
  35. package/lib/promise-task.js +78 -74
  36. package/lib/react.js +59 -0
  37. package/lib/ret-task.js +59 -55
  38. package/lib/sprintf.js +18 -0
  39. package/lib/status.js +11 -2
  40. package/lib/task.js +219 -213
  41. package/lib/track-tasks.js +67 -110
  42. package/lib/validate.js +136 -136
  43. package/lib/vcon.js +78 -69
  44. package/lib/when-task.js +69 -65
  45. package/package.json +11 -9
  46. package/src/dist.build.requirejs +20 -0
  47. package/test/ast.mocha.js +136 -0
  48. package/test/cb-task.mocha.js +220 -0
  49. package/test/core-deferred.mocha.js +143 -0
  50. package/test/core-when.mocha.js +96 -0
  51. package/test/core.mocha.js +589 -0
  52. package/test/dsl.mocha.js +350 -0
  53. package/test/event-manager.mocha.js +119 -0
  54. package/test/exec-options.mocha.js +48 -0
  55. package/test/finalcb-task.mocha.js +58 -0
  56. package/test/input-parser.mocha.js +86 -0
  57. package/test/mocha.opts +2 -0
  58. package/test/module-use.mocha.js +147 -0
  59. package/test/promise-auto-resolve.mocha.js +68 -0
  60. package/test/ret-task.mocha.js +220 -0
  61. package/test/task.mocha.js +42 -0
  62. package/test/validate-cb-task.mocha.js +100 -0
  63. package/test/validate-ret-task.mocha.js +110 -0
  64. package/test/validate.mocha.js +324 -0
  65. package/test/vcon.mocha.js +193 -0
  66. package/vendor/chai/chai.js +2038 -0
  67. package/vendor/jquery/jquery-1.7.1.js +9266 -0
  68. package/vendor/jquery/jquery-1.7.1.min.js +4 -0
  69. package/vendor/mocha/mocha.css +135 -0
  70. package/vendor/mocha/mocha.js +3589 -0
  71. package/vendor/node/util.js +531 -0
  72. package/vendor/requirejs/require.js +2053 -0
  73. package/vendor/requirejs/require.min.js +33 -0
  74. package/doc/alternate-dsls.md +0 -103
  75. package/doc/default-simple.dot +0 -19
  76. package/doc/default-simple.dot.png +0 -0
  77. package/dsl/chain.js +0 -150
  78. package/dsl/fstr.js +0 -121
  79. package/dsl/pcode.js +0 -175
  80. package/examples/chain-events1.js +0 -55
  81. package/examples/chain1.js +0 -19
  82. package/examples/fstr-events1.js +0 -38
  83. package/examples/fstr1.js +0 -37
  84. package/examples/pcode1.js +0 -22
  85. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia.html +0 -675
  86. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/37px-Wiktionary-logo-en.svg.png +0 -0
  87. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/closewindow.png +0 -0
  88. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/index(1).php +0 -407
  89. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/index.php +0 -130
  90. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/load(1).php +0 -3
  91. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/load(10).php +0 -89
  92. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/load(2).php +0 -23
  93. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/load(3).php +0 -153
  94. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/load(4).php +0 -6
  95. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/load(5).php +0 -3
  96. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/load(6).php +0 -96
  97. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/load(7).php +0 -16
  98. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/load(8).php +0 -14
  99. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/load(9).php +0 -123
  100. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/load.php +0 -3
  101. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/poweredby_mediawiki_88x31.png +0 -0
  102. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/saved_resource +0 -1
  103. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/search-ltr.png +0 -0
  104. package/externalDocs/Dataflow - Wikipedia, the free encyclopedia_files/wikimedia-button.png +0 -0
  105. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's.html +0 -1369
  106. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/121911_DobbsDigest_Cover.jpg +0 -0
  107. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/160-x-600-IMU Impact 2012.jpg +0 -0
  108. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp= +0 -68
  109. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=(1) +0 -67
  110. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=(2) +0 -2
  111. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=(3) +0 -2
  112. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=(4) +0 -8
  113. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=(5) +0 -2
  114. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=500202461 +0 -2
  115. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=500202461(1) +0 -2
  116. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=500202461(2) +0 -2
  117. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=500202461(3) +0 -2
  118. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=500202461(4) +0 -2
  119. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=500202461(5) +0 -431
  120. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=500202461(6) +0 -2
  121. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=500202461(7) +0 -431
  122. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=500202461(8) +0 -2
  123. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/231400148;kvarticleid=231400148;kauthor=Jim Falgout;loc=100;target=_blank;grp=500202461(9) +0 -2
  124. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/Ad0St1Sz6Sq0V0Id20628317.gif +0 -0
  125. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/Ad2331174St1Sz225Sq20825250V0Id4.gif +0 -0
  126. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/AdTracImage.gif +0 -0
  127. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/Default_Size_16_1x1.gif +0 -0
  128. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/FB.Share +0 -9
  129. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/addthis_widget.js +0 -2
  130. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/adlink_5242_1183459_0_154_AdId=2355270;BnId=1;itime=820768810;key=231400148+_database_231400148;link= +0 -11
  131. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/beacon.js +0 -7
  132. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/checkauth.js +0 -18
  133. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/colorbox.css +0 -49
  134. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/convert_data.js +0 -1
  135. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/count(1).js +0 -5
  136. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/count.js +0 -5
  137. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/count.json +0 -1
  138. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/dataflow1.gif +0 -0
  139. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/def.html +0 -126
  140. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/defaults.css +0 -1
  141. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/detect.js +0 -91
  142. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/devtest_left-col-slim.css +0 -30
  143. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/disqus.js +0 -327
  144. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/disqusHints.css +0 -34
  145. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/disqusHints.js +0 -8
  146. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/disqusLoggedOff(1).css +0 -24
  147. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/disqusLoggedOff.css +0 -24
  148. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/dobbs_disqus_logo.gif +0 -0
  149. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/dsqcd10c7f376188a4a2ca3e8fea2c03aeb.css +0 -1
  150. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/dsqcd10c7f376188a4a2ca3e8fea2c03aeb.js +0 -1
  151. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/elqCfg.js +0 -55
  152. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/elqImg.js +0 -12
  153. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/embed.js +0 -76
  154. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/experience_util.js +0 -636
  155. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/fastbutton.html +0 -11
  156. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/ga.js +0 -51
  157. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/h-facebook_sm.png +0 -0
  158. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/h-nav.css +0 -798
  159. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/h-twitter_sm.png +0 -0
  160. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/h_s_code_remote.js +0 -377
  161. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/hintbox_info.jpg +0 -0
  162. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/hub.1326407570.html +0 -3
  163. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/in.js +0 -76
  164. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/insight.min.js +0 -55
  165. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/jquery-1.2.6.min.js +0 -32
  166. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/jquery-1.4.2.min.js +0 -154
  167. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/jquery-ui-1.8rc3.custom.min.js +0 -374
  168. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/jquery.colorbox-min.js +0 -4
  169. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/jquery.min.js +0 -154
  170. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/lib.js +0 -212
  171. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/like.html +0 -214
  172. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/noavatar32.png +0 -0
  173. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/nodetag.js +0 -18
  174. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/nonSecureAnonymousFramework +0 -2913
  175. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/p.json +0 -1
  176. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/plusone.js +0 -32
  177. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/popwindow.js +0 -24
  178. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/q4OyybLB0-A.js +0 -91
  179. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/quant.js +0 -28
  180. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/qxvZoiHdpAF.css +0 -192
  181. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/reply.html +0 -160
  182. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/rss.gif +0 -0
  183. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/s.js +0 -1
  184. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/saved_resource +0 -421
  185. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/saved_resource(1) +0 -1
  186. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/saved_resource(2) +0 -341
  187. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/saved_resource(3) +0 -127
  188. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/script84.js +0 -113
  189. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/scripts.js +0 -30
  190. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/sh72.html +0 -5
  191. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shAutoloader.js +0 -17
  192. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushAS3.js +0 -59
  193. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushAppleScript.js +0 -75
  194. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushBash.js +0 -59
  195. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushCSharp.js +0 -65
  196. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushColdFusion.js +0 -100
  197. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushCpp.js +0 -97
  198. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushCss.js +0 -91
  199. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushDelphi.js +0 -55
  200. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushDiff.js +0 -41
  201. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushErlang.js +0 -52
  202. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushGroovy.js +0 -67
  203. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushJScript.js +0 -52
  204. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushJava.js +0 -57
  205. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushJavaFX.js +0 -58
  206. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushPerl.js +0 -72
  207. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushPhp.js +0 -88
  208. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushPlain.js +0 -33
  209. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushPowerShell.js +0 -74
  210. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushPython.js +0 -64
  211. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushRuby.js +0 -55
  212. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushSass.js +0 -94
  213. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushScala.js +0 -51
  214. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushSql.js +0 -66
  215. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushVb.js +0 -56
  216. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shBrushXml.js +0 -69
  217. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shCore.css +0 -226
  218. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shCoreDefault.css +0 -333
  219. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shCore_new.js +0 -17
  220. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shLegacy.js +0 -17
  221. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/shThemeDefault.css +0 -117
  222. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/share-button-css +0 -67
  223. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/share_email_icon.gif +0 -0
  224. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/share_print_icon.gif +0 -0
  225. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/sidebar.js +0 -88
  226. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/superfooter_936.css +0 -186
  227. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/svrGP.aspx +0 -0
  228. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/t.gif +0 -0
  229. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/thickbox.js +0 -343
  230. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/thread.js +0 -128
  231. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/togglediv.js +0 -15
  232. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/tweet_button.html +0 -3
  233. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/ubmtechweb_logo_sm.gif +0 -0
  234. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/upload.html +0 -91
  235. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/welcome.js +0 -7
  236. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/widget74.css +0 -1
  237. package/externalDocs/Dataflow Programming Handling Huge Data Loads Without Adding Complexity Dr Dobb's_files/widgets.js +0 -40
  238. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia.html +0 -904
  239. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/50px-Question_book-new.svg.png +0 -0
  240. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/closewindow.png +0 -0
  241. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/index(1).php +0 -407
  242. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/index.php +0 -130
  243. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/load(1).php +0 -3
  244. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/load(10).php +0 -89
  245. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/load(2).php +0 -23
  246. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/load(3).php +0 -153
  247. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/load(4).php +0 -6
  248. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/load(5).php +0 -3
  249. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/load(6).php +0 -96
  250. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/load(7).php +0 -16
  251. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/load(8).php +0 -14
  252. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/load(9).php +0 -123
  253. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/load.php +0 -3
  254. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/poweredby_mediawiki_88x31.png +0 -0
  255. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/saved_resource +0 -1
  256. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/search-ltr.png +0 -0
  257. package/externalDocs/Reactive programming - Wikipedia, the free encyclopedia_files/wikimedia-button.png +0 -0
  258. package/externalDocs/The Step of the Conductor - How To Node - NodeJS.html +0 -113
  259. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/6654_111305815684_541245684_2583159_5383291_n_normal.jpg +0 -0
  260. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/MARC3_normal.jpg +0 -2
  261. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/beacon.js +0 -7
  262. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/c953ddd239707998340e1a6fbb3eeb46 +0 -0
  263. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/c953ddd239707998340e1a6fbb3eeb46_normal.jpeg +0 -0
  264. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/clouds2_normal.jpg +0 -0
  265. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/count.json +0 -1
  266. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/def.html +0 -126
  267. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/defaults.css +0 -1
  268. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/disqus.js +0 -327
  269. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/dsq7884a9652e94555c70f96b6be63be216.css +0 -1
  270. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/dsq7884a9652e94555c70f96b6be63be216.js +0 -66
  271. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/embed.js +0 -76
  272. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/example1.dot +0 -0
  273. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/ga.js +0 -51
  274. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/get_num_replies.js +0 -79
  275. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/hub.1326407570.html +0 -3
  276. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/lib.js +0 -212
  277. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/noavatar32.png +0 -0
  278. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/quant.js +0 -28
  279. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/reply.html +0 -160
  280. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/t.gif +0 -0
  281. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/thread.js +0 -128
  282. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/tweet_button.1326407570.html +0 -3
  283. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/twitter_normal.jpg +0 -2
  284. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/upload.html +0 -91
  285. package/externalDocs/The Step of the Conductor - How To Node - NodeJS_files/widgets.js +0 -40
  286. package/jake-tasks/jake-test.js +0 -64
  287. package/promise-resolve.js +0 -35
  288. package/react.js +0 -8
  289. package/test/ast.test.js +0 -69
  290. package/test/cb-task.test.js +0 -197
  291. package/test/core-deferred.test.js +0 -134
  292. package/test/core-promised.test.js +0 -132
  293. package/test/core-when.test.js +0 -84
  294. package/test/core.test.js +0 -568
  295. package/test/dsl.test.js +0 -330
  296. package/test/dsl/chain.test.js +0 -324
  297. package/test/dsl/fstr.test.js +0 -300
  298. package/test/dsl/pcode.test.js +0 -448
  299. package/test/event-manager.test.js +0 -102
  300. package/test/exec-options.test.js +0 -33
  301. package/test/finalcb-task.test.js +0 -38
  302. package/test/input-parser.test.js +0 -66
  303. package/test/module-use.test.js +0 -131
  304. package/test/promise-auto-resolve.test.js +0 -51
  305. package/test/ret-task.test.js +0 -199
  306. package/test/task.test.js +0 -21
  307. package/test/validate-cb-task.test.js +0 -74
  308. package/test/validate-ret-task.test.js +0 -83
  309. package/test/validate.test.js +0 -295
  310. package/test/vcon.test.js +0 -173
@@ -0,0 +1,50 @@
1
+ 'use strict';
2
+ /*global define:true */
3
+
4
+ if (typeof define !== 'function') {
5
+ var define = require('amdefine')(module);
6
+ }
7
+
8
+ define([], function () {
9
+
10
+ /**
11
+ Auto resolve promises passed in as arguments to the flow
12
+
13
+ - Detects promises by checking for .then()
14
+ - Create promise name for param (param__promise)
15
+ - moves existing vCon promise into the param__promise
16
+ - creates WhenTask which resolves param__promise into param
17
+ */
18
+
19
+
20
+ var PROMISE_SUFFIX = '__promise'; // added to param names that are promises
21
+
22
+ var resolvingPromises = false;
23
+
24
+ function resolvePromises(react) {
25
+ if (resolvingPromises) return; // already resolving
26
+ resolvingPromises = true;
27
+
28
+ react.events.on(react.events.TYPES.EXEC_TASKS_PRECREATE, function (env) {
29
+ var vConValues = env.vCon.values;
30
+ var promiseParams = env.ast.inParams.filter(function (p) {
31
+ var value = vConValues[p];
32
+ return (value && typeof(value.then) === 'function');
33
+ });
34
+ promiseParams.forEach(function (p) {
35
+ var promiseName = p + PROMISE_SUFFIX;
36
+ vConValues[promiseName] = vConValues[p];
37
+ vConValues[p] = undefined;
38
+ env.taskDefs.push({
39
+ type: 'when',
40
+ a: [promiseName],
41
+ out: [p]
42
+ });
43
+ });
44
+ });
45
+
46
+ }
47
+
48
+ return resolvePromises;
49
+
50
+ });
@@ -1,89 +1,93 @@
1
1
  'use strict';
2
+ /*global define:true */
2
3
 
3
- /**
4
- PromiseTask is a task which executes a fn that returns a promise
5
- and when it completes it sets the values in vCon
6
- */
4
+ if (typeof define !== 'function') {
5
+ var define = require('amdefine')(module);
6
+ }
7
7
 
8
- var util = require('util');
9
- var sprintf = require('sprintf').sprintf;
8
+ define(['util', './sprintf', './base-task'], function (util, sprintf, BaseTask) {
10
9
 
11
- var BaseTask = require('./base-task.js');
10
+ /**
11
+ PromiseTask is a task which executes a fn that returns a promise
12
+ and when it completes it sets the values in vCon
13
+ */
12
14
 
13
- function format_error(errmsg, obj) {
14
- return sprintf('%s - %s', errmsg, util.inspect(obj));
15
- }
15
+ function format_error(errmsg, obj) {
16
+ return sprintf('%s - %s', errmsg, util.inspect(obj));
17
+ }
16
18
 
17
- var REQ = 'promiseTask requires f, a, out';
18
- var FN_REQ = 'promiseTask requires f to be a function or string';
19
- var A_REQ = 'promiseTask requires a to be an array of string param names';
20
- var OUT_REQ = 'promiseTask requires out to be an array[1] of string param names';
19
+ var REQ = 'promiseTask requires f, a, out';
20
+ var FN_REQ = 'promiseTask requires f to be a function or string';
21
+ var A_REQ = 'promiseTask requires a to be an array of string param names';
22
+ var OUT_REQ = 'promiseTask requires out to be an array[1] of string param names';
21
23
 
22
- function PromiseTask(taskDef) {
23
- var self = this;
24
- Object.keys(taskDef).forEach(function (k) { self[k] = taskDef[k]; });
25
- }
24
+ function PromiseTask(taskDef) {
25
+ var self = this;
26
+ Object.keys(taskDef).forEach(function (k) { self[k] = taskDef[k]; });
27
+ }
26
28
 
27
- PromiseTask.prototype = new BaseTask();
28
- PromiseTask.prototype.constructor = PromiseTask;
29
+ PromiseTask.prototype = new BaseTask();
30
+ PromiseTask.prototype.constructor = PromiseTask;
29
31
 
30
- PromiseTask.validate = function (taskDef) {
31
- var errors = [];
32
- if (!taskDef.f || !taskDef.a || !taskDef.out) {
33
- errors.push(format_error(REQ, taskDef));
34
- } else {
35
- var ftype = typeof(taskDef.f);
36
- if (! ((taskDef.f instanceof Function) || (ftype === 'string'))) {
37
- errors.push(format_error(FN_REQ, taskDef));
32
+ PromiseTask.validate = function (taskDef) {
33
+ var errors = [];
34
+ if (!taskDef.f || !taskDef.a || !taskDef.out) {
35
+ errors.push(format_error(REQ, taskDef));
36
+ } else {
37
+ var ftype = typeof(taskDef.f);
38
+ if (! ((taskDef.f instanceof Function) || (ftype === 'string'))) {
39
+ errors.push(format_error(FN_REQ, taskDef));
40
+ }
41
+ if (! (Array.isArray(taskDef.a) &&
42
+ taskDef.a.every(function (x) { return (typeof(x) === 'string'); }))) {
43
+ errors.push(format_error(A_REQ, taskDef));
44
+ }
45
+ if (! (Array.isArray(taskDef.out) && taskDef.out.length <= 1 &&
46
+ taskDef.out.every(function (x) { return (typeof(x) === 'string'); }))) {
47
+ errors.push(format_error(OUT_REQ, taskDef));
48
+ }
38
49
  }
39
- if (! (Array.isArray(taskDef.a) &&
40
- taskDef.a.every(function (x) { return (typeof(x) === 'string'); }))) {
41
- errors.push(format_error(A_REQ, taskDef));
42
- }
43
- if (! (Array.isArray(taskDef.out) && taskDef.out.length <= 1 &&
44
- taskDef.out.every(function (x) { return (typeof(x) === 'string'); }))) {
45
- errors.push(format_error(OUT_REQ, taskDef));
46
- }
47
- }
48
- return errors;
49
- };
50
+ return errors;
51
+ };
50
52
 
51
- PromiseTask.prototype.prepare = function prepare(handleTaskError, vCon, contExec) {
52
- var self = this;
53
- this.nextFn = function (arg) {
54
- var args = Array.prototype.slice.call(arguments);
55
- vCon.saveResults(self.out, args);
56
- self.complete(args);
57
- contExec();
53
+ PromiseTask.prototype.prepare = function prepare(handleTaskError, vCon, contExec) {
54
+ var self = this;
55
+ this.nextFn = function (arg) {
56
+ var args = Array.prototype.slice.call(arguments);
57
+ vCon.saveResults(self.out, args);
58
+ self.complete(args);
59
+ contExec();
60
+ };
61
+ this.failFn = function (err) {
62
+ handleTaskError(self, err);
63
+ };
58
64
  };
59
- this.failFn = function (err) {
60
- handleTaskError(self, err);
65
+
66
+ PromiseTask.prototype.exec = function exec(vCon, handleError, contExec) {
67
+ try {
68
+ var args = this.a.map(function (k) { return vCon.getVar(k); }); //get args from vCon
69
+ //console.error('PromiseTask.exec.args=', args);
70
+ //console.error('PromiseTask.exec.vCon=', vCon);
71
+ this.start(args); //note the start time, args
72
+ var func = this.f;
73
+ var bindObj = vCon.getVar('this'); //global space or the original this
74
+ if (this.isMethodCall()) { //if method call then reset func and bindObj
75
+ func = vCon.getVar(this.f);
76
+ bindObj = this.getMethodObj(vCon);
77
+ } else if (typeof(func) === 'string') {
78
+ func = vCon.getVar(func); // we want the actual fn from this string
79
+ }
80
+ var retValue = func.apply(bindObj, args);
81
+ if (retValue && typeof(retValue.then) === 'function') { // is a promise
82
+ retValue.then(this.nextFn, this.failFn);
83
+ } else { // just a value, proceed now
84
+ this.nextFn(retValue);
85
+ }
86
+ } catch (err) { //catch and handle the task error, calling final cb
87
+ handleError(this, err);
88
+ }
61
89
  };
62
- };
63
90
 
64
- PromiseTask.prototype.exec = function exec(vCon, handleError, contExec) {
65
- try {
66
- var args = this.a.map(function (k) { return vCon.getVar(k); }); //get args from vCon
67
- //console.error('PromiseTask.exec.args=', args);
68
- //console.error('PromiseTask.exec.vCon=', vCon);
69
- this.start(args); //note the start time, args
70
- var func = this.f;
71
- var bindObj = vCon.getVar('this'); //global space or the original this
72
- if (this.isMethodCall()) { //if method call then reset func and bindObj
73
- func = vCon.getVar(this.f);
74
- bindObj = this.getMethodObj(vCon);
75
- } else if (typeof(func) === 'string') {
76
- func = vCon.getVar(func); // we want the actual fn from this string
77
- }
78
- var retValue = func.apply(bindObj, args);
79
- if (retValue && typeof(retValue.then) === 'function') { // is a promise
80
- retValue.then(this.nextFn, this.failFn);
81
- } else { // just a value, proceed now
82
- this.nextFn(retValue);
83
- }
84
- } catch (err) { //catch and handle the task error, calling final cb
85
- handleError(this, err);
86
- }
87
- };
91
+ return PromiseTask;
88
92
 
89
- module.exports = PromiseTask;
93
+ });
package/lib/react.js ADDED
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+ /*global define:true */
3
+
4
+ if (typeof define !== 'function') {
5
+ var define = require('amdefine')(module);
6
+ }
7
+
8
+ define(['./core', './dsl', './track-tasks', './log-events', './promise-resolve', './event-collector'],
9
+ function (core, dsl, trackTasksFn, logEventsMod, resolvePromisesFn, eventCollectorFactory) {
10
+
11
+ var react = dsl; // core + default dsl
12
+
13
+ /**
14
+ Enable detection of promises and resolution
15
+ */
16
+ function resolvePromises() {
17
+ resolvePromisesFn(react);
18
+ }
19
+
20
+ /**
21
+ Enable tracking of tasks and flow execution, emitting events and
22
+ tracking start, end, elapsed time
23
+ */
24
+ function trackTasks() {
25
+ trackTasksFn(react);
26
+ }
27
+
28
+ /**
29
+ If called, load the built-in plugin for log events and invoke
30
+
31
+ @param flowFn [function] if not provided uses global react
32
+ @param eventWildcard [string] pattern to log events for
33
+ */
34
+ function logEvents(flowFn, eventWildcard) {
35
+ if (!eventWildcard && typeof(flowFn) === 'string') { // only wildcard provided
36
+ eventWildcard = flowFn;
37
+ flowFn = undefined;
38
+ }
39
+ if (!flowFn) flowFn = react; // use global
40
+ trackTasks();
41
+ return logEventsMod.logEvents(flowFn, eventWildcard);
42
+ }
43
+
44
+ /**
45
+ Instantiate an event collector
46
+ */
47
+ function createEventCollector() {
48
+ return eventCollectorFactory(react);
49
+ }
50
+
51
+ react.options = core.options; // global react options
52
+ react.events = core.events; // global react event emitter
53
+ react.logEvents = logEvents; // enable event logging
54
+ react.resolvePromises = resolvePromises; // enable promise resolution
55
+ react.trackTasks = trackTasks; // enable tracking of tasks
56
+ react.createEventCollector = createEventCollector; // create instance of EventCollector
57
+ return react;
58
+
59
+ });
package/lib/ret-task.js CHANGED
@@ -1,67 +1,71 @@
1
1
  'use strict';
2
+ /*global define:true */
2
3
 
3
- var util = require('util');
4
- var sprintf = require('sprintf').sprintf;
4
+ if (typeof define !== 'function') {
5
+ var define = require('amdefine')(module);
6
+ }
5
7
 
6
- var BaseTask = require('./base-task.js');
8
+ define(['util', './sprintf', './base-task'], function (util, sprintf, BaseTask) {
9
+
10
+ function format_error(errmsg, obj) {
11
+ return sprintf('%s - %s', errmsg, util.inspect(obj));
12
+ }
7
13
 
8
- function format_error(errmsg, obj) {
9
- return sprintf('%s - %s', errmsg, util.inspect(obj));
10
- }
14
+ var REQ = 'retTask requires f, a, out';
15
+ var FN_REQ = 'retTask requires f to be a function or string';
16
+ var A_REQ = 'retTask requires a to be an array of string param names';
17
+ var RET_REQ = 'retTask requires out to be an array with single string param name or []';
11
18
 
12
- var REQ = 'retTask requires f, a, out';
13
- var FN_REQ = 'retTask requires f to be a function or string';
14
- var A_REQ = 'retTask requires a to be an array of string param names';
15
- var RET_REQ = 'retTask requires out to be an array with single string param name or []';
19
+ function RetTask(taskDef) {
20
+ var self = this;
21
+ Object.keys(taskDef).forEach(function (k) { self[k] = taskDef[k]; });
22
+ }
16
23
 
17
- function RetTask(taskDef) {
18
- var self = this;
19
- Object.keys(taskDef).forEach(function (k) { self[k] = taskDef[k]; });
20
- }
24
+ RetTask.prototype = new BaseTask();
25
+ RetTask.prototype.constructor = RetTask;
21
26
 
22
- RetTask.prototype = new BaseTask();
23
- RetTask.prototype.constructor = RetTask;
27
+ RetTask.validate = function (taskDef) {
28
+ var errors = [];
29
+ if (!taskDef.f || !taskDef.a || !taskDef.out) {
30
+ errors.push(format_error(REQ, taskDef));
31
+ } else {
32
+ var ftype = typeof(taskDef.f);
33
+ if (! ((taskDef.f instanceof Function) || (ftype === 'string'))) {
34
+ errors.push(format_error(FN_REQ, taskDef));
35
+ }
36
+ if (! (Array.isArray(taskDef.a) &&
37
+ taskDef.a.every(function (x) { return (typeof(x) === 'string'); }))) {
38
+ errors.push(format_error(A_REQ, taskDef));
39
+ }
24
40
 
25
- RetTask.validate = function (taskDef) {
26
- var errors = [];
27
- if (!taskDef.f || !taskDef.a || !taskDef.out) {
28
- errors.push(format_error(REQ, taskDef));
29
- } else {
30
- var ftype = typeof(taskDef.f);
31
- if (! ((taskDef.f instanceof Function) || (ftype === 'string'))) {
32
- errors.push(format_error(FN_REQ, taskDef));
33
- }
34
- if (! (Array.isArray(taskDef.a) &&
35
- taskDef.a.every(function (x) { return (typeof(x) === 'string'); }))) {
36
- errors.push(format_error(A_REQ, taskDef));
41
+ if (! (Array.isArray(taskDef.out) &&
42
+ (taskDef.out.length === 0 ||
43
+ (taskDef.out.length === 1 && typeof(taskDef.out[0] === 'string'))))) {
44
+ errors.push(format_error(RET_REQ, taskDef));
45
+ }
37
46
  }
47
+ return errors;
48
+ };
38
49
 
39
- if (! (Array.isArray(taskDef.out) &&
40
- (taskDef.out.length === 0 ||
41
- (taskDef.out.length === 1 && typeof(taskDef.out[0] === 'string'))))) {
42
- errors.push(format_error(RET_REQ, taskDef));
43
- }
44
- }
45
- return errors;
46
- };
50
+ RetTask.prototype.exec = function exec(vCon, handleError, contExec) {
51
+ try {
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
54
+ var func = this.f;
55
+ var bindObj = vCon.getVar('this'); //global space or the original this
56
+ if (this.isMethodCall()) { //if method call then reset func and bindObj
57
+ func = vCon.getVar(this.f);
58
+ bindObj = this.getMethodObj(vCon);
59
+ } else if (typeof(func) === 'string') {
60
+ func = vCon.getVar(func); // we want the actual fn from this string
61
+ }
62
+ var results = [func.apply(bindObj, args)];
63
+ vCon.saveResults(this.out, results); // save retval, takes arrays
64
+ this.complete(results);
65
+ contExec(); // continue since no callback to run this
66
+ } catch (err) { handleError(this, err); } // catch and handle the task error, calling final cb
67
+ };
47
68
 
48
- RetTask.prototype.exec = function exec(vCon, handleError, contExec) {
49
- try {
50
- var args = this.a.map(function (k) { return vCon.getVar(k); }); //get args from vCon
51
- this.start(args); //note the start time, args
52
- var func = this.f;
53
- var bindObj = vCon.getVar('this'); //global space or the original this
54
- if (this.isMethodCall()) { //if method call then reset func and bindObj
55
- func = vCon.getVar(this.f);
56
- bindObj = this.getMethodObj(vCon);
57
- } else if (typeof(func) === 'string') {
58
- func = vCon.getVar(func); // we want the actual fn from this string
59
- }
60
- var results = [func.apply(bindObj, args)];
61
- vCon.saveResults(this.out, results); // save retval, takes arrays
62
- this.complete(results);
63
- contExec(); // continue since no callback to run this
64
- } catch (err) { handleError(this, err); } // catch and handle the task error, calling final cb
65
- };
69
+ return RetTask;
66
70
 
67
- module.exports = RetTask;
71
+ });
package/lib/sprintf.js ADDED
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+ /*global define:true sprint:true */
3
+
4
+ if (typeof define !== 'function') {
5
+ var define = require('amdefine')(module);
6
+ }
7
+
8
+ define(['sprint'], function (sprintfMod) {
9
+
10
+ /**
11
+ Abstract the details of getting a sprintf function
12
+ */
13
+
14
+ // Sprint doesn't return itself in browser so need to get the global
15
+ var sprintf = (sprintfMod) ? sprintfMod : sprint;
16
+ return sprintf;
17
+
18
+ });
package/lib/status.js CHANGED
@@ -1,5 +1,14 @@
1
1
  'use strict';
2
+ /*global define:true */
2
3
 
3
- var STATUS = { READY: 'ready', RUNNING: 'running', ERRORED: 'errored', COMPLETE: 'complete' };
4
+ if (typeof define !== 'function') {
5
+ var define = require('amdefine')(module);
6
+ }
4
7
 
5
- module.exports = STATUS;
8
+ define([], function () {
9
+
10
+ var STATUS = { READY: 'ready', RUNNING: 'running', ERRORED: 'errored', COMPLETE: 'complete' };
11
+
12
+ return STATUS;
13
+
14
+ });
package/lib/task.js CHANGED
@@ -1,248 +1,254 @@
1
1
  'use strict';
2
+ /*global define:true */
2
3
 
3
- var util = require('util');
4
- var sprintf = require('sprintf').sprintf;
5
- var array = require('ensure-array');
6
- var CbTask = require('./cb-task.js');
7
- var PromiseTask = require('./promise-task.js');
8
- var RetTask = require('./ret-task.js');
9
- var WhenTask = require('./when-task.js');
10
- var FinalCbTask = require('./finalcb-task.js');
11
- var FinalCbFirstSuccTask = require('./finalcb-first-task.js');
12
- var STATUS = require('./status.js');
13
- var error = require('./error.js');
14
- var VContext = require('./vcon.js');
15
- var EventManager = require('./event-manager.js');
16
-
17
- var TASK_TYPES = {
18
- cb: CbTask,
19
- ret: RetTask,
20
- promise: PromiseTask,
21
- when: WhenTask
22
- };
23
- function taskTypeKeys() { return Object.keys(TASK_TYPES); }
24
-
25
- var OUT_TASK_TYPES = {
26
- finalcb: FinalCbTask, //first task is the default if no type specified in taskDef
27
- finalcbFirst: FinalCbFirstSuccTask
28
- };
29
- function outTaskTypeKeys() { return Object.keys(OUT_TASK_TYPES); }
30
-
31
- var LOCAL_FN_MISSING = 'function: %s not found in locals or input params - task[%s]';
32
- var TASKDEF_IS_OBJECT = 'task must be an object';
33
- var NO_TASKS_RUNNING_WONT_COMPLETE = 'no tasks running, flow will not complete, remaining tasks: %s';
34
- var TASK_TYPE_SHOULD_MATCH = 'task.type should match one of ' +
35
- Object.keys(TASK_TYPES).join(', ');
36
-
37
- var validateTaskType, validateTask, create;
38
-
39
-
40
- function format_error(errmsg, obj) {
41
- return sprintf('%s - %s', errmsg, util.inspect(obj));
4
+ if (typeof define !== 'function') {
5
+ var define = require('amdefine')(module);
42
6
  }
43
7
 
44
- /**
45
- guess the missing types from params.
46
- Augments in place but also returns taskDef.
47
- If not specified then is 'cb'
8
+ define(['util', './sprintf', 'ensure-array', './cb-task', './promise-task',
9
+ './ret-task', './when-task', './finalcb-task', './finalcb-first-task',
10
+ './status', './error', './vcon', './event-manager'],
11
+ function (util, sprintf, array, CbTask, PromiseTask,
12
+ RetTask, WhenTask, FinalCbTask, FinalCbFirstSuccTask,
13
+ STATUS, error, VContext, EventManager) {
14
+
15
+ var TASK_TYPES = {
16
+ cb: CbTask,
17
+ ret: RetTask,
18
+ promise: PromiseTask,
19
+ when: WhenTask
20
+ };
21
+
22
+ var DEFAULT_TASK_NAME = 'task_%s'; // for unnamed tasks use task_idx, like task_0
23
+
24
+ function taskTypeKeys() { return Object.keys(TASK_TYPES); }
25
+
26
+ var OUT_TASK_TYPES = {
27
+ finalcb: FinalCbTask, //first task is the default if no type specified in taskDef
28
+ finalcbFirst: FinalCbFirstSuccTask
29
+ };
30
+ function outTaskTypeKeys() { return Object.keys(OUT_TASK_TYPES); }
31
+
32
+ var LOCAL_FN_MISSING = 'function: %s not found in locals or input params - task[%s]';
33
+ var TASKDEF_IS_OBJECT = 'task must be an object';
34
+ var NO_TASKS_RUNNING_WONT_COMPLETE = 'no tasks running, flow will not complete, remaining tasks: %s';
35
+ var TASK_TYPE_SHOULD_MATCH = 'task.type should match one of ' +
36
+ Object.keys(TASK_TYPES).join(', ');
37
+
38
+ var validateTaskType, validateTask, create;
39
+
40
+
41
+ function format_error(errmsg, obj) {
42
+ return sprintf('%s - %s', errmsg, util.inspect(obj));
43
+ }
44
+
45
+ /**
46
+ guess the missing types from params.
47
+ Augments in place but also returns taskDef.
48
+ If not specified then is 'cb'
48
49
  */
49
- function setMissingType(taskDef) {
50
- if (taskDef.type) return taskDef; //already set, return
51
- taskDef.type = 'cb';
52
- return taskDef;
53
- }
50
+ function setMissingType(taskDef) {
51
+ if (taskDef.type) return taskDef; //already set, return
52
+ taskDef.type = 'cb';
53
+ return taskDef;
54
+ }
54
55
 
55
- function setMissingOutTaskType(taskDef) {
56
- if (!taskDef.type) taskDef.type = Object.keys(OUT_TASK_TYPES)[0]; //use first outTask type as default
57
- }
56
+ function setMissingOutTaskType(taskDef) {
57
+ if (!taskDef.type) taskDef.type = Object.keys(OUT_TASK_TYPES)[0]; //use first outTask type as default
58
+ }
58
59
 
59
- function ensureAfterArrStrings(taskDef) { // convert any fn to str, and make sure is array
60
- if (!taskDef.after) return;
61
- var afterArr = array(taskDef.after); // ensure is array, null becomes []
62
- afterArr = afterArr.map(function (a) { return (typeof(a) === 'function') ? a.name : a; });
63
- taskDef.after = afterArr;
64
- }
60
+ function ensureAfterArrStrings(taskDef) { // convert any fn to str, and make sure is array
61
+ if (!taskDef.after) return;
62
+ var afterArr = array(taskDef.after); // ensure is array, null becomes []
63
+ afterArr = afterArr.map(function (a) { return (typeof(a) === 'function') ? a.name : a; });
64
+ taskDef.after = afterArr;
65
+ }
65
66
 
66
- /**
67
- @returns array of errors for taskDef, could be empty
67
+ /**
68
+ @returns array of errors for taskDef, could be empty
68
69
  */
69
- function validate(taskDef) {
70
- if (!taskDef || typeof(taskDef) !== 'object') {
71
- return [format_error(TASKDEF_IS_OBJECT, taskDef)];
72
- }
73
- setMissingType(taskDef);
74
- ensureAfterArrStrings(taskDef);
75
- var errors = [];
76
- errors = errors.concat(validateTaskType(taskDef));
77
- errors = errors.concat(validateTask(taskDef));
78
- return errors;
79
- }
70
+ function validate(taskDef) {
71
+ if (!taskDef || typeof(taskDef) !== 'object') {
72
+ return [format_error(TASKDEF_IS_OBJECT, taskDef)];
73
+ }
74
+ setMissingType(taskDef);
75
+ ensureAfterArrStrings(taskDef);
76
+ var errors = [];
77
+ errors = errors.concat(validateTaskType(taskDef));
78
+ errors = errors.concat(validateTask(taskDef));
79
+ return errors;
80
+ }
80
81
 
81
- function validateTaskType(taskDef) {
82
- var errors = [];
83
- if (!Object.keys(TASK_TYPES).some(
84
- function (type) { return (taskDef.type === type); })) {
85
- errors.push(format_error(TASK_TYPE_SHOULD_MATCH, taskDef));
82
+ function validateTaskType(taskDef) {
83
+ var errors = [];
84
+ if (!Object.keys(TASK_TYPES).some(
85
+ function (type) { return (taskDef.type === type); })) {
86
+ errors.push(format_error(TASK_TYPE_SHOULD_MATCH, taskDef));
87
+ }
88
+ return errors;
86
89
  }
87
- return errors;
88
- }
89
90
 
90
- function validateTask(taskDef) {
91
- var errors = [];
92
- var taskCons = TASK_TYPES[taskDef.type];
93
- if (taskCons) {
94
- errors = errors.concat(taskCons.validate(taskDef));
91
+ function validateTask(taskDef) {
92
+ var errors = [];
93
+ var taskCons = TASK_TYPES[taskDef.type];
94
+ if (taskCons) {
95
+ errors = errors.concat(taskCons.validate(taskDef));
96
+ }
97
+ return errors;
95
98
  }
96
- return errors;
97
- }
98
99
 
99
- function validateOutTask(taskDef) {
100
- var errors = [];
101
- setMissingOutTaskType(taskDef);
102
- var taskCons = OUT_TASK_TYPES[taskDef.type];
103
- errors = errors.concat(taskCons.validate(taskDef));
104
- return errors;
105
- }
100
+ function validateOutTask(taskDef) {
101
+ var errors = [];
102
+ setMissingOutTaskType(taskDef);
103
+ var taskCons = OUT_TASK_TYPES[taskDef.type];
104
+ errors = errors.concat(taskCons.validate(taskDef));
105
+ return errors;
106
+ }
106
107
 
107
108
 
108
- function validateLocalFunctions(inParams, taskDefs, locals) {
109
- var errors = [];
110
- function foo() { } //used to mock args as fns for validation check
111
- var mock_args = inParams.map(function (p) { return foo; }); //mock args with fns
112
- var vCon = VContext.create(mock_args, inParams, locals);
113
- var tasks = taskDefs.map(create);
114
- var tasksWFunctions = tasks.filter(function (t) { return (t.type !== 'when'); }); // non-when tasks need f
115
- tasksWFunctions.forEach(function (t, idx) {
116
- if (!t.functionExists(vCon)) { // error if function doesnt exist AND
117
- if (!t.isMethodCall()) errors.push(sprintf(LOCAL_FN_MISSING, t.f, idx)); // not method OR
118
- else {
119
- var obj = t.getMethodObj(vCon);
120
- if (obj && obj !== foo) { // (has parent but not our mock)
121
- errors.push(sprintf(LOCAL_FN_MISSING, t.f, idx));
109
+ function validateLocalFunctions(inParams, taskDefs, locals) {
110
+ var errors = [];
111
+ function foo() { } //used to mock args as fns for validation check
112
+ var mock_args = inParams.map(function (p) { return foo; }); //mock args with fns
113
+ var vCon = VContext.create(mock_args, inParams, locals);
114
+ var tasks = taskDefs.map(create);
115
+ var tasksWFunctions = tasks.filter(function (t) { return (t.type !== 'when'); }); // non-when tasks need f
116
+ tasksWFunctions.forEach(function (t, idx) {
117
+ if (!t.functionExists(vCon)) { // error if function doesnt exist AND
118
+ if (!t.isMethodCall()) errors.push(sprintf(LOCAL_FN_MISSING, t.f, idx)); // not method OR
119
+ else {
120
+ var obj = t.getMethodObj(vCon);
121
+ if (obj && obj !== foo) { // (has parent but not our mock)
122
+ errors.push(sprintf(LOCAL_FN_MISSING, t.f, idx));
123
+ }
124
+ }
122
125
  }
123
- }
126
+ });
127
+ return errors;
124
128
  }
125
- });
126
- return errors;
127
- }
128
129
 
129
- function fName(fn) {
130
- return (fn) ?
131
- ((fn.name) ? fn.name : fn) : // if defined, try name, otherwise toString()
132
- 'undefined'; // not defined, use undefined
133
- }
130
+ function fName(fn) {
131
+ if (typeof(fn) === 'function') {
132
+ return fn.name;
133
+ }
134
+ return (fn) ? fn : '';
135
+ }
134
136
 
135
- /**
136
- Name tasks that are not already named. Prenamed task uniquness validation
137
- will be done in validate.
137
+ /**
138
+ Name tasks that are not already named. Prenamed task uniquness validation
139
+ will be done in validate.
138
140
 
139
- This modifies the tasks with the new names.
141
+ This modifies the tasks with the new names.
140
142
 
141
- @returns map of names to tasks
143
+ @returns map of names to tasks
142
144
  */
143
- function nameTasks(tasks) { //name tasks that are not already named, validation done elsewhere, ret map
144
- var namesMap = tasks.reduce(function (map, t) {
145
- if (t.name) { map[t.name] = t; }
146
- return map;
147
- }, {});
148
- tasks.forEach(function (t, idx) {
149
- if (!t.name) { //not already named
150
- var name = fName(t.f);
151
- if (!name || namesMap[name]) {
152
- name = sprintf('%s_%s', name, idx); //if empty or already used, postfix with _idx
145
+ function nameTasks(tasks) { //name tasks that are not already named, validation done elsewhere, ret map
146
+ var namesMap = tasks.reduce(function (map, t) {
147
+ if (t.name) { map[t.name] = t; }
148
+ return map;
149
+ }, {});
150
+ tasks.forEach(function (t, idx) {
151
+ if (!t.name) { //not already named
152
+ var name = fName(t.f);
153
+ if (!name) name = sprintf(DEFAULT_TASK_NAME, idx);
154
+ if (!name || namesMap[name]) {
155
+ name = sprintf('%s_%s', name, idx); //if empty or already used, postfix with _idx
156
+ }
157
+ t.name = name;
158
+ namesMap[name] = t;
153
159
  }
154
- t.name = name;
155
- namesMap[name] = t;
156
- }
157
- });
158
- return namesMap;
159
- }
160
+ });
161
+ return namesMap;
162
+ }
160
163
 
161
- function create(taskDef) {
162
- var TaskConstructor = TASK_TYPES[taskDef.type];
163
- return new TaskConstructor(taskDef);
164
- }
164
+ function create(taskDef) {
165
+ var TaskConstructor = TASK_TYPES[taskDef.type];
166
+ return new TaskConstructor(taskDef);
167
+ }
165
168
 
166
- function createOutTask(taskDef, cbFunc, tasks, vCon, execOptions, env) {
167
- setMissingOutTaskType(taskDef);
168
- var outTaskOptions = {
169
- taskDef: taskDef,
170
- cbFunc: cbFunc,
171
- tasks: tasks,
172
- vCon: vCon,
173
- execOptions: execOptions,
174
- env: env,
175
- TaskConstructor: OUT_TASK_TYPES[taskDef.type]
176
- };
177
- EventManager.global.emit(EventManager.TYPES.EXEC_OUTTASK_CREATE, outTaskOptions); // hook
178
- var TaskConstructor = outTaskOptions.TaskConstructor; // hook could have changed
179
- return new TaskConstructor(outTaskOptions);
180
- }
169
+ function createOutTask(taskDef, cbFunc, tasks, vCon, execOptions, env) {
170
+ setMissingOutTaskType(taskDef);
171
+ var outTaskOptions = {
172
+ taskDef: taskDef,
173
+ cbFunc: cbFunc,
174
+ tasks: tasks,
175
+ vCon: vCon,
176
+ execOptions: execOptions,
177
+ env: env,
178
+ TaskConstructor: OUT_TASK_TYPES[taskDef.type]
179
+ };
180
+ EventManager.global.emit(EventManager.TYPES.EXEC_OUTTASK_CREATE, outTaskOptions); // hook
181
+ var TaskConstructor = outTaskOptions.TaskConstructor; // hook could have changed
182
+ return new TaskConstructor(outTaskOptions);
183
+ }
181
184
 
182
- function createErrorHandler(vCon, outTask) {
183
- return function handleError(task, err) {
184
- task.status = STATUS.ERRORED;
185
- task.error = err;
186
- outTask.env.currentTask = task;
187
- outTask.env.flowEmitter.emit(EventManager.TYPES.EXEC_TASK_ERRORED, task);
188
- var errWithMeta = error.augmentError(err, {task: task, vcon: vCon});
189
- outTask.exec(errWithMeta); //call the final callback with the first error hit
190
- };
191
- }
185
+ function createErrorHandler(vCon, outTask) {
186
+ return function handleError(task, err) {
187
+ task.status = STATUS.ERRORED;
188
+ task.error = err;
189
+ outTask.env.currentTask = task;
190
+ outTask.env.flowEmitter.emit(EventManager.TYPES.EXEC_TASK_ERRORED, task);
191
+ var errWithMeta = error.augmentError(err, {task: task, vcon: vCon});
192
+ outTask.exec(errWithMeta); //call the final callback with the first error hit
193
+ };
194
+ }
192
195
 
193
- function findTasksReady(vCon, tasks, tasksByName) {
194
- return tasks.filter(function (t) { return t.isReady(vCon, tasksByName); });
195
- }
196
+ function findTasksReady(vCon, tasks, tasksByName) {
197
+ return tasks.filter(function (t) { return t.isReady(vCon, tasksByName); });
198
+ }
196
199
 
197
- function execTasks(tasksReady, vCon, handleError, contExec) {
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); });
200
- }
200
+ function execTasks(tasksReady, vCon, handleError, contExec) {
201
+ tasksReady.forEach(function (t) { t.status = STATUS.READY; }); //set ready first, no double exec
202
+ tasksReady.forEach(function (t) { t.exec(vCon, handleError, contExec); });
203
+ }
201
204
 
202
- /**
203
- this will be called if there are no tasks found to run,
204
- and it will check if there are still tasks running or ready
205
- (which means they will be running shortly), in which
206
- case everything is fine. If no tasks are running then
207
- call handleError since this will never complete.
205
+ /**
206
+ this will be called if there are no tasks found to run,
207
+ and it will check if there are still tasks running or ready
208
+ (which means they will be running shortly), in which
209
+ case everything is fine. If no tasks are running then
210
+ call handleError since this will never complete.
208
211
  */
209
- function checkIfTasksRunning(vCon, tasks, handleError, env) {
210
- var tasksRunning = tasks.filter(function (t) {
211
- return (t.status === STATUS.RUNNING || t.status === STATUS.READY);
212
- });
213
- if (!tasksRunning.length) {
214
- var remainingTasks = tasks.filter(function (t) { return (!t.status); });
215
- var remainingTNames = remainingTasks.map(function (t) { return t.name; });
216
- var errMsg = sprintf(NO_TASKS_RUNNING_WONT_COMPLETE, remainingTNames.join(', '));
217
- var emptyTask = { env: env };
218
- handleError(emptyTask, new Error(errMsg));
212
+ function checkIfTasksRunning(vCon, tasks, handleError, env) {
213
+ var tasksRunning = tasks.filter(function (t) {
214
+ return (t.status === STATUS.RUNNING || t.status === STATUS.READY);
215
+ });
216
+ if (!tasksRunning.length) {
217
+ var remainingTasks = tasks.filter(function (t) { return (!t.status); });
218
+ var remainingTNames = remainingTasks.map(function (t) { return t.name; });
219
+ var errMsg = sprintf(NO_TASKS_RUNNING_WONT_COMPLETE, remainingTNames.join(', '));
220
+ var emptyTask = { env: env };
221
+ handleError(emptyTask, new Error(errMsg));
222
+ }
219
223
  }
220
- }
221
224
 
222
- function findReadyAndExec(vCon, tasks, tasksByName, handleError, contExec, env) {
223
- var tasksReady = findTasksReady(vCon, tasks, tasksByName);
224
- if (!tasksReady.length) checkIfTasksRunning(vCon, tasks, handleError, env); // no tasks to run, check if ok
225
- execTasks(tasksReady, vCon, handleError, contExec);
226
- }
225
+ function findReadyAndExec(vCon, tasks, tasksByName, handleError, contExec, env) {
226
+ var tasksReady = findTasksReady(vCon, tasks, tasksByName);
227
+ if (!tasksReady.length) checkIfTasksRunning(vCon, tasks, handleError, env); // no tasks to run, check if ok
228
+ execTasks(tasksReady, vCon, handleError, contExec);
229
+ }
227
230
 
228
- function serializeTasks(tasks) { // conveniently set after for each task idx > 0
229
- nameTasks(tasks);
230
- tasks.forEach(function (t, idx, arr) { if (idx !== 0) t.after = [arr[idx - 1].name]; });
231
- return tasks;
232
- }
231
+ function serializeTasks(tasks) { // conveniently set after for each task idx > 0
232
+ nameTasks(tasks);
233
+ tasks.forEach(function (t, idx, arr) { if (idx !== 0) t.after = [arr[idx - 1].name]; });
234
+ return tasks;
235
+ }
236
+
237
+ return {
238
+ serializeTasks: serializeTasks,
239
+ TASK_TYPES: TASK_TYPES,
240
+ taskTypeKeys: taskTypeKeys,
241
+ OUT_TASK_TYPES: OUT_TASK_TYPES,
242
+ outTaskTypeKeys: outTaskTypeKeys,
243
+ setMissingType: setMissingType,
244
+ validate: validate,
245
+ validateOutTask: validateOutTask,
246
+ validateLocalFunctions: validateLocalFunctions,
247
+ nameTasks: nameTasks,
248
+ create: create,
249
+ createOutTask: createOutTask,
250
+ createErrorHandler: createErrorHandler,
251
+ findReadyAndExec: findReadyAndExec
252
+ };
233
253
 
234
- exports.serializeTasks = serializeTasks;
235
-
236
- exports.TASK_TYPES = TASK_TYPES;
237
- exports.taskTypeKeys = taskTypeKeys;
238
- exports.OUT_TASK_TYPES = OUT_TASK_TYPES;
239
- exports.outTaskTypeKeys = outTaskTypeKeys;
240
- exports.setMissingType = setMissingType;
241
- exports.validate = validate;
242
- exports.validateOutTask = validateOutTask;
243
- exports.validateLocalFunctions = validateLocalFunctions;
244
- exports.nameTasks = nameTasks;
245
- exports.create = create;
246
- exports.createOutTask = createOutTask;
247
- exports.createErrorHandler = createErrorHandler;
248
- exports.findReadyAndExec = findReadyAndExec;
254
+ });