traceur-rb 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (410) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +2 -2
  3. data/lib/js/compile.js +7 -15
  4. data/lib/traceur.rb +2 -1
  5. data/lib/traceur/compilation_error.rb +27 -0
  6. data/lib/traceur/compiler.rb +4 -1
  7. data/lib/traceur/configuration.rb +1 -1
  8. data/lib/traceur/node/runner.rb +1 -1
  9. data/lib/traceur/version.rb +1 -1
  10. data/spec/examples/syntax_error.js +3 -0
  11. data/spec/integration/examples_spec.rb +6 -0
  12. data/vendor/node_modules/traceur/LICENSE +202 -0
  13. data/vendor/node_modules/traceur/README.md +5 -5
  14. data/vendor/node_modules/traceur/bin/traceur-runtime.js +1392 -623
  15. data/vendor/node_modules/traceur/bin/traceur.js +24749 -17990
  16. data/vendor/node_modules/traceur/node_modules/.bin/semver +2 -2
  17. data/vendor/node_modules/traceur/node_modules/commander/History.md +222 -0
  18. data/vendor/node_modules/traceur/node_modules/commander/Readme.md +127 -35
  19. data/vendor/node_modules/traceur/node_modules/commander/index.js +261 -93
  20. data/vendor/node_modules/traceur/node_modules/commander/package.json +41 -9
  21. data/vendor/node_modules/traceur/node_modules/glob/LICENSE +15 -0
  22. data/vendor/node_modules/traceur/node_modules/glob/README.md +357 -0
  23. data/vendor/node_modules/traceur/node_modules/glob/common.js +177 -0
  24. data/vendor/node_modules/traceur/node_modules/glob/glob.js +649 -0
  25. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/.eslintrc +17 -0
  26. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/LICENSE +15 -0
  27. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/README.md +37 -0
  28. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/inflight.js +44 -0
  29. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE +15 -0
  30. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md +36 -0
  31. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +34 -0
  32. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js +51 -0
  33. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js +33 -0
  34. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/package.json +61 -0
  35. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/test.js +97 -0
  36. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/LICENSE +16 -0
  37. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/README.md +42 -0
  38. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/inherits.js +1 -0
  39. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
  40. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/package.json +33 -0
  41. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/test.js +25 -0
  42. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/.npmignore +1 -0
  43. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/.travis.yml +4 -0
  44. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/LICENSE +23 -0
  45. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/README.md +216 -0
  46. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/benchmark.js +15 -0
  47. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/browser.js +1181 -0
  48. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/minimatch.js +845 -0
  49. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +2 -0
  50. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml +3 -0
  51. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +121 -0
  52. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +8 -0
  53. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +191 -0
  54. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +2 -0
  55. data/vendor/node_modules/traceur/node_modules/{q-io/node_modules/collections → glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/.travis.yml +0 -0
  56. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +6 -0
  57. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +80 -0
  58. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +5 -0
  59. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +38 -0
  60. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +73 -0
  61. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +56 -0
  62. data/vendor/node_modules/traceur/node_modules/{q-io/node_modules/url2 → glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map}/.travis.yml +1 -1
  63. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +18 -0
  64. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +62 -0
  65. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +6 -0
  66. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +13 -0
  67. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +83 -0
  68. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +39 -0
  69. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +75 -0
  70. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +32 -0
  71. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +1075 -0
  72. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +182 -0
  73. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +9 -0
  74. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +10 -0
  75. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +24 -0
  76. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +15 -0
  77. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +16 -0
  78. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js +10 -0
  79. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +13 -0
  80. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +7 -0
  81. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +50 -0
  82. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/package.json +60 -0
  83. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/basic.js +399 -0
  84. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/brace-expand.js +45 -0
  85. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/defaults.js +274 -0
  86. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
  87. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/LICENSE +27 -0
  88. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/README.md +51 -0
  89. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +15 -0
  90. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +36 -0
  91. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +34 -0
  92. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +51 -0
  93. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +33 -0
  94. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/once.js +21 -0
  95. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/package.json +42 -0
  96. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/test/once.js +23 -0
  97. data/vendor/node_modules/traceur/node_modules/glob/package.json +72 -0
  98. data/vendor/node_modules/traceur/node_modules/glob/sync.js +409 -0
  99. data/vendor/node_modules/traceur/node_modules/rsvp/.release.json +17 -0
  100. data/vendor/node_modules/traceur/node_modules/rsvp/CHANGELOG.md +165 -0
  101. data/vendor/node_modules/traceur/node_modules/rsvp/LICENSE +19 -0
  102. data/vendor/node_modules/traceur/node_modules/rsvp/README.md +364 -0
  103. data/vendor/node_modules/traceur/node_modules/rsvp/dist/rsvp.js +1671 -0
  104. data/vendor/node_modules/traceur/node_modules/rsvp/dist/rsvp.min.js +9 -0
  105. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp.js +66 -0
  106. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp.umd.js +50 -0
  107. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/-internal.js +265 -0
  108. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/all-settled.js +71 -0
  109. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/all.js +15 -0
  110. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/asap.js +109 -0
  111. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/config.js +28 -0
  112. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/defer.js +45 -0
  113. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/enumerator.js +125 -0
  114. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/events.js +201 -0
  115. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/filter.js +120 -0
  116. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/hash-settled.js +124 -0
  117. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/hash.js +94 -0
  118. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/instrument.js +41 -0
  119. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/map.js +99 -0
  120. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/node.js +281 -0
  121. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise-hash.js +51 -0
  122. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise.js +496 -0
  123. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/all.js +52 -0
  124. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/race.js +105 -0
  125. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/reject.js +47 -0
  126. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/resolve.js +49 -0
  127. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/race.js +15 -0
  128. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/reject.js +16 -0
  129. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/resolve.js +17 -0
  130. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/rethrow.js +46 -0
  131. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/utils.js +39 -0
  132. data/vendor/node_modules/traceur/node_modules/rsvp/package.json +100 -0
  133. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/README.md +9 -0
  134. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/bower.json +22 -0
  135. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/composer.json +18 -0
  136. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/package.json +52 -0
  137. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.amd.js +1607 -0
  138. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.js +1566 -0
  139. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.min.js +26 -0
  140. data/vendor/node_modules/traceur/node_modules/rsvp/vertx.js +1 -0
  141. data/vendor/node_modules/traceur/node_modules/semver/bin/semver +2 -2
  142. data/vendor/node_modules/traceur/node_modules/semver/package.json +4 -3
  143. data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js +7 -0
  144. data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js.gz +0 -0
  145. data/vendor/node_modules/traceur/node_modules/semver/semver.js +7 -0
  146. data/vendor/node_modules/traceur/node_modules/semver/semver.min.js +1 -1
  147. data/vendor/node_modules/traceur/node_modules/semver/semver.min.js.gz +0 -0
  148. data/vendor/node_modules/traceur/node_modules/semver/test/index.js +8 -4
  149. data/vendor/node_modules/traceur/node_modules/semver/test/ltr.js +2 -1
  150. data/vendor/node_modules/traceur/node_modules/source-map-support/.npmignore +1 -0
  151. data/vendor/node_modules/traceur/node_modules/{q-io/node_modules/mime/LICENSE → source-map-support/LICENSE.md} +7 -5
  152. data/vendor/node_modules/traceur/node_modules/source-map-support/README.md +165 -0
  153. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/browser-source-map-support.js +89 -0
  154. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/index.html +6 -0
  155. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/require.js +36 -0
  156. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.coffee +13 -0
  157. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.js +24 -0
  158. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.map +10 -0
  159. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-source-map-support.js +89 -0
  160. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/index.html +6 -0
  161. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.coffee +12 -0
  162. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.js +25 -0
  163. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.map +10 -0
  164. data/vendor/node_modules/traceur/node_modules/source-map-support/build.js +69 -0
  165. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/index.html +6 -0
  166. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.coffee +12 -0
  167. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.js +25 -0
  168. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.map +10 -0
  169. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/server.js +45 -0
  170. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/.npmignore +2 -0
  171. data/vendor/node_modules/traceur/node_modules/{q-io → source-map-support/node_modules/source-map}/.travis.yml +1 -0
  172. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/CHANGELOG.md +121 -0
  173. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/LICENSE +28 -0
  174. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/Makefile.dryice.js +166 -0
  175. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/README.md +434 -0
  176. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/assert-shim.js +56 -0
  177. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/mini-require.js +152 -0
  178. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/prefix-source-map.jsm +20 -0
  179. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/prefix-utils.jsm +18 -0
  180. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-browser.js +8 -0
  181. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-source-map.jsm +6 -0
  182. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-utils.jsm +21 -0
  183. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/test-prefix.js +8 -0
  184. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/test-suffix.js +3 -0
  185. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map.js +8 -0
  186. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/array-set.js +97 -0
  187. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
  188. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/base64.js +42 -0
  189. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/binary-search.js +81 -0
  190. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-map-consumer.js +478 -0
  191. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-map-generator.js +380 -0
  192. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-node.js +371 -0
  193. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/util.js +205 -0
  194. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
  195. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/README.md +171 -0
  196. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
  197. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/intercept.js +36 -0
  198. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/package.json +37 -0
  199. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/package.json +142 -0
  200. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/run-tests.js +62 -0
  201. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-api.js +26 -0
  202. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-array-set.js +104 -0
  203. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
  204. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-base64.js +35 -0
  205. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
  206. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-dog-fooding.js +72 -0
  207. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-map-consumer.js +451 -0
  208. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-map-generator.js +417 -0
  209. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-node.js +365 -0
  210. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/util.js +161 -0
  211. data/vendor/node_modules/traceur/node_modules/source-map-support/package.json +52 -0
  212. data/vendor/node_modules/traceur/node_modules/source-map-support/source-map-support.js +381 -0
  213. data/vendor/node_modules/traceur/node_modules/source-map-support/test.js +359 -0
  214. data/vendor/node_modules/traceur/package.json +234 -20
  215. data/vendor/node_modules/traceur/src/node/NodeCompiler.js +78 -0
  216. data/vendor/node_modules/traceur/src/node/System.js +32 -5
  217. data/vendor/node_modules/traceur/src/node/api.js +28 -93
  218. data/vendor/node_modules/traceur/src/node/command.js +84 -19
  219. data/vendor/node_modules/traceur/src/node/compileAllJsFilesInDir.js +40 -0
  220. data/vendor/node_modules/traceur/src/node/interpreter.js +11 -8
  221. data/vendor/node_modules/traceur/src/node/recursiveModuleCompile.js +171 -0
  222. data/vendor/node_modules/traceur/src/node/require.js +7 -21
  223. data/vendor/node_modules/traceur/src/node/to-amd-compiler.js +2 -7
  224. data/vendor/node_modules/traceur/src/node/to-closure-compiler.js +28 -0
  225. data/vendor/node_modules/traceur/src/node/to-commonjs-compiler.js +3 -7
  226. data/vendor/node_modules/traceur/src/node/traceur.js +1 -1
  227. metadata +196 -190
  228. data/vendor/node_modules/traceur/node_modules/q-io/.npmignore +0 -1
  229. data/vendor/node_modules/traceur/node_modules/q-io/CHANGES.md +0 -122
  230. data/vendor/node_modules/traceur/node_modules/q-io/LICENSE +0 -19
  231. data/vendor/node_modules/traceur/node_modules/q-io/README.md +0 -928
  232. data/vendor/node_modules/traceur/node_modules/q-io/buffer-stream.js +0 -59
  233. data/vendor/node_modules/traceur/node_modules/q-io/coverage-report.js +0 -44
  234. data/vendor/node_modules/traceur/node_modules/q-io/deprecate.js +0 -51
  235. data/vendor/node_modules/traceur/node_modules/q-io/fs-boot.js +0 -307
  236. data/vendor/node_modules/traceur/node_modules/q-io/fs-common.js +0 -499
  237. data/vendor/node_modules/traceur/node_modules/q-io/fs-mock.js +0 -547
  238. data/vendor/node_modules/traceur/node_modules/q-io/fs-root.js +0 -105
  239. data/vendor/node_modules/traceur/node_modules/q-io/fs.js +0 -355
  240. data/vendor/node_modules/traceur/node_modules/q-io/fs2http.js +0 -65
  241. data/vendor/node_modules/traceur/node_modules/q-io/http-apps.js +0 -152
  242. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/chain.js +0 -24
  243. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/content.js +0 -93
  244. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/cookie.js +0 -154
  245. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/decorators.js +0 -178
  246. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/fs.js +0 -417
  247. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/html.js +0 -58
  248. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/json.js +0 -78
  249. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/negotiate.js +0 -120
  250. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/proxy.js +0 -27
  251. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/redirect.js +0 -209
  252. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/route.js +0 -125
  253. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/status.js +0 -175
  254. data/vendor/node_modules/traceur/node_modules/q-io/http-cookie.js +0 -75
  255. data/vendor/node_modules/traceur/node_modules/q-io/http.js +0 -378
  256. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.npmignore +0 -11
  257. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/CHANGES.md +0 -78
  258. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/LICENSE.md +0 -21
  259. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/README.md +0 -1285
  260. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/collections.js +0 -22
  261. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/dict.js +0 -142
  262. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-map.js +0 -57
  263. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-set.js +0 -183
  264. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-collection.js +0 -261
  265. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-map.js +0 -186
  266. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-order.js +0 -55
  267. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-set.js +0 -59
  268. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/heap.js +0 -236
  269. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/iterator.js +0 -371
  270. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/list.js +0 -435
  271. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/array-changes.js +0 -247
  272. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/map-changes.js +0 -147
  273. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/property-changes.js +0 -448
  274. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/range-changes.js +0 -139
  275. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-map.js +0 -79
  276. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-set.js +0 -142
  277. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/map.js +0 -60
  278. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/multi-map.js +0 -41
  279. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/package.json +0 -12
  280. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync +0 -7
  281. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync.patch +0 -48
  282. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/weak-map.js +0 -590
  283. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/package.json +0 -49
  284. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/set.js +0 -173
  285. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-array.js +0 -274
  286. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-function.js +0 -59
  287. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-object.js +0 -538
  288. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-regexp.js +0 -14
  289. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim.js +0 -6
  290. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-map.js +0 -49
  291. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-set.js +0 -51
  292. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array.js +0 -269
  293. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-map.js +0 -61
  294. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-set.js +0 -736
  295. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/tree-log.js +0 -40
  296. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/weak-map.js +0 -1
  297. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/README.md +0 -66
  298. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/mime.js +0 -114
  299. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/package.json +0 -35
  300. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/test.js +0 -84
  301. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/mime.types +0 -1588
  302. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/node.types +0 -77
  303. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/CHANGES +0 -15
  304. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/LICENSE +0 -19
  305. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/README +0 -96
  306. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/lib/mimeparse.js +0 -166
  307. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/package.json +0 -43
  308. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/CONTRIBUTING.md +0 -40
  309. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/LICENSE +0 -19
  310. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/README.md +0 -813
  311. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/compare-with-callbacks.js +0 -71
  312. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/scenarios.js +0 -36
  313. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/package.json +0 -93
  314. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/q.js +0 -1937
  315. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/queue.js +0 -35
  316. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/.gitmodules +0 -6
  317. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/History.md +0 -36
  318. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Makefile +0 -7
  319. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Readme.md +0 -38
  320. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/benchmark.js +0 -32
  321. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/examples.js +0 -39
  322. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/index.js +0 -2
  323. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/lib/querystring.js +0 -123
  324. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/package.json +0 -19
  325. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.gitmodules +0 -3
  326. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.npmignore +0 -3
  327. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/History.md +0 -128
  328. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Makefile +0 -53
  329. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Readme.md +0 -61
  330. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/bin/expresso +0 -856
  331. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/api.html +0 -1080
  332. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.html +0 -377
  333. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.md +0 -290
  334. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/foot.html +0 -3
  335. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/head.html +0 -42
  336. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/bar.js +0 -4
  337. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/foo.js +0 -16
  338. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/package.json +0 -12
  339. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/assert.test.js +0 -91
  340. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/async.test.js +0 -12
  341. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/bar.test.js +0 -13
  342. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/foo.test.js +0 -14
  343. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/http.test.js +0 -146
  344. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/async.test.js +0 -39
  345. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/http.test.js +0 -48
  346. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/.gitmodules +0 -3
  347. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/History.md +0 -22
  348. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Makefile +0 -6
  349. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Readme.md +0 -248
  350. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/examples/runner.js +0 -53
  351. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/index.js +0 -2
  352. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/eql.js +0 -91
  353. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/should.js +0 -548
  354. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/package.json +0 -8
  355. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/test/should.test.js +0 -358
  356. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/test/querystring.test.js +0 -133
  357. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.npmignore +0 -3
  358. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/LICENSE.md +0 -20
  359. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/README.md +0 -33
  360. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/package.json +0 -37
  361. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/test/url2-spec.js +0 -125
  362. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/url2.js +0 -151
  363. data/vendor/node_modules/traceur/node_modules/q-io/package.json +0 -51
  364. data/vendor/node_modules/traceur/node_modules/q-io/reader.js +0 -133
  365. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/boot-directory-spec.js +0 -47
  366. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/contains-spec.js +0 -11
  367. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/fixtures/hello.txt +0 -1
  368. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/issues/1-spec.js +0 -33
  369. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/make-tree-spec.js +0 -92
  370. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/append-spec.js +0 -41
  371. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/copy-tree-spec.js +0 -57
  372. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/fixture/hello.txt +0 -1
  373. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/link-spec.js +0 -70
  374. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/make-tree-spec.js +0 -109
  375. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/merge-spec.js +0 -67
  376. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/move-spec.js +0 -219
  377. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/object-spec.js +0 -20
  378. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/range-spec.js +0 -26
  379. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/read-spec.js +0 -40
  380. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-directory-spec.js +0 -37
  381. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-tree-spec.js +0 -39
  382. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/root-spec.js +0 -32
  383. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/stat-spec.js +0 -26
  384. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/symbolic-link-spec.js +0 -86
  385. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/working-directory-spec.js +0 -31
  386. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/write-spec.js +0 -73
  387. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.js +0 -23
  388. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.txt +0 -1
  389. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/read-spec.js +0 -22
  390. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/relative-spec.js +0 -25
  391. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/reroot-spec.js +0 -45
  392. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/write-spec.js +0 -38
  393. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/cookie-spec.js +0 -52
  394. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/directory-list-spec.js +0 -86
  395. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/01234.txt +0 -1
  396. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/1234.txt +0 -1
  397. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/5678.txt +0 -0
  398. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/9012/3456.txt +0 -0
  399. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/hosts-spec.js +0 -49
  400. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/interpret-range-spec.js +0 -47
  401. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/partial-range-spec.js +0 -186
  402. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/proxy-spec.js +0 -82
  403. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/symbolic-link-spec.js +0 -110
  404. data/vendor/node_modules/traceur/node_modules/q-io/spec/http/agent-spec.js +0 -96
  405. data/vendor/node_modules/traceur/node_modules/q-io/spec/http/basic-spec.js +0 -96
  406. data/vendor/node_modules/traceur/node_modules/q-io/spec/lib/jasmine-promise.js +0 -42
  407. data/vendor/node_modules/traceur/node_modules/q-io/writer.js +0 -111
  408. data/vendor/node_modules/traceur/src/node/compile-single-file.js +0 -69
  409. data/vendor/node_modules/traceur/src/node/compiler.js +0 -116
  410. data/vendor/node_modules/traceur/src/node/inline-module.js +0 -149
@@ -0,0 +1,9 @@
1
+ RSVP.js
2
+ =========
3
+
4
+ Shim repository for [RSVP.js](http://github.com/tildeio/rsvp.js).
5
+
6
+ Package Managers
7
+ ----------------
8
+
9
+ * [Bower](http://bower.io): `rsvp`
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "rsvp.js",
3
+ "version": "3.0.15",
4
+ "homepage": "https://github.com/tildeio/rsvp.js",
5
+ "authors": [
6
+ "Stefan Penner <stefan.penner@gmail.com>"
7
+ ],
8
+ "description": "A lightweight library that provides tools for organizing asynchronous code",
9
+ "main": "dist/rsvp.js",
10
+ "keywords": [
11
+ "promise"
12
+ ],
13
+ "license": "MIT",
14
+ "ignore": [
15
+ "node_modules",
16
+ "bower_components",
17
+ "test",
18
+ "tests",
19
+ "vendor",
20
+ "tasks"
21
+ ]
22
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "components/rsvp.js",
3
+ "description": "RSVP.js provides simple tools for organizing asynchronous code.",
4
+ "type": "component",
5
+ "homepage": "http://github.com/components/rsvp.js",
6
+ "license": "MIT",
7
+ "extra": {
8
+ "component": {
9
+ "scripts": [
10
+ "rsvp.js"
11
+ ],
12
+ "files": [
13
+ "rsvp.min.js",
14
+ "rsvp.amd.js"
15
+ ]
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "rsvp",
3
+ "namespace": "RSVP",
4
+ "version": "3.0.15",
5
+ "description": "A lightweight library that provides tools for organizing asynchronous code",
6
+ "main": "dist/commonjs/main.js",
7
+ "directories": {
8
+ "lib": "lib"
9
+ },
10
+ "devDependencies": {
11
+ "brfs": "0.0.8",
12
+ "grunt": "~0.4.2",
13
+ "grunt-browserify": "~1.2.11",
14
+ "grunt-cli": "~0.1.11",
15
+ "grunt-contrib-clean": "~0.5.0",
16
+ "grunt-contrib-concat": "~0.3.0",
17
+ "grunt-contrib-connect": "~0.5.0",
18
+ "grunt-contrib-jshint": "~0.7.0",
19
+ "grunt-contrib-uglify": "~0.2.4",
20
+ "grunt-contrib-watch": "~0.5.3",
21
+ "grunt-es6-module-transpiler": "~0.5.0",
22
+ "grunt-mocha-phantomjs": "~0.3.1",
23
+ "grunt-mocha-test": "~0.5.0",
24
+ "grunt-s3": "~0.2.0-alpha.2",
25
+ "jshint": "~0.9",
26
+ "load-grunt-config": "~0.5.0",
27
+ "load-grunt-tasks": "~0.2.0",
28
+ "mocha-phantomjs": "~3.1.6",
29
+ "promises-aplus-tests": "git://github.com/stefanpenner/promises-tests.git",
30
+ "connect-redirection": "0.0.1",
31
+ "grunt-contrib-yuidoc": "~0.5.0"
32
+ },
33
+ "scripts": {
34
+ "test": "grunt test",
35
+ "lint": "jshint lib",
36
+ "prepublish": "grunt build"
37
+ },
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git://github.com/tildeio/rsvp.js.git"
41
+ },
42
+ "bugs": {
43
+ "url": "https://github.com/tildeio/rsvp.js/issues"
44
+ },
45
+ "keywords": [
46
+ "promises",
47
+ "futures",
48
+ "events"
49
+ ],
50
+ "author": "Tilde, Inc.",
51
+ "license": "MIT"
52
+ }
@@ -0,0 +1,1607 @@
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.11
7
+ */
8
+
9
+ (function() {
10
+ "use strict";
11
+
12
+ function $$rsvp$events$$indexOf(callbacks, callback) {
13
+ for (var i=0, l=callbacks.length; i<l; i++) {
14
+ if (callbacks[i] === callback) { return i; }
15
+ }
16
+
17
+ return -1;
18
+ }
19
+
20
+ function $$rsvp$events$$callbacksFor(object) {
21
+ var callbacks = object._promiseCallbacks;
22
+
23
+ if (!callbacks) {
24
+ callbacks = object._promiseCallbacks = {};
25
+ }
26
+
27
+ return callbacks;
28
+ }
29
+
30
+ var $$rsvp$events$$default = {
31
+
32
+ /**
33
+ `RSVP.EventTarget.mixin` extends an object with EventTarget methods. For
34
+ Example:
35
+
36
+ ```javascript
37
+ var object = {};
38
+
39
+ RSVP.EventTarget.mixin(object);
40
+
41
+ object.on('finished', function(event) {
42
+ // handle event
43
+ });
44
+
45
+ object.trigger('finished', { detail: value });
46
+ ```
47
+
48
+ `EventTarget.mixin` also works with prototypes:
49
+
50
+ ```javascript
51
+ var Person = function() {};
52
+ RSVP.EventTarget.mixin(Person.prototype);
53
+
54
+ var yehuda = new Person();
55
+ var tom = new Person();
56
+
57
+ yehuda.on('poke', function(event) {
58
+ console.log('Yehuda says OW');
59
+ });
60
+
61
+ tom.on('poke', function(event) {
62
+ console.log('Tom says OW');
63
+ });
64
+
65
+ yehuda.trigger('poke');
66
+ tom.trigger('poke');
67
+ ```
68
+
69
+ @method mixin
70
+ @for RSVP.EventTarget
71
+ @private
72
+ @param {Object} object object to extend with EventTarget methods
73
+ */
74
+ mixin: function(object) {
75
+ object.on = this.on;
76
+ object.off = this.off;
77
+ object.trigger = this.trigger;
78
+ object._promiseCallbacks = undefined;
79
+ return object;
80
+ },
81
+
82
+ /**
83
+ Registers a callback to be executed when `eventName` is triggered
84
+
85
+ ```javascript
86
+ object.on('event', function(eventInfo){
87
+ // handle the event
88
+ });
89
+
90
+ object.trigger('event');
91
+ ```
92
+
93
+ @method on
94
+ @for RSVP.EventTarget
95
+ @private
96
+ @param {String} eventName name of the event to listen for
97
+ @param {Function} callback function to be called when the event is triggered.
98
+ */
99
+ on: function(eventName, callback) {
100
+ var allCallbacks = $$rsvp$events$$callbacksFor(this), callbacks;
101
+
102
+ callbacks = allCallbacks[eventName];
103
+
104
+ if (!callbacks) {
105
+ callbacks = allCallbacks[eventName] = [];
106
+ }
107
+
108
+ if ($$rsvp$events$$indexOf(callbacks, callback) === -1) {
109
+ callbacks.push(callback);
110
+ }
111
+ },
112
+
113
+ /**
114
+ You can use `off` to stop firing a particular callback for an event:
115
+
116
+ ```javascript
117
+ function doStuff() { // do stuff! }
118
+ object.on('stuff', doStuff);
119
+
120
+ object.trigger('stuff'); // doStuff will be called
121
+
122
+ // Unregister ONLY the doStuff callback
123
+ object.off('stuff', doStuff);
124
+ object.trigger('stuff'); // doStuff will NOT be called
125
+ ```
126
+
127
+ If you don't pass a `callback` argument to `off`, ALL callbacks for the
128
+ event will not be executed when the event fires. For example:
129
+
130
+ ```javascript
131
+ var callback1 = function(){};
132
+ var callback2 = function(){};
133
+
134
+ object.on('stuff', callback1);
135
+ object.on('stuff', callback2);
136
+
137
+ object.trigger('stuff'); // callback1 and callback2 will be executed.
138
+
139
+ object.off('stuff');
140
+ object.trigger('stuff'); // callback1 and callback2 will not be executed!
141
+ ```
142
+
143
+ @method off
144
+ @for RSVP.EventTarget
145
+ @private
146
+ @param {String} eventName event to stop listening to
147
+ @param {Function} callback optional argument. If given, only the function
148
+ given will be removed from the event's callback queue. If no `callback`
149
+ argument is given, all callbacks will be removed from the event's callback
150
+ queue.
151
+ */
152
+ off: function(eventName, callback) {
153
+ var allCallbacks = $$rsvp$events$$callbacksFor(this), callbacks, index;
154
+
155
+ if (!callback) {
156
+ allCallbacks[eventName] = [];
157
+ return;
158
+ }
159
+
160
+ callbacks = allCallbacks[eventName];
161
+
162
+ index = $$rsvp$events$$indexOf(callbacks, callback);
163
+
164
+ if (index !== -1) { callbacks.splice(index, 1); }
165
+ },
166
+
167
+ /**
168
+ Use `trigger` to fire custom events. For example:
169
+
170
+ ```javascript
171
+ object.on('foo', function(){
172
+ console.log('foo event happened!');
173
+ });
174
+ object.trigger('foo');
175
+ // 'foo event happened!' logged to the console
176
+ ```
177
+
178
+ You can also pass a value as a second argument to `trigger` that will be
179
+ passed as an argument to all event listeners for the event:
180
+
181
+ ```javascript
182
+ object.on('foo', function(value){
183
+ console.log(value.name);
184
+ });
185
+
186
+ object.trigger('foo', { name: 'bar' });
187
+ // 'bar' logged to the console
188
+ ```
189
+
190
+ @method trigger
191
+ @for RSVP.EventTarget
192
+ @private
193
+ @param {String} eventName name of the event to be triggered
194
+ @param {Any} options optional value to be passed to any event handlers for
195
+ the given `eventName`
196
+ */
197
+ trigger: function(eventName, options) {
198
+ var allCallbacks = $$rsvp$events$$callbacksFor(this), callbacks, callback;
199
+
200
+ if (callbacks = allCallbacks[eventName]) {
201
+ // Don't cache the callbacks.length since it may grow
202
+ for (var i=0; i<callbacks.length; i++) {
203
+ callback = callbacks[i];
204
+
205
+ callback(options);
206
+ }
207
+ }
208
+ }
209
+ };
210
+
211
+ var $$rsvp$config$$config = {
212
+ instrument: false
213
+ };
214
+
215
+ $$rsvp$events$$default.mixin($$rsvp$config$$config);
216
+
217
+ function $$rsvp$config$$configure(name, value) {
218
+ if (name === 'onerror') {
219
+ // handle for legacy users that expect the actual
220
+ // error to be passed to their function added via
221
+ // `RSVP.configure('onerror', someFunctionHere);`
222
+ $$rsvp$config$$config.on('error', value);
223
+ return;
224
+ }
225
+
226
+ if (arguments.length === 2) {
227
+ $$rsvp$config$$config[name] = value;
228
+ } else {
229
+ return $$rsvp$config$$config[name];
230
+ }
231
+ }
232
+
233
+ function $$utils$$objectOrFunction(x) {
234
+ return typeof x === 'function' || (typeof x === 'object' && x !== null);
235
+ }
236
+
237
+ function $$utils$$isFunction(x) {
238
+ return typeof x === 'function';
239
+ }
240
+
241
+ function $$utils$$isMaybeThenable(x) {
242
+ return typeof x === 'object' && x !== null;
243
+ }
244
+
245
+ var $$utils$$_isArray;
246
+
247
+ if (!Array.isArray) {
248
+ $$utils$$_isArray = function (x) {
249
+ return Object.prototype.toString.call(x) === '[object Array]';
250
+ };
251
+ } else {
252
+ $$utils$$_isArray = Array.isArray;
253
+ }
254
+
255
+ var $$utils$$isArray = $$utils$$_isArray;
256
+ var $$utils$$now = Date.now || function() { return new Date().getTime(); };
257
+
258
+ var $$utils$$o_create = (Object.create || function(object) {
259
+ var o = function() { };
260
+ o.prototype = object;
261
+ return o;
262
+ });
263
+
264
+ var $$instrument$$queue = [];
265
+
266
+ var $$instrument$$default = function instrument(eventName, promise, child) {
267
+ if (1 === $$instrument$$queue.push({
268
+ name: eventName,
269
+ payload: {
270
+ guid: promise._guidKey + promise._id,
271
+ eventName: eventName,
272
+ detail: promise._result,
273
+ childGuid: child && promise._guidKey + child._id,
274
+ label: promise._label,
275
+ timeStamp: $$utils$$now(),
276
+ stack: new Error(promise._label).stack
277
+ }})) {
278
+
279
+ setTimeout(function() {
280
+ var entry;
281
+ for (var i = 0; i < $$instrument$$queue.length; i++) {
282
+ entry = $$instrument$$queue[i];
283
+ $$rsvp$config$$config.trigger(entry.name, entry.payload);
284
+ }
285
+ $$instrument$$queue.length = 0;
286
+ }, 50);
287
+ }
288
+ };
289
+
290
+ function $$$internal$$noop() {}
291
+ var $$$internal$$PENDING = void 0;
292
+ var $$$internal$$FULFILLED = 1;
293
+ var $$$internal$$REJECTED = 2;
294
+ var $$$internal$$GET_THEN_ERROR = new $$$internal$$ErrorObject();
295
+
296
+ function $$$internal$$getThen(promise) {
297
+ try {
298
+ return promise.then;
299
+ } catch(error) {
300
+ $$$internal$$GET_THEN_ERROR.error = error;
301
+ return $$$internal$$GET_THEN_ERROR;
302
+ }
303
+ }
304
+
305
+ function $$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {
306
+ try {
307
+ then.call(value, fulfillmentHandler, rejectionHandler);
308
+ } catch(e) {
309
+ return e;
310
+ }
311
+ }
312
+
313
+ function $$$internal$$handleForeignThenable(promise, thenable, then) {
314
+ $$rsvp$config$$config.async(function(promise) {
315
+ var sealed = false;
316
+ var error = $$$internal$$tryThen(then, thenable, function(value) {
317
+ if (sealed) { return; }
318
+ sealed = true;
319
+ if (thenable !== value) {
320
+ $$$internal$$resolve(promise, value);
321
+ } else {
322
+ $$$internal$$fulfill(promise, value);
323
+ }
324
+ }, function(reason) {
325
+ if (sealed) { return; }
326
+ sealed = true;
327
+
328
+ $$$internal$$reject(promise, reason);
329
+ }, 'Settle: ' + (promise._label || ' unknown promise'));
330
+
331
+ if (!sealed && error) {
332
+ sealed = true;
333
+ $$$internal$$reject(promise, error);
334
+ }
335
+ }, promise);
336
+ }
337
+
338
+ function $$$internal$$handleOwnThenable(promise, thenable) {
339
+ if (thenable._state === $$$internal$$FULFILLED) {
340
+ $$$internal$$fulfill(promise, thenable._result);
341
+ } else if (promise._state === $$$internal$$REJECTED) {
342
+ $$$internal$$reject(promise, thenable._result);
343
+ } else {
344
+ $$$internal$$subscribe(thenable, undefined, function(value) {
345
+ if (thenable !== value) {
346
+ $$$internal$$resolve(promise, value);
347
+ } else {
348
+ $$$internal$$fulfill(promise, value);
349
+ }
350
+ }, function(reason) {
351
+ $$$internal$$reject(promise, reason);
352
+ });
353
+ }
354
+ }
355
+
356
+ function $$$internal$$handleMaybeThenable(promise, maybeThenable) {
357
+ if (maybeThenable.constructor === promise.constructor) {
358
+ $$$internal$$handleOwnThenable(promise, maybeThenable);
359
+ } else {
360
+ var then = $$$internal$$getThen(maybeThenable);
361
+
362
+ if (then === $$$internal$$GET_THEN_ERROR) {
363
+ $$$internal$$reject(promise, $$$internal$$GET_THEN_ERROR.error);
364
+ } else if (then === undefined) {
365
+ $$$internal$$fulfill(promise, maybeThenable);
366
+ } else if ($$utils$$isFunction(then)) {
367
+ $$$internal$$handleForeignThenable(promise, maybeThenable, then);
368
+ } else {
369
+ $$$internal$$fulfill(promise, maybeThenable);
370
+ }
371
+ }
372
+ }
373
+
374
+ function $$$internal$$resolve(promise, value) {
375
+ if (promise === value) {
376
+ $$$internal$$fulfill(promise, value);
377
+ } else if ($$utils$$objectOrFunction(value)) {
378
+ $$$internal$$handleMaybeThenable(promise, value);
379
+ } else {
380
+ $$$internal$$fulfill(promise, value);
381
+ }
382
+ }
383
+
384
+ function $$$internal$$publishRejection(promise) {
385
+ if (promise._onerror) {
386
+ promise._onerror(promise._result);
387
+ }
388
+
389
+ $$$internal$$publish(promise);
390
+ }
391
+
392
+ function $$$internal$$fulfill(promise, value) {
393
+ if (promise._state !== $$$internal$$PENDING) { return; }
394
+
395
+ promise._result = value;
396
+ promise._state = $$$internal$$FULFILLED;
397
+
398
+ if (promise._subscribers.length === 0) {
399
+ if ($$rsvp$config$$config.instrument) {
400
+ $$instrument$$default('fulfilled', promise);
401
+ }
402
+ } else {
403
+ $$rsvp$config$$config.async($$$internal$$publish, promise);
404
+ }
405
+ }
406
+
407
+ function $$$internal$$reject(promise, reason) {
408
+ if (promise._state !== $$$internal$$PENDING) { return; }
409
+ promise._state = $$$internal$$REJECTED;
410
+ promise._result = reason;
411
+
412
+ $$rsvp$config$$config.async($$$internal$$publishRejection, promise);
413
+ }
414
+
415
+ function $$$internal$$subscribe(parent, child, onFulfillment, onRejection) {
416
+ var subscribers = parent._subscribers;
417
+ var length = subscribers.length;
418
+
419
+ parent._onerror = null;
420
+
421
+ subscribers[length] = child;
422
+ subscribers[length + $$$internal$$FULFILLED] = onFulfillment;
423
+ subscribers[length + $$$internal$$REJECTED] = onRejection;
424
+
425
+ if (length === 0 && parent._state) {
426
+ $$rsvp$config$$config.async($$$internal$$publish, parent);
427
+ }
428
+ }
429
+
430
+ function $$$internal$$publish(promise) {
431
+ var subscribers = promise._subscribers;
432
+ var settled = promise._state;
433
+
434
+ if ($$rsvp$config$$config.instrument) {
435
+ $$instrument$$default(settled === $$$internal$$FULFILLED ? 'fulfilled' : 'rejected', promise);
436
+ }
437
+
438
+ if (subscribers.length === 0) { return; }
439
+
440
+ var child, callback, detail = promise._result;
441
+
442
+ for (var i = 0; i < subscribers.length; i += 3) {
443
+ child = subscribers[i];
444
+ callback = subscribers[i + settled];
445
+
446
+ if (child) {
447
+ $$$internal$$invokeCallback(settled, child, callback, detail);
448
+ } else {
449
+ callback(detail);
450
+ }
451
+ }
452
+
453
+ promise._subscribers.length = 0;
454
+ }
455
+
456
+ function $$$internal$$ErrorObject() {
457
+ this.error = null;
458
+ }
459
+
460
+ var $$$internal$$TRY_CATCH_ERROR = new $$$internal$$ErrorObject();
461
+
462
+ function $$$internal$$tryCatch(callback, detail) {
463
+ try {
464
+ return callback(detail);
465
+ } catch(e) {
466
+ $$$internal$$TRY_CATCH_ERROR.error = e;
467
+ return $$$internal$$TRY_CATCH_ERROR;
468
+ }
469
+ }
470
+
471
+ function $$$internal$$invokeCallback(settled, promise, callback, detail) {
472
+ var hasCallback = $$utils$$isFunction(callback),
473
+ value, error, succeeded, failed;
474
+
475
+ if (hasCallback) {
476
+ value = $$$internal$$tryCatch(callback, detail);
477
+
478
+ if (value === $$$internal$$TRY_CATCH_ERROR) {
479
+ failed = true;
480
+ error = value.error;
481
+ value = null;
482
+ } else {
483
+ succeeded = true;
484
+ }
485
+
486
+ if (promise === value) {
487
+ $$$internal$$reject(promise, new TypeError('A promises callback cannot return that same promise.'));
488
+ return;
489
+ }
490
+
491
+ } else {
492
+ value = detail;
493
+ succeeded = true;
494
+ }
495
+
496
+ if (promise._state !== $$$internal$$PENDING) {
497
+ // noop
498
+ } else if (hasCallback && succeeded) {
499
+ $$$internal$$resolve(promise, value);
500
+ } else if (failed) {
501
+ $$$internal$$reject(promise, error);
502
+ } else if (settled === $$$internal$$FULFILLED) {
503
+ $$$internal$$fulfill(promise, value);
504
+ } else if (settled === $$$internal$$REJECTED) {
505
+ $$$internal$$reject(promise, value);
506
+ }
507
+ }
508
+
509
+ function $$$internal$$initializePromise(promise, resolver) {
510
+ try {
511
+ resolver(function resolvePromise(value){
512
+ $$$internal$$resolve(promise, value);
513
+ }, function rejectPromise(reason) {
514
+ $$$internal$$reject(promise, reason);
515
+ });
516
+ } catch(e) {
517
+ $$$internal$$reject(promise, e);
518
+ }
519
+ }
520
+
521
+ function $$enumerator$$makeSettledResult(state, position, value) {
522
+ if (state === $$$internal$$FULFILLED) {
523
+ return {
524
+ state: 'fulfilled',
525
+ value: value
526
+ };
527
+ } else {
528
+ return {
529
+ state: 'rejected',
530
+ reason: value
531
+ };
532
+ }
533
+ }
534
+
535
+ function $$enumerator$$Enumerator(Constructor, input, abortOnReject, label) {
536
+ this._instanceConstructor = Constructor;
537
+ this.promise = new Constructor($$$internal$$noop, label);
538
+ this._abortOnReject = abortOnReject;
539
+
540
+ if (this._validateInput(input)) {
541
+ this._input = input;
542
+ this.length = input.length;
543
+ this._remaining = input.length;
544
+
545
+ this._init();
546
+
547
+ if (this.length === 0) {
548
+ $$$internal$$fulfill(this.promise, this._result);
549
+ } else {
550
+ this.length = this.length || 0;
551
+ this._enumerate();
552
+ if (this._remaining === 0) {
553
+ $$$internal$$fulfill(this.promise, this._result);
554
+ }
555
+ }
556
+ } else {
557
+ $$$internal$$reject(this.promise, this._validationError());
558
+ }
559
+ }
560
+
561
+ $$enumerator$$Enumerator.prototype._validateInput = function(input) {
562
+ return $$utils$$isArray(input);
563
+ };
564
+
565
+ $$enumerator$$Enumerator.prototype._validationError = function() {
566
+ return new Error('Array Methods must be provided an Array');
567
+ };
568
+
569
+ $$enumerator$$Enumerator.prototype._init = function() {
570
+ this._result = new Array(this.length);
571
+ };
572
+
573
+ var $$enumerator$$default = $$enumerator$$Enumerator;
574
+
575
+ $$enumerator$$Enumerator.prototype._enumerate = function() {
576
+ var length = this.length;
577
+ var promise = this.promise;
578
+ var input = this._input;
579
+
580
+ for (var i = 0; promise._state === $$$internal$$PENDING && i < length; i++) {
581
+ this._eachEntry(input[i], i);
582
+ }
583
+ };
584
+
585
+ $$enumerator$$Enumerator.prototype._eachEntry = function(entry, i) {
586
+ var c = this._instanceConstructor;
587
+ if ($$utils$$isMaybeThenable(entry)) {
588
+ if (entry.constructor === c && entry._state !== $$$internal$$PENDING) {
589
+ entry._onerror = null;
590
+ this._settledAt(entry._state, i, entry._result);
591
+ } else {
592
+ this._willSettleAt(c.resolve(entry), i);
593
+ }
594
+ } else {
595
+ this._remaining--;
596
+ this._result[i] = this._makeResult($$$internal$$FULFILLED, i, entry);
597
+ }
598
+ };
599
+
600
+ $$enumerator$$Enumerator.prototype._settledAt = function(state, i, value) {
601
+ var promise = this.promise;
602
+
603
+ if (promise._state === $$$internal$$PENDING) {
604
+ this._remaining--;
605
+
606
+ if (this._abortOnReject && state === $$$internal$$REJECTED) {
607
+ $$$internal$$reject(promise, value);
608
+ } else {
609
+ this._result[i] = this._makeResult(state, i, value);
610
+ }
611
+ }
612
+
613
+ if (this._remaining === 0) {
614
+ $$$internal$$fulfill(promise, this._result);
615
+ }
616
+ };
617
+
618
+ $$enumerator$$Enumerator.prototype._makeResult = function(state, i, value) {
619
+ return value;
620
+ };
621
+
622
+ $$enumerator$$Enumerator.prototype._willSettleAt = function(promise, i) {
623
+ var enumerator = this;
624
+
625
+ $$$internal$$subscribe(promise, undefined, function(value) {
626
+ enumerator._settledAt($$$internal$$FULFILLED, i, value);
627
+ }, function(reason) {
628
+ enumerator._settledAt($$$internal$$REJECTED, i, reason);
629
+ });
630
+ };
631
+
632
+ var $$promise$all$$default = function all(entries, label) {
633
+ return new $$enumerator$$default(this, entries, true /* abort on reject */, label).promise;
634
+ };
635
+
636
+ var $$promise$race$$default = function race(entries, label) {
637
+ /*jshint validthis:true */
638
+ var Constructor = this;
639
+
640
+ var promise = new Constructor($$$internal$$noop, label);
641
+
642
+ if (!$$utils$$isArray(entries)) {
643
+ $$$internal$$reject(promise, new TypeError('You must pass an array to race.'));
644
+ return promise;
645
+ }
646
+
647
+ var length = entries.length;
648
+
649
+ function onFulfillment(value) {
650
+ $$$internal$$resolve(promise, value);
651
+ }
652
+
653
+ function onRejection(reason) {
654
+ $$$internal$$reject(promise, reason);
655
+ }
656
+
657
+ for (var i = 0; promise._state === $$$internal$$PENDING && i < length; i++) {
658
+ $$$internal$$subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
659
+ }
660
+
661
+ return promise;
662
+ };
663
+
664
+ var $$promise$resolve$$default = function resolve(object, label) {
665
+ /*jshint validthis:true */
666
+ var Constructor = this;
667
+
668
+ if (object && typeof object === 'object' && object.constructor === Constructor) {
669
+ return object;
670
+ }
671
+
672
+ var promise = new Constructor($$$internal$$noop, label);
673
+ $$$internal$$resolve(promise, object);
674
+ return promise;
675
+ };
676
+
677
+ var $$promise$reject$$default = function reject(reason, label) {
678
+ /*jshint validthis:true */
679
+ var Constructor = this;
680
+ var promise = new Constructor($$$internal$$noop, label);
681
+ $$$internal$$reject(promise, reason);
682
+ return promise;
683
+ };
684
+
685
+ var $$rsvp$promise$$guidKey = 'rsvp_' + $$utils$$now() + '-';
686
+ var $$rsvp$promise$$counter = 0;
687
+
688
+ function $$rsvp$promise$$needsResolver() {
689
+ throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
690
+ }
691
+
692
+ function $$rsvp$promise$$needsNew() {
693
+ throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
694
+ }
695
+
696
+ var $$rsvp$promise$$default = $$rsvp$promise$$Promise;
697
+
698
+ /**
699
+ Promise objects represent the eventual result of an asynchronous operation. The
700
+ primary way of interacting with a promise is through its `then` method, which
701
+ registers callbacks to receive either a promise’s eventual value or the reason
702
+ why the promise cannot be fulfilled.
703
+
704
+ Terminology
705
+ -----------
706
+
707
+ - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
708
+ - `thenable` is an object or function that defines a `then` method.
709
+ - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
710
+ - `exception` is a value that is thrown using the throw statement.
711
+ - `reason` is a value that indicates why a promise was rejected.
712
+ - `settled` the final resting state of a promise, fulfilled or rejected.
713
+
714
+ A promise can be in one of three states: pending, fulfilled, or rejected.
715
+
716
+ Promises that are fulfilled have a fulfillment value and are in the fulfilled
717
+ state. Promises that are rejected have a rejection reason and are in the
718
+ rejected state. A fulfillment value is never a thenable.
719
+
720
+ Promises can also be said to *resolve* a value. If this value is also a
721
+ promise, then the original promise's settled state will match the value's
722
+ settled state. So a promise that *resolves* a promise that rejects will
723
+ itself reject, and a promise that *resolves* a promise that fulfills will
724
+ itself fulfill.
725
+
726
+
727
+ Basic Usage:
728
+ ------------
729
+
730
+ ```js
731
+ var promise = new Promise(function(resolve, reject) {
732
+ // on success
733
+ resolve(value);
734
+
735
+ // on failure
736
+ reject(reason);
737
+ });
738
+
739
+ promise.then(function(value) {
740
+ // on fulfillment
741
+ }, function(reason) {
742
+ // on rejection
743
+ });
744
+ ```
745
+
746
+ Advanced Usage:
747
+ ---------------
748
+
749
+ Promises shine when abstracting away asynchronous interactions such as
750
+ `XMLHttpRequest`s.
751
+
752
+ ```js
753
+ function getJSON(url) {
754
+ return new Promise(function(resolve, reject){
755
+ var xhr = new XMLHttpRequest();
756
+
757
+ xhr.open('GET', url);
758
+ xhr.onreadystatechange = handler;
759
+ xhr.responseType = 'json';
760
+ xhr.setRequestHeader('Accept', 'application/json');
761
+ xhr.send();
762
+
763
+ function handler() {
764
+ if (this.readyState === this.DONE) {
765
+ if (this.status === 200) {
766
+ resolve(this.response);
767
+ } else {
768
+ reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
769
+ }
770
+ }
771
+ };
772
+ });
773
+ }
774
+
775
+ getJSON('/posts.json').then(function(json) {
776
+ // on fulfillment
777
+ }, function(reason) {
778
+ // on rejection
779
+ });
780
+ ```
781
+
782
+ Unlike callbacks, promises are great composable primitives.
783
+
784
+ ```js
785
+ Promise.all([
786
+ getJSON('/posts'),
787
+ getJSON('/comments')
788
+ ]).then(function(values){
789
+ values[0] // => postsJSON
790
+ values[1] // => commentsJSON
791
+
792
+ return values;
793
+ });
794
+ ```
795
+
796
+ @class RSVP.Promise
797
+ @param {function} resolver
798
+ @param {String} label optional string for labeling the promise.
799
+ Useful for tooling.
800
+ @constructor
801
+ */
802
+ function $$rsvp$promise$$Promise(resolver, label) {
803
+ this._id = $$rsvp$promise$$counter++;
804
+ this._label = label;
805
+ this._subscribers = [];
806
+
807
+ if ($$rsvp$config$$config.instrument) {
808
+ $$instrument$$default('created', this);
809
+ }
810
+
811
+ if ($$$internal$$noop !== resolver) {
812
+ if (!$$utils$$isFunction(resolver)) {
813
+ $$rsvp$promise$$needsResolver();
814
+ }
815
+
816
+ if (!(this instanceof $$rsvp$promise$$Promise)) {
817
+ $$rsvp$promise$$needsNew();
818
+ }
819
+
820
+ $$$internal$$initializePromise(this, resolver);
821
+ }
822
+ }
823
+
824
+ // deprecated
825
+ $$rsvp$promise$$Promise.cast = $$promise$resolve$$default;
826
+
827
+ $$rsvp$promise$$Promise.all = $$promise$all$$default;
828
+ $$rsvp$promise$$Promise.race = $$promise$race$$default;
829
+ $$rsvp$promise$$Promise.resolve = $$promise$resolve$$default;
830
+ $$rsvp$promise$$Promise.reject = $$promise$reject$$default;
831
+
832
+ $$rsvp$promise$$Promise.prototype = {
833
+ constructor: $$rsvp$promise$$Promise,
834
+
835
+ _id: undefined,
836
+ _guidKey: $$rsvp$promise$$guidKey,
837
+ _label: undefined,
838
+
839
+ _state: undefined,
840
+ _result: undefined,
841
+ _subscribers: undefined,
842
+
843
+ _onerror: function (reason) {
844
+ $$rsvp$config$$config.trigger('error', reason);
845
+ },
846
+
847
+ /**
848
+ The primary way of interacting with a promise is through its `then` method,
849
+ which registers callbacks to receive either a promise's eventual value or the
850
+ reason why the promise cannot be fulfilled.
851
+
852
+ ```js
853
+ findUser().then(function(user){
854
+ // user is available
855
+ }, function(reason){
856
+ // user is unavailable, and you are given the reason why
857
+ });
858
+ ```
859
+
860
+ Chaining
861
+ --------
862
+
863
+ The return value of `then` is itself a promise. This second, 'downstream'
864
+ promise is resolved with the return value of the first promise's fulfillment
865
+ or rejection handler, or rejected if the handler throws an exception.
866
+
867
+ ```js
868
+ findUser().then(function (user) {
869
+ return user.name;
870
+ }, function (reason) {
871
+ return 'default name';
872
+ }).then(function (userName) {
873
+ // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
874
+ // will be `'default name'`
875
+ });
876
+
877
+ findUser().then(function (user) {
878
+ throw new Error('Found user, but still unhappy');
879
+ }, function (reason) {
880
+ throw new Error('`findUser` rejected and we're unhappy');
881
+ }).then(function (value) {
882
+ // never reached
883
+ }, function (reason) {
884
+ // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
885
+ // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
886
+ });
887
+ ```
888
+ If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
889
+
890
+ ```js
891
+ findUser().then(function (user) {
892
+ throw new PedagogicalException('Upstream error');
893
+ }).then(function (value) {
894
+ // never reached
895
+ }).then(function (value) {
896
+ // never reached
897
+ }, function (reason) {
898
+ // The `PedgagocialException` is propagated all the way down to here
899
+ });
900
+ ```
901
+
902
+ Assimilation
903
+ ------------
904
+
905
+ Sometimes the value you want to propagate to a downstream promise can only be
906
+ retrieved asynchronously. This can be achieved by returning a promise in the
907
+ fulfillment or rejection handler. The downstream promise will then be pending
908
+ until the returned promise is settled. This is called *assimilation*.
909
+
910
+ ```js
911
+ findUser().then(function (user) {
912
+ return findCommentsByAuthor(user);
913
+ }).then(function (comments) {
914
+ // The user's comments are now available
915
+ });
916
+ ```
917
+
918
+ If the assimliated promise rejects, then the downstream promise will also reject.
919
+
920
+ ```js
921
+ findUser().then(function (user) {
922
+ return findCommentsByAuthor(user);
923
+ }).then(function (comments) {
924
+ // If `findCommentsByAuthor` fulfills, we'll have the value here
925
+ }, function (reason) {
926
+ // If `findCommentsByAuthor` rejects, we'll have the reason here
927
+ });
928
+ ```
929
+
930
+ Simple Example
931
+ --------------
932
+
933
+ Synchronous Example
934
+
935
+ ```javascript
936
+ var result;
937
+
938
+ try {
939
+ result = findResult();
940
+ // success
941
+ } catch(reason) {
942
+ // failure
943
+ }
944
+ ```
945
+
946
+ Errback Example
947
+
948
+ ```js
949
+ findResult(function(result, err){
950
+ if (err) {
951
+ // failure
952
+ } else {
953
+ // success
954
+ }
955
+ });
956
+ ```
957
+
958
+ Promise Example;
959
+
960
+ ```javascript
961
+ findResult().then(function(result){
962
+ // success
963
+ }, function(reason){
964
+ // failure
965
+ });
966
+ ```
967
+
968
+ Advanced Example
969
+ --------------
970
+
971
+ Synchronous Example
972
+
973
+ ```javascript
974
+ var author, books;
975
+
976
+ try {
977
+ author = findAuthor();
978
+ books = findBooksByAuthor(author);
979
+ // success
980
+ } catch(reason) {
981
+ // failure
982
+ }
983
+ ```
984
+
985
+ Errback Example
986
+
987
+ ```js
988
+
989
+ function foundBooks(books) {
990
+
991
+ }
992
+
993
+ function failure(reason) {
994
+
995
+ }
996
+
997
+ findAuthor(function(author, err){
998
+ if (err) {
999
+ failure(err);
1000
+ // failure
1001
+ } else {
1002
+ try {
1003
+ findBoooksByAuthor(author, function(books, err) {
1004
+ if (err) {
1005
+ failure(err);
1006
+ } else {
1007
+ try {
1008
+ foundBooks(books);
1009
+ } catch(reason) {
1010
+ failure(reason);
1011
+ }
1012
+ }
1013
+ });
1014
+ } catch(error) {
1015
+ failure(err);
1016
+ }
1017
+ // success
1018
+ }
1019
+ });
1020
+ ```
1021
+
1022
+ Promise Example;
1023
+
1024
+ ```javascript
1025
+ findAuthor().
1026
+ then(findBooksByAuthor).
1027
+ then(function(books){
1028
+ // found books
1029
+ }).catch(function(reason){
1030
+ // something went wrong
1031
+ });
1032
+ ```
1033
+
1034
+ @method then
1035
+ @param {Function} onFulfilled
1036
+ @param {Function} onRejected
1037
+ @param {String} label optional string for labeling the promise.
1038
+ Useful for tooling.
1039
+ @return {Promise}
1040
+ */
1041
+ then: function(onFulfillment, onRejection, label) {
1042
+ var parent = this;
1043
+ var state = parent._state;
1044
+
1045
+ if (state === $$$internal$$FULFILLED && !onFulfillment || state === $$$internal$$REJECTED && !onRejection) {
1046
+ if ($$rsvp$config$$config.instrument) {
1047
+ $$instrument$$default('chained', this, this);
1048
+ }
1049
+ return this;
1050
+ }
1051
+
1052
+ parent._onerror = null;
1053
+
1054
+ var child = new this.constructor($$$internal$$noop, label);
1055
+ var result = parent._result;
1056
+
1057
+ if ($$rsvp$config$$config.instrument) {
1058
+ $$instrument$$default('chained', parent, child);
1059
+ }
1060
+
1061
+ if (state) {
1062
+ var callback = arguments[state - 1];
1063
+ $$rsvp$config$$config.async(function(){
1064
+ $$$internal$$invokeCallback(state, child, callback, result);
1065
+ });
1066
+ } else {
1067
+ $$$internal$$subscribe(parent, child, onFulfillment, onRejection);
1068
+ }
1069
+
1070
+ return child;
1071
+ },
1072
+
1073
+ /**
1074
+ `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
1075
+ as the catch block of a try/catch statement.
1076
+
1077
+ ```js
1078
+ function findAuthor(){
1079
+ throw new Error('couldn't find that author');
1080
+ }
1081
+
1082
+ // synchronous
1083
+ try {
1084
+ findAuthor();
1085
+ } catch(reason) {
1086
+ // something went wrong
1087
+ }
1088
+
1089
+ // async with promises
1090
+ findAuthor().catch(function(reason){
1091
+ // something went wrong
1092
+ });
1093
+ ```
1094
+
1095
+ @method catch
1096
+ @param {Function} onRejection
1097
+ @param {String} label optional string for labeling the promise.
1098
+ Useful for tooling.
1099
+ @return {Promise}
1100
+ */
1101
+ 'catch': function(onRejection, label) {
1102
+ return this.then(null, onRejection, label);
1103
+ },
1104
+
1105
+ /**
1106
+ `finally` will be invoked regardless of the promise's fate just as native
1107
+ try/catch/finally behaves
1108
+
1109
+ Synchronous example:
1110
+
1111
+ ```js
1112
+ findAuthor() {
1113
+ if (Math.random() > 0.5) {
1114
+ throw new Error();
1115
+ }
1116
+ return new Author();
1117
+ }
1118
+
1119
+ try {
1120
+ return findAuthor(); // succeed or fail
1121
+ } catch(error) {
1122
+ return findOtherAuther();
1123
+ } finally {
1124
+ // always runs
1125
+ // doesn't affect the return value
1126
+ }
1127
+ ```
1128
+
1129
+ Asynchronous example:
1130
+
1131
+ ```js
1132
+ findAuthor().catch(function(reason){
1133
+ return findOtherAuther();
1134
+ }).finally(function(){
1135
+ // author was either found, or not
1136
+ });
1137
+ ```
1138
+
1139
+ @method finally
1140
+ @param {Function} callback
1141
+ @param {String} label optional string for labeling the promise.
1142
+ Useful for tooling.
1143
+ @return {Promise}
1144
+ */
1145
+ 'finally': function(callback, label) {
1146
+ var constructor = this.constructor;
1147
+
1148
+ return this.then(function(value) {
1149
+ return constructor.resolve(callback()).then(function(){
1150
+ return value;
1151
+ });
1152
+ }, function(reason) {
1153
+ return constructor.resolve(callback()).then(function(){
1154
+ throw reason;
1155
+ });
1156
+ }, label);
1157
+ }
1158
+ };
1159
+
1160
+ function $$rsvp$node$$Result() {
1161
+ this.value = undefined;
1162
+ }
1163
+
1164
+ var $$rsvp$node$$ERROR = new $$rsvp$node$$Result();
1165
+ var $$rsvp$node$$GET_THEN_ERROR = new $$rsvp$node$$Result();
1166
+
1167
+ function $$rsvp$node$$getThen(obj) {
1168
+ try {
1169
+ return obj.then;
1170
+ } catch(error) {
1171
+ $$rsvp$node$$ERROR.value= error;
1172
+ return $$rsvp$node$$ERROR;
1173
+ }
1174
+ }
1175
+
1176
+ function $$rsvp$node$$tryApply(f, s, a) {
1177
+ try {
1178
+ f.apply(s, a);
1179
+ } catch(error) {
1180
+ $$rsvp$node$$ERROR.value = error;
1181
+ return $$rsvp$node$$ERROR;
1182
+ }
1183
+ }
1184
+
1185
+ function $$rsvp$node$$makeObject(_, argumentNames) {
1186
+ var obj = {};
1187
+ var name;
1188
+ var i;
1189
+ var length = _.length;
1190
+ var args = new Array(length);
1191
+
1192
+ for (var x = 0; x < length; x++) {
1193
+ args[x] = _[x];
1194
+ }
1195
+
1196
+ for (i = 0; i < argumentNames.length; i++) {
1197
+ name = argumentNames[i];
1198
+ obj[name] = args[i + 1];
1199
+ }
1200
+
1201
+ return obj;
1202
+ }
1203
+
1204
+ function $$rsvp$node$$arrayResult(_) {
1205
+ var length = _.length;
1206
+ var args = new Array(length - 1);
1207
+
1208
+ for (var i = 1; i < length; i++) {
1209
+ args[i - 1] = _[i];
1210
+ }
1211
+
1212
+ return args;
1213
+ }
1214
+
1215
+ function $$rsvp$node$$wrapThenable(then, arg, args) {
1216
+ return {
1217
+ then: function() {
1218
+ return then.apply(arg, args);
1219
+ }
1220
+ };
1221
+ }
1222
+
1223
+ var $$rsvp$node$$default = function denodeify(nodeFunc, options) {
1224
+ var fn = function() {
1225
+ var self = this;
1226
+ var l = arguments.length;
1227
+ var args = new Array(l + 1);
1228
+ var arg;
1229
+ var promiseInput = false;
1230
+
1231
+ for (var i = 0; i < l; ++i) {
1232
+ arg = arguments[i];
1233
+
1234
+ if (!promiseInput) {
1235
+ promiseInput = $$rsvp$node$$needsPromiseInput(arg);
1236
+ if (promiseInput === $$rsvp$node$$GET_THEN_ERROR) {
1237
+ var p = new $$rsvp$promise$$default($$$internal$$noop);
1238
+ $$$internal$$reject(p, $$rsvp$node$$GET_THEN_ERROR.value);
1239
+ return p;
1240
+ } else if (promiseInput && arg.constructor !== $$rsvp$promise$$default) {
1241
+ arg = $$rsvp$node$$wrapThenable(promiseInput, arguments);
1242
+ }
1243
+ }
1244
+ args[i] = arg;
1245
+ }
1246
+
1247
+ var promise = new $$rsvp$promise$$default($$$internal$$noop);
1248
+
1249
+ args[l] = function(err, val) {
1250
+ if (err)
1251
+ $$$internal$$reject(promise, err);
1252
+ else if (options === undefined)
1253
+ $$$internal$$resolve(promise, val);
1254
+ else if (options === true)
1255
+ $$$internal$$resolve(promise, $$rsvp$node$$arrayResult(arguments));
1256
+ else if ($$utils$$isArray(options))
1257
+ $$$internal$$resolve(promise, $$rsvp$node$$makeObject(arguments, options));
1258
+ else
1259
+ $$$internal$$resolve(promise, val);
1260
+ };
1261
+
1262
+ if (promiseInput) {
1263
+ return $$rsvp$node$$handlePromiseInput(promise, args, nodeFunc, self);
1264
+ } else {
1265
+ return $$rsvp$node$$handleValueInput(promise, args, nodeFunc, self);
1266
+ }
1267
+ };
1268
+
1269
+ fn.__proto__ = nodeFunc;
1270
+
1271
+ return fn;
1272
+ };
1273
+
1274
+ function $$rsvp$node$$handleValueInput(promise, args, nodeFunc, self) {
1275
+ var result = $$rsvp$node$$tryApply(nodeFunc, self, args);
1276
+ if (result === $$rsvp$node$$ERROR) {
1277
+ $$$internal$$reject(promise, result.value);
1278
+ }
1279
+ return promise;
1280
+ }
1281
+
1282
+ function $$rsvp$node$$handlePromiseInput(promise, args, nodeFunc, self){
1283
+ return $$rsvp$promise$$default.all(args).then(function(args){
1284
+ var result = $$rsvp$node$$tryApply(nodeFunc, self, args);
1285
+ if (result === $$rsvp$node$$ERROR) {
1286
+ $$$internal$$reject(promise, result.value);
1287
+ }
1288
+ return promise;
1289
+ });
1290
+ }
1291
+
1292
+ function $$rsvp$node$$needsPromiseInput(arg) {
1293
+ if (arg && typeof arg === 'object') {
1294
+ if (arg.constructor === $$rsvp$promise$$default) {
1295
+ return true;
1296
+ } else {
1297
+ return $$rsvp$node$$getThen(arg);
1298
+ }
1299
+ } else {
1300
+ return false;
1301
+ }
1302
+ }
1303
+
1304
+ var $$rsvp$all$$default = function all(array, label) {
1305
+ return $$rsvp$promise$$default.all(array, label);
1306
+ };
1307
+
1308
+ function $$rsvp$all$settled$$AllSettled(Constructor, entries, label) {
1309
+ this._superConstructor(Constructor, entries, false /* don't abort on reject */, label);
1310
+ }
1311
+
1312
+ $$rsvp$all$settled$$AllSettled.prototype = $$utils$$o_create($$enumerator$$default.prototype);
1313
+ $$rsvp$all$settled$$AllSettled.prototype._superConstructor = $$enumerator$$default;
1314
+ $$rsvp$all$settled$$AllSettled.prototype._makeResult = $$enumerator$$makeSettledResult;
1315
+
1316
+ $$rsvp$all$settled$$AllSettled.prototype._validationError = function() {
1317
+ return new Error('allSettled must be called with an array');
1318
+ };
1319
+
1320
+ var $$rsvp$all$settled$$default = function allSettled(entries, label) {
1321
+ return new $$rsvp$all$settled$$AllSettled($$rsvp$promise$$default, entries, label).promise;
1322
+ };
1323
+
1324
+ var $$rsvp$race$$default = function race(array, label) {
1325
+ return $$rsvp$promise$$default.race(array, label);
1326
+ };
1327
+
1328
+ function $$promise$hash$$PromiseHash(Constructor, object, label) {
1329
+ this._superConstructor(Constructor, object, true, label);
1330
+ }
1331
+
1332
+ var $$promise$hash$$default = $$promise$hash$$PromiseHash;
1333
+ $$promise$hash$$PromiseHash.prototype = $$utils$$o_create($$enumerator$$default.prototype);
1334
+ $$promise$hash$$PromiseHash.prototype._superConstructor = $$enumerator$$default;
1335
+
1336
+ $$promise$hash$$PromiseHash.prototype._init = function() {
1337
+ this._result = {};
1338
+ };
1339
+
1340
+ $$promise$hash$$PromiseHash.prototype._validateInput = function(input) {
1341
+ return input && typeof input === 'object';
1342
+ };
1343
+
1344
+ $$promise$hash$$PromiseHash.prototype._validationError = function() {
1345
+ return new Error('Promise.hash must be called with an object');
1346
+ };
1347
+
1348
+ $$promise$hash$$PromiseHash.prototype._enumerate = function() {
1349
+ var promise = this.promise;
1350
+ var input = this._input;
1351
+ var results = [];
1352
+
1353
+ for (var key in input) {
1354
+ if (promise._state === $$$internal$$PENDING && input.hasOwnProperty(key)) {
1355
+ results.push({
1356
+ position: key,
1357
+ entry: input[key]
1358
+ });
1359
+ }
1360
+ }
1361
+
1362
+ var length = results.length;
1363
+ this._remaining = length;
1364
+ var result;
1365
+
1366
+ for (var i = 0; promise._state === $$$internal$$PENDING && i < length; i++) {
1367
+ result = results[i];
1368
+ this._eachEntry(result.entry, result.position);
1369
+ }
1370
+ };
1371
+
1372
+ var $$rsvp$hash$$default = function hash(object, label) {
1373
+ return new $$promise$hash$$default($$rsvp$promise$$default, object, label).promise;
1374
+ };
1375
+
1376
+ function $$rsvp$hash$settled$$HashSettled(Constructor, object, label) {
1377
+ this._superConstructor(Constructor, object, false, label);
1378
+ }
1379
+
1380
+ $$rsvp$hash$settled$$HashSettled.prototype = $$utils$$o_create($$promise$hash$$default.prototype);
1381
+ $$rsvp$hash$settled$$HashSettled.prototype._superConstructor = $$enumerator$$default;
1382
+ $$rsvp$hash$settled$$HashSettled.prototype._makeResult = $$enumerator$$makeSettledResult;
1383
+
1384
+ $$rsvp$hash$settled$$HashSettled.prototype._validationError = function() {
1385
+ return new Error('hashSettled must be called with an object');
1386
+ };
1387
+
1388
+ var $$rsvp$hash$settled$$default = function hashSettled(object, label) {
1389
+ return new $$rsvp$hash$settled$$HashSettled($$rsvp$promise$$default, object, label).promise;
1390
+ };
1391
+
1392
+ var $$rsvp$rethrow$$default = function rethrow(reason) {
1393
+ setTimeout(function() {
1394
+ throw reason;
1395
+ });
1396
+ throw reason;
1397
+ };
1398
+
1399
+ var $$rsvp$defer$$default = function defer(label) {
1400
+ var deferred = { };
1401
+
1402
+ deferred.promise = new $$rsvp$promise$$default(function(resolve, reject) {
1403
+ deferred.resolve = resolve;
1404
+ deferred.reject = reject;
1405
+ }, label);
1406
+
1407
+ return deferred;
1408
+ };
1409
+
1410
+ var $$rsvp$map$$default = function map(promises, mapFn, label) {
1411
+ return $$rsvp$promise$$default.all(promises, label).then(function(values) {
1412
+ if (!$$utils$$isFunction(mapFn)) {
1413
+ throw new TypeError("You must pass a function as map's second argument.");
1414
+ }
1415
+
1416
+ var length = values.length;
1417
+ var results = new Array(length);
1418
+
1419
+ for (var i = 0; i < length; i++) {
1420
+ results[i] = mapFn(values[i]);
1421
+ }
1422
+
1423
+ return $$rsvp$promise$$default.all(results, label);
1424
+ });
1425
+ };
1426
+
1427
+ var $$rsvp$resolve$$default = function resolve(value, label) {
1428
+ return $$rsvp$promise$$default.resolve(value, label);
1429
+ };
1430
+
1431
+ var $$rsvp$reject$$default = function reject(reason, label) {
1432
+ return $$rsvp$promise$$default.reject(reason, label);
1433
+ };
1434
+
1435
+ var $$rsvp$filter$$default = function filter(promises, filterFn, label) {
1436
+ return $$rsvp$promise$$default.all(promises, label).then(function(values) {
1437
+ if (!$$utils$$isFunction(filterFn)) {
1438
+ throw new TypeError("You must pass a function as filter's second argument.");
1439
+ }
1440
+
1441
+ var length = values.length;
1442
+ var filtered = new Array(length);
1443
+
1444
+ for (var i = 0; i < length; i++) {
1445
+ filtered[i] = filterFn(values[i]);
1446
+ }
1447
+
1448
+ return $$rsvp$promise$$default.all(filtered, label).then(function(filtered) {
1449
+ var results = new Array(length);
1450
+ var newLength = 0;
1451
+
1452
+ for (var i = 0; i < length; i++) {
1453
+ if (filtered[i]) {
1454
+ results[newLength] = values[i];
1455
+ newLength++;
1456
+ }
1457
+ }
1458
+
1459
+ results.length = newLength;
1460
+
1461
+ return results;
1462
+ });
1463
+ });
1464
+ };
1465
+
1466
+ var $$rsvp$asap$$len = 0;
1467
+
1468
+ var $$rsvp$asap$$default = function asap(callback, arg) {
1469
+ $$rsvp$asap$$queue[$$rsvp$asap$$len] = callback;
1470
+ $$rsvp$asap$$queue[$$rsvp$asap$$len + 1] = arg;
1471
+ $$rsvp$asap$$len += 2;
1472
+ if ($$rsvp$asap$$len === 2) {
1473
+ // If len is 1, that means that we need to schedule an async flush.
1474
+ // If additional callbacks are queued before the queue is flushed, they
1475
+ // will be processed by this flush that we are scheduling.
1476
+ $$rsvp$asap$$scheduleFlush();
1477
+ }
1478
+ };
1479
+
1480
+ var $$rsvp$asap$$browserGlobal = (typeof window !== 'undefined') ? window : {};
1481
+ var $$rsvp$asap$$BrowserMutationObserver = $$rsvp$asap$$browserGlobal.MutationObserver || $$rsvp$asap$$browserGlobal.WebKitMutationObserver;
1482
+
1483
+ // test for web worker but not in IE10
1484
+ var $$rsvp$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' &&
1485
+ typeof importScripts !== 'undefined' &&
1486
+ typeof MessageChannel !== 'undefined';
1487
+
1488
+ // node
1489
+ function $$rsvp$asap$$useNextTick() {
1490
+ return function() {
1491
+ process.nextTick($$rsvp$asap$$flush);
1492
+ };
1493
+ }
1494
+
1495
+ function $$rsvp$asap$$useMutationObserver() {
1496
+ var iterations = 0;
1497
+ var observer = new $$rsvp$asap$$BrowserMutationObserver($$rsvp$asap$$flush);
1498
+ var node = document.createTextNode('');
1499
+ observer.observe(node, { characterData: true });
1500
+
1501
+ return function() {
1502
+ node.data = (iterations = ++iterations % 2);
1503
+ };
1504
+ }
1505
+
1506
+ // web worker
1507
+ function $$rsvp$asap$$useMessageChannel() {
1508
+ var channel = new MessageChannel();
1509
+ channel.port1.onmessage = $$rsvp$asap$$flush;
1510
+ return function () {
1511
+ channel.port2.postMessage(0);
1512
+ };
1513
+ }
1514
+
1515
+ function $$rsvp$asap$$useSetTimeout() {
1516
+ return function() {
1517
+ setTimeout($$rsvp$asap$$flush, 1);
1518
+ };
1519
+ }
1520
+
1521
+ var $$rsvp$asap$$queue = new Array(1000);
1522
+
1523
+ function $$rsvp$asap$$flush() {
1524
+ for (var i = 0; i < $$rsvp$asap$$len; i+=2) {
1525
+ var callback = $$rsvp$asap$$queue[i];
1526
+ var arg = $$rsvp$asap$$queue[i+1];
1527
+
1528
+ callback(arg);
1529
+
1530
+ $$rsvp$asap$$queue[i] = undefined;
1531
+ $$rsvp$asap$$queue[i+1] = undefined;
1532
+ }
1533
+
1534
+ $$rsvp$asap$$len = 0;
1535
+ }
1536
+
1537
+ var $$rsvp$asap$$scheduleFlush;
1538
+
1539
+ // Decide what async method to use to triggering processing of queued callbacks:
1540
+ if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
1541
+ $$rsvp$asap$$scheduleFlush = $$rsvp$asap$$useNextTick();
1542
+ } else if ($$rsvp$asap$$BrowserMutationObserver) {
1543
+ $$rsvp$asap$$scheduleFlush = $$rsvp$asap$$useMutationObserver();
1544
+ } else if ($$rsvp$asap$$isWorker) {
1545
+ $$rsvp$asap$$scheduleFlush = $$rsvp$asap$$useMessageChannel();
1546
+ } else {
1547
+ $$rsvp$asap$$scheduleFlush = $$rsvp$asap$$useSetTimeout();
1548
+ }
1549
+
1550
+ // default async is asap;
1551
+ $$rsvp$config$$config.async = $$rsvp$asap$$default;
1552
+
1553
+ var $$rsvp$$cast = $$rsvp$resolve$$default;
1554
+
1555
+ function $$rsvp$$async(callback, arg) {
1556
+ $$rsvp$config$$config.async(callback, arg);
1557
+ }
1558
+
1559
+ function $$rsvp$$on() {
1560
+ $$rsvp$config$$config.on.apply($$rsvp$config$$config, arguments);
1561
+ }
1562
+
1563
+ function $$rsvp$$off() {
1564
+ $$rsvp$config$$config.off.apply($$rsvp$config$$config, arguments);
1565
+ }
1566
+
1567
+ // Set up instrumentation through `window.__PROMISE_INTRUMENTATION__`
1568
+ if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') {
1569
+ var $$rsvp$$callbacks = window['__PROMISE_INSTRUMENTATION__'];
1570
+ $$rsvp$config$$configure('instrument', true);
1571
+ for (var $$rsvp$$eventName in $$rsvp$$callbacks) {
1572
+ if ($$rsvp$$callbacks.hasOwnProperty($$rsvp$$eventName)) {
1573
+ $$rsvp$$on($$rsvp$$eventName, $$rsvp$$callbacks[$$rsvp$$eventName]);
1574
+ }
1575
+ }
1576
+ }
1577
+
1578
+ var rsvp$umd$$RSVP = {
1579
+ 'race': $$rsvp$race$$default,
1580
+ 'Promise': $$rsvp$promise$$default,
1581
+ 'allSettled': $$rsvp$all$settled$$default,
1582
+ 'hash': $$rsvp$hash$$default,
1583
+ 'hashSettled': $$rsvp$hash$settled$$default,
1584
+ 'denodeify': $$rsvp$node$$default,
1585
+ 'on': $$rsvp$$on,
1586
+ 'off': $$rsvp$$off,
1587
+ 'map': $$rsvp$map$$default,
1588
+ 'filter': $$rsvp$filter$$default,
1589
+ 'resolve': $$rsvp$resolve$$default,
1590
+ 'reject': $$rsvp$reject$$default,
1591
+ 'all': $$rsvp$all$$default,
1592
+ 'rethrow': $$rsvp$rethrow$$default,
1593
+ 'defer': $$rsvp$defer$$default,
1594
+ 'EventTarget': $$rsvp$events$$default,
1595
+ 'configure': $$rsvp$config$$configure,
1596
+ 'async': $$rsvp$$async
1597
+ };
1598
+
1599
+ /* global define:true module:true window: true */
1600
+ if (typeof define === 'function' && define.amd) {
1601
+ define(function() { return rsvp$umd$$RSVP; });
1602
+ } else if (typeof module !== 'undefined' && module.exports) {
1603
+ module.exports = rsvp$umd$$RSVP;
1604
+ } else if (typeof this !== 'undefined') {
1605
+ this['RSVP'] = rsvp$umd$$RSVP;
1606
+ }
1607
+ }).call(this);