traceur-rb 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (410) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +2 -2
  3. data/lib/js/compile.js +7 -15
  4. data/lib/traceur.rb +2 -1
  5. data/lib/traceur/compilation_error.rb +27 -0
  6. data/lib/traceur/compiler.rb +4 -1
  7. data/lib/traceur/configuration.rb +1 -1
  8. data/lib/traceur/node/runner.rb +1 -1
  9. data/lib/traceur/version.rb +1 -1
  10. data/spec/examples/syntax_error.js +3 -0
  11. data/spec/integration/examples_spec.rb +6 -0
  12. data/vendor/node_modules/traceur/LICENSE +202 -0
  13. data/vendor/node_modules/traceur/README.md +5 -5
  14. data/vendor/node_modules/traceur/bin/traceur-runtime.js +1392 -623
  15. data/vendor/node_modules/traceur/bin/traceur.js +24749 -17990
  16. data/vendor/node_modules/traceur/node_modules/.bin/semver +2 -2
  17. data/vendor/node_modules/traceur/node_modules/commander/History.md +222 -0
  18. data/vendor/node_modules/traceur/node_modules/commander/Readme.md +127 -35
  19. data/vendor/node_modules/traceur/node_modules/commander/index.js +261 -93
  20. data/vendor/node_modules/traceur/node_modules/commander/package.json +41 -9
  21. data/vendor/node_modules/traceur/node_modules/glob/LICENSE +15 -0
  22. data/vendor/node_modules/traceur/node_modules/glob/README.md +357 -0
  23. data/vendor/node_modules/traceur/node_modules/glob/common.js +177 -0
  24. data/vendor/node_modules/traceur/node_modules/glob/glob.js +649 -0
  25. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/.eslintrc +17 -0
  26. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/LICENSE +15 -0
  27. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/README.md +37 -0
  28. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/inflight.js +44 -0
  29. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE +15 -0
  30. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md +36 -0
  31. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +34 -0
  32. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js +51 -0
  33. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js +33 -0
  34. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/package.json +61 -0
  35. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/test.js +97 -0
  36. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/LICENSE +16 -0
  37. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/README.md +42 -0
  38. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/inherits.js +1 -0
  39. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
  40. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/package.json +33 -0
  41. data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/test.js +25 -0
  42. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/.npmignore +1 -0
  43. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/.travis.yml +4 -0
  44. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/LICENSE +23 -0
  45. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/README.md +216 -0
  46. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/benchmark.js +15 -0
  47. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/browser.js +1181 -0
  48. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/minimatch.js +845 -0
  49. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +2 -0
  50. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml +3 -0
  51. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +121 -0
  52. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +8 -0
  53. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +191 -0
  54. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +2 -0
  55. data/vendor/node_modules/traceur/node_modules/{q-io/node_modules/collections → glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/.travis.yml +0 -0
  56. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +6 -0
  57. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +80 -0
  58. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +5 -0
  59. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +38 -0
  60. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +73 -0
  61. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +56 -0
  62. data/vendor/node_modules/traceur/node_modules/{q-io/node_modules/url2 → glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map}/.travis.yml +1 -1
  63. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +18 -0
  64. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +62 -0
  65. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +6 -0
  66. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +13 -0
  67. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +83 -0
  68. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +39 -0
  69. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +75 -0
  70. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +32 -0
  71. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +1075 -0
  72. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +182 -0
  73. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +9 -0
  74. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +10 -0
  75. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +24 -0
  76. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +15 -0
  77. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +16 -0
  78. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js +10 -0
  79. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +13 -0
  80. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +7 -0
  81. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +50 -0
  82. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/package.json +60 -0
  83. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/basic.js +399 -0
  84. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/brace-expand.js +45 -0
  85. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/defaults.js +274 -0
  86. data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
  87. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/LICENSE +27 -0
  88. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/README.md +51 -0
  89. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +15 -0
  90. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +36 -0
  91. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +34 -0
  92. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +51 -0
  93. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +33 -0
  94. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/once.js +21 -0
  95. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/package.json +42 -0
  96. data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/test/once.js +23 -0
  97. data/vendor/node_modules/traceur/node_modules/glob/package.json +72 -0
  98. data/vendor/node_modules/traceur/node_modules/glob/sync.js +409 -0
  99. data/vendor/node_modules/traceur/node_modules/rsvp/.release.json +17 -0
  100. data/vendor/node_modules/traceur/node_modules/rsvp/CHANGELOG.md +165 -0
  101. data/vendor/node_modules/traceur/node_modules/rsvp/LICENSE +19 -0
  102. data/vendor/node_modules/traceur/node_modules/rsvp/README.md +364 -0
  103. data/vendor/node_modules/traceur/node_modules/rsvp/dist/rsvp.js +1671 -0
  104. data/vendor/node_modules/traceur/node_modules/rsvp/dist/rsvp.min.js +9 -0
  105. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp.js +66 -0
  106. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp.umd.js +50 -0
  107. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/-internal.js +265 -0
  108. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/all-settled.js +71 -0
  109. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/all.js +15 -0
  110. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/asap.js +109 -0
  111. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/config.js +28 -0
  112. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/defer.js +45 -0
  113. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/enumerator.js +125 -0
  114. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/events.js +201 -0
  115. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/filter.js +120 -0
  116. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/hash-settled.js +124 -0
  117. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/hash.js +94 -0
  118. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/instrument.js +41 -0
  119. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/map.js +99 -0
  120. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/node.js +281 -0
  121. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise-hash.js +51 -0
  122. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise.js +496 -0
  123. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/all.js +52 -0
  124. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/race.js +105 -0
  125. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/reject.js +47 -0
  126. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/resolve.js +49 -0
  127. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/race.js +15 -0
  128. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/reject.js +16 -0
  129. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/resolve.js +17 -0
  130. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/rethrow.js +46 -0
  131. data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/utils.js +39 -0
  132. data/vendor/node_modules/traceur/node_modules/rsvp/package.json +100 -0
  133. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/README.md +9 -0
  134. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/bower.json +22 -0
  135. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/composer.json +18 -0
  136. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/package.json +52 -0
  137. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.amd.js +1607 -0
  138. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.js +1566 -0
  139. data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.min.js +26 -0
  140. data/vendor/node_modules/traceur/node_modules/rsvp/vertx.js +1 -0
  141. data/vendor/node_modules/traceur/node_modules/semver/bin/semver +2 -2
  142. data/vendor/node_modules/traceur/node_modules/semver/package.json +4 -3
  143. data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js +7 -0
  144. data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js.gz +0 -0
  145. data/vendor/node_modules/traceur/node_modules/semver/semver.js +7 -0
  146. data/vendor/node_modules/traceur/node_modules/semver/semver.min.js +1 -1
  147. data/vendor/node_modules/traceur/node_modules/semver/semver.min.js.gz +0 -0
  148. data/vendor/node_modules/traceur/node_modules/semver/test/index.js +8 -4
  149. data/vendor/node_modules/traceur/node_modules/semver/test/ltr.js +2 -1
  150. data/vendor/node_modules/traceur/node_modules/source-map-support/.npmignore +1 -0
  151. data/vendor/node_modules/traceur/node_modules/{q-io/node_modules/mime/LICENSE → source-map-support/LICENSE.md} +7 -5
  152. data/vendor/node_modules/traceur/node_modules/source-map-support/README.md +165 -0
  153. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/browser-source-map-support.js +89 -0
  154. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/index.html +6 -0
  155. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/require.js +36 -0
  156. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.coffee +13 -0
  157. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.js +24 -0
  158. data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.map +10 -0
  159. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-source-map-support.js +89 -0
  160. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/index.html +6 -0
  161. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.coffee +12 -0
  162. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.js +25 -0
  163. data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.map +10 -0
  164. data/vendor/node_modules/traceur/node_modules/source-map-support/build.js +69 -0
  165. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/index.html +6 -0
  166. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.coffee +12 -0
  167. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.js +25 -0
  168. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.map +10 -0
  169. data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/server.js +45 -0
  170. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/.npmignore +2 -0
  171. data/vendor/node_modules/traceur/node_modules/{q-io → source-map-support/node_modules/source-map}/.travis.yml +1 -0
  172. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/CHANGELOG.md +121 -0
  173. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/LICENSE +28 -0
  174. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/Makefile.dryice.js +166 -0
  175. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/README.md +434 -0
  176. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/assert-shim.js +56 -0
  177. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/mini-require.js +152 -0
  178. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/prefix-source-map.jsm +20 -0
  179. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/prefix-utils.jsm +18 -0
  180. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-browser.js +8 -0
  181. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-source-map.jsm +6 -0
  182. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-utils.jsm +21 -0
  183. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/test-prefix.js +8 -0
  184. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/test-suffix.js +3 -0
  185. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map.js +8 -0
  186. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/array-set.js +97 -0
  187. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
  188. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/base64.js +42 -0
  189. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/binary-search.js +81 -0
  190. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-map-consumer.js +478 -0
  191. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-map-generator.js +380 -0
  192. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-node.js +371 -0
  193. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/util.js +205 -0
  194. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
  195. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/README.md +171 -0
  196. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
  197. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/intercept.js +36 -0
  198. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/package.json +37 -0
  199. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/package.json +142 -0
  200. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/run-tests.js +62 -0
  201. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-api.js +26 -0
  202. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-array-set.js +104 -0
  203. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
  204. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-base64.js +35 -0
  205. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
  206. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-dog-fooding.js +72 -0
  207. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-map-consumer.js +451 -0
  208. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-map-generator.js +417 -0
  209. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-node.js +365 -0
  210. data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/util.js +161 -0
  211. data/vendor/node_modules/traceur/node_modules/source-map-support/package.json +52 -0
  212. data/vendor/node_modules/traceur/node_modules/source-map-support/source-map-support.js +381 -0
  213. data/vendor/node_modules/traceur/node_modules/source-map-support/test.js +359 -0
  214. data/vendor/node_modules/traceur/package.json +234 -20
  215. data/vendor/node_modules/traceur/src/node/NodeCompiler.js +78 -0
  216. data/vendor/node_modules/traceur/src/node/System.js +32 -5
  217. data/vendor/node_modules/traceur/src/node/api.js +28 -93
  218. data/vendor/node_modules/traceur/src/node/command.js +84 -19
  219. data/vendor/node_modules/traceur/src/node/compileAllJsFilesInDir.js +40 -0
  220. data/vendor/node_modules/traceur/src/node/interpreter.js +11 -8
  221. data/vendor/node_modules/traceur/src/node/recursiveModuleCompile.js +171 -0
  222. data/vendor/node_modules/traceur/src/node/require.js +7 -21
  223. data/vendor/node_modules/traceur/src/node/to-amd-compiler.js +2 -7
  224. data/vendor/node_modules/traceur/src/node/to-closure-compiler.js +28 -0
  225. data/vendor/node_modules/traceur/src/node/to-commonjs-compiler.js +3 -7
  226. data/vendor/node_modules/traceur/src/node/traceur.js +1 -1
  227. metadata +196 -190
  228. data/vendor/node_modules/traceur/node_modules/q-io/.npmignore +0 -1
  229. data/vendor/node_modules/traceur/node_modules/q-io/CHANGES.md +0 -122
  230. data/vendor/node_modules/traceur/node_modules/q-io/LICENSE +0 -19
  231. data/vendor/node_modules/traceur/node_modules/q-io/README.md +0 -928
  232. data/vendor/node_modules/traceur/node_modules/q-io/buffer-stream.js +0 -59
  233. data/vendor/node_modules/traceur/node_modules/q-io/coverage-report.js +0 -44
  234. data/vendor/node_modules/traceur/node_modules/q-io/deprecate.js +0 -51
  235. data/vendor/node_modules/traceur/node_modules/q-io/fs-boot.js +0 -307
  236. data/vendor/node_modules/traceur/node_modules/q-io/fs-common.js +0 -499
  237. data/vendor/node_modules/traceur/node_modules/q-io/fs-mock.js +0 -547
  238. data/vendor/node_modules/traceur/node_modules/q-io/fs-root.js +0 -105
  239. data/vendor/node_modules/traceur/node_modules/q-io/fs.js +0 -355
  240. data/vendor/node_modules/traceur/node_modules/q-io/fs2http.js +0 -65
  241. data/vendor/node_modules/traceur/node_modules/q-io/http-apps.js +0 -152
  242. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/chain.js +0 -24
  243. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/content.js +0 -93
  244. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/cookie.js +0 -154
  245. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/decorators.js +0 -178
  246. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/fs.js +0 -417
  247. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/html.js +0 -58
  248. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/json.js +0 -78
  249. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/negotiate.js +0 -120
  250. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/proxy.js +0 -27
  251. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/redirect.js +0 -209
  252. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/route.js +0 -125
  253. data/vendor/node_modules/traceur/node_modules/q-io/http-apps/status.js +0 -175
  254. data/vendor/node_modules/traceur/node_modules/q-io/http-cookie.js +0 -75
  255. data/vendor/node_modules/traceur/node_modules/q-io/http.js +0 -378
  256. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.npmignore +0 -11
  257. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/CHANGES.md +0 -78
  258. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/LICENSE.md +0 -21
  259. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/README.md +0 -1285
  260. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/collections.js +0 -22
  261. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/dict.js +0 -142
  262. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-map.js +0 -57
  263. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-set.js +0 -183
  264. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-collection.js +0 -261
  265. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-map.js +0 -186
  266. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-order.js +0 -55
  267. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-set.js +0 -59
  268. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/heap.js +0 -236
  269. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/iterator.js +0 -371
  270. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/list.js +0 -435
  271. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/array-changes.js +0 -247
  272. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/map-changes.js +0 -147
  273. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/property-changes.js +0 -448
  274. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/range-changes.js +0 -139
  275. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-map.js +0 -79
  276. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-set.js +0 -142
  277. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/map.js +0 -60
  278. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/multi-map.js +0 -41
  279. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/package.json +0 -12
  280. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync +0 -7
  281. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync.patch +0 -48
  282. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/weak-map.js +0 -590
  283. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/package.json +0 -49
  284. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/set.js +0 -173
  285. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-array.js +0 -274
  286. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-function.js +0 -59
  287. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-object.js +0 -538
  288. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-regexp.js +0 -14
  289. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim.js +0 -6
  290. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-map.js +0 -49
  291. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-set.js +0 -51
  292. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array.js +0 -269
  293. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-map.js +0 -61
  294. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-set.js +0 -736
  295. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/tree-log.js +0 -40
  296. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/weak-map.js +0 -1
  297. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/README.md +0 -66
  298. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/mime.js +0 -114
  299. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/package.json +0 -35
  300. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/test.js +0 -84
  301. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/mime.types +0 -1588
  302. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/node.types +0 -77
  303. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/CHANGES +0 -15
  304. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/LICENSE +0 -19
  305. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/README +0 -96
  306. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/lib/mimeparse.js +0 -166
  307. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/package.json +0 -43
  308. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/CONTRIBUTING.md +0 -40
  309. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/LICENSE +0 -19
  310. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/README.md +0 -813
  311. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/compare-with-callbacks.js +0 -71
  312. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/scenarios.js +0 -36
  313. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/package.json +0 -93
  314. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/q.js +0 -1937
  315. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/queue.js +0 -35
  316. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/.gitmodules +0 -6
  317. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/History.md +0 -36
  318. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Makefile +0 -7
  319. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Readme.md +0 -38
  320. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/benchmark.js +0 -32
  321. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/examples.js +0 -39
  322. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/index.js +0 -2
  323. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/lib/querystring.js +0 -123
  324. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/package.json +0 -19
  325. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.gitmodules +0 -3
  326. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.npmignore +0 -3
  327. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/History.md +0 -128
  328. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Makefile +0 -53
  329. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Readme.md +0 -61
  330. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/bin/expresso +0 -856
  331. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/api.html +0 -1080
  332. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.html +0 -377
  333. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.md +0 -290
  334. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/foot.html +0 -3
  335. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/head.html +0 -42
  336. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/bar.js +0 -4
  337. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/foo.js +0 -16
  338. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/package.json +0 -12
  339. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/assert.test.js +0 -91
  340. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/async.test.js +0 -12
  341. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/bar.test.js +0 -13
  342. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/foo.test.js +0 -14
  343. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/http.test.js +0 -146
  344. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/async.test.js +0 -39
  345. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/http.test.js +0 -48
  346. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/.gitmodules +0 -3
  347. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/History.md +0 -22
  348. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Makefile +0 -6
  349. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Readme.md +0 -248
  350. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/examples/runner.js +0 -53
  351. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/index.js +0 -2
  352. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/eql.js +0 -91
  353. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/should.js +0 -548
  354. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/package.json +0 -8
  355. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/test/should.test.js +0 -358
  356. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/test/querystring.test.js +0 -133
  357. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.npmignore +0 -3
  358. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/LICENSE.md +0 -20
  359. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/README.md +0 -33
  360. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/package.json +0 -37
  361. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/test/url2-spec.js +0 -125
  362. data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/url2.js +0 -151
  363. data/vendor/node_modules/traceur/node_modules/q-io/package.json +0 -51
  364. data/vendor/node_modules/traceur/node_modules/q-io/reader.js +0 -133
  365. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/boot-directory-spec.js +0 -47
  366. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/contains-spec.js +0 -11
  367. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/fixtures/hello.txt +0 -1
  368. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/issues/1-spec.js +0 -33
  369. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/make-tree-spec.js +0 -92
  370. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/append-spec.js +0 -41
  371. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/copy-tree-spec.js +0 -57
  372. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/fixture/hello.txt +0 -1
  373. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/link-spec.js +0 -70
  374. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/make-tree-spec.js +0 -109
  375. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/merge-spec.js +0 -67
  376. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/move-spec.js +0 -219
  377. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/object-spec.js +0 -20
  378. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/range-spec.js +0 -26
  379. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/read-spec.js +0 -40
  380. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-directory-spec.js +0 -37
  381. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-tree-spec.js +0 -39
  382. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/root-spec.js +0 -32
  383. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/stat-spec.js +0 -26
  384. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/symbolic-link-spec.js +0 -86
  385. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/working-directory-spec.js +0 -31
  386. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/write-spec.js +0 -73
  387. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.js +0 -23
  388. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.txt +0 -1
  389. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/read-spec.js +0 -22
  390. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/relative-spec.js +0 -25
  391. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/reroot-spec.js +0 -45
  392. data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/write-spec.js +0 -38
  393. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/cookie-spec.js +0 -52
  394. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/directory-list-spec.js +0 -86
  395. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/01234.txt +0 -1
  396. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/1234.txt +0 -1
  397. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/5678.txt +0 -0
  398. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/9012/3456.txt +0 -0
  399. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/hosts-spec.js +0 -49
  400. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/interpret-range-spec.js +0 -47
  401. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/partial-range-spec.js +0 -186
  402. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/proxy-spec.js +0 -82
  403. data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/symbolic-link-spec.js +0 -110
  404. data/vendor/node_modules/traceur/node_modules/q-io/spec/http/agent-spec.js +0 -96
  405. data/vendor/node_modules/traceur/node_modules/q-io/spec/http/basic-spec.js +0 -96
  406. data/vendor/node_modules/traceur/node_modules/q-io/spec/lib/jasmine-promise.js +0 -42
  407. data/vendor/node_modules/traceur/node_modules/q-io/writer.js +0 -111
  408. data/vendor/node_modules/traceur/src/node/compile-single-file.js +0 -69
  409. data/vendor/node_modules/traceur/src/node/compiler.js +0 -116
  410. data/vendor/node_modules/traceur/src/node/inline-module.js +0 -149
@@ -0,0 +1,161 @@
1
+ /* -*- Mode: js; js-indent-level: 2; -*- */
2
+ /*
3
+ * Copyright 2011 Mozilla Foundation and contributors
4
+ * Licensed under the New BSD license. See LICENSE or:
5
+ * http://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ if (typeof define !== 'function') {
8
+ var define = require('amdefine')(module, require);
9
+ }
10
+ define(function (require, exports, module) {
11
+
12
+ var util = require('../../lib/source-map/util');
13
+
14
+ // This is a test mapping which maps functions from two different files
15
+ // (one.js and two.js) to a minified generated source.
16
+ //
17
+ // Here is one.js:
18
+ //
19
+ // ONE.foo = function (bar) {
20
+ // return baz(bar);
21
+ // };
22
+ //
23
+ // Here is two.js:
24
+ //
25
+ // TWO.inc = function (n) {
26
+ // return n + 1;
27
+ // };
28
+ //
29
+ // And here is the generated code (min.js):
30
+ //
31
+ // ONE.foo=function(a){return baz(a);};
32
+ // TWO.inc=function(a){return a+1;};
33
+ exports.testGeneratedCode = " ONE.foo=function(a){return baz(a);};\n"+
34
+ " TWO.inc=function(a){return a+1;};";
35
+ exports.testMap = {
36
+ version: 3,
37
+ file: 'min.js',
38
+ names: ['bar', 'baz', 'n'],
39
+ sources: ['one.js', 'two.js'],
40
+ sourceRoot: '/the/root',
41
+ mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
42
+ };
43
+ exports.testMapWithSourcesContent = {
44
+ version: 3,
45
+ file: 'min.js',
46
+ names: ['bar', 'baz', 'n'],
47
+ sources: ['one.js', 'two.js'],
48
+ sourcesContent: [
49
+ ' ONE.foo = function (bar) {\n' +
50
+ ' return baz(bar);\n' +
51
+ ' };',
52
+ ' TWO.inc = function (n) {\n' +
53
+ ' return n + 1;\n' +
54
+ ' };'
55
+ ],
56
+ sourceRoot: '/the/root',
57
+ mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
58
+ };
59
+ exports.emptyMap = {
60
+ version: 3,
61
+ file: 'min.js',
62
+ names: [],
63
+ sources: [],
64
+ mappings: ''
65
+ };
66
+
67
+
68
+ function assertMapping(generatedLine, generatedColumn, originalSource,
69
+ originalLine, originalColumn, name, map, assert,
70
+ dontTestGenerated, dontTestOriginal) {
71
+ if (!dontTestOriginal) {
72
+ var origMapping = map.originalPositionFor({
73
+ line: generatedLine,
74
+ column: generatedColumn
75
+ });
76
+ assert.equal(origMapping.name, name,
77
+ 'Incorrect name, expected ' + JSON.stringify(name)
78
+ + ', got ' + JSON.stringify(origMapping.name));
79
+ assert.equal(origMapping.line, originalLine,
80
+ 'Incorrect line, expected ' + JSON.stringify(originalLine)
81
+ + ', got ' + JSON.stringify(origMapping.line));
82
+ assert.equal(origMapping.column, originalColumn,
83
+ 'Incorrect column, expected ' + JSON.stringify(originalColumn)
84
+ + ', got ' + JSON.stringify(origMapping.column));
85
+
86
+ var expectedSource;
87
+
88
+ if (originalSource && map.sourceRoot && originalSource.indexOf(map.sourceRoot) === 0) {
89
+ expectedSource = originalSource;
90
+ } else if (originalSource) {
91
+ expectedSource = map.sourceRoot
92
+ ? util.join(map.sourceRoot, originalSource)
93
+ : originalSource;
94
+ } else {
95
+ expectedSource = null;
96
+ }
97
+
98
+ assert.equal(origMapping.source, expectedSource,
99
+ 'Incorrect source, expected ' + JSON.stringify(expectedSource)
100
+ + ', got ' + JSON.stringify(origMapping.source));
101
+ }
102
+
103
+ if (!dontTestGenerated) {
104
+ var genMapping = map.generatedPositionFor({
105
+ source: originalSource,
106
+ line: originalLine,
107
+ column: originalColumn
108
+ });
109
+ assert.equal(genMapping.line, generatedLine,
110
+ 'Incorrect line, expected ' + JSON.stringify(generatedLine)
111
+ + ', got ' + JSON.stringify(genMapping.line));
112
+ assert.equal(genMapping.column, generatedColumn,
113
+ 'Incorrect column, expected ' + JSON.stringify(generatedColumn)
114
+ + ', got ' + JSON.stringify(genMapping.column));
115
+ }
116
+ }
117
+ exports.assertMapping = assertMapping;
118
+
119
+ function assertEqualMaps(assert, actualMap, expectedMap) {
120
+ assert.equal(actualMap.version, expectedMap.version, "version mismatch");
121
+ assert.equal(actualMap.file, expectedMap.file, "file mismatch");
122
+ assert.equal(actualMap.names.length,
123
+ expectedMap.names.length,
124
+ "names length mismatch: " +
125
+ actualMap.names.join(", ") + " != " + expectedMap.names.join(", "));
126
+ for (var i = 0; i < actualMap.names.length; i++) {
127
+ assert.equal(actualMap.names[i],
128
+ expectedMap.names[i],
129
+ "names[" + i + "] mismatch: " +
130
+ actualMap.names.join(", ") + " != " + expectedMap.names.join(", "));
131
+ }
132
+ assert.equal(actualMap.sources.length,
133
+ expectedMap.sources.length,
134
+ "sources length mismatch: " +
135
+ actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", "));
136
+ for (var i = 0; i < actualMap.sources.length; i++) {
137
+ assert.equal(actualMap.sources[i],
138
+ expectedMap.sources[i],
139
+ "sources[" + i + "] length mismatch: " +
140
+ actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", "));
141
+ }
142
+ assert.equal(actualMap.sourceRoot,
143
+ expectedMap.sourceRoot,
144
+ "sourceRoot mismatch: " +
145
+ actualMap.sourceRoot + " != " + expectedMap.sourceRoot);
146
+ assert.equal(actualMap.mappings, expectedMap.mappings,
147
+ "mappings mismatch:\nActual: " + actualMap.mappings + "\nExpected: " + expectedMap.mappings);
148
+ if (actualMap.sourcesContent) {
149
+ assert.equal(actualMap.sourcesContent.length,
150
+ expectedMap.sourcesContent.length,
151
+ "sourcesContent length mismatch");
152
+ for (var i = 0; i < actualMap.sourcesContent.length; i++) {
153
+ assert.equal(actualMap.sourcesContent[i],
154
+ expectedMap.sourcesContent[i],
155
+ "sourcesContent[" + i + "] mismatch");
156
+ }
157
+ }
158
+ }
159
+ exports.assertEqualMaps = assertEqualMaps;
160
+
161
+ });
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "source-map-support",
3
+ "description": "Fixes stack traces for files with source maps",
4
+ "version": "0.2.9",
5
+ "main": "./source-map-support.js",
6
+ "scripts": {
7
+ "test": "node_modules/mocha/bin/mocha"
8
+ },
9
+ "dependencies": {
10
+ "source-map": "0.1.32"
11
+ },
12
+ "devDependencies": {
13
+ "coffee-script": "1.7.1",
14
+ "browserify": "3.44.2",
15
+ "mocha": "1.18.2"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/evanw/node-source-map-support"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/evanw/node-source-map-support/issues"
23
+ },
24
+ "licenses": [
25
+ {
26
+ "type": "MIT"
27
+ }
28
+ ],
29
+ "gitHead": "fc511adace58467c478967819b38b3945d2183ef",
30
+ "homepage": "https://github.com/evanw/node-source-map-support",
31
+ "_id": "source-map-support@0.2.9",
32
+ "_shasum": "0bfb3bdae680f36b51815160bb950d0b17f4a248",
33
+ "_from": "source-map-support@>=0.2.8 <0.3.0",
34
+ "_npmVersion": "1.4.28",
35
+ "_npmUser": {
36
+ "name": "evanw",
37
+ "email": "evan.exe@gmail.com"
38
+ },
39
+ "maintainers": [
40
+ {
41
+ "name": "evanw",
42
+ "email": "evan.exe@gmail.com"
43
+ }
44
+ ],
45
+ "dist": {
46
+ "shasum": "0bfb3bdae680f36b51815160bb950d0b17f4a248",
47
+ "tarball": "http://registry.npmjs.org/source-map-support/-/source-map-support-0.2.9.tgz"
48
+ },
49
+ "directories": {},
50
+ "_resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.2.9.tgz",
51
+ "readme": "ERROR: No README data found!"
52
+ }
@@ -0,0 +1,381 @@
1
+ var SourceMapConsumer = require('source-map').SourceMapConsumer;
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+
5
+ // Only install once if called multiple times
6
+ var alreadyInstalled = false;
7
+
8
+ // If true, the caches are reset before a stack trace formatting operation
9
+ var emptyCacheBetweenOperations = false;
10
+
11
+ // Maps a file path to a string containing the file contents
12
+ var fileContentsCache = {};
13
+
14
+ // Maps a file path to a source map for that file
15
+ var sourceMapCache = {};
16
+
17
+ function isInBrowser() {
18
+ return typeof window !== 'undefined';
19
+ }
20
+
21
+ function retrieveFile(path) {
22
+ if (path in fileContentsCache) {
23
+ return fileContentsCache[path];
24
+ }
25
+
26
+ try {
27
+ // Use SJAX if we are in the browser
28
+ if (isInBrowser()) {
29
+ var xhr = new XMLHttpRequest();
30
+ xhr.open('GET', path, false);
31
+ xhr.send(null);
32
+ var contents = xhr.readyState === 4 ? xhr.responseText : null;
33
+ }
34
+
35
+ // Otherwise, use the filesystem
36
+ else {
37
+ var contents = fs.readFileSync(path, 'utf8');
38
+ }
39
+ } catch (e) {
40
+ var contents = null;
41
+ }
42
+
43
+ return fileContentsCache[path] = contents;
44
+ }
45
+
46
+ // Support URLs relative to a directory, but be careful about a protocol prefix
47
+ // in case we are in the browser (i.e. directories may start with "http://")
48
+ function supportRelativeURL(file, url) {
49
+ if (!file) return url;
50
+ var dir = path.dirname(file);
51
+ var match = /^\w+:\/\/[^\/]*/.exec(dir);
52
+ var protocol = match ? match[0] : '';
53
+ return protocol + path.resolve(dir.slice(protocol.length), url);
54
+ }
55
+
56
+ function retrieveSourceMapURL(source) {
57
+ var fileData;
58
+
59
+ if (isInBrowser()) {
60
+ var xhr = new XMLHttpRequest();
61
+ xhr.open('GET', source, false);
62
+ xhr.send(null);
63
+ fileData = xhr.readyState === 4 ? xhr.responseText : null;
64
+
65
+ // Support providing a sourceMappingURL via the SourceMap header
66
+ var sourceMapHeader = xhr.getResponseHeader("SourceMap") ||
67
+ xhr.getResponseHeader("X-SourceMap");
68
+ if (sourceMapHeader) {
69
+ return sourceMapHeader;
70
+ }
71
+ }
72
+
73
+ // Get the URL of the source map
74
+ fileData = retrieveFile(source);
75
+ var match = /\/\/[#@]\s*sourceMappingURL=(.*)\s*$/m.exec(fileData);
76
+ if (!match) return null;
77
+ return match[1];
78
+ };
79
+
80
+ // Can be overridden by the retrieveSourceMap option to install. Takes a
81
+ // generated source filename; returns a {map, optional url} object, or null if
82
+ // there is no source map. The map field may be either a string or the parsed
83
+ // JSON object (ie, it must be a valid argument to the SourceMapConsumer
84
+ // constructor).
85
+ function retrieveSourceMap(source) {
86
+ var sourceMappingURL = retrieveSourceMapURL(source);
87
+ if (!sourceMappingURL) return null;
88
+
89
+ // Read the contents of the source map
90
+ var sourceMapData;
91
+ var dataUrlPrefix = "data:application/json;base64,";
92
+ if (sourceMappingURL.slice(0, dataUrlPrefix.length).toLowerCase() == dataUrlPrefix) {
93
+ // Support source map URL as a data url
94
+ sourceMapData = new Buffer(sourceMappingURL.slice(dataUrlPrefix.length), "base64").toString();
95
+ sourceMappingURL = null;
96
+ } else {
97
+ // Support source map URLs relative to the source URL
98
+ sourceMappingURL = supportRelativeURL(source, sourceMappingURL);
99
+ sourceMapData = retrieveFile(sourceMappingURL, 'utf8');
100
+ }
101
+
102
+ if (!sourceMapData) {
103
+ return null;
104
+ }
105
+
106
+ return {
107
+ url: sourceMappingURL,
108
+ map: sourceMapData
109
+ };
110
+ }
111
+
112
+ function mapSourcePosition(position) {
113
+ var sourceMap = sourceMapCache[position.source];
114
+ if (!sourceMap) {
115
+ // Call the (overrideable) retrieveSourceMap function to get the source map.
116
+ var urlAndMap = retrieveSourceMap(position.source);
117
+ if (urlAndMap) {
118
+ sourceMap = sourceMapCache[position.source] = {
119
+ url: urlAndMap.url,
120
+ map: new SourceMapConsumer(urlAndMap.map)
121
+ };
122
+
123
+ // Load all sources stored inline with the source map into the file cache
124
+ // to pretend like they are already loaded. They may not exist on disk.
125
+ if (sourceMap.map.sourcesContent) {
126
+ sourceMap.map.sources.forEach(function(source, i) {
127
+ var contents = sourceMap.map.sourcesContent[i];
128
+ if (contents) {
129
+ var url = supportRelativeURL(sourceMap.url, source);
130
+ fileContentsCache[url] = contents;
131
+ }
132
+ });
133
+ }
134
+ }
135
+ }
136
+
137
+ // Resolve the source URL relative to the URL of the source map
138
+ if (sourceMap) {
139
+ var originalPosition = sourceMap.map.originalPositionFor(position);
140
+
141
+ // Only return the original position if a matching line was found. If no
142
+ // matching line is found then we return position instead, which will cause
143
+ // the stack trace to print the path and line for the compiled file. It is
144
+ // better to give a precise location in the compiled file than a vague
145
+ // location in the original file.
146
+ if (originalPosition.source !== null) {
147
+ originalPosition.source = supportRelativeURL(
148
+ sourceMap.url, originalPosition.source);
149
+ return originalPosition;
150
+ }
151
+ }
152
+
153
+ return position;
154
+ }
155
+
156
+ // Parses code generated by FormatEvalOrigin(), a function inside V8:
157
+ // https://code.google.com/p/v8/source/browse/trunk/src/messages.js
158
+ function mapEvalOrigin(origin) {
159
+ // Most eval() calls are in this format
160
+ var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
161
+ if (match) {
162
+ var position = mapSourcePosition({
163
+ source: match[2],
164
+ line: match[3],
165
+ column: match[4] - 1
166
+ });
167
+ return 'eval at ' + match[1] + ' (' + position.source + ':' +
168
+ position.line + ':' + (position.column + 1) + ')';
169
+ }
170
+
171
+ // Parse nested eval() calls using recursion
172
+ match = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
173
+ if (match) {
174
+ return 'eval at ' + match[1] + ' (' + mapEvalOrigin(match[2]) + ')';
175
+ }
176
+
177
+ // Make sure we still return useful information if we didn't find anything
178
+ return origin;
179
+ }
180
+
181
+ // This is copied almost verbatim from the V8 source code at
182
+ // https://code.google.com/p/v8/source/browse/trunk/src/messages.js. The
183
+ // implementation of wrapCallSite() used to just forward to the actual source
184
+ // code of CallSite.prototype.toString but unfortunately a new release of V8
185
+ // did something to the prototype chain and broke the shim. The only fix I
186
+ // could find was copy/paste.
187
+ function CallSiteToString() {
188
+ var fileName;
189
+ var fileLocation = "";
190
+ if (this.isNative()) {
191
+ fileLocation = "native";
192
+ } else {
193
+ fileName = this.getScriptNameOrSourceURL();
194
+ if (!fileName && this.isEval()) {
195
+ fileLocation = this.getEvalOrigin();
196
+ fileLocation += ", "; // Expecting source position to follow.
197
+ }
198
+
199
+ if (fileName) {
200
+ fileLocation += fileName;
201
+ } else {
202
+ // Source code does not originate from a file and is not native, but we
203
+ // can still get the source position inside the source string, e.g. in
204
+ // an eval string.
205
+ fileLocation += "<anonymous>";
206
+ }
207
+ var lineNumber = this.getLineNumber();
208
+ if (lineNumber != null) {
209
+ fileLocation += ":" + lineNumber;
210
+ var columnNumber = this.getColumnNumber();
211
+ if (columnNumber) {
212
+ fileLocation += ":" + columnNumber;
213
+ }
214
+ }
215
+ }
216
+
217
+ var line = "";
218
+ var functionName = this.getFunctionName();
219
+ var addSuffix = true;
220
+ var isConstructor = this.isConstructor();
221
+ var isMethodCall = !(this.isToplevel() || isConstructor);
222
+ if (isMethodCall) {
223
+ var typeName = this.getTypeName();
224
+ var methodName = this.getMethodName();
225
+ if (functionName) {
226
+ if (typeName && functionName.indexOf(typeName) != 0) {
227
+ line += typeName + ".";
228
+ }
229
+ line += functionName;
230
+ if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) {
231
+ line += " [as " + methodName + "]";
232
+ }
233
+ } else {
234
+ line += typeName + "." + (methodName || "<anonymous>");
235
+ }
236
+ } else if (isConstructor) {
237
+ line += "new " + (functionName || "<anonymous>");
238
+ } else if (functionName) {
239
+ line += functionName;
240
+ } else {
241
+ line += fileLocation;
242
+ addSuffix = false;
243
+ }
244
+ if (addSuffix) {
245
+ line += " (" + fileLocation + ")";
246
+ }
247
+ return line;
248
+ }
249
+
250
+ function cloneCallSite(frame) {
251
+ var object = {};
252
+ Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {
253
+ object[name] = /^(?:is|get)/.test(name) ? function() { return frame[name].call(frame); } : frame[name];
254
+ });
255
+ object.toString = CallSiteToString;
256
+ return object;
257
+ }
258
+
259
+ function wrapCallSite(frame) {
260
+ // Most call sites will return the source file from getFileName(), but code
261
+ // passed to eval() ending in "//# sourceURL=..." will return the source file
262
+ // from getScriptNameOrSourceURL() instead
263
+ var source = frame.getFileName() || frame.getScriptNameOrSourceURL();
264
+ if (source) {
265
+ var position = mapSourcePosition({
266
+ source: source,
267
+ line: frame.getLineNumber(),
268
+ column: frame.getColumnNumber() - 1
269
+ });
270
+ frame = cloneCallSite(frame);
271
+ frame.getFileName = function() { return position.source; };
272
+ frame.getLineNumber = function() { return position.line; };
273
+ frame.getColumnNumber = function() { return position.column + 1; };
274
+ frame.getScriptNameOrSourceURL = function() { return position.source; };
275
+ return frame;
276
+ }
277
+
278
+ // Code called using eval() needs special handling
279
+ var origin = frame.isEval() && frame.getEvalOrigin();
280
+ if (origin) {
281
+ origin = mapEvalOrigin(origin);
282
+ frame = cloneCallSite(frame);
283
+ frame.getEvalOrigin = function() { return origin; };
284
+ return frame;
285
+ }
286
+
287
+ // If we get here then we were unable to change the source position
288
+ return frame;
289
+ }
290
+
291
+ // This function is part of the V8 stack trace API, for more info see:
292
+ // http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
293
+ function prepareStackTrace(error, stack) {
294
+ if (emptyCacheBetweenOperations) {
295
+ fileContentsCache = {};
296
+ sourceMapCache = {};
297
+ }
298
+ return error + stack.map(function(frame) {
299
+ return '\n at ' + wrapCallSite(frame);
300
+ }).join('');
301
+ }
302
+
303
+ // Generate position and snippet of original source with pointer
304
+ function getErrorSource(error) {
305
+ var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
306
+ if (match) {
307
+ var source = match[1];
308
+ var line = +match[2];
309
+ var column = +match[3];
310
+
311
+ // Support the inline sourceContents inside the source map
312
+ var contents = fileContentsCache[source];
313
+
314
+ // Support files on disk
315
+ if (!contents && fs.existsSync(source)) {
316
+ contents = fs.readFileSync(source, 'utf8');
317
+ }
318
+
319
+ // Format the line from the original source code like node does
320
+ if (contents) {
321
+ var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1];
322
+ if (code) {
323
+ return '\n' + source + ':' + line + '\n' + code + '\n' +
324
+ new Array(column).join(' ') + '^';
325
+ }
326
+ }
327
+ }
328
+ return null;
329
+ }
330
+
331
+ // Mimic node's stack trace printing when an exception escapes the process
332
+ function handleUncaughtExceptions(error) {
333
+ if (!error || !error.stack) {
334
+ console.log('Uncaught exception:', error);
335
+ } else {
336
+ var source = getErrorSource(error);
337
+ if (source !== null) console.log(source);
338
+ console.log(error.stack);
339
+ }
340
+ process.exit(1);
341
+ }
342
+
343
+ exports.wrapCallSite = wrapCallSite;
344
+ exports.getErrorSource = getErrorSource;
345
+ exports.mapSourcePosition = mapSourcePosition;
346
+ exports.retrieveSourceMap = retrieveSourceMap;
347
+
348
+ exports.install = function(options) {
349
+ if (!alreadyInstalled) {
350
+ alreadyInstalled = true;
351
+ Error.prepareStackTrace = prepareStackTrace;
352
+
353
+ // Configure options
354
+ options = options || {};
355
+ var installHandler = 'handleUncaughtExceptions' in options ?
356
+ options.handleUncaughtExceptions : true;
357
+ emptyCacheBetweenOperations = 'emptyCacheBetweenOperations' in options ?
358
+ options.emptyCacheBetweenOperations : false;
359
+
360
+ // Allow sources to be found by methods other than reading the files
361
+ // directly from disk.
362
+ if (options.retrieveFile)
363
+ retrieveFile = options.retrieveFile;
364
+
365
+ // Allow source maps to be found by methods other than reading the files
366
+ // directly from disk.
367
+ if (options.retrieveSourceMap)
368
+ retrieveSourceMap = options.retrieveSourceMap;
369
+
370
+ // Provide the option to not install the uncaught exception handler. This is
371
+ // to support other uncaught exception handlers (in test frameworks, for
372
+ // example). If this handler is not installed and there are no other uncaught
373
+ // exception handlers, uncaught exceptions will be caught by node's built-in
374
+ // exception handler and the process will still be terminated. However, the
375
+ // generated JavaScript code will be shown above the stack trace instead of
376
+ // the original source code.
377
+ if (installHandler && !isInBrowser()) {
378
+ process.on('uncaughtException', handleUncaughtExceptions);
379
+ }
380
+ }
381
+ };