traceur-rb 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. checksums.yaml +8 -8
  2. data/lib/traceur/configuration.rb +1 -1
  3. data/lib/traceur/version.rb +1 -1
  4. data/{vendor/node_modules → node_modules}/.bin/traceur +0 -0
  5. data/{vendor/node_modules → node_modules}/traceur/LICENSE +0 -0
  6. data/{vendor/node_modules → node_modules}/traceur/README.md +0 -0
  7. data/node_modules/traceur/bin/traceur-runtime.js +3420 -0
  8. data/node_modules/traceur/bin/traceur.js +30354 -0
  9. data/{vendor/node_modules → node_modules}/traceur/node_modules/.bin/semver +0 -0
  10. data/node_modules/traceur/node_modules/commander/History.md +256 -0
  11. data/node_modules/traceur/node_modules/commander/LICENSE +22 -0
  12. data/node_modules/traceur/node_modules/commander/Readme.md +342 -0
  13. data/node_modules/traceur/node_modules/commander/index.js +1103 -0
  14. data/node_modules/traceur/node_modules/commander/node_modules/graceful-readlink/.npmignore +3 -0
  15. data/node_modules/traceur/node_modules/commander/node_modules/graceful-readlink/.travis.yml +5 -0
  16. data/node_modules/traceur/node_modules/commander/node_modules/graceful-readlink/LICENSE +22 -0
  17. data/node_modules/traceur/node_modules/commander/node_modules/graceful-readlink/README.md +17 -0
  18. data/node_modules/traceur/node_modules/commander/node_modules/graceful-readlink/index.js +12 -0
  19. data/node_modules/traceur/node_modules/commander/node_modules/graceful-readlink/package.json +48 -0
  20. data/node_modules/traceur/node_modules/commander/package.json +75 -0
  21. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/LICENSE +0 -0
  22. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/README.md +0 -0
  23. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/common.js +0 -0
  24. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/glob.js +0 -0
  25. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inflight/.eslintrc +0 -0
  26. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inflight/LICENSE +0 -0
  27. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inflight/README.md +0 -0
  28. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inflight/inflight.js +0 -0
  29. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE +0 -0
  30. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md +0 -0
  31. data/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +52 -0
  32. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js +0 -0
  33. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js +0 -0
  34. data/node_modules/traceur/node_modules/glob/node_modules/inflight/package.json +61 -0
  35. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inflight/test.js +0 -0
  36. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inherits/LICENSE +0 -0
  37. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inherits/README.md +0 -0
  38. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inherits/inherits.js +0 -0
  39. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inherits/inherits_browser.js +0 -0
  40. data/node_modules/traceur/node_modules/glob/node_modules/inherits/package.json +50 -0
  41. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/inherits/test.js +0 -0
  42. data/{vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy → node_modules/traceur/node_modules/glob/node_modules/minimatch}/LICENSE +0 -0
  43. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/README.md +0 -0
  44. data/node_modules/traceur/node_modules/glob/node_modules/minimatch/browser.js +1159 -0
  45. data/node_modules/traceur/node_modules/glob/node_modules/minimatch/minimatch.js +912 -0
  46. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +0 -0
  47. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml +0 -0
  48. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -0
  49. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +0 -0
  50. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -0
  51. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +0 -0
  52. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +0 -0
  53. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +0 -0
  54. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +0 -0
  55. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +0 -0
  56. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +0 -0
  57. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +0 -0
  58. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +0 -0
  59. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +0 -0
  60. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +0 -0
  61. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +0 -0
  62. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +0 -0
  63. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +0 -0
  64. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +0 -0
  65. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +0 -0
  66. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -0
  67. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +0 -0
  68. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +0 -0
  69. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +0 -0
  70. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +0 -0
  71. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +0 -0
  72. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +0 -0
  73. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +0 -0
  74. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +0 -0
  75. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js +0 -0
  76. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +0 -0
  77. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +0 -0
  78. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +0 -0
  79. data/node_modules/traceur/node_modules/glob/node_modules/minimatch/package.json +63 -0
  80. data/node_modules/traceur/node_modules/glob/node_modules/once/LICENSE +15 -0
  81. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/once/README.md +0 -0
  82. data/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +15 -0
  83. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +0 -0
  84. data/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +52 -0
  85. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +0 -0
  86. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +0 -0
  87. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/once/once.js +0 -0
  88. data/node_modules/traceur/node_modules/glob/node_modules/once/package.json +60 -0
  89. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/node_modules/once/test/once.js +0 -0
  90. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/package.json +0 -0
  91. data/{vendor/node_modules → node_modules}/traceur/node_modules/glob/sync.js +0 -0
  92. data/node_modules/traceur/node_modules/rsvp/CHANGELOG.md +255 -0
  93. data/{vendor/node_modules → node_modules}/traceur/node_modules/rsvp/LICENSE +0 -0
  94. data/node_modules/traceur/node_modules/rsvp/README.md +366 -0
  95. data/node_modules/traceur/node_modules/rsvp/dist/rsvp.js +1597 -0
  96. data/node_modules/traceur/node_modules/rsvp/dist/rsvp.min.js +9 -0
  97. data/node_modules/traceur/node_modules/rsvp/lib/rsvp.js +70 -0
  98. data/node_modules/traceur/node_modules/rsvp/lib/rsvp.umd.js +51 -0
  99. data/{vendor/node_modules → node_modules}/traceur/node_modules/rsvp/lib/rsvp/-internal.js +0 -0
  100. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/all-settled.js +73 -0
  101. data/{vendor/node_modules → node_modules}/traceur/node_modules/rsvp/lib/rsvp/all.js +0 -0
  102. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/asap.js +112 -0
  103. data/{vendor/node_modules → node_modules}/traceur/node_modules/rsvp/lib/rsvp/config.js +0 -0
  104. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/defer.js +45 -0
  105. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/enumerator.js +130 -0
  106. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/events.js +205 -0
  107. data/{vendor/node_modules → node_modules}/traceur/node_modules/rsvp/lib/rsvp/filter.js +0 -0
  108. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/hash-settled.js +126 -0
  109. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/hash.js +94 -0
  110. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/instrument.js +41 -0
  111. data/{vendor/node_modules → node_modules}/traceur/node_modules/rsvp/lib/rsvp/map.js +0 -0
  112. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/node.js +281 -0
  113. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/platform.js +14 -0
  114. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise-hash.js +52 -0
  115. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise.js +496 -0
  116. data/{vendor/node_modules → node_modules}/traceur/node_modules/rsvp/lib/rsvp/promise/all.js +0 -0
  117. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/race.js +105 -0
  118. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/reject.js +47 -0
  119. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/resolve.js +49 -0
  120. data/{vendor/node_modules → node_modules}/traceur/node_modules/rsvp/lib/rsvp/race.js +0 -0
  121. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/reject.js +16 -0
  122. data/node_modules/traceur/node_modules/rsvp/lib/rsvp/resolve.js +17 -0
  123. data/{vendor/node_modules → node_modules}/traceur/node_modules/rsvp/lib/rsvp/rethrow.js +0 -0
  124. data/{vendor/node_modules → node_modules}/traceur/node_modules/rsvp/lib/rsvp/utils.js +0 -0
  125. data/node_modules/traceur/node_modules/rsvp/package.json +106 -0
  126. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/.npmignore +0 -0
  127. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/LICENSE +0 -0
  128. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/Makefile +0 -0
  129. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/README.md +0 -0
  130. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/bin/semver +0 -0
  131. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/foot.js +0 -0
  132. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/head.js +0 -0
  133. data/node_modules/traceur/node_modules/semver/package.json +50 -0
  134. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/semver.browser.js +0 -0
  135. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/semver.browser.js.gz +0 -0
  136. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/semver.js +0 -0
  137. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/semver.min.js +0 -0
  138. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/semver.min.js.gz +0 -0
  139. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/test/amd.js +0 -0
  140. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/test/gtr.js +0 -0
  141. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/test/index.js +0 -0
  142. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/test/ltr.js +0 -0
  143. data/{vendor/node_modules → node_modules}/traceur/node_modules/semver/test/no-module.js +0 -0
  144. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/.npmignore +0 -0
  145. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/LICENSE.md +0 -0
  146. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/README.md +0 -0
  147. data/node_modules/traceur/node_modules/source-map-support/amd-test/browser-source-map-support.js +89 -0
  148. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/amd-test/index.html +0 -0
  149. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/amd-test/require.js +0 -0
  150. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/amd-test/script.coffee +0 -0
  151. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/amd-test/script.js +0 -0
  152. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/amd-test/script.map +0 -0
  153. data/node_modules/traceur/node_modules/source-map-support/browser-source-map-support.js +89 -0
  154. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/browser-test/index.html +0 -0
  155. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/browser-test/script.coffee +0 -0
  156. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/browser-test/script.js +0 -0
  157. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/browser-test/script.map +0 -0
  158. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/build.js +0 -0
  159. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/header-test/index.html +0 -0
  160. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/header-test/script.coffee +0 -0
  161. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/header-test/script.js +0 -0
  162. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/header-test/script.map +0 -0
  163. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/header-test/server.js +0 -0
  164. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/.npmignore +0 -0
  165. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/.travis.yml +0 -0
  166. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/CHANGELOG.md +0 -0
  167. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/LICENSE +0 -0
  168. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/Makefile.dryice.js +0 -0
  169. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/README.md +0 -0
  170. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/build/assert-shim.js +0 -0
  171. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/build/mini-require.js +0 -0
  172. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/build/prefix-source-map.jsm +0 -0
  173. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/build/prefix-utils.jsm +0 -0
  174. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-browser.js +0 -0
  175. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-source-map.jsm +0 -0
  176. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-utils.jsm +0 -0
  177. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/build/test-prefix.js +0 -0
  178. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/build/test-suffix.js +0 -0
  179. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map.js +0 -0
  180. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/array-set.js +0 -0
  181. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/base64-vlq.js +0 -0
  182. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/base64.js +0 -0
  183. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/binary-search.js +0 -0
  184. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-map-consumer.js +0 -0
  185. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-map-generator.js +0 -0
  186. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-node.js +0 -0
  187. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/util.js +0 -0
  188. data/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
  189. data/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/README.md +171 -0
  190. data/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/amdefine.js +301 -0
  191. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/intercept.js +0 -0
  192. data/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/package.json +47 -0
  193. data/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/package.json +142 -0
  194. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/test/run-tests.js +0 -0
  195. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-api.js +0 -0
  196. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-array-set.js +0 -0
  197. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-base64-vlq.js +0 -0
  198. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-base64.js +0 -0
  199. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-binary-search.js +0 -0
  200. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-dog-fooding.js +0 -0
  201. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-map-consumer.js +0 -0
  202. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-map-generator.js +0 -0
  203. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-node.js +0 -0
  204. data/{vendor/node_modules → node_modules}/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/util.js +0 -0
  205. data/node_modules/traceur/node_modules/source-map-support/package.json +52 -0
  206. data/node_modules/traceur/node_modules/source-map-support/source-map-support.js +386 -0
  207. data/node_modules/traceur/node_modules/source-map-support/test.js +384 -0
  208. data/node_modules/traceur/package.json +286 -0
  209. data/node_modules/traceur/src/node/NodeCompiler.js +81 -0
  210. data/{vendor/node_modules → node_modules}/traceur/src/node/System.js +0 -0
  211. data/{vendor/node_modules → node_modules}/traceur/src/node/api.js +0 -0
  212. data/node_modules/traceur/src/node/command.js +203 -0
  213. data/{vendor/node_modules → node_modules}/traceur/src/node/compileAllJsFilesInDir.js +0 -0
  214. data/{vendor/node_modules → node_modules}/traceur/src/node/deferred.js +0 -0
  215. data/{vendor/node_modules → node_modules}/traceur/src/node/file-util.js +0 -0
  216. data/{vendor/node_modules → node_modules}/traceur/src/node/getopt.js +0 -0
  217. data/node_modules/traceur/src/node/interpreter.js +37 -0
  218. data/{vendor/node_modules → node_modules}/traceur/src/node/nodeLoader.js +0 -0
  219. data/node_modules/traceur/src/node/recursiveModuleCompile.js +171 -0
  220. data/{vendor/node_modules → node_modules}/traceur/src/node/require.js +0 -0
  221. data/{vendor/node_modules → node_modules}/traceur/src/node/to-amd-compiler.js +0 -0
  222. data/{vendor/node_modules → node_modules}/traceur/src/node/to-closure-compiler.js +0 -0
  223. data/{vendor/node_modules → node_modules}/traceur/src/node/to-commonjs-compiler.js +0 -0
  224. data/{vendor/node_modules → node_modules}/traceur/src/node/traceur.js +0 -0
  225. data/{vendor/node_modules → node_modules}/traceur/traceur +0 -0
  226. data/package.json +15 -0
  227. data/spec/traceur/configuration_spec.rb +3 -3
  228. metadata +225 -161
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * @overview RSVP - a tiny implementation of Promises/A+.
3
+ * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors
4
+ * @license Licensed under MIT license
5
+ * See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE
6
+ * @version 3.0.21
7
+ */
8
+
9
+ (function(){"use strict";function lib$rsvp$utils$$objectOrFunction(x){return typeof x==="function"||typeof x==="object"&&x!==null}function lib$rsvp$utils$$isFunction(x){return typeof x==="function"}function lib$rsvp$utils$$isMaybeThenable(x){return typeof x==="object"&&x!==null}var lib$rsvp$utils$$_isArray;if(!Array.isArray){lib$rsvp$utils$$_isArray=function(x){return Object.prototype.toString.call(x)==="[object Array]"}}else{lib$rsvp$utils$$_isArray=Array.isArray}var lib$rsvp$utils$$isArray=lib$rsvp$utils$$_isArray;var lib$rsvp$utils$$now=Date.now||function(){return(new Date).getTime()};function lib$rsvp$utils$$F(){}var lib$rsvp$utils$$o_create=Object.create||function(o){if(arguments.length>1){throw new Error("Second argument not supported")}if(typeof o!=="object"){throw new TypeError("Argument must be an object")}lib$rsvp$utils$$F.prototype=o;return new lib$rsvp$utils$$F};function lib$rsvp$events$$indexOf(callbacks,callback){for(var i=0,l=callbacks.length;i<l;i++){if(callbacks[i]===callback){return i}}return-1}function lib$rsvp$events$$callbacksFor(object){var callbacks=object._promiseCallbacks;if(!callbacks){callbacks=object._promiseCallbacks={}}return callbacks}var lib$rsvp$events$$default={mixin:function(object){object["on"]=this["on"];object["off"]=this["off"];object["trigger"]=this["trigger"];object._promiseCallbacks=undefined;return object},on:function(eventName,callback){if(typeof callback!=="function"){throw new TypeError("Callback must be a function")}var allCallbacks=lib$rsvp$events$$callbacksFor(this),callbacks;callbacks=allCallbacks[eventName];if(!callbacks){callbacks=allCallbacks[eventName]=[]}if(lib$rsvp$events$$indexOf(callbacks,callback)===-1){callbacks.push(callback)}},off:function(eventName,callback){var allCallbacks=lib$rsvp$events$$callbacksFor(this),callbacks,index;if(!callback){allCallbacks[eventName]=[];return}callbacks=allCallbacks[eventName];index=lib$rsvp$events$$indexOf(callbacks,callback);if(index!==-1){callbacks.splice(index,1)}},trigger:function(eventName,options){var allCallbacks=lib$rsvp$events$$callbacksFor(this),callbacks,callback;if(callbacks=allCallbacks[eventName]){for(var i=0;i<callbacks.length;i++){callback=callbacks[i];callback(options)}}}};var lib$rsvp$config$$config={instrument:false};lib$rsvp$events$$default["mixin"](lib$rsvp$config$$config);function lib$rsvp$config$$configure(name,value){if(name==="onerror"){lib$rsvp$config$$config["on"]("error",value);return}if(arguments.length===2){lib$rsvp$config$$config[name]=value}else{return lib$rsvp$config$$config[name]}}var lib$rsvp$instrument$$queue=[];function lib$rsvp$instrument$$scheduleFlush(){setTimeout(function(){var entry;for(var i=0;i<lib$rsvp$instrument$$queue.length;i++){entry=lib$rsvp$instrument$$queue[i];var payload=entry.payload;payload.guid=payload.key+payload.id;payload.childGuid=payload.key+payload.childId;if(payload.error){payload.stack=payload.error.stack}lib$rsvp$config$$config["trigger"](entry.name,entry.payload)}lib$rsvp$instrument$$queue.length=0},50)}function lib$rsvp$instrument$$instrument(eventName,promise,child){if(1===lib$rsvp$instrument$$queue.push({name:eventName,payload:{key:promise._guidKey,id:promise._id,eventName:eventName,detail:promise._result,childId:child&&child._id,label:promise._label,timeStamp:lib$rsvp$utils$$now(),error:lib$rsvp$config$$config["instrument-with-stack"]?new Error(promise._label):null}})){lib$rsvp$instrument$$scheduleFlush()}}var lib$rsvp$instrument$$default=lib$rsvp$instrument$$instrument;function lib$rsvp$$internal$$withOwnPromise(){return new TypeError("A promises callback cannot return that same promise.")}function lib$rsvp$$internal$$noop(){}var lib$rsvp$$internal$$PENDING=void 0;var lib$rsvp$$internal$$FULFILLED=1;var lib$rsvp$$internal$$REJECTED=2;var lib$rsvp$$internal$$GET_THEN_ERROR=new lib$rsvp$$internal$$ErrorObject;function lib$rsvp$$internal$$getThen(promise){try{return promise.then}catch(error){lib$rsvp$$internal$$GET_THEN_ERROR.error=error;return lib$rsvp$$internal$$GET_THEN_ERROR}}function lib$rsvp$$internal$$tryThen(then,value,fulfillmentHandler,rejectionHandler){try{then.call(value,fulfillmentHandler,rejectionHandler)}catch(e){return e}}function lib$rsvp$$internal$$handleForeignThenable(promise,thenable,then){lib$rsvp$config$$config.async(function(promise){var sealed=false;var error=lib$rsvp$$internal$$tryThen(then,thenable,function(value){if(sealed){return}sealed=true;if(thenable!==value){lib$rsvp$$internal$$resolve(promise,value)}else{lib$rsvp$$internal$$fulfill(promise,value)}},function(reason){if(sealed){return}sealed=true;lib$rsvp$$internal$$reject(promise,reason)},"Settle: "+(promise._label||" unknown promise"));if(!sealed&&error){sealed=true;lib$rsvp$$internal$$reject(promise,error)}},promise)}function lib$rsvp$$internal$$handleOwnThenable(promise,thenable){if(thenable._state===lib$rsvp$$internal$$FULFILLED){lib$rsvp$$internal$$fulfill(promise,thenable._result)}else if(thenable._state===lib$rsvp$$internal$$REJECTED){thenable._onError=null;lib$rsvp$$internal$$reject(promise,thenable._result)}else{lib$rsvp$$internal$$subscribe(thenable,undefined,function(value){if(thenable!==value){lib$rsvp$$internal$$resolve(promise,value)}else{lib$rsvp$$internal$$fulfill(promise,value)}},function(reason){lib$rsvp$$internal$$reject(promise,reason)})}}function lib$rsvp$$internal$$handleMaybeThenable(promise,maybeThenable){if(maybeThenable.constructor===promise.constructor){lib$rsvp$$internal$$handleOwnThenable(promise,maybeThenable)}else{var then=lib$rsvp$$internal$$getThen(maybeThenable);if(then===lib$rsvp$$internal$$GET_THEN_ERROR){lib$rsvp$$internal$$reject(promise,lib$rsvp$$internal$$GET_THEN_ERROR.error)}else if(then===undefined){lib$rsvp$$internal$$fulfill(promise,maybeThenable)}else if(lib$rsvp$utils$$isFunction(then)){lib$rsvp$$internal$$handleForeignThenable(promise,maybeThenable,then)}else{lib$rsvp$$internal$$fulfill(promise,maybeThenable)}}}function lib$rsvp$$internal$$resolve(promise,value){if(promise===value){lib$rsvp$$internal$$fulfill(promise,value)}else if(lib$rsvp$utils$$objectOrFunction(value)){lib$rsvp$$internal$$handleMaybeThenable(promise,value)}else{lib$rsvp$$internal$$fulfill(promise,value)}}function lib$rsvp$$internal$$publishRejection(promise){if(promise._onError){promise._onError(promise._result)}lib$rsvp$$internal$$publish(promise)}function lib$rsvp$$internal$$fulfill(promise,value){if(promise._state!==lib$rsvp$$internal$$PENDING){return}promise._result=value;promise._state=lib$rsvp$$internal$$FULFILLED;if(promise._subscribers.length===0){if(lib$rsvp$config$$config.instrument){lib$rsvp$instrument$$default("fulfilled",promise)}}else{lib$rsvp$config$$config.async(lib$rsvp$$internal$$publish,promise)}}function lib$rsvp$$internal$$reject(promise,reason){if(promise._state!==lib$rsvp$$internal$$PENDING){return}promise._state=lib$rsvp$$internal$$REJECTED;promise._result=reason;lib$rsvp$config$$config.async(lib$rsvp$$internal$$publishRejection,promise)}function lib$rsvp$$internal$$subscribe(parent,child,onFulfillment,onRejection){var subscribers=parent._subscribers;var length=subscribers.length;parent._onError=null;subscribers[length]=child;subscribers[length+lib$rsvp$$internal$$FULFILLED]=onFulfillment;subscribers[length+lib$rsvp$$internal$$REJECTED]=onRejection;if(length===0&&parent._state){lib$rsvp$config$$config.async(lib$rsvp$$internal$$publish,parent)}}function lib$rsvp$$internal$$publish(promise){var subscribers=promise._subscribers;var settled=promise._state;if(lib$rsvp$config$$config.instrument){lib$rsvp$instrument$$default(settled===lib$rsvp$$internal$$FULFILLED?"fulfilled":"rejected",promise)}if(subscribers.length===0){return}var child,callback,detail=promise._result;for(var i=0;i<subscribers.length;i+=3){child=subscribers[i];callback=subscribers[i+settled];if(child){lib$rsvp$$internal$$invokeCallback(settled,child,callback,detail)}else{callback(detail)}}promise._subscribers.length=0}function lib$rsvp$$internal$$ErrorObject(){this.error=null}var lib$rsvp$$internal$$TRY_CATCH_ERROR=new lib$rsvp$$internal$$ErrorObject;function lib$rsvp$$internal$$tryCatch(callback,detail){try{return callback(detail)}catch(e){lib$rsvp$$internal$$TRY_CATCH_ERROR.error=e;return lib$rsvp$$internal$$TRY_CATCH_ERROR}}function lib$rsvp$$internal$$invokeCallback(settled,promise,callback,detail){var hasCallback=lib$rsvp$utils$$isFunction(callback),value,error,succeeded,failed;if(hasCallback){value=lib$rsvp$$internal$$tryCatch(callback,detail);if(value===lib$rsvp$$internal$$TRY_CATCH_ERROR){failed=true;error=value.error;value=null}else{succeeded=true}if(promise===value){lib$rsvp$$internal$$reject(promise,lib$rsvp$$internal$$withOwnPromise());return}}else{value=detail;succeeded=true}if(promise._state!==lib$rsvp$$internal$$PENDING){}else if(hasCallback&&succeeded){lib$rsvp$$internal$$resolve(promise,value)}else if(failed){lib$rsvp$$internal$$reject(promise,error)}else if(settled===lib$rsvp$$internal$$FULFILLED){lib$rsvp$$internal$$fulfill(promise,value)}else if(settled===lib$rsvp$$internal$$REJECTED){lib$rsvp$$internal$$reject(promise,value)}}function lib$rsvp$$internal$$initializePromise(promise,resolver){var resolved=false;try{resolver(function resolvePromise(value){if(resolved){return}resolved=true;lib$rsvp$$internal$$resolve(promise,value)},function rejectPromise(reason){if(resolved){return}resolved=true;lib$rsvp$$internal$$reject(promise,reason)})}catch(e){lib$rsvp$$internal$$reject(promise,e)}}function lib$rsvp$enumerator$$makeSettledResult(state,position,value){if(state===lib$rsvp$$internal$$FULFILLED){return{state:"fulfilled",value:value}}else{return{state:"rejected",reason:value}}}function lib$rsvp$enumerator$$Enumerator(Constructor,input,abortOnReject,label){var enumerator=this;enumerator._instanceConstructor=Constructor;enumerator.promise=new Constructor(lib$rsvp$$internal$$noop,label);enumerator._abortOnReject=abortOnReject;if(enumerator._validateInput(input)){enumerator._input=input;enumerator.length=input.length;enumerator._remaining=input.length;enumerator._init();if(enumerator.length===0){lib$rsvp$$internal$$fulfill(enumerator.promise,enumerator._result)}else{enumerator.length=enumerator.length||0;enumerator._enumerate();if(enumerator._remaining===0){lib$rsvp$$internal$$fulfill(enumerator.promise,enumerator._result)}}}else{lib$rsvp$$internal$$reject(enumerator.promise,enumerator._validationError())}}var lib$rsvp$enumerator$$default=lib$rsvp$enumerator$$Enumerator;lib$rsvp$enumerator$$Enumerator.prototype._validateInput=function(input){return lib$rsvp$utils$$isArray(input)};lib$rsvp$enumerator$$Enumerator.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")};lib$rsvp$enumerator$$Enumerator.prototype._init=function(){this._result=new Array(this.length)};lib$rsvp$enumerator$$Enumerator.prototype._enumerate=function(){var enumerator=this;var length=enumerator.length;var promise=enumerator.promise;var input=enumerator._input;for(var i=0;promise._state===lib$rsvp$$internal$$PENDING&&i<length;i++){enumerator._eachEntry(input[i],i)}};lib$rsvp$enumerator$$Enumerator.prototype._eachEntry=function(entry,i){var enumerator=this;var c=enumerator._instanceConstructor;if(lib$rsvp$utils$$isMaybeThenable(entry)){if(entry.constructor===c&&entry._state!==lib$rsvp$$internal$$PENDING){entry._onError=null;enumerator._settledAt(entry._state,i,entry._result)}else{enumerator._willSettleAt(c.resolve(entry),i)}}else{enumerator._remaining--;enumerator._result[i]=enumerator._makeResult(lib$rsvp$$internal$$FULFILLED,i,entry)}};lib$rsvp$enumerator$$Enumerator.prototype._settledAt=function(state,i,value){var enumerator=this;var promise=enumerator.promise;if(promise._state===lib$rsvp$$internal$$PENDING){enumerator._remaining--;if(enumerator._abortOnReject&&state===lib$rsvp$$internal$$REJECTED){lib$rsvp$$internal$$reject(promise,value)}else{enumerator._result[i]=enumerator._makeResult(state,i,value)}}if(enumerator._remaining===0){lib$rsvp$$internal$$fulfill(promise,enumerator._result)}};lib$rsvp$enumerator$$Enumerator.prototype._makeResult=function(state,i,value){return value};lib$rsvp$enumerator$$Enumerator.prototype._willSettleAt=function(promise,i){var enumerator=this;lib$rsvp$$internal$$subscribe(promise,undefined,function(value){enumerator._settledAt(lib$rsvp$$internal$$FULFILLED,i,value)},function(reason){enumerator._settledAt(lib$rsvp$$internal$$REJECTED,i,reason)})};function lib$rsvp$promise$all$$all(entries,label){return new lib$rsvp$enumerator$$default(this,entries,true,label).promise}var lib$rsvp$promise$all$$default=lib$rsvp$promise$all$$all;function lib$rsvp$promise$race$$race(entries,label){var Constructor=this;var promise=new Constructor(lib$rsvp$$internal$$noop,label);if(!lib$rsvp$utils$$isArray(entries)){lib$rsvp$$internal$$reject(promise,new TypeError("You must pass an array to race."));return promise}var length=entries.length;function onFulfillment(value){lib$rsvp$$internal$$resolve(promise,value)}function onRejection(reason){lib$rsvp$$internal$$reject(promise,reason)}for(var i=0;promise._state===lib$rsvp$$internal$$PENDING&&i<length;i++){lib$rsvp$$internal$$subscribe(Constructor.resolve(entries[i]),undefined,onFulfillment,onRejection)}return promise}var lib$rsvp$promise$race$$default=lib$rsvp$promise$race$$race;function lib$rsvp$promise$resolve$$resolve(object,label){var Constructor=this;if(object&&typeof object==="object"&&object.constructor===Constructor){return object}var promise=new Constructor(lib$rsvp$$internal$$noop,label);lib$rsvp$$internal$$resolve(promise,object);return promise}var lib$rsvp$promise$resolve$$default=lib$rsvp$promise$resolve$$resolve;function lib$rsvp$promise$reject$$reject(reason,label){var Constructor=this;var promise=new Constructor(lib$rsvp$$internal$$noop,label);lib$rsvp$$internal$$reject(promise,reason);return promise}var lib$rsvp$promise$reject$$default=lib$rsvp$promise$reject$$reject;var lib$rsvp$promise$$guidKey="rsvp_"+lib$rsvp$utils$$now()+"-";var lib$rsvp$promise$$counter=0;function lib$rsvp$promise$$needsResolver(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function lib$rsvp$promise$$needsNew(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function lib$rsvp$promise$$Promise(resolver,label){var promise=this;promise._id=lib$rsvp$promise$$counter++;promise._label=label;promise._state=undefined;promise._result=undefined;promise._subscribers=[];if(lib$rsvp$config$$config.instrument){lib$rsvp$instrument$$default("created",promise)}if(lib$rsvp$$internal$$noop!==resolver){if(!lib$rsvp$utils$$isFunction(resolver)){lib$rsvp$promise$$needsResolver()}if(!(promise instanceof lib$rsvp$promise$$Promise)){lib$rsvp$promise$$needsNew()}lib$rsvp$$internal$$initializePromise(promise,resolver)}}var lib$rsvp$promise$$default=lib$rsvp$promise$$Promise;lib$rsvp$promise$$Promise.cast=lib$rsvp$promise$resolve$$default;lib$rsvp$promise$$Promise.all=lib$rsvp$promise$all$$default;lib$rsvp$promise$$Promise.race=lib$rsvp$promise$race$$default;lib$rsvp$promise$$Promise.resolve=lib$rsvp$promise$resolve$$default;lib$rsvp$promise$$Promise.reject=lib$rsvp$promise$reject$$default;lib$rsvp$promise$$Promise.prototype={constructor:lib$rsvp$promise$$Promise,_guidKey:lib$rsvp$promise$$guidKey,_onError:function(reason){var promise=this;lib$rsvp$config$$config.after(function(){if(promise._onError){lib$rsvp$config$$config["trigger"]("error",reason)}})},then:function(onFulfillment,onRejection,label){var parent=this;var state=parent._state;if(state===lib$rsvp$$internal$$FULFILLED&&!onFulfillment||state===lib$rsvp$$internal$$REJECTED&&!onRejection){if(lib$rsvp$config$$config.instrument){lib$rsvp$instrument$$default("chained",parent,parent)}return parent}parent._onError=null;var child=new parent.constructor(lib$rsvp$$internal$$noop,label);var result=parent._result;if(lib$rsvp$config$$config.instrument){lib$rsvp$instrument$$default("chained",parent,child)}if(state){var callback=arguments[state-1];lib$rsvp$config$$config.async(function(){lib$rsvp$$internal$$invokeCallback(state,child,callback,result)})}else{lib$rsvp$$internal$$subscribe(parent,child,onFulfillment,onRejection)}return child},"catch":function(onRejection,label){return this.then(undefined,onRejection,label)},"finally":function(callback,label){var promise=this;var constructor=promise.constructor;return promise.then(function(value){return constructor.resolve(callback()).then(function(){return value})},function(reason){return constructor.resolve(callback()).then(function(){throw reason})},label)}};function lib$rsvp$all$settled$$AllSettled(Constructor,entries,label){this._superConstructor(Constructor,entries,false,label)}lib$rsvp$all$settled$$AllSettled.prototype=lib$rsvp$utils$$o_create(lib$rsvp$enumerator$$default.prototype);lib$rsvp$all$settled$$AllSettled.prototype._superConstructor=lib$rsvp$enumerator$$default;lib$rsvp$all$settled$$AllSettled.prototype._makeResult=lib$rsvp$enumerator$$makeSettledResult;lib$rsvp$all$settled$$AllSettled.prototype._validationError=function(){return new Error("allSettled must be called with an array")};function lib$rsvp$all$settled$$allSettled(entries,label){return new lib$rsvp$all$settled$$AllSettled(lib$rsvp$promise$$default,entries,label).promise}var lib$rsvp$all$settled$$default=lib$rsvp$all$settled$$allSettled;function lib$rsvp$all$$all(array,label){return lib$rsvp$promise$$default.all(array,label)}var lib$rsvp$all$$default=lib$rsvp$all$$all;var lib$rsvp$asap$$len=0;var lib$rsvp$asap$$toString={}.toString;var lib$rsvp$asap$$vertxNext;function lib$rsvp$asap$$asap(callback,arg){lib$rsvp$asap$$queue[lib$rsvp$asap$$len]=callback;lib$rsvp$asap$$queue[lib$rsvp$asap$$len+1]=arg;lib$rsvp$asap$$len+=2;if(lib$rsvp$asap$$len===2){lib$rsvp$asap$$scheduleFlush()}}var lib$rsvp$asap$$default=lib$rsvp$asap$$asap;var lib$rsvp$asap$$browserWindow=typeof window!=="undefined"?window:undefined;var lib$rsvp$asap$$browserGlobal=lib$rsvp$asap$$browserWindow||{};var lib$rsvp$asap$$BrowserMutationObserver=lib$rsvp$asap$$browserGlobal.MutationObserver||lib$rsvp$asap$$browserGlobal.WebKitMutationObserver;var lib$rsvp$asap$$isNode=typeof self==="undefined"&&typeof process!=="undefined"&&{}.toString.call(process)==="[object process]";var lib$rsvp$asap$$isWorker=typeof Uint8ClampedArray!=="undefined"&&typeof importScripts!=="undefined"&&typeof MessageChannel!=="undefined";function lib$rsvp$asap$$useNextTick(){var nextTick=process.nextTick;var version=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);if(Array.isArray(version)&&version[1]==="0"&&version[2]==="10"){nextTick=setImmediate}return function(){nextTick(lib$rsvp$asap$$flush)}}function lib$rsvp$asap$$useVertxTimer(){return function(){lib$rsvp$asap$$vertxNext(lib$rsvp$asap$$flush)}}function lib$rsvp$asap$$useMutationObserver(){var iterations=0;var observer=new lib$rsvp$asap$$BrowserMutationObserver(lib$rsvp$asap$$flush);var node=document.createTextNode("");observer.observe(node,{characterData:true});return function(){node.data=iterations=++iterations%2}}function lib$rsvp$asap$$useMessageChannel(){var channel=new MessageChannel;channel.port1.onmessage=lib$rsvp$asap$$flush;return function(){channel.port2.postMessage(0)}}function lib$rsvp$asap$$useSetTimeout(){return function(){setTimeout(lib$rsvp$asap$$flush,1)}}var lib$rsvp$asap$$queue=new Array(1e3);function lib$rsvp$asap$$flush(){for(var i=0;i<lib$rsvp$asap$$len;i+=2){var callback=lib$rsvp$asap$$queue[i];var arg=lib$rsvp$asap$$queue[i+1];callback(arg);lib$rsvp$asap$$queue[i]=undefined;lib$rsvp$asap$$queue[i+1]=undefined}lib$rsvp$asap$$len=0}function lib$rsvp$asap$$attemptVertex(){try{var r=require;var vertx=r("vertx");lib$rsvp$asap$$vertxNext=vertx.runOnLoop||vertx.runOnContext;return lib$rsvp$asap$$useVertxTimer()}catch(e){return lib$rsvp$asap$$useSetTimeout()}}var lib$rsvp$asap$$scheduleFlush;if(lib$rsvp$asap$$isNode){lib$rsvp$asap$$scheduleFlush=lib$rsvp$asap$$useNextTick()}else if(lib$rsvp$asap$$BrowserMutationObserver){lib$rsvp$asap$$scheduleFlush=lib$rsvp$asap$$useMutationObserver()}else if(lib$rsvp$asap$$isWorker){lib$rsvp$asap$$scheduleFlush=lib$rsvp$asap$$useMessageChannel()}else if(lib$rsvp$asap$$browserWindow===undefined&&typeof require==="function"){lib$rsvp$asap$$scheduleFlush=lib$rsvp$asap$$attemptVertex()}else{lib$rsvp$asap$$scheduleFlush=lib$rsvp$asap$$useSetTimeout()}function lib$rsvp$defer$$defer(label){var deferred={};deferred["promise"]=new lib$rsvp$promise$$default(function(resolve,reject){deferred["resolve"]=resolve;deferred["reject"]=reject},label);return deferred}var lib$rsvp$defer$$default=lib$rsvp$defer$$defer;function lib$rsvp$filter$$filter(promises,filterFn,label){return lib$rsvp$promise$$default.all(promises,label).then(function(values){if(!lib$rsvp$utils$$isFunction(filterFn)){throw new TypeError("You must pass a function as filter's second argument.")}var length=values.length;var filtered=new Array(length);for(var i=0;i<length;i++){filtered[i]=filterFn(values[i])}return lib$rsvp$promise$$default.all(filtered,label).then(function(filtered){var results=new Array(length);var newLength=0;for(var i=0;i<length;i++){if(filtered[i]){results[newLength]=values[i];newLength++}}results.length=newLength;return results})})}var lib$rsvp$filter$$default=lib$rsvp$filter$$filter;function lib$rsvp$promise$hash$$PromiseHash(Constructor,object,label){this._superConstructor(Constructor,object,true,label)}var lib$rsvp$promise$hash$$default=lib$rsvp$promise$hash$$PromiseHash;lib$rsvp$promise$hash$$PromiseHash.prototype=lib$rsvp$utils$$o_create(lib$rsvp$enumerator$$default.prototype);lib$rsvp$promise$hash$$PromiseHash.prototype._superConstructor=lib$rsvp$enumerator$$default;lib$rsvp$promise$hash$$PromiseHash.prototype._init=function(){this._result={}};lib$rsvp$promise$hash$$PromiseHash.prototype._validateInput=function(input){return input&&typeof input==="object"};lib$rsvp$promise$hash$$PromiseHash.prototype._validationError=function(){return new Error("Promise.hash must be called with an object")};lib$rsvp$promise$hash$$PromiseHash.prototype._enumerate=function(){var enumerator=this;var promise=enumerator.promise;var input=enumerator._input;var results=[];for(var key in input){if(promise._state===lib$rsvp$$internal$$PENDING&&Object.prototype.hasOwnProperty.call(input,key)){results.push({position:key,entry:input[key]})}}var length=results.length;enumerator._remaining=length;var result;for(var i=0;promise._state===lib$rsvp$$internal$$PENDING&&i<length;i++){result=results[i];enumerator._eachEntry(result.entry,result.position)}};function lib$rsvp$hash$settled$$HashSettled(Constructor,object,label){this._superConstructor(Constructor,object,false,label)}lib$rsvp$hash$settled$$HashSettled.prototype=lib$rsvp$utils$$o_create(lib$rsvp$promise$hash$$default.prototype);lib$rsvp$hash$settled$$HashSettled.prototype._superConstructor=lib$rsvp$enumerator$$default;lib$rsvp$hash$settled$$HashSettled.prototype._makeResult=lib$rsvp$enumerator$$makeSettledResult;lib$rsvp$hash$settled$$HashSettled.prototype._validationError=function(){return new Error("hashSettled must be called with an object")};function lib$rsvp$hash$settled$$hashSettled(object,label){return new lib$rsvp$hash$settled$$HashSettled(lib$rsvp$promise$$default,object,label).promise}var lib$rsvp$hash$settled$$default=lib$rsvp$hash$settled$$hashSettled;function lib$rsvp$hash$$hash(object,label){return new lib$rsvp$promise$hash$$default(lib$rsvp$promise$$default,object,label).promise}var lib$rsvp$hash$$default=lib$rsvp$hash$$hash;function lib$rsvp$map$$map(promises,mapFn,label){return lib$rsvp$promise$$default.all(promises,label).then(function(values){if(!lib$rsvp$utils$$isFunction(mapFn)){throw new TypeError("You must pass a function as map's second argument.")}var length=values.length;var results=new Array(length);for(var i=0;i<length;i++){results[i]=mapFn(values[i])}return lib$rsvp$promise$$default.all(results,label)})}var lib$rsvp$map$$default=lib$rsvp$map$$map;function lib$rsvp$node$$Result(){this.value=undefined}var lib$rsvp$node$$ERROR=new lib$rsvp$node$$Result;var lib$rsvp$node$$GET_THEN_ERROR=new lib$rsvp$node$$Result;function lib$rsvp$node$$getThen(obj){try{return obj.then}catch(error){lib$rsvp$node$$ERROR.value=error;return lib$rsvp$node$$ERROR}}function lib$rsvp$node$$tryApply(f,s,a){try{f.apply(s,a)}catch(error){lib$rsvp$node$$ERROR.value=error;return lib$rsvp$node$$ERROR}}function lib$rsvp$node$$makeObject(_,argumentNames){var obj={};var name;var i;var length=_.length;var args=new Array(length);for(var x=0;x<length;x++){args[x]=_[x]}for(i=0;i<argumentNames.length;i++){name=argumentNames[i];obj[name]=args[i+1]}return obj}function lib$rsvp$node$$arrayResult(_){var length=_.length;var args=new Array(length-1);for(var i=1;i<length;i++){args[i-1]=_[i]}return args}function lib$rsvp$node$$wrapThenable(then,promise){return{then:function(onFulFillment,onRejection){return then.call(promise,onFulFillment,onRejection)}}}function lib$rsvp$node$$denodeify(nodeFunc,options){var fn=function(){var self=this;var l=arguments.length;var args=new Array(l+1);var arg;var promiseInput=false;for(var i=0;i<l;++i){arg=arguments[i];if(!promiseInput){promiseInput=lib$rsvp$node$$needsPromiseInput(arg);if(promiseInput===lib$rsvp$node$$GET_THEN_ERROR){var p=new lib$rsvp$promise$$default(lib$rsvp$$internal$$noop);lib$rsvp$$internal$$reject(p,lib$rsvp$node$$GET_THEN_ERROR.value);return p}else if(promiseInput&&promiseInput!==true){arg=lib$rsvp$node$$wrapThenable(promiseInput,arg)}}args[i]=arg}var promise=new lib$rsvp$promise$$default(lib$rsvp$$internal$$noop);args[l]=function(err,val){if(err)lib$rsvp$$internal$$reject(promise,err);else if(options===undefined)lib$rsvp$$internal$$resolve(promise,val);else if(options===true)lib$rsvp$$internal$$resolve(promise,lib$rsvp$node$$arrayResult(arguments));else if(lib$rsvp$utils$$isArray(options))lib$rsvp$$internal$$resolve(promise,lib$rsvp$node$$makeObject(arguments,options));else lib$rsvp$$internal$$resolve(promise,val)};if(promiseInput){return lib$rsvp$node$$handlePromiseInput(promise,args,nodeFunc,self)}else{return lib$rsvp$node$$handleValueInput(promise,args,nodeFunc,self)}};fn.__proto__=nodeFunc;return fn}var lib$rsvp$node$$default=lib$rsvp$node$$denodeify;function lib$rsvp$node$$handleValueInput(promise,args,nodeFunc,self){var result=lib$rsvp$node$$tryApply(nodeFunc,self,args);if(result===lib$rsvp$node$$ERROR){lib$rsvp$$internal$$reject(promise,result.value)}return promise}function lib$rsvp$node$$handlePromiseInput(promise,args,nodeFunc,self){return lib$rsvp$promise$$default.all(args).then(function(args){var result=lib$rsvp$node$$tryApply(nodeFunc,self,args);if(result===lib$rsvp$node$$ERROR){lib$rsvp$$internal$$reject(promise,result.value)}return promise})}function lib$rsvp$node$$needsPromiseInput(arg){if(arg&&typeof arg==="object"){if(arg.constructor===lib$rsvp$promise$$default){return true}else{return lib$rsvp$node$$getThen(arg)}}else{return false}}var lib$rsvp$platform$$platform;if(typeof self==="object"){lib$rsvp$platform$$platform=self}else if(typeof global==="object"){lib$rsvp$platform$$platform=global}else{throw new Error("no global: `self` or `global` found")}var lib$rsvp$platform$$default=lib$rsvp$platform$$platform;function lib$rsvp$race$$race(array,label){return lib$rsvp$promise$$default.race(array,label)}var lib$rsvp$race$$default=lib$rsvp$race$$race;function lib$rsvp$reject$$reject(reason,label){return lib$rsvp$promise$$default.reject(reason,label)}var lib$rsvp$reject$$default=lib$rsvp$reject$$reject;function lib$rsvp$resolve$$resolve(value,label){return lib$rsvp$promise$$default.resolve(value,label)}var lib$rsvp$resolve$$default=lib$rsvp$resolve$$resolve;function lib$rsvp$rethrow$$rethrow(reason){setTimeout(function(){throw reason});throw reason}var lib$rsvp$rethrow$$default=lib$rsvp$rethrow$$rethrow;lib$rsvp$config$$config.async=lib$rsvp$asap$$default;lib$rsvp$config$$config.after=function(cb){setTimeout(cb,0)};var lib$rsvp$$cast=lib$rsvp$resolve$$default;function lib$rsvp$$async(callback,arg){lib$rsvp$config$$config.async(callback,arg)}function lib$rsvp$$on(){lib$rsvp$config$$config["on"].apply(lib$rsvp$config$$config,arguments)}function lib$rsvp$$off(){lib$rsvp$config$$config["off"].apply(lib$rsvp$config$$config,arguments)}if(typeof window!=="undefined"&&typeof window["__PROMISE_INSTRUMENTATION__"]==="object"){var lib$rsvp$$callbacks=window["__PROMISE_INSTRUMENTATION__"];lib$rsvp$config$$configure("instrument",true);for(var lib$rsvp$$eventName in lib$rsvp$$callbacks){if(lib$rsvp$$callbacks.hasOwnProperty(lib$rsvp$$eventName)){lib$rsvp$$on(lib$rsvp$$eventName,lib$rsvp$$callbacks[lib$rsvp$$eventName])}}}var lib$rsvp$umd$$RSVP={race:lib$rsvp$race$$default,Promise:lib$rsvp$promise$$default,allSettled:lib$rsvp$all$settled$$default,hash:lib$rsvp$hash$$default,hashSettled:lib$rsvp$hash$settled$$default,denodeify:lib$rsvp$node$$default,on:lib$rsvp$$on,off:lib$rsvp$$off,map:lib$rsvp$map$$default,filter:lib$rsvp$filter$$default,resolve:lib$rsvp$resolve$$default,reject:lib$rsvp$reject$$default,all:lib$rsvp$all$$default,rethrow:lib$rsvp$rethrow$$default,defer:lib$rsvp$defer$$default,EventTarget:lib$rsvp$events$$default,configure:lib$rsvp$config$$configure,async:lib$rsvp$$async};if(typeof define==="function"&&define["amd"]){define(function(){return lib$rsvp$umd$$RSVP})}else if(typeof module!=="undefined"&&module["exports"]){module["exports"]=lib$rsvp$umd$$RSVP}else if(typeof lib$rsvp$platform$$default!=="undefined"){lib$rsvp$platform$$default["RSVP"]=lib$rsvp$umd$$RSVP}}).call(this);
@@ -0,0 +1,70 @@
1
+ import Promise from './rsvp/promise';
2
+ import EventTarget from './rsvp/events';
3
+ import denodeify from './rsvp/node';
4
+ import all from './rsvp/all';
5
+ import allSettled from './rsvp/all-settled';
6
+ import race from './rsvp/race';
7
+ import hash from './rsvp/hash';
8
+ import hashSettled from './rsvp/hash-settled';
9
+ import rethrow from './rsvp/rethrow';
10
+ import defer from './rsvp/defer';
11
+ import {
12
+ config,
13
+ configure
14
+ } from './rsvp/config';
15
+ import map from './rsvp/map';
16
+ import resolve from './rsvp/resolve';
17
+ import reject from './rsvp/reject';
18
+ import filter from './rsvp/filter';
19
+ import asap from './rsvp/asap';
20
+
21
+ // defaults
22
+ config.async = asap;
23
+ config.after = function(cb) {
24
+ setTimeout(cb, 0);
25
+ };
26
+ var cast = resolve;
27
+ function async(callback, arg) {
28
+ config.async(callback, arg);
29
+ }
30
+
31
+ function on() {
32
+ config['on'].apply(config, arguments);
33
+ }
34
+
35
+ function off() {
36
+ config['off'].apply(config, arguments);
37
+ }
38
+
39
+ // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__`
40
+ if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') {
41
+ var callbacks = window['__PROMISE_INSTRUMENTATION__'];
42
+ configure('instrument', true);
43
+ for (var eventName in callbacks) {
44
+ if (callbacks.hasOwnProperty(eventName)) {
45
+ on(eventName, callbacks[eventName]);
46
+ }
47
+ }
48
+ }
49
+
50
+ export {
51
+ cast,
52
+ Promise,
53
+ EventTarget,
54
+ all,
55
+ allSettled,
56
+ race,
57
+ hash,
58
+ hashSettled,
59
+ rethrow,
60
+ defer,
61
+ denodeify,
62
+ configure,
63
+ on,
64
+ off,
65
+ resolve,
66
+ reject,
67
+ async,
68
+ map,
69
+ filter
70
+ };
@@ -0,0 +1,51 @@
1
+ import platform from './rsvp/platform';
2
+ import {
3
+ Promise,
4
+ allSettled,
5
+ hash,
6
+ hashSettled,
7
+ denodeify,
8
+ on,
9
+ off,
10
+ map,
11
+ filter,
12
+ resolve,
13
+ reject,
14
+ rethrow,
15
+ all,
16
+ defer,
17
+ EventTarget,
18
+ configure,
19
+ race,
20
+ async
21
+ } from './rsvp';
22
+
23
+ var RSVP = {
24
+ 'race': race,
25
+ 'Promise': Promise,
26
+ 'allSettled': allSettled,
27
+ 'hash': hash,
28
+ 'hashSettled': hashSettled,
29
+ 'denodeify': denodeify,
30
+ 'on': on,
31
+ 'off': off,
32
+ 'map': map,
33
+ 'filter': filter,
34
+ 'resolve': resolve,
35
+ 'reject': reject,
36
+ 'all': all,
37
+ 'rethrow': rethrow,
38
+ 'defer': defer,
39
+ 'EventTarget': EventTarget,
40
+ 'configure': configure,
41
+ 'async': async
42
+ };
43
+
44
+ /* global define:true module:true window: true */
45
+ if (typeof define === 'function' && define['amd']) {
46
+ define(function() { return RSVP; });
47
+ } else if (typeof module !== 'undefined' && module['exports']) {
48
+ module['exports'] = RSVP;
49
+ } else if (typeof platform !== 'undefined') {
50
+ platform['RSVP'] = RSVP;
51
+ }
@@ -0,0 +1,73 @@
1
+ import {
2
+ default as Enumerator,
3
+ makeSettledResult
4
+ } from './enumerator';
5
+ import Promise from './promise';
6
+ import { o_create } from './utils';
7
+
8
+ function AllSettled(Constructor, entries, label) {
9
+ this._superConstructor(Constructor, entries, false /* don't abort on reject */, label);
10
+ }
11
+
12
+ AllSettled.prototype = o_create(Enumerator.prototype);
13
+ AllSettled.prototype._superConstructor = Enumerator;
14
+ AllSettled.prototype._makeResult = makeSettledResult;
15
+ AllSettled.prototype._validationError = function() {
16
+ return new Error('allSettled must be called with an array');
17
+ };
18
+
19
+ /**
20
+ `RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing
21
+ a fail-fast method, it waits until all the promises have returned and
22
+ shows you all the results. This is useful if you want to handle multiple
23
+ promises' failure states together as a set.
24
+
25
+ Returns a promise that is fulfilled when all the given promises have been
26
+ settled. The return promise is fulfilled with an array of the states of
27
+ the promises passed into the `promises` array argument.
28
+
29
+ Each state object will either indicate fulfillment or rejection, and
30
+ provide the corresponding value or reason. The states will take one of
31
+ the following formats:
32
+
33
+ ```javascript
34
+ { state: 'fulfilled', value: value }
35
+ or
36
+ { state: 'rejected', reason: reason }
37
+ ```
38
+
39
+ Example:
40
+
41
+ ```javascript
42
+ var promise1 = RSVP.Promise.resolve(1);
43
+ var promise2 = RSVP.Promise.reject(new Error('2'));
44
+ var promise3 = RSVP.Promise.reject(new Error('3'));
45
+ var promises = [ promise1, promise2, promise3 ];
46
+
47
+ RSVP.allSettled(promises).then(function(array){
48
+ // array == [
49
+ // { state: 'fulfilled', value: 1 },
50
+ // { state: 'rejected', reason: Error },
51
+ // { state: 'rejected', reason: Error }
52
+ // ]
53
+ // Note that for the second item, reason.message will be '2', and for the
54
+ // third item, reason.message will be '3'.
55
+ }, function(error) {
56
+ // Not run. (This block would only be called if allSettled had failed,
57
+ // for instance if passed an incorrect argument type.)
58
+ });
59
+ ```
60
+
61
+ @method allSettled
62
+ @static
63
+ @for RSVP
64
+ @param {Array} entries
65
+ @param {String} label - optional string that describes the promise.
66
+ Useful for tooling.
67
+ @return {Promise} promise that is fulfilled with an array of the settled
68
+ states of the constituent promises.
69
+ */
70
+
71
+ export default function allSettled(entries, label) {
72
+ return new AllSettled(Promise, entries, label).promise;
73
+ }
@@ -0,0 +1,112 @@
1
+ var len = 0;
2
+ var toString = {}.toString;
3
+ var vertxNext;
4
+ export default function asap(callback, arg) {
5
+ queue[len] = callback;
6
+ queue[len + 1] = arg;
7
+ len += 2;
8
+ if (len === 2) {
9
+ // If len is 1, that means that we need to schedule an async flush.
10
+ // If additional callbacks are queued before the queue is flushed, they
11
+ // will be processed by this flush that we are scheduling.
12
+ scheduleFlush();
13
+ }
14
+ }
15
+
16
+ var browserWindow = (typeof window !== 'undefined') ? window : undefined;
17
+ var browserGlobal = browserWindow || {};
18
+ var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
19
+ var isNode = typeof self === 'undefined' &&
20
+ typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
21
+
22
+ // test for web worker but not in IE10
23
+ var isWorker = typeof Uint8ClampedArray !== 'undefined' &&
24
+ typeof importScripts !== 'undefined' &&
25
+ typeof MessageChannel !== 'undefined';
26
+
27
+ // node
28
+ function useNextTick() {
29
+ var nextTick = process.nextTick;
30
+ // node version 0.10.x displays a deprecation warning when nextTick is used recursively
31
+ // setImmediate should be used instead instead
32
+ var version = process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);
33
+ if (Array.isArray(version) && version[1] === '0' && version[2] === '10') {
34
+ nextTick = setImmediate;
35
+ }
36
+ return function() {
37
+ nextTick(flush);
38
+ };
39
+ }
40
+
41
+ // vertx
42
+ function useVertxTimer() {
43
+ return function() {
44
+ vertxNext(flush);
45
+ };
46
+ }
47
+
48
+ function useMutationObserver() {
49
+ var iterations = 0;
50
+ var observer = new BrowserMutationObserver(flush);
51
+ var node = document.createTextNode('');
52
+ observer.observe(node, { characterData: true });
53
+
54
+ return function() {
55
+ node.data = (iterations = ++iterations % 2);
56
+ };
57
+ }
58
+
59
+ // web worker
60
+ function useMessageChannel() {
61
+ var channel = new MessageChannel();
62
+ channel.port1.onmessage = flush;
63
+ return function () {
64
+ channel.port2.postMessage(0);
65
+ };
66
+ }
67
+
68
+ function useSetTimeout() {
69
+ return function() {
70
+ setTimeout(flush, 1);
71
+ };
72
+ }
73
+
74
+ var queue = new Array(1000);
75
+ function flush() {
76
+ for (var i = 0; i < len; i+=2) {
77
+ var callback = queue[i];
78
+ var arg = queue[i+1];
79
+
80
+ callback(arg);
81
+
82
+ queue[i] = undefined;
83
+ queue[i+1] = undefined;
84
+ }
85
+
86
+ len = 0;
87
+ }
88
+
89
+ function attemptVertex() {
90
+ try {
91
+ var r = require;
92
+ var vertx = r('vertx');
93
+ vertxNext = vertx.runOnLoop || vertx.runOnContext;
94
+ return useVertxTimer();
95
+ } catch(e) {
96
+ return useSetTimeout();
97
+ }
98
+ }
99
+
100
+ var scheduleFlush;
101
+ // Decide what async method to use to triggering processing of queued callbacks:
102
+ if (isNode) {
103
+ scheduleFlush = useNextTick();
104
+ } else if (BrowserMutationObserver) {
105
+ scheduleFlush = useMutationObserver();
106
+ } else if (isWorker) {
107
+ scheduleFlush = useMessageChannel();
108
+ } else if (browserWindow === undefined && typeof require === 'function') {
109
+ scheduleFlush = attemptVertex();
110
+ } else {
111
+ scheduleFlush = useSetTimeout();
112
+ }
@@ -0,0 +1,45 @@
1
+ import Promise from "./promise";
2
+
3
+ /**
4
+ `RSVP.defer` returns an object similar to jQuery's `$.Deferred`.
5
+ `RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s
6
+ interface. New code should use the `RSVP.Promise` constructor instead.
7
+
8
+ The object returned from `RSVP.defer` is a plain object with three properties:
9
+
10
+ * promise - an `RSVP.Promise`.
11
+ * reject - a function that causes the `promise` property on this object to
12
+ become rejected
13
+ * resolve - a function that causes the `promise` property on this object to
14
+ become fulfilled.
15
+
16
+ Example:
17
+
18
+ ```javascript
19
+ var deferred = RSVP.defer();
20
+
21
+ deferred.resolve("Success!");
22
+
23
+ deferred.promise.then(function(value){
24
+ // value here is "Success!"
25
+ });
26
+ ```
27
+
28
+ @method defer
29
+ @static
30
+ @for RSVP
31
+ @param {String} label optional string for labeling the promise.
32
+ Useful for tooling.
33
+ @return {Object}
34
+ */
35
+
36
+ export default function defer(label) {
37
+ var deferred = {};
38
+
39
+ deferred['promise'] = new Promise(function(resolve, reject) {
40
+ deferred['resolve'] = resolve;
41
+ deferred['reject'] = reject;
42
+ }, label);
43
+
44
+ return deferred;
45
+ }
@@ -0,0 +1,130 @@
1
+ import {
2
+ isArray,
3
+ isMaybeThenable
4
+ } from './utils';
5
+
6
+ import {
7
+ noop,
8
+ reject,
9
+ fulfill,
10
+ subscribe,
11
+ FULFILLED,
12
+ REJECTED,
13
+ PENDING
14
+ } from './-internal';
15
+
16
+ export function makeSettledResult(state, position, value) {
17
+ if (state === FULFILLED) {
18
+ return {
19
+ state: 'fulfilled',
20
+ value: value
21
+ };
22
+ } else {
23
+ return {
24
+ state: 'rejected',
25
+ reason: value
26
+ };
27
+ }
28
+ }
29
+
30
+ function Enumerator(Constructor, input, abortOnReject, label) {
31
+ var enumerator = this;
32
+
33
+ enumerator._instanceConstructor = Constructor;
34
+ enumerator.promise = new Constructor(noop, label);
35
+ enumerator._abortOnReject = abortOnReject;
36
+
37
+ if (enumerator._validateInput(input)) {
38
+ enumerator._input = input;
39
+ enumerator.length = input.length;
40
+ enumerator._remaining = input.length;
41
+
42
+ enumerator._init();
43
+
44
+ if (enumerator.length === 0) {
45
+ fulfill(enumerator.promise, enumerator._result);
46
+ } else {
47
+ enumerator.length = enumerator.length || 0;
48
+ enumerator._enumerate();
49
+ if (enumerator._remaining === 0) {
50
+ fulfill(enumerator.promise, enumerator._result);
51
+ }
52
+ }
53
+ } else {
54
+ reject(enumerator.promise, enumerator._validationError());
55
+ }
56
+ }
57
+
58
+ export default Enumerator;
59
+
60
+ Enumerator.prototype._validateInput = function(input) {
61
+ return isArray(input);
62
+ };
63
+
64
+ Enumerator.prototype._validationError = function() {
65
+ return new Error('Array Methods must be provided an Array');
66
+ };
67
+
68
+ Enumerator.prototype._init = function() {
69
+ this._result = new Array(this.length);
70
+ };
71
+
72
+ Enumerator.prototype._enumerate = function() {
73
+ var enumerator = this;
74
+ var length = enumerator.length;
75
+ var promise = enumerator.promise;
76
+ var input = enumerator._input;
77
+
78
+ for (var i = 0; promise._state === PENDING && i < length; i++) {
79
+ enumerator._eachEntry(input[i], i);
80
+ }
81
+ };
82
+
83
+ Enumerator.prototype._eachEntry = function(entry, i) {
84
+ var enumerator = this;
85
+ var c = enumerator._instanceConstructor;
86
+ if (isMaybeThenable(entry)) {
87
+ if (entry.constructor === c && entry._state !== PENDING) {
88
+ entry._onError = null;
89
+ enumerator._settledAt(entry._state, i, entry._result);
90
+ } else {
91
+ enumerator._willSettleAt(c.resolve(entry), i);
92
+ }
93
+ } else {
94
+ enumerator._remaining--;
95
+ enumerator._result[i] = enumerator._makeResult(FULFILLED, i, entry);
96
+ }
97
+ };
98
+
99
+ Enumerator.prototype._settledAt = function(state, i, value) {
100
+ var enumerator = this;
101
+ var promise = enumerator.promise;
102
+
103
+ if (promise._state === PENDING) {
104
+ enumerator._remaining--;
105
+
106
+ if (enumerator._abortOnReject && state === REJECTED) {
107
+ reject(promise, value);
108
+ } else {
109
+ enumerator._result[i] = enumerator._makeResult(state, i, value);
110
+ }
111
+ }
112
+
113
+ if (enumerator._remaining === 0) {
114
+ fulfill(promise, enumerator._result);
115
+ }
116
+ };
117
+
118
+ Enumerator.prototype._makeResult = function(state, i, value) {
119
+ return value;
120
+ };
121
+
122
+ Enumerator.prototype._willSettleAt = function(promise, i) {
123
+ var enumerator = this;
124
+
125
+ subscribe(promise, undefined, function(value) {
126
+ enumerator._settledAt(FULFILLED, i, value);
127
+ }, function(reason) {
128
+ enumerator._settledAt(REJECTED, i, reason);
129
+ });
130
+ };