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
@@ -1,59 +0,0 @@
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
-
@@ -1,538 +0,0 @@
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
-