traceur-rb 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (255) hide show
  1. checksums.yaml +15 -0
  2. data/.gitignore +22 -0
  3. data/.rspec +1 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/Gemfile +4 -0
  7. data/Guardfile +8 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +87 -0
  10. data/Rakefile +2 -0
  11. data/lib/js/compile.js +31 -0
  12. data/lib/traceur-rb.rb +1 -0
  13. data/lib/traceur.rb +43 -0
  14. data/lib/traceur/compilation_options.rb +65 -0
  15. data/lib/traceur/compiler.rb +33 -0
  16. data/lib/traceur/configuration.rb +47 -0
  17. data/lib/traceur/node.rb +26 -0
  18. data/lib/traceur/node/command_result.rb +28 -0
  19. data/lib/traceur/node/runner.rb +40 -0
  20. data/lib/traceur/version.rb +3 -0
  21. data/spec/examples/classes.js +12 -0
  22. data/spec/integration/examples_spec.rb +28 -0
  23. data/spec/spec_helper.rb +1 -0
  24. data/spec/traceur/compilation_options_spec.rb +31 -0
  25. data/spec/traceur/configuration_spec.rb +54 -0
  26. data/spec/traceur/node_spec.rb +15 -0
  27. data/traceur-rb.gemspec +25 -0
  28. data/vendor/node_modules/.bin/traceur +3 -0
  29. data/vendor/node_modules/traceur/README.md +40 -0
  30. data/vendor/node_modules/traceur/bin/traceur-runtime.js +2101 -0
  31. data/vendor/node_modules/traceur/bin/traceur.js +23034 -0
  32. data/vendor/node_modules/traceur/node_modules/.bin/semver +125 -0
  33. data/vendor/node_modules/traceur/node_modules/commander/Readme.md +208 -0
  34. data/vendor/node_modules/traceur/node_modules/commander/index.js +852 -0
  35. data/vendor/node_modules/traceur/node_modules/commander/package.json +40 -0
  36. data/vendor/node_modules/traceur/node_modules/q-io/.npmignore +1 -0
  37. data/vendor/node_modules/traceur/node_modules/q-io/.travis.yml +3 -0
  38. data/vendor/node_modules/traceur/node_modules/q-io/CHANGES.md +122 -0
  39. data/vendor/node_modules/traceur/node_modules/q-io/LICENSE +19 -0
  40. data/vendor/node_modules/traceur/node_modules/q-io/README.md +928 -0
  41. data/vendor/node_modules/traceur/node_modules/q-io/buffer-stream.js +59 -0
  42. data/vendor/node_modules/traceur/node_modules/q-io/coverage-report.js +44 -0
  43. data/vendor/node_modules/traceur/node_modules/q-io/deprecate.js +51 -0
  44. data/vendor/node_modules/traceur/node_modules/q-io/fs-boot.js +307 -0
  45. data/vendor/node_modules/traceur/node_modules/q-io/fs-common.js +499 -0
  46. data/vendor/node_modules/traceur/node_modules/q-io/fs-mock.js +547 -0
  47. data/vendor/node_modules/traceur/node_modules/q-io/fs-root.js +105 -0
  48. data/vendor/node_modules/traceur/node_modules/q-io/fs.js +355 -0
  49. data/vendor/node_modules/traceur/node_modules/q-io/fs2http.js +65 -0
  50. data/vendor/node_modules/traceur/node_modules/q-io/http-apps.js +152 -0
  51. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/chain.js +24 -0
  52. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/content.js +93 -0
  53. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/cookie.js +154 -0
  54. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/decorators.js +178 -0
  55. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/fs.js +417 -0
  56. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/html.js +58 -0
  57. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/json.js +78 -0
  58. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/negotiate.js +120 -0
  59. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/proxy.js +27 -0
  60. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/redirect.js +209 -0
  61. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/route.js +125 -0
  62. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/status.js +175 -0
  63. data/vendor/node_modules/traceur/node_modules/q-io/http-cookie.js +75 -0
  64. data/vendor/node_modules/traceur/node_modules/q-io/http.js +378 -0
  65. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.npmignore +11 -0
  66. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.travis.yml +4 -0
  67. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/CHANGES.md +78 -0
  68. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/LICENSE.md +21 -0
  69. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/README.md +1285 -0
  70. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/collections.js +22 -0
  71. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/dict.js +142 -0
  72. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-map.js +57 -0
  73. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-set.js +183 -0
  74. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-collection.js +261 -0
  75. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-map.js +186 -0
  76. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-order.js +55 -0
  77. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-set.js +59 -0
  78. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/heap.js +236 -0
  79. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/iterator.js +371 -0
  80. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/list.js +435 -0
  81. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/array-changes.js +247 -0
  82. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/map-changes.js +147 -0
  83. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/property-changes.js +448 -0
  84. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/range-changes.js +139 -0
  85. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-map.js +79 -0
  86. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-set.js +142 -0
  87. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/map.js +60 -0
  88. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/multi-map.js +41 -0
  89. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/package.json +12 -0
  90. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync +7 -0
  91. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync.patch +48 -0
  92. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/weak-map.js +590 -0
  93. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/package.json +49 -0
  94. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/set.js +173 -0
  95. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-array.js +274 -0
  96. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-function.js +59 -0
  97. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-object.js +538 -0
  98. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-regexp.js +14 -0
  99. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim.js +6 -0
  100. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-map.js +49 -0
  101. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-set.js +51 -0
  102. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array.js +269 -0
  103. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-map.js +61 -0
  104. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-set.js +736 -0
  105. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/tree-log.js +40 -0
  106. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/weak-map.js +1 -0
  107. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/LICENSE +19 -0
  108. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/README.md +66 -0
  109. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/mime.js +114 -0
  110. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/package.json +35 -0
  111. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/test.js +84 -0
  112. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/mime.types +1588 -0
  113. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/node.types +77 -0
  114. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/CHANGES +15 -0
  115. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/LICENSE +19 -0
  116. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/README +96 -0
  117. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/lib/mimeparse.js +166 -0
  118. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/package.json +43 -0
  119. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/CONTRIBUTING.md +40 -0
  120. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/LICENSE +19 -0
  121. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/README.md +813 -0
  122. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/compare-with-callbacks.js +71 -0
  123. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/scenarios.js +36 -0
  124. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/package.json +93 -0
  125. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/q.js +1937 -0
  126. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/queue.js +35 -0
  127. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/.gitmodules +6 -0
  128. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/History.md +36 -0
  129. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Makefile +7 -0
  130. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Readme.md +38 -0
  131. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/benchmark.js +32 -0
  132. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/examples.js +39 -0
  133. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/index.js +2 -0
  134. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/lib/querystring.js +123 -0
  135. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/package.json +19 -0
  136. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.gitmodules +3 -0
  137. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.npmignore +3 -0
  138. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/History.md +128 -0
  139. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Makefile +53 -0
  140. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Readme.md +61 -0
  141. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/bin/expresso +856 -0
  142. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/api.html +1080 -0
  143. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.html +377 -0
  144. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.md +290 -0
  145. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/foot.html +3 -0
  146. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/head.html +42 -0
  147. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/bar.js +4 -0
  148. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/foo.js +16 -0
  149. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/package.json +12 -0
  150. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/assert.test.js +91 -0
  151. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/async.test.js +12 -0
  152. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/bar.test.js +13 -0
  153. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/foo.test.js +14 -0
  154. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/http.test.js +146 -0
  155. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/async.test.js +39 -0
  156. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/http.test.js +48 -0
  157. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/.gitmodules +3 -0
  158. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/History.md +22 -0
  159. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Makefile +6 -0
  160. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Readme.md +248 -0
  161. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/examples/runner.js +53 -0
  162. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/index.js +2 -0
  163. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/eql.js +91 -0
  164. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/should.js +548 -0
  165. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/package.json +8 -0
  166. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/test/should.test.js +358 -0
  167. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/test/querystring.test.js +133 -0
  168. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.npmignore +3 -0
  169. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.travis.yml +4 -0
  170. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/LICENSE.md +20 -0
  171. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/README.md +33 -0
  172. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/package.json +37 -0
  173. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/test/url2-spec.js +125 -0
  174. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/url2.js +151 -0
  175. data/vendor/node_modules/traceur/node_modules/q-io/package.json +51 -0
  176. data/vendor/node_modules/traceur/node_modules/q-io/reader.js +133 -0
  177. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/boot-directory-spec.js +47 -0
  178. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/contains-spec.js +11 -0
  179. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/fixtures/hello.txt +1 -0
  180. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/issues/1-spec.js +33 -0
  181. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/make-tree-spec.js +92 -0
  182. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/append-spec.js +41 -0
  183. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/copy-tree-spec.js +57 -0
  184. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/fixture/hello.txt +1 -0
  185. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/link-spec.js +70 -0
  186. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/make-tree-spec.js +109 -0
  187. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/merge-spec.js +67 -0
  188. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/move-spec.js +219 -0
  189. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/object-spec.js +20 -0
  190. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/range-spec.js +26 -0
  191. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/read-spec.js +40 -0
  192. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-directory-spec.js +37 -0
  193. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-tree-spec.js +39 -0
  194. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/root-spec.js +32 -0
  195. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/stat-spec.js +26 -0
  196. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/symbolic-link-spec.js +86 -0
  197. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/working-directory-spec.js +31 -0
  198. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/write-spec.js +73 -0
  199. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.js +23 -0
  200. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.txt +1 -0
  201. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/read-spec.js +22 -0
  202. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/relative-spec.js +25 -0
  203. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/reroot-spec.js +45 -0
  204. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/write-spec.js +38 -0
  205. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/cookie-spec.js +52 -0
  206. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/directory-list-spec.js +86 -0
  207. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/01234.txt +1 -0
  208. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/1234.txt +1 -0
  209. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/5678.txt +0 -0
  210. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/9012/3456.txt +0 -0
  211. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/hosts-spec.js +49 -0
  212. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/interpret-range-spec.js +47 -0
  213. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/partial-range-spec.js +186 -0
  214. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/proxy-spec.js +82 -0
  215. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/symbolic-link-spec.js +110 -0
  216. data/vendor/node_modules/traceur/node_modules/q-io/spec/http/agent-spec.js +96 -0
  217. data/vendor/node_modules/traceur/node_modules/q-io/spec/http/basic-spec.js +96 -0
  218. data/vendor/node_modules/traceur/node_modules/q-io/spec/lib/jasmine-promise.js +42 -0
  219. data/vendor/node_modules/traceur/node_modules/q-io/writer.js +111 -0
  220. data/vendor/node_modules/traceur/node_modules/semver/.npmignore +1 -0
  221. data/vendor/node_modules/traceur/node_modules/semver/LICENSE +27 -0
  222. data/vendor/node_modules/traceur/node_modules/semver/Makefile +24 -0
  223. data/vendor/node_modules/traceur/node_modules/semver/README.md +158 -0
  224. data/vendor/node_modules/traceur/node_modules/semver/bin/semver +125 -0
  225. data/vendor/node_modules/traceur/node_modules/semver/foot.js +6 -0
  226. data/vendor/node_modules/traceur/node_modules/semver/head.js +2 -0
  227. data/vendor/node_modules/traceur/node_modules/semver/package.json +31 -0
  228. data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js +1039 -0
  229. data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js.gz +0 -0
  230. data/vendor/node_modules/traceur/node_modules/semver/semver.js +1043 -0
  231. data/vendor/node_modules/traceur/node_modules/semver/semver.min.js +1 -0
  232. data/vendor/node_modules/traceur/node_modules/semver/semver.min.js.gz +0 -0
  233. data/vendor/node_modules/traceur/node_modules/semver/test/amd.js +15 -0
  234. data/vendor/node_modules/traceur/node_modules/semver/test/gtr.js +173 -0
  235. data/vendor/node_modules/traceur/node_modules/semver/test/index.js +584 -0
  236. data/vendor/node_modules/traceur/node_modules/semver/test/ltr.js +174 -0
  237. data/vendor/node_modules/traceur/node_modules/semver/test/no-module.js +19 -0
  238. data/vendor/node_modules/traceur/package.json +64 -0
  239. data/vendor/node_modules/traceur/src/node/System.js +31 -0
  240. data/vendor/node_modules/traceur/src/node/api.js +124 -0
  241. data/vendor/node_modules/traceur/src/node/command.js +141 -0
  242. data/vendor/node_modules/traceur/src/node/compile-single-file.js +69 -0
  243. data/vendor/node_modules/traceur/src/node/compiler.js +116 -0
  244. data/vendor/node_modules/traceur/src/node/deferred.js +110 -0
  245. data/vendor/node_modules/traceur/src/node/file-util.js +73 -0
  246. data/vendor/node_modules/traceur/src/node/getopt.js +147 -0
  247. data/vendor/node_modules/traceur/src/node/inline-module.js +149 -0
  248. data/vendor/node_modules/traceur/src/node/interpreter.js +33 -0
  249. data/vendor/node_modules/traceur/src/node/nodeLoader.js +41 -0
  250. data/vendor/node_modules/traceur/src/node/require.js +85 -0
  251. data/vendor/node_modules/traceur/src/node/to-amd-compiler.js +33 -0
  252. data/vendor/node_modules/traceur/src/node/to-commonjs-compiler.js +33 -0
  253. data/vendor/node_modules/traceur/src/node/traceur.js +32 -0
  254. data/vendor/node_modules/traceur/traceur +3 -0
  255. metadata +359 -0
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+
3
+ var Object = require("./shim-object");
4
+ var MapChanges = require("./listen/map-changes");
5
+ var PropertyChanges = require("./listen/property-changes");
6
+
7
+ module.exports = GenericMap;
8
+ function GenericMap() {
9
+ throw new Error("Can't construct. GenericMap is a mixin.");
10
+ }
11
+
12
+ Object.addEach(GenericMap.prototype, MapChanges.prototype);
13
+ Object.addEach(GenericMap.prototype, PropertyChanges.prototype);
14
+
15
+ // all of these methods depend on the constructor providing a `store` set
16
+
17
+ GenericMap.prototype.isMap = true;
18
+
19
+ GenericMap.prototype.addEach = function (values) {
20
+ if (values && Object(values) === values) {
21
+ if (typeof values.forEach === "function") {
22
+ // copy map-alikes
23
+ if (values.isMap === true) {
24
+ values.forEach(function (value, key) {
25
+ this.set(key, value);
26
+ }, this);
27
+ // iterate key value pairs of other iterables
28
+ } else {
29
+ values.forEach(function (pair) {
30
+ this.set(pair[0], pair[1]);
31
+ }, this);
32
+ }
33
+ } else {
34
+ // copy other objects as map-alikes
35
+ Object.keys(values).forEach(function (key) {
36
+ this.set(key, values[key]);
37
+ }, this);
38
+ }
39
+ }
40
+ return this;
41
+ }
42
+
43
+ GenericMap.prototype.get = function (key, defaultValue) {
44
+ var item = this.store.get(new this.Item(key));
45
+ if (item) {
46
+ return item.value;
47
+ } else if (arguments.length > 1) {
48
+ return defaultValue;
49
+ } else {
50
+ return this.getDefault(key);
51
+ }
52
+ };
53
+
54
+ GenericMap.prototype.set = function (key, value) {
55
+ var item = new this.Item(key, value);
56
+ var found = this.store.get(item);
57
+ var grew = false;
58
+ if (found) { // update
59
+ if (this.dispatchesMapChanges) {
60
+ this.dispatchBeforeMapChange(key, found.value);
61
+ }
62
+ found.value = value;
63
+ if (this.dispatchesMapChanges) {
64
+ this.dispatchMapChange(key, value);
65
+ }
66
+ } else { // create
67
+ if (this.dispatchesMapChanges) {
68
+ this.dispatchBeforeMapChange(key, undefined);
69
+ }
70
+ if (this.store.add(item)) {
71
+ this.length++;
72
+ grew = true;
73
+ }
74
+ if (this.dispatchesMapChanges) {
75
+ this.dispatchMapChange(key, value);
76
+ }
77
+ }
78
+ return grew;
79
+ };
80
+
81
+ GenericMap.prototype.add = function (value, key) {
82
+ return this.set(key, value);
83
+ };
84
+
85
+ GenericMap.prototype.has = function (key) {
86
+ return this.store.has(new this.Item(key));
87
+ };
88
+
89
+ GenericMap.prototype['delete'] = function (key) {
90
+ var item = new this.Item(key);
91
+ if (this.store.has(item)) {
92
+ var from = this.store.get(item).value;
93
+ if (this.dispatchesMapChanges) {
94
+ this.dispatchBeforeMapChange(key, from);
95
+ }
96
+ this.store["delete"](item);
97
+ this.length--;
98
+ if (this.dispatchesMapChanges) {
99
+ this.dispatchMapChange(key, undefined);
100
+ }
101
+ return true;
102
+ }
103
+ return false;
104
+ };
105
+
106
+ GenericMap.prototype.clear = function () {
107
+ var keys;
108
+ if (this.dispatchesMapChanges) {
109
+ this.forEach(function (value, key) {
110
+ this.dispatchBeforeMapChange(key, value);
111
+ }, this);
112
+ keys = this.keys();
113
+ }
114
+ this.store.clear();
115
+ this.length = 0;
116
+ if (this.dispatchesMapChanges) {
117
+ keys.forEach(function (key) {
118
+ this.dispatchMapChange(key);
119
+ }, this);
120
+ }
121
+ };
122
+
123
+ GenericMap.prototype.reduce = function (callback, basis, thisp) {
124
+ return this.store.reduce(function (basis, item) {
125
+ return callback.call(thisp, basis, item.value, item.key, this);
126
+ }, basis, this);
127
+ };
128
+
129
+ GenericMap.prototype.reduceRight = function (callback, basis, thisp) {
130
+ return this.store.reduceRight(function (basis, item) {
131
+ return callback.call(thisp, basis, item.value, item.key, this);
132
+ }, basis, this);
133
+ };
134
+
135
+ GenericMap.prototype.keys = function () {
136
+ return this.map(function (value, key) {
137
+ return key;
138
+ });
139
+ };
140
+
141
+ GenericMap.prototype.values = function () {
142
+ return this.map(Function.identity);
143
+ };
144
+
145
+ GenericMap.prototype.entries = function () {
146
+ return this.map(function (value, key) {
147
+ return [key, value];
148
+ });
149
+ };
150
+
151
+ // XXX deprecated
152
+ GenericMap.prototype.items = function () {
153
+ return this.entries();
154
+ };
155
+
156
+ GenericMap.prototype.equals = function (that, equals) {
157
+ equals = equals || Object.equals;
158
+ if (this === that) {
159
+ return true;
160
+ } else if (Object.can(that, "every")) {
161
+ return that.length === this.length && that.every(function (value, key) {
162
+ return equals(this.get(key), value);
163
+ }, this);
164
+ } else {
165
+ var keys = Object.keys(that);
166
+ return keys.length === this.length && Object.keys(that).every(function (key) {
167
+ return equals(this.get(key), that[key]);
168
+ }, this);
169
+ }
170
+ };
171
+
172
+ GenericMap.prototype.Item = Item;
173
+
174
+ function Item(key, value) {
175
+ this.key = key;
176
+ this.value = value;
177
+ }
178
+
179
+ Item.prototype.equals = function (that) {
180
+ return Object.equals(this.key, that.key) && Object.equals(this.value, that.value);
181
+ };
182
+
183
+ Item.prototype.compare = function (that) {
184
+ return Object.compare(this.key, that.key);
185
+ };
186
+
@@ -0,0 +1,55 @@
1
+
2
+ var Object = require("./shim-object");
3
+
4
+ module.exports = GenericOrder;
5
+ function GenericOrder() {
6
+ throw new Error("Can't construct. GenericOrder is a mixin.");
7
+ }
8
+
9
+ GenericOrder.prototype.equals = function (that, equals) {
10
+ equals = equals || this.contentEquals || Object.equals;
11
+
12
+ if (this === that) {
13
+ return true;
14
+ }
15
+ if (!that) {
16
+ return false;
17
+ }
18
+
19
+ var self = this;
20
+ return (
21
+ this.length === that.length &&
22
+ this.zip(that).every(function (pair) {
23
+ return equals(pair[0], pair[1]);
24
+ })
25
+ );
26
+ };
27
+
28
+ GenericOrder.prototype.compare = function (that, compare) {
29
+ compare = compare || this.contentCompare || Object.compare;
30
+
31
+ if (this === that) {
32
+ return 0;
33
+ }
34
+ if (!that) {
35
+ return 1;
36
+ }
37
+
38
+ var length = Math.min(this.length, that.length);
39
+ var comparison = this.zip(that).reduce(function (comparison, pair, index) {
40
+ if (comparison === 0) {
41
+ if (index >= length) {
42
+ return comparison;
43
+ } else {
44
+ return compare(pair[0], pair[1]);
45
+ }
46
+ } else {
47
+ return comparison;
48
+ }
49
+ }, 0);
50
+ if (comparison === 0) {
51
+ return this.length - that.length;
52
+ }
53
+ return comparison;
54
+ };
55
+
@@ -0,0 +1,59 @@
1
+
2
+ module.exports = GenericSet;
3
+ function GenericSet() {
4
+ throw new Error("Can't construct. GenericSet is a mixin.");
5
+ }
6
+
7
+ GenericSet.prototype.union = function (that) {
8
+ var union = this.constructClone(this);
9
+ union.addEach(that);
10
+ return union;
11
+ };
12
+
13
+ GenericSet.prototype.intersection = function (that) {
14
+ return this.constructClone(this.filter(function (value) {
15
+ return that.has(value);
16
+ }));
17
+ };
18
+
19
+ GenericSet.prototype.difference = function (that) {
20
+ var union = this.constructClone(this);
21
+ union.deleteEach(that);
22
+ return union;
23
+ };
24
+
25
+ GenericSet.prototype.symmetricDifference = function (that) {
26
+ var union = this.union(that);
27
+ var intersection = this.intersection(that);
28
+ return union.difference(intersection);
29
+ };
30
+
31
+ GenericSet.prototype.equals = function (that, equals) {
32
+ var self = this;
33
+ return (
34
+ Object.can(that, "reduce") &&
35
+ this.length === that.length &&
36
+ that.reduce(function (equal, value) {
37
+ return equal && self.has(value, equals);
38
+ }, true)
39
+ );
40
+ };
41
+
42
+ // W3C DOMTokenList API overlap (does not handle variadic arguments)
43
+
44
+ GenericSet.prototype.contains = function (value) {
45
+ return this.has(value);
46
+ };
47
+
48
+ GenericSet.prototype.remove = function (value) {
49
+ return this["delete"](value);
50
+ };
51
+
52
+ GenericSet.prototype.toggle = function (value) {
53
+ if (this.has(value)) {
54
+ this["delete"](value);
55
+ } else {
56
+ this.add(value);
57
+ }
58
+ };
59
+
@@ -0,0 +1,236 @@
1
+
2
+ // Adapted from Eloquent JavaScript by Marijn Haverbeke
3
+ // http://eloquentjavascript.net/appendix2.html
4
+
5
+ var ArrayChanges = require("./listen/array-changes");
6
+ var Shim = require("./shim");
7
+ var GenericCollection = require("./generic-collection");
8
+ var MapChanges = require("./listen/map-changes");
9
+ var RangeChanges = require("./listen/range-changes");
10
+ var PropertyChanges = require("./listen/property-changes");
11
+
12
+ // Max Heap by default. Comparison can be reversed to produce a Min Heap.
13
+
14
+ module.exports = Heap;
15
+
16
+ function Heap(values, equals, compare) {
17
+ if (!(this instanceof Heap)) {
18
+ return new Heap(values, equals, compare);
19
+ }
20
+ this.contentEquals = equals || Object.equals;
21
+ this.contentCompare = compare || Object.compare;
22
+ this.content = [];
23
+ this.length = 0;
24
+ this.addEach(values);
25
+ }
26
+
27
+ Heap.Heap = Heap; // hack so require("heap").Heap will work in MontageJS
28
+
29
+ Object.addEach(Heap.prototype, GenericCollection.prototype);
30
+ Object.addEach(Heap.prototype, PropertyChanges.prototype);
31
+ Object.addEach(Heap.prototype, RangeChanges.prototype);
32
+ Object.addEach(Heap.prototype, MapChanges.prototype);
33
+
34
+ Heap.prototype.constructClone = function (values) {
35
+ return new this.constructor(
36
+ values,
37
+ this.contentEquals,
38
+ this.contentCompare
39
+ );
40
+ };
41
+
42
+ Heap.prototype.push = function (value) {
43
+ this.content.push(value);
44
+ this.float(this.content.length - 1);
45
+ this.length++;
46
+ };
47
+
48
+ Heap.prototype.pop = function () {
49
+ // Store the first value so we can return it later. This will leave a gap
50
+ // at index 0 that must be filled.
51
+ var result = this.content[0];
52
+ // Remove the value at the end of the array. The value most be removed
53
+ // from the end to preserve the completness of the tree, despite that the
54
+ // last child is also among the most likely to need to sink back to the
55
+ // bottom.
56
+ var top = this.content.pop();
57
+ // If there are any values remaining, put the last value on the top and
58
+ // let it sink back down.
59
+ if (this.content.length > 0) {
60
+ this.content.set(0, top);
61
+ this.sink(0);
62
+ }
63
+ this.length--;
64
+ return result;
65
+ };
66
+
67
+ Heap.prototype.add = function (value) {
68
+ this.push(value);
69
+ };
70
+
71
+ // indexOf must do a linear search since a binary heap does not preserve a
72
+ // strict sort order. Thus, deletion takes linear time for all values except
73
+ // for the max value.
74
+
75
+ Heap.prototype.indexOf = function (value) {
76
+ for (var index = 0; index < this.length; index++) {
77
+ if (this.contentEquals(this.content[index], value)) {
78
+ return index;
79
+ }
80
+ }
81
+ return -1;
82
+ };
83
+
84
+ Heap.prototype.delete = function (value) {
85
+ var index = this.indexOf(value);
86
+ if (index === -1)
87
+ return false;
88
+ var top = this.content.pop();
89
+ if (index === this.content.length)
90
+ return true;
91
+ this.content.set(index, top);
92
+ var comparison = this.contentCompare(top, value);
93
+ if (comparison > 0) {
94
+ this.float(index);
95
+ } else if (comparison < 0) {
96
+ this.sink(index);
97
+ }
98
+ this.length--;
99
+ return true;
100
+ };
101
+
102
+ Heap.prototype.peek = function () {
103
+ if (this.length) {
104
+ return this.content[0];
105
+ }
106
+ };
107
+
108
+ Heap.prototype.max = function () {
109
+ return this.peek();
110
+ };
111
+
112
+ Heap.prototype.one = function () {
113
+ return this.peek();
114
+ };
115
+
116
+ // Brings a value up until its parent is greater than it
117
+ Heap.prototype.float = function (index) {
118
+ // Grab the value that is being adjusted
119
+ var value = this.content[index];
120
+ // A value can go no higher that the top: index 0
121
+ while (index > 0) {
122
+ // Compute the parent value's index and fetch it
123
+ var parentIndex = Math.floor((index + 1) / 2) - 1;
124
+ var parent = this.content[parentIndex];
125
+ // If the parent is less than it
126
+ if (this.contentCompare(parent, value) < 0) {
127
+ this.content.set(parentIndex, value);
128
+ this.content.set(index, parent);
129
+ } else {
130
+ // Stop propagating if the parent is greater than the value.
131
+ break;
132
+ }
133
+ // Proceed upward
134
+ index = parentIndex;
135
+ }
136
+ };
137
+
138
+ // Brings a value down until its children are both less than it
139
+ Heap.prototype.sink = function (index) {
140
+ // Moves a value downward until it is greater than its children.
141
+ var length = this.content.length;
142
+ var value = this.content[index];
143
+ var left, right, leftIndex, rightIndex, swapIndex, needsSwap;
144
+
145
+ while (true) {
146
+ // Invariant: the value is at index.
147
+ // Variant: the index proceedes down the tree.
148
+
149
+ // Compute the indicies of the children.
150
+ rightIndex = (index + 1) * 2;
151
+ leftIndex = rightIndex - 1;
152
+
153
+ // If the left child exists, determine whether it is greater than the
154
+ // parent (value) and thus whether it can be floated upward.
155
+ needsSwap = false;
156
+ if (leftIndex < length) {
157
+ // Look it up and compare it.
158
+ var left = this.content[leftIndex];
159
+ var comparison = this.contentCompare(left, value);
160
+ // If the child is greater than the parent, it can be floated.
161
+ if (comparison > 0) {
162
+ swapIndex = leftIndex;
163
+ needsSwap = true;
164
+ }
165
+ }
166
+
167
+ // If the right child exists, determine whether it is greater than the
168
+ // parent (value), or even greater than the left child.
169
+ if (rightIndex < length) {
170
+ var right = this.content[rightIndex];
171
+ var comparison = this.contentCompare(right, needsSwap ? left : value);
172
+ if (comparison > 0) {
173
+ swapIndex = rightIndex;
174
+ needsSwap = true;
175
+ }
176
+ }
177
+
178
+ // if there is a child that is less than the value, float the child and
179
+ // sink the value.
180
+ if (needsSwap) {
181
+ this.content.set(index, this.content[swapIndex]);
182
+ this.content.set(swapIndex, value);
183
+ index = swapIndex;
184
+ // and continue sinking
185
+ } else {
186
+ // if the children are both less than the value
187
+ break;
188
+ }
189
+
190
+ }
191
+
192
+ };
193
+
194
+ Heap.prototype.clear = function () {
195
+ this.content.clear();
196
+ this.length = 0;
197
+ };
198
+
199
+ Heap.prototype.reduce = function (callback, basis /*, thisp*/) {
200
+ var thisp = arguments[2];
201
+ return this.content.reduce(function (basis, value, key) {
202
+ return callback.call(thisp, basis, value, key, this);
203
+ }, basis, this);
204
+ };
205
+
206
+ Heap.prototype.reduceRight = function (callback, basis /*, thisp*/) {
207
+ var thisp = arguments[2];
208
+ return this.content.reduceRight(function (basis, value, key) {
209
+ return callback.call(thisp, basis, value, key, this);
210
+ }, basis, this);
211
+ };
212
+
213
+ Heap.prototype.makeObservable = function () {
214
+ // TODO refactor dispatchers to allow direct forwarding
215
+ this.content.addRangeChangeListener(this, "content");
216
+ this.content.addBeforeRangeChangeListener(this, "content");
217
+ this.content.addMapChangeListener(this, "content");
218
+ this.content.addBeforeMapChangeListener(this, "content");
219
+ };
220
+
221
+ Heap.prototype.handleContentRangeChange = function (plus, minus, index) {
222
+ this.dispatchRangeChange(plus, minus, index);
223
+ };
224
+
225
+ Heap.prototype.handleContentRangeWillChange = function (plus, minus, index) {
226
+ this.dispatchBeforeRangeChange(plus, minus, index);
227
+ };
228
+
229
+ Heap.prototype.handleContentMapChange = function (value, key) {
230
+ this.dispatchMapChange(key, value);
231
+ };
232
+
233
+ Heap.prototype.handleContentMapWillChange = function (value, key) {
234
+ this.dispatchBeforeMapChange(key, value);
235
+ };
236
+