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,59 @@
1
+
2
+ module.exports = Function;
3
+
4
+ /**
5
+ A utility to reduce unnecessary allocations of <code>function () {}</code>
6
+ in its many colorful variations. It does nothing and returns
7
+ <code>undefined</code> thus makes a suitable default in some circumstances.
8
+
9
+ @function external:Function.noop
10
+ */
11
+ Function.noop = function () {
12
+ };
13
+
14
+ /**
15
+ A utility to reduce unnecessary allocations of <code>function (x) {return
16
+ x}</code> in its many colorful but ultimately wasteful parameter name
17
+ variations.
18
+
19
+ @function external:Function.identity
20
+ @param {Any} any value
21
+ @returns {Any} that value
22
+ */
23
+ Function.identity = function (value) {
24
+ return value;
25
+ };
26
+
27
+ /**
28
+ A utility for creating a comparator function for a particular aspect of a
29
+ figurative class of objects.
30
+
31
+ @function external:Function.by
32
+ @param {Function} relation A function that accepts a value and returns a
33
+ corresponding value to use as a representative when sorting that object.
34
+ @param {Function} compare an alternate comparator for comparing the
35
+ represented values. The default is <code>Object.compare</code>, which
36
+ does a deep, type-sensitive, polymorphic comparison.
37
+ @returns {Function} a comparator that has been annotated with
38
+ <code>by</code> and <code>compare</code> properties so
39
+ <code>sorted</code> can perform a transform that reduces the need to call
40
+ <code>by</code> on each sorted object to just once.
41
+ */
42
+ Function.by = function (by , compare) {
43
+ compare = compare || Object.compare;
44
+ by = by || Function.identity;
45
+ var compareBy = function (a, b) {
46
+ return compare(by(a), by(b));
47
+ };
48
+ compareBy.compare = compare;
49
+ compareBy.by = by;
50
+ return compareBy;
51
+ };
52
+
53
+ // TODO document
54
+ Function.get = function (key) {
55
+ return function (object) {
56
+ return Object.get(object, key);
57
+ };
58
+ };
59
+
@@ -0,0 +1,538 @@
1
+ "use strict";
2
+
3
+ var WeakMap = require("weak-map");
4
+
5
+ module.exports = Object;
6
+
7
+ /*
8
+ Based in part on extras from Motorola Mobility’s Montage
9
+ Copyright (c) 2012, Motorola Mobility LLC. All Rights Reserved.
10
+ 3-Clause BSD License
11
+ https://github.com/motorola-mobility/montage/blob/master/LICENSE.md
12
+ */
13
+
14
+ /**
15
+ Defines extensions to intrinsic <code>Object</code>.
16
+ @see [Object class]{@link external:Object}
17
+ */
18
+
19
+ /**
20
+ A utility object to avoid unnecessary allocations of an empty object
21
+ <code>{}</code>. This object is frozen so it is safe to share.
22
+
23
+ @object external:Object.empty
24
+ */
25
+ Object.empty = Object.freeze(Object.create(null));
26
+
27
+ /**
28
+ Returns whether the given value is an object, as opposed to a value.
29
+ Unboxed numbers, strings, true, false, undefined, and null are not
30
+ objects. Arrays are objects.
31
+
32
+ @function external:Object.isObject
33
+ @param {Any} value
34
+ @returns {Boolean} whether the given value is an object
35
+ */
36
+ Object.isObject = function (object) {
37
+ return Object(object) === object;
38
+ };
39
+
40
+ /**
41
+ Returns the value of an any value, particularly objects that
42
+ implement <code>valueOf</code>.
43
+
44
+ <p>Note that, unlike the precedent of methods like
45
+ <code>Object.equals</code> and <code>Object.compare</code> would suggest,
46
+ this method is named <code>Object.getValueOf</code> instead of
47
+ <code>valueOf</code>. This is a delicate issue, but the basis of this
48
+ decision is that the JavaScript runtime would be far more likely to
49
+ accidentally call this method with no arguments, assuming that it would
50
+ return the value of <code>Object</code> itself in various situations,
51
+ whereas <code>Object.equals(Object, null)</code> protects against this case
52
+ by noting that <code>Object</code> owns the <code>equals</code> property
53
+ and therefore does not delegate to it.
54
+
55
+ @function external:Object.getValueOf
56
+ @param {Any} value a value or object wrapping a value
57
+ @returns {Any} the primitive value of that object, if one exists, or passes
58
+ the value through
59
+ */
60
+ Object.getValueOf = function (value) {
61
+ if (Object.can(value, "valueOf")) {
62
+ value = value.valueOf();
63
+ }
64
+ return value;
65
+ };
66
+
67
+ var hashMap = new WeakMap();
68
+ Object.hash = function (object) {
69
+ if (Object.can(object, "hash")) {
70
+ return "" + object.hash();
71
+ } else if (Object(object) === object) {
72
+ if (!hashMap.has(object)) {
73
+ hashMap.set(object, Math.random().toString(36).slice(2));
74
+ }
75
+ return hashMap.get(object);
76
+ } else {
77
+ return "" + object;
78
+ }
79
+ };
80
+
81
+ /**
82
+ A shorthand for <code>Object.prototype.hasOwnProperty.call(object,
83
+ key)</code>. Returns whether the object owns a property for the given key.
84
+ It does not consult the prototype chain and works for any string (including
85
+ "hasOwnProperty") except "__proto__".
86
+
87
+ @function external:Object.owns
88
+ @param {Object} object
89
+ @param {String} key
90
+ @returns {Boolean} whether the object owns a property wfor the given key.
91
+ */
92
+ var owns = Object.prototype.hasOwnProperty;
93
+ Object.owns = function (object, key) {
94
+ return owns.call(object, key);
95
+ };
96
+
97
+ /**
98
+ Returns whether a value implements a particular duck-type method.
99
+
100
+ <p>To qualify as a duck-type method, the value in question must have a
101
+ method by the given name on the prototype chain. To distinguish it from
102
+ a property of an object literal, the property must not be owned by the
103
+ object directly.
104
+
105
+ <p>A value that implements a method is not necessarily an object, for
106
+ example, numbers implement <code>valueOf</code>, so this is function
107
+ does not imply <code>Object.isObject</code> of the same value.
108
+
109
+ @function external:Object.can
110
+ @param {Any} value a value
111
+ @param {String} name a method name
112
+ @returns {Boolean} whether the given value implements the given method
113
+
114
+ */
115
+ Object.can = function (object, name) {
116
+ return (
117
+ object != null && // false only for null *and* undefined
118
+ typeof object[name] === "function" &&
119
+ !owns.call(object, name)
120
+ );
121
+ };
122
+
123
+ /**
124
+ A utility that is like Object.owns but is also useful for finding
125
+ properties on the prototype chain, provided that they do not refer to
126
+ methods on the Object prototype. Works for all strings except "__proto__".
127
+
128
+ <p>Alternately, you could use the "in" operator as long as the object
129
+ descends from "null" instead of the Object.prototype, as with
130
+ <code>Object.create(null)</code>. However,
131
+ <code>Object.create(null)</code> only works in fully compliant EcmaScript 5
132
+ JavaScript engines and cannot be faithfully shimmed.
133
+
134
+ <p>If the given object is an instance of a type that implements a method
135
+ named "has", this function defers to the collection, so this method can be
136
+ used to generically handle objects, arrays, or other collections. In that
137
+ case, the domain of the key depends on the instance.
138
+
139
+ @param {Object} object
140
+ @param {String} key
141
+ @returns {Boolean} whether the object, or any of its prototypes except
142
+ <code>Object.prototype</code>
143
+ @function external:Object.has
144
+ */
145
+ Object.has = function (object, key) {
146
+ if (typeof object !== "object") {
147
+ throw new Error("Object.has can't accept non-object: " + typeof object);
148
+ }
149
+ // forward to mapped collections that implement "has"
150
+ if (Object.can(object, "has")) {
151
+ return object.has(key);
152
+ // otherwise report whether the key is on the prototype chain,
153
+ // as long as it is not one of the methods on object.prototype
154
+ } else if (typeof key === "string") {
155
+ return key in object && object[key] !== Object.prototype[key];
156
+ } else {
157
+ throw new Error("Key must be a string for Object.has on plain objects");
158
+ }
159
+ };
160
+
161
+ /**
162
+ Gets the value for a corresponding key from an object.
163
+
164
+ <p>Uses Object.has to determine whether there is a corresponding value for
165
+ the given key. As such, <code>Object.get</code> is capable of retriving
166
+ values from the prototype chain as long as they are not from the
167
+ <code>Object.prototype</code>.
168
+
169
+ <p>If there is no corresponding value, returns the given default, which may
170
+ be <code>undefined</code>.
171
+
172
+ <p>If the given object is an instance of a type that implements a method
173
+ named "get", this function defers to the collection, so this method can be
174
+ used to generically handle objects, arrays, or other collections. In that
175
+ case, the domain of the key depends on the implementation. For a `Map`,
176
+ for example, the key might be any object.
177
+
178
+ @param {Object} object
179
+ @param {String} key
180
+ @param {Any} value a default to return, <code>undefined</code> if omitted
181
+ @returns {Any} value for key, or default value
182
+ @function external:Object.get
183
+ */
184
+ Object.get = function (object, key, value) {
185
+ if (typeof object !== "object") {
186
+ throw new Error("Object.get can't accept non-object: " + typeof object);
187
+ }
188
+ // forward to mapped collections that implement "get"
189
+ if (Object.can(object, "get")) {
190
+ return object.get(key, value);
191
+ } else if (Object.has(object, key)) {
192
+ return object[key];
193
+ } else {
194
+ return value;
195
+ }
196
+ };
197
+
198
+ /**
199
+ Sets the value for a given key on an object.
200
+
201
+ <p>If the given object is an instance of a type that implements a method
202
+ named "set", this function defers to the collection, so this method can be
203
+ used to generically handle objects, arrays, or other collections. As such,
204
+ the key domain varies by the object type.
205
+
206
+ @param {Object} object
207
+ @param {String} key
208
+ @param {Any} value
209
+ @returns <code>undefined</code>
210
+ @function external:Object.set
211
+ */
212
+ Object.set = function (object, key, value) {
213
+ if (Object.can(object, "set")) {
214
+ object.set(key, value);
215
+ } else {
216
+ object[key] = value;
217
+ }
218
+ };
219
+
220
+ Object.addEach = function (target, source) {
221
+ if (!source) {
222
+ } else if (Object.can(source, "forEach")) {
223
+ // copy map-alikes
224
+ if (typeof source.keys === "function") {
225
+ source.forEach(function (value, key) {
226
+ target[key] = value;
227
+ });
228
+ // iterate key value pairs of other iterables
229
+ } else {
230
+ source.forEach(function (pair) {
231
+ target[pair[0]] = pair[1];
232
+ });
233
+ }
234
+ } else {
235
+ // copy other objects as map-alikes
236
+ Object.keys(source).forEach(function (key) {
237
+ target[key] = source[key];
238
+ });
239
+ }
240
+ return target;
241
+ };
242
+
243
+ /**
244
+ Iterates over the owned properties of an object.
245
+
246
+ @function external:Object.forEach
247
+ @param {Object} object an object to iterate.
248
+ @param {Function} callback a function to call for every key and value
249
+ pair in the object. Receives <code>value</code>, <code>key</code>,
250
+ and <code>object</code> as arguments.
251
+ @param {Object} thisp the <code>this</code> to pass through to the
252
+ callback
253
+ */
254
+ Object.forEach = function (object, callback, thisp) {
255
+ Object.keys(object).forEach(function (key) {
256
+ callback.call(thisp, object[key], key, object);
257
+ });
258
+ };
259
+
260
+ /**
261
+ Iterates over the owned properties of a map, constructing a new array of
262
+ mapped values.
263
+
264
+ @function external:Object.map
265
+ @param {Object} object an object to iterate.
266
+ @param {Function} callback a function to call for every key and value
267
+ pair in the object. Receives <code>value</code>, <code>key</code>,
268
+ and <code>object</code> as arguments.
269
+ @param {Object} thisp the <code>this</code> to pass through to the
270
+ callback
271
+ @returns {Array} the respective values returned by the callback for each
272
+ item in the object.
273
+ */
274
+ Object.map = function (object, callback, thisp) {
275
+ return Object.keys(object).map(function (key) {
276
+ return callback.call(thisp, object[key], key, object);
277
+ });
278
+ };
279
+
280
+ /**
281
+ Returns the values for owned properties of an object.
282
+
283
+ @function external:Object.map
284
+ @param {Object} object
285
+ @returns {Array} the respective value for each owned property of the
286
+ object.
287
+ */
288
+ Object.values = function (object) {
289
+ return Object.map(object, Function.identity);
290
+ };
291
+
292
+ // TODO inline document concat
293
+ Object.concat = function () {
294
+ var object = {};
295
+ for (var i = 0; i < arguments.length; i++) {
296
+ Object.addEach(object, arguments[i]);
297
+ }
298
+ return object;
299
+ };
300
+
301
+ Object.from = Object.concat;
302
+
303
+ /**
304
+ Returns whether two values are identical. Any value is identical to itself
305
+ and only itself. This is much more restictive than equivalence and subtly
306
+ different than strict equality, <code>===</code> because of edge cases
307
+ including negative zero and <code>NaN</code>. Identity is useful for
308
+ resolving collisions among keys in a mapping where the domain is any value.
309
+ This method does not delgate to any method on an object and cannot be
310
+ overridden.
311
+ @see http://wiki.ecmascript.org/doku.php?id=harmony:egal
312
+ @param {Any} this
313
+ @param {Any} that
314
+ @returns {Boolean} whether this and that are identical
315
+ @function external:Object.is
316
+ */
317
+ Object.is = function (x, y) {
318
+ if (x === y) {
319
+ // 0 === -0, but they are not identical
320
+ return x !== 0 || 1 / x === 1 / y;
321
+ }
322
+ // NaN !== NaN, but they are identical.
323
+ // NaNs are the only non-reflexive value, i.e., if x !== x,
324
+ // then x is a NaN.
325
+ // isNaN is broken: it converts its argument to number, so
326
+ // isNaN("foo") => true
327
+ return x !== x && y !== y;
328
+ };
329
+
330
+ /**
331
+ Performs a polymorphic, type-sensitive deep equivalence comparison of any
332
+ two values.
333
+
334
+ <p>As a basic principle, any value is equivalent to itself (as in
335
+ identity), any boxed version of itself (as a <code>new Number(10)</code> is
336
+ to 10), and any deep clone of itself.
337
+
338
+ <p>Equivalence has the following properties:
339
+
340
+ <ul>
341
+ <li><strong>polymorphic:</strong>
342
+ If the given object is an instance of a type that implements a
343
+ methods named "equals", this function defers to the method. So,
344
+ this function can safely compare any values regardless of type,
345
+ including undefined, null, numbers, strings, any pair of objects
346
+ where either implements "equals", or object literals that may even
347
+ contain an "equals" key.
348
+ <li><strong>type-sensitive:</strong>
349
+ Incomparable types are not equal. No object is equivalent to any
350
+ array. No string is equal to any other number.
351
+ <li><strong>deep:</strong>
352
+ Collections with equivalent content are equivalent, recursively.
353
+ <li><strong>equivalence:</strong>
354
+ Identical values and objects are equivalent, but so are collections
355
+ that contain equivalent content. Whether order is important varies
356
+ by type. For Arrays and lists, order is important. For Objects,
357
+ maps, and sets, order is not important. Boxed objects are mutally
358
+ equivalent with their unboxed values, by virtue of the standard
359
+ <code>valueOf</code> method.
360
+ </ul>
361
+ @param this
362
+ @param that
363
+ @returns {Boolean} whether the values are deeply equivalent
364
+ @function external:Object.equals
365
+ */
366
+ Object.equals = function (a, b, equals) {
367
+ equals = equals || Object.equals;
368
+ // unbox objects, but do not confuse object literals
369
+ a = Object.getValueOf(a);
370
+ b = Object.getValueOf(b);
371
+ if (a === b)
372
+ // 0 === -0, but they are not equal
373
+ return a !== 0 || 1 / a === 1 / b;
374
+ if (a === null || b === null)
375
+ return a === b;
376
+ if (Object.can(a, "equals"))
377
+ return a.equals(b, equals);
378
+ // commutative
379
+ if (Object.can(b, "equals"))
380
+ return b.equals(a, equals);
381
+ if (typeof a === "object" && typeof b === "object") {
382
+ var aPrototype = Object.getPrototypeOf(a);
383
+ var bPrototype = Object.getPrototypeOf(b);
384
+ if (
385
+ aPrototype === bPrototype && (
386
+ aPrototype === Object.prototype ||
387
+ aPrototype === null
388
+ )
389
+ ) {
390
+ for (var key in a) {
391
+ if (!equals(a[key], b[key])) {
392
+ return false;
393
+ }
394
+ }
395
+ for (var key in b) {
396
+ if (!equals(a[key], b[key])) {
397
+ return false;
398
+ }
399
+ }
400
+ return true;
401
+ }
402
+ }
403
+ // NaN !== NaN, but they are equal.
404
+ // NaNs are the only non-reflexive value, i.e., if x !== x,
405
+ // then x is a NaN.
406
+ // isNaN is broken: it converts its argument to number, so
407
+ // isNaN("foo") => true
408
+ return a !== a && b !== b;
409
+ };
410
+
411
+ // Because a return value of 0 from a `compare` function may mean either
412
+ // "equals" or "is incomparable", `equals` cannot be defined in terms of
413
+ // `compare`. However, `compare` *can* be defined in terms of `equals` and
414
+ // `lessThan`. Again however, more often it would be desirable to implement
415
+ // all of the comparison functions in terms of compare rather than the other
416
+ // way around.
417
+
418
+ /**
419
+ Determines the order in which any two objects should be sorted by returning
420
+ a number that has an analogous relationship to zero as the left value to
421
+ the right. That is, if the left is "less than" the right, the returned
422
+ value will be "less than" zero, where "less than" may be any other
423
+ transitive relationship.
424
+
425
+ <p>Arrays are compared by the first diverging values, or by length.
426
+
427
+ <p>Any two values that are incomparable return zero. As such,
428
+ <code>equals</code> should not be implemented with <code>compare</code>
429
+ since incomparability is indistinguishable from equality.
430
+
431
+ <p>Sorts strings lexicographically. This is not suitable for any
432
+ particular international setting. Different locales sort their phone books
433
+ in very different ways, particularly regarding diacritics and ligatures.
434
+
435
+ <p>If the given object is an instance of a type that implements a method
436
+ named "compare", this function defers to the instance. The method does not
437
+ need to be an owned property to distinguish it from an object literal since
438
+ object literals are incomparable. Unlike <code>Object</code> however,
439
+ <code>Array</code> implements <code>compare</code>.
440
+
441
+ @param {Any} left
442
+ @param {Any} right
443
+ @returns {Number} a value having the same transitive relationship to zero
444
+ as the left and right values.
445
+ @function external:Object.compare
446
+ */
447
+ Object.compare = function (a, b) {
448
+ // unbox objects, but do not confuse object literals
449
+ // mercifully handles the Date case
450
+ a = Object.getValueOf(a);
451
+ b = Object.getValueOf(b);
452
+ var aType = typeof a;
453
+ var bType = typeof b;
454
+ if (a === b)
455
+ return 0;
456
+ if (aType !== bType)
457
+ return 0;
458
+ if (aType === "number")
459
+ return a - b;
460
+ if (aType === "string")
461
+ return a < b ? -1 : 1;
462
+ // the possibility of equality elimiated above
463
+ if (Object.can(a, "compare"))
464
+ return a.compare(b);
465
+ // not commutative, the relationship is reversed
466
+ if (Object.can(b, "compare"))
467
+ return -b.compare(a);
468
+ return 0;
469
+ };
470
+
471
+ /**
472
+ Creates a deep copy of any value. Values, being immutable, are
473
+ returned without alternation. Forwards to <code>clone</code> on
474
+ objects and arrays.
475
+
476
+ @function external:Object.clone
477
+ @param {Any} value a value to clone
478
+ @param {Number} depth an optional traversal depth, defaults to infinity.
479
+ A value of <code>0</code> means to make no clone and return the value
480
+ directly.
481
+ @param {Map} memo an optional memo of already visited objects to preserve
482
+ reference cycles. The cloned object will have the exact same shape as the
483
+ original, but no identical objects. Te map may be later used to associate
484
+ all objects in the original object graph with their corresponding member of
485
+ the cloned graph.
486
+ @returns a copy of the value
487
+ */
488
+ Object.clone = function (value, depth, memo) {
489
+ value = Object.getValueOf(value);
490
+ memo = memo || new WeakMap();
491
+ if (depth === undefined) {
492
+ depth = Infinity;
493
+ } else if (depth === 0) {
494
+ return value;
495
+ }
496
+ if (Object.isObject(value)) {
497
+ if (!memo.has(value)) {
498
+ if (Object.can(value, "clone")) {
499
+ memo.set(value, value.clone(depth, memo));
500
+ } else {
501
+ var prototype = Object.getPrototypeOf(value);
502
+ if (prototype === null || prototype === Object.prototype) {
503
+ var clone = Object.create(prototype);
504
+ memo.set(value, clone);
505
+ for (var key in value) {
506
+ clone[key] = Object.clone(value[key], depth - 1, memo);
507
+ }
508
+ } else {
509
+ throw new Error("Can't clone " + value);
510
+ }
511
+ }
512
+ }
513
+ return memo.get(value);
514
+ }
515
+ return value;
516
+ };
517
+
518
+ /**
519
+ Removes all properties owned by this object making the object suitable for
520
+ reuse.
521
+
522
+ @function external:Object.clear
523
+ @returns this
524
+ */
525
+ Object.clear = function (object) {
526
+ if (Object.can(object, "clear")) {
527
+ object.clear();
528
+ } else {
529
+ var keys = Object.keys(object),
530
+ i = keys.length;
531
+ while (i) {
532
+ i--;
533
+ delete object[keys[i]];
534
+ }
535
+ }
536
+ return object;
537
+ };
538
+