coffeecake 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1336) hide show
  1. data/.gitignore +17 -0
  2. data/Gemfile +4 -0
  3. data/README.markdown +28 -0
  4. data/Rakefile +2 -0
  5. data/bin/ck +16 -0
  6. data/coffeecake.gemspec +21 -0
  7. data/lib/coffeecake.rb +4 -0
  8. data/lib/coffeecake/generators.rb +12 -0
  9. data/lib/coffeecake/generators/new_generator.rb +55 -0
  10. data/lib/coffeecake/templates/.gitkeep +0 -0
  11. data/lib/coffeecake/templates/README.markdown +56 -0
  12. data/lib/coffeecake/templates/SpecHelper.tt +0 -0
  13. data/lib/coffeecake/templates/docs_readme +5 -0
  14. data/lib/coffeecake/templates/jasmine.tt +18 -0
  15. data/lib/coffeecake/templates/lib.tt +3 -0
  16. data/lib/coffeecake/templates/spec.tt +3 -0
  17. data/lib/coffeecake/version.rb +3 -0
  18. data/lib/thor_register_patch.rb +16 -0
  19. data/node_modules/.bin/cake +7 -0
  20. data/node_modules/.bin/coffee +7 -0
  21. data/node_modules/.bin/docco +8 -0
  22. data/node_modules/.bin/jasmine +26 -0
  23. data/node_modules/.bin/jasmine-node +7 -0
  24. data/node_modules/.bin/uglifycss +127 -0
  25. data/node_modules/.bin/uglifyjs +317 -0
  26. data/node_modules/coffee-script/.npmignore +11 -0
  27. data/node_modules/coffee-script/LICENSE +22 -0
  28. data/node_modules/coffee-script/README +51 -0
  29. data/node_modules/coffee-script/Rakefile +78 -0
  30. data/node_modules/coffee-script/bin/cake +7 -0
  31. data/node_modules/coffee-script/bin/coffee +7 -0
  32. data/node_modules/coffee-script/extras/jsl.conf +44 -0
  33. data/node_modules/coffee-script/lib/coffee-script/browser.js +74 -0
  34. data/node_modules/coffee-script/lib/coffee-script/cake.js +89 -0
  35. data/node_modules/coffee-script/lib/coffee-script/coffee-script.js +148 -0
  36. data/node_modules/coffee-script/lib/coffee-script/command.js +310 -0
  37. data/node_modules/coffee-script/lib/coffee-script/grammar.js +588 -0
  38. data/node_modules/coffee-script/lib/coffee-script/helpers.js +72 -0
  39. data/node_modules/coffee-script/lib/coffee-script/index.js +10 -0
  40. data/node_modules/coffee-script/lib/coffee-script/lexer.js +687 -0
  41. data/node_modules/coffee-script/lib/coffee-script/nodes.js +2481 -0
  42. data/node_modules/coffee-script/lib/coffee-script/optparse.js +122 -0
  43. data/node_modules/coffee-script/lib/coffee-script/parser.js +670 -0
  44. data/node_modules/coffee-script/lib/coffee-script/repl.js +149 -0
  45. data/node_modules/coffee-script/lib/coffee-script/rewriter.js +288 -0
  46. data/node_modules/coffee-script/lib/coffee-script/scope.js +124 -0
  47. data/node_modules/coffee-script/npm-install-45965.sh +282 -0
  48. data/node_modules/coffee-script/package.json +31 -0
  49. data/node_modules/docco/.gitignore +3 -0
  50. data/node_modules/docco/Cakefile +27 -0
  51. data/node_modules/docco/README +13 -0
  52. data/node_modules/docco/bin/docco +8 -0
  53. data/node_modules/docco/index.html +143 -0
  54. data/node_modules/docco/lib/docco.js +155 -0
  55. data/node_modules/docco/package.json +21 -0
  56. data/node_modules/docco/resources/docco.css +186 -0
  57. data/node_modules/docco/resources/docco.jst +58 -0
  58. data/node_modules/docco/src/docco.coffee +204 -0
  59. data/node_modules/docco/vendor/showdown.js +1298 -0
  60. data/node_modules/jasmine-jquery/.gitignore +3 -0
  61. data/node_modules/jasmine-jquery/MIT.LICENSE +20 -0
  62. data/node_modules/jasmine-jquery/README.markdown +174 -0
  63. data/node_modules/jasmine-jquery/SpecRunner.html +24 -0
  64. data/node_modules/jasmine-jquery/index.js +15 -0
  65. data/node_modules/jasmine-jquery/lib/jasmine-jquery.js +288 -0
  66. data/node_modules/jasmine-jquery/package.json +19 -0
  67. data/node_modules/jasmine-jquery/spec/fixtures/real_non_mocked_fixture.html +1 -0
  68. data/node_modules/jasmine-jquery/spec/suites/jasmine-jquery-spec.js +691 -0
  69. data/node_modules/jasmine-node/.gitignore +10 -0
  70. data/node_modules/jasmine-node/LICENSE +22 -0
  71. data/node_modules/jasmine-node/README.md +35 -0
  72. data/node_modules/jasmine-node/bin/jasmine-node +7 -0
  73. data/node_modules/jasmine-node/lib/jasmine-node/cli.js +110 -0
  74. data/node_modules/jasmine-node/lib/jasmine-node/index.js +171 -0
  75. data/node_modules/jasmine-node/lib/jasmine-node/jasmine-2.0.0.rc1.js +2479 -0
  76. data/node_modules/jasmine-node/lib/jasmine-node/reporter.js +177 -0
  77. data/node_modules/jasmine-node/package.json +22 -0
  78. data/node_modules/jasmine-node/spec/CoffeeSpec.coffee +4 -0
  79. data/node_modules/jasmine-node/spec/SampleSpecs.js +15 -0
  80. data/node_modules/jasmine-node/spec/TestSpec.js +5 -0
  81. data/node_modules/jasmine-node/spec/helper_spec.js +7 -0
  82. data/node_modules/jasmine-node/spec/include/include_spec.js +7 -0
  83. data/node_modules/jasmine-node/spec/include/lib/test.js +3 -0
  84. data/node_modules/jasmine-node/spec/nested.js/NestedSpec.js +5 -0
  85. data/node_modules/jasmine-node/spec/nested/NestedSpec.js +5 -0
  86. data/node_modules/jasmine-node/spec/nested/uber-nested/UberNestedSpec.js +11 -0
  87. data/node_modules/jasmine-node/spec/sample_helper.js +19 -0
  88. data/node_modules/jasmine-node/specs.sh +2 -0
  89. data/node_modules/jasmine-reporters/.gitignore +1 -0
  90. data/node_modules/jasmine-reporters/.gitmodules +3 -0
  91. data/node_modules/jasmine-reporters/LICENSE +21 -0
  92. data/node_modules/jasmine-reporters/README.markdown +52 -0
  93. data/node_modules/jasmine-reporters/ext/env.rhino.1.2.js +13989 -0
  94. data/node_modules/jasmine-reporters/ext/jasmine-html.js +182 -0
  95. data/node_modules/jasmine-reporters/ext/jasmine.css +166 -0
  96. data/node_modules/jasmine-reporters/ext/jasmine.js +2421 -0
  97. data/node_modules/jasmine-reporters/ext/jline.jar +0 -0
  98. data/node_modules/jasmine-reporters/ext/js.jar +0 -0
  99. data/node_modules/jasmine-reporters/ext/phantomjs/.gitignore +10 -0
  100. data/node_modules/jasmine-reporters/ext/phantomjs/ChangeLog +57 -0
  101. data/node_modules/jasmine-reporters/ext/phantomjs/LICENSE.BSD +22 -0
  102. data/node_modules/jasmine-reporters/ext/phantomjs/README.md +28 -0
  103. data/node_modules/jasmine-reporters/ext/phantomjs/examples/arguments.coffee +6 -0
  104. data/node_modules/jasmine-reporters/ext/phantomjs/examples/arguments.js +8 -0
  105. data/node_modules/jasmine-reporters/ext/phantomjs/examples/colorwheel.coffee +45 -0
  106. data/node_modules/jasmine-reporters/ext/phantomjs/examples/colorwheel.js +52 -0
  107. data/node_modules/jasmine-reporters/ext/phantomjs/examples/countdown.coffee +8 -0
  108. data/node_modules/jasmine-reporters/ext/phantomjs/examples/countdown.js +8 -0
  109. data/node_modules/jasmine-reporters/ext/phantomjs/examples/cycle_multiple_urls.js +64 -0
  110. data/node_modules/jasmine-reporters/ext/phantomjs/examples/direction.coffee +28 -0
  111. data/node_modules/jasmine-reporters/ext/phantomjs/examples/direction.js +34 -0
  112. data/node_modules/jasmine-reporters/ext/phantomjs/examples/extract-text.coffee +81 -0
  113. data/node_modules/jasmine-reporters/ext/phantomjs/examples/extract-text.js +121 -0
  114. data/node_modules/jasmine-reporters/ext/phantomjs/examples/fibo.coffee +8 -0
  115. data/node_modules/jasmine-reporters/ext/phantomjs/examples/fibo.js +9 -0
  116. data/node_modules/jasmine-reporters/ext/phantomjs/examples/follow.coffee +36 -0
  117. data/node_modules/jasmine-reporters/ext/phantomjs/examples/follow.js +37 -0
  118. data/node_modules/jasmine-reporters/ext/phantomjs/examples/hello.coffee +2 -0
  119. data/node_modules/jasmine-reporters/ext/phantomjs/examples/hello.js +2 -0
  120. data/node_modules/jasmine-reporters/ext/phantomjs/examples/ipgeocode.coffee +13 -0
  121. data/node_modules/jasmine-reporters/ext/phantomjs/examples/ipgeocode.js +14 -0
  122. data/node_modules/jasmine-reporters/ext/phantomjs/examples/loadspeed.coffee +17 -0
  123. data/node_modules/jasmine-reporters/ext/phantomjs/examples/loadspeed.js +20 -0
  124. data/node_modules/jasmine-reporters/ext/phantomjs/examples/movies.coffee +13 -0
  125. data/node_modules/jasmine-reporters/ext/phantomjs/examples/movies.js +14 -0
  126. data/node_modules/jasmine-reporters/ext/phantomjs/examples/pizza.coffee +10 -0
  127. data/node_modules/jasmine-reporters/ext/phantomjs/examples/pizza.js +12 -0
  128. data/node_modules/jasmine-reporters/ext/phantomjs/examples/rasterize.coffee +21 -0
  129. data/node_modules/jasmine-reporters/ext/phantomjs/examples/rasterize.js +22 -0
  130. data/node_modules/jasmine-reporters/ext/phantomjs/examples/run-jasmine.js +26 -0
  131. data/node_modules/jasmine-reporters/ext/phantomjs/examples/run-qunit.js +24 -0
  132. data/node_modules/jasmine-reporters/ext/phantomjs/examples/seasonfood.coffee +17 -0
  133. data/node_modules/jasmine-reporters/ext/phantomjs/examples/seasonfood.js +19 -0
  134. data/node_modules/jasmine-reporters/ext/phantomjs/examples/technews.coffee +13 -0
  135. data/node_modules/jasmine-reporters/ext/phantomjs/examples/technews.js +14 -0
  136. data/node_modules/jasmine-reporters/ext/phantomjs/examples/tweets.coffee +8 -0
  137. data/node_modules/jasmine-reporters/ext/phantomjs/examples/tweets.js +12 -0
  138. data/node_modules/jasmine-reporters/ext/phantomjs/examples/useragent.coffee +7 -0
  139. data/node_modules/jasmine-reporters/ext/phantomjs/examples/useragent.js +8 -0
  140. data/node_modules/jasmine-reporters/ext/phantomjs/examples/version.coffee +5 -0
  141. data/node_modules/jasmine-reporters/ext/phantomjs/examples/version.js +5 -0
  142. data/node_modules/jasmine-reporters/ext/phantomjs/examples/waitfor.coffee +40 -0
  143. data/node_modules/jasmine-reporters/ext/phantomjs/examples/waitfor.js +43 -0
  144. data/node_modules/jasmine-reporters/ext/phantomjs/examples/weather.coffee +35 -0
  145. data/node_modules/jasmine-reporters/ext/phantomjs/examples/weather.js +42 -0
  146. data/node_modules/jasmine-reporters/ext/phantomjs/phantomjs.pro +3 -0
  147. data/node_modules/jasmine-reporters/ext/phantomjs/python/INSTALL +20 -0
  148. data/node_modules/jasmine-reporters/ext/phantomjs/python/LICENSE +674 -0
  149. data/node_modules/jasmine-reporters/ext/phantomjs/python/README +56 -0
  150. data/node_modules/jasmine-reporters/ext/phantomjs/python/csconverter.py +41 -0
  151. data/node_modules/jasmine-reporters/ext/phantomjs/python/networkaccessmanager.py +84 -0
  152. data/node_modules/jasmine-reporters/ext/phantomjs/python/phantom.py +384 -0
  153. data/node_modules/jasmine-reporters/ext/phantomjs/python/plugincontroller.py +98 -0
  154. data/node_modules/jasmine-reporters/ext/phantomjs/python/plugins/__init__.py +1 -0
  155. data/node_modules/jasmine-reporters/ext/phantomjs/python/pyphantomjs.py +154 -0
  156. data/node_modules/jasmine-reporters/ext/phantomjs/python/resources.py +4160 -0
  157. data/node_modules/jasmine-reporters/ext/phantomjs/python/resources.qrc +6 -0
  158. data/node_modules/jasmine-reporters/ext/phantomjs/python/resources/coffee-script.js +8 -0
  159. data/node_modules/jasmine-reporters/ext/phantomjs/python/resources/pyphantomjs-icon.ico +0 -0
  160. data/node_modules/jasmine-reporters/ext/phantomjs/python/resources/pyphantomjs-icon.png +0 -0
  161. data/node_modules/jasmine-reporters/ext/phantomjs/python/tools/build_resources.sh +14 -0
  162. data/node_modules/jasmine-reporters/ext/phantomjs/python/tools/setup.py +52 -0
  163. data/node_modules/jasmine-reporters/ext/phantomjs/python/utils.py +126 -0
  164. data/node_modules/jasmine-reporters/ext/phantomjs/python/webpage.py +67 -0
  165. data/node_modules/jasmine-reporters/ext/phantomjs/src/coffee-script.js +8 -0
  166. data/node_modules/jasmine-reporters/ext/phantomjs/src/consts.h +39 -0
  167. data/node_modules/jasmine-reporters/ext/phantomjs/src/csconverter.cpp +61 -0
  168. data/node_modules/jasmine-reporters/ext/phantomjs/src/csconverter.h +47 -0
  169. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/config.h +1 -0
  170. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/egif_lib.c +1111 -0
  171. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gif.pri +20 -0
  172. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gif_err.c +120 -0
  173. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gif_hash.c +160 -0
  174. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gif_hash.h +59 -0
  175. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gif_lib.h +336 -0
  176. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gif_lib_private.h +59 -0
  177. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gifalloc.c +443 -0
  178. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gifwriter.cpp +126 -0
  179. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/gifwriter.h +38 -0
  180. data/node_modules/jasmine-reporters/ext/phantomjs/src/gif/quantize.c +330 -0
  181. data/node_modules/jasmine-reporters/ext/phantomjs/src/main.cpp +64 -0
  182. data/node_modules/jasmine-reporters/ext/phantomjs/src/networkaccessmanager.cpp +119 -0
  183. data/node_modules/jasmine-reporters/ext/phantomjs/src/networkaccessmanager.h +53 -0
  184. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantom.cpp +494 -0
  185. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantom.h +117 -0
  186. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs-icon.png +0 -0
  187. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs.pro +32 -0
  188. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs.qrc +7 -0
  189. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs_os2.ico +0 -0
  190. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs_os2.rc +1 -0
  191. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs_win.ico +0 -0
  192. data/node_modules/jasmine-reporters/ext/phantomjs/src/phantomjs_win.rc +1 -0
  193. data/node_modules/jasmine-reporters/ext/phantomjs/src/usage.txt +11 -0
  194. data/node_modules/jasmine-reporters/ext/phantomjs/src/utils.cpp +74 -0
  195. data/node_modules/jasmine-reporters/ext/phantomjs/src/utils.h +50 -0
  196. data/node_modules/jasmine-reporters/ext/phantomjs/src/webpage.cpp +87 -0
  197. data/node_modules/jasmine-reporters/ext/phantomjs/src/webpage.h +61 -0
  198. data/node_modules/jasmine-reporters/package.json +15 -0
  199. data/node_modules/jasmine-reporters/src/jasmine.console_reporter.js +132 -0
  200. data/node_modules/jasmine-reporters/src/jasmine.junit_reporter.js +199 -0
  201. data/node_modules/jasmine-reporters/src/load_reporters.js +2 -0
  202. data/node_modules/jasmine-reporters/test/JUnitXmlReporterSpec.js +214 -0
  203. data/node_modules/jasmine-reporters/test/console_reporter.html +36 -0
  204. data/node_modules/jasmine-reporters/test/envjs.bootstrap.js +14 -0
  205. data/node_modules/jasmine-reporters/test/envjs.runner.sh +7 -0
  206. data/node_modules/jasmine-reporters/test/junit_xml_reporter.html +23 -0
  207. data/node_modules/jasmine-reporters/test/phantomjs-testrunner.js +39 -0
  208. data/node_modules/jasmine-reporters/test/phantomjs.runner.sh +30 -0
  209. data/node_modules/jasmine-reporters/test/pyphantomjs-plugins/saveToFile/__init__.py +1 -0
  210. data/node_modules/jasmine-reporters/test/pyphantomjs-plugins/saveToFile/saveToFile.py +46 -0
  211. data/node_modules/jasmine-runner/README.md +42 -0
  212. data/node_modules/jasmine-runner/TODO.md +16 -0
  213. data/node_modules/jasmine-runner/bin/jasmine +26 -0
  214. data/node_modules/jasmine-runner/lib/ServerRoutes.js +70 -0
  215. data/node_modules/jasmine-runner/lib/TestRunner.js +29 -0
  216. data/node_modules/jasmine-runner/lib/browser.js +14 -0
  217. data/node_modules/jasmine-runner/lib/config.js +21 -0
  218. data/node_modules/jasmine-runner/lib/jasmine-runner.js +83 -0
  219. data/node_modules/jasmine-runner/lib/monitor.js +34 -0
  220. data/node_modules/jasmine-runner/lib/notify.js +48 -0
  221. data/node_modules/jasmine-runner/lib/public/control-frame.js +57 -0
  222. data/node_modules/jasmine-runner/lib/public/jasmine-html.js +188 -0
  223. data/node_modules/jasmine-runner/lib/public/jasmine.css +166 -0
  224. data/node_modules/jasmine-runner/lib/public/jasmine.js +2421 -0
  225. data/node_modules/jasmine-runner/lib/public/jquery-1.4.3.js +166 -0
  226. data/node_modules/jasmine-runner/lib/public/json2.js +482 -0
  227. data/node_modules/jasmine-runner/lib/public/run.js +6 -0
  228. data/node_modules/jasmine-runner/lib/reporters.js +31 -0
  229. data/node_modules/jasmine-runner/lib/server-worker.js +18 -0
  230. data/node_modules/jasmine-runner/lib/server.js +27 -0
  231. data/node_modules/jasmine-runner/lib/template/jasmine.json +18 -0
  232. data/node_modules/jasmine-runner/lib/template/public/javascript/Player.js +22 -0
  233. data/node_modules/jasmine-runner/lib/template/public/javascript/Song.js +7 -0
  234. data/node_modules/jasmine-runner/lib/template/spec/PlayerSpec.coffee +45 -0
  235. data/node_modules/jasmine-runner/lib/template/spec/PlayerSpec.js +58 -0
  236. data/node_modules/jasmine-runner/lib/template/spec/SpecHelper.js +9 -0
  237. data/node_modules/jasmine-runner/lib/testserver.js +26 -0
  238. data/node_modules/jasmine-runner/lib/views/control-frame.jade +7 -0
  239. data/node_modules/jasmine-runner/lib/views/index.jade +18 -0
  240. data/node_modules/jasmine-runner/node_modules/.bin/cake +7 -0
  241. data/node_modules/jasmine-runner/node_modules/.bin/coffee +7 -0
  242. data/node_modules/jasmine-runner/node_modules/.bin/express +451 -0
  243. data/node_modules/jasmine-runner/node_modules/.bin/jade +92 -0
  244. data/node_modules/jasmine-runner/node_modules/.bin/vows +421 -0
  245. data/node_modules/jasmine-runner/node_modules/coffee-script/.npmignore +11 -0
  246. data/node_modules/jasmine-runner/node_modules/coffee-script/LICENSE +22 -0
  247. data/node_modules/jasmine-runner/node_modules/coffee-script/README +47 -0
  248. data/node_modules/jasmine-runner/node_modules/coffee-script/Rakefile +78 -0
  249. data/node_modules/jasmine-runner/node_modules/coffee-script/bin/cake +7 -0
  250. data/node_modules/jasmine-runner/node_modules/coffee-script/bin/coffee +7 -0
  251. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/browser.js +52 -0
  252. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/cake.js +76 -0
  253. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/coffee-script.js +82 -0
  254. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/command.js +269 -0
  255. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/grammar.js +586 -0
  256. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/helpers.js +66 -0
  257. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/index.js +8 -0
  258. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/lexer.js +638 -0
  259. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/nodes.js +2181 -0
  260. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/optparse.js +111 -0
  261. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/parser.js +656 -0
  262. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/repl.js +47 -0
  263. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/rewriter.js +353 -0
  264. data/node_modules/jasmine-runner/node_modules/coffee-script/lib/scope.js +120 -0
  265. data/node_modules/jasmine-runner/node_modules/coffee-script/package.json +22 -0
  266. data/node_modules/jasmine-runner/node_modules/colors/MIT-LICENSE.txt +20 -0
  267. data/node_modules/jasmine-runner/node_modules/colors/ReadMe.md +30 -0
  268. data/node_modules/jasmine-runner/node_modules/colors/colors.js +75 -0
  269. data/node_modules/jasmine-runner/node_modules/colors/example.js +6 -0
  270. data/node_modules/jasmine-runner/node_modules/colors/package.json +14 -0
  271. data/node_modules/jasmine-runner/node_modules/express/.npmignore +7 -0
  272. data/node_modules/jasmine-runner/node_modules/express/History.md +630 -0
  273. data/node_modules/jasmine-runner/node_modules/express/LICENSE +22 -0
  274. data/node_modules/jasmine-runner/node_modules/express/Makefile +39 -0
  275. data/node_modules/jasmine-runner/node_modules/express/Readme.md +102 -0
  276. data/node_modules/jasmine-runner/node_modules/express/bin/express +451 -0
  277. data/node_modules/jasmine-runner/node_modules/express/index.js +2 -0
  278. data/node_modules/jasmine-runner/node_modules/express/lib/express.js +78 -0
  279. data/node_modules/jasmine-runner/node_modules/express/lib/http.js +503 -0
  280. data/node_modules/jasmine-runner/node_modules/express/lib/https.js +52 -0
  281. data/node_modules/jasmine-runner/node_modules/express/lib/request.js +289 -0
  282. data/node_modules/jasmine-runner/node_modules/express/lib/response.js +423 -0
  283. data/node_modules/jasmine-runner/node_modules/express/lib/router/index.js +329 -0
  284. data/node_modules/jasmine-runner/node_modules/express/lib/router/methods.js +70 -0
  285. data/node_modules/jasmine-runner/node_modules/express/lib/router/route.js +71 -0
  286. data/node_modules/jasmine-runner/node_modules/express/lib/utils.js +122 -0
  287. data/node_modules/jasmine-runner/node_modules/express/lib/view.js +413 -0
  288. data/node_modules/jasmine-runner/node_modules/express/lib/view/partial.js +40 -0
  289. data/node_modules/jasmine-runner/node_modules/express/lib/view/view.js +206 -0
  290. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/.npmignore +11 -0
  291. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/LICENSE +24 -0
  292. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/index.js +2 -0
  293. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/cache.js +81 -0
  294. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/connect.js +106 -0
  295. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/http.js +215 -0
  296. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/https.js +47 -0
  297. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/index.js +46 -0
  298. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/basicAuth.js +93 -0
  299. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js +92 -0
  300. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/compiler.js +163 -0
  301. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/cookieParser.js +46 -0
  302. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/csrf.js +105 -0
  303. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/directory.js +222 -0
  304. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/errorHandler.js +100 -0
  305. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/favicon.js +76 -0
  306. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/limit.js +82 -0
  307. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/logger.js +299 -0
  308. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js +38 -0
  309. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/profiler.js +100 -0
  310. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/query.js +40 -0
  311. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/responseTime.js +34 -0
  312. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/router.js +379 -0
  313. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/session.js +346 -0
  314. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/session/cookie.js +126 -0
  315. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/session/memory.js +131 -0
  316. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/session/session.js +137 -0
  317. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/session/store.js +87 -0
  318. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/static.js +225 -0
  319. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/staticCache.js +175 -0
  320. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/middleware/vhost.js +44 -0
  321. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/patch.js +79 -0
  322. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/directory.html +75 -0
  323. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/error.html +13 -0
  324. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/favicon.ico +0 -0
  325. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page.png +0 -0
  326. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_add.png +0 -0
  327. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_attach.png +0 -0
  328. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_code.png +0 -0
  329. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_copy.png +0 -0
  330. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_delete.png +0 -0
  331. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_edit.png +0 -0
  332. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_error.png +0 -0
  333. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_excel.png +0 -0
  334. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_find.png +0 -0
  335. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_gear.png +0 -0
  336. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_go.png +0 -0
  337. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_green.png +0 -0
  338. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_key.png +0 -0
  339. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_lightning.png +0 -0
  340. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_link.png +0 -0
  341. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_paintbrush.png +0 -0
  342. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_paste.png +0 -0
  343. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_red.png +0 -0
  344. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_refresh.png +0 -0
  345. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_save.png +0 -0
  346. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white.png +0 -0
  347. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_acrobat.png +0 -0
  348. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_actionscript.png +0 -0
  349. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_add.png +0 -0
  350. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_c.png +0 -0
  351. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_camera.png +0 -0
  352. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_cd.png +0 -0
  353. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_code.png +0 -0
  354. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_code_red.png +0 -0
  355. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_coldfusion.png +0 -0
  356. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_compressed.png +0 -0
  357. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_copy.png +0 -0
  358. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_cplusplus.png +0 -0
  359. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_csharp.png +0 -0
  360. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_cup.png +0 -0
  361. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_database.png +0 -0
  362. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_delete.png +0 -0
  363. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_dvd.png +0 -0
  364. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_edit.png +0 -0
  365. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_error.png +0 -0
  366. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_excel.png +0 -0
  367. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_find.png +0 -0
  368. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_flash.png +0 -0
  369. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_freehand.png +0 -0
  370. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_gear.png +0 -0
  371. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_get.png +0 -0
  372. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_go.png +0 -0
  373. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_h.png +0 -0
  374. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_horizontal.png +0 -0
  375. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_key.png +0 -0
  376. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_lightning.png +0 -0
  377. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_link.png +0 -0
  378. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_magnify.png +0 -0
  379. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_medal.png +0 -0
  380. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_office.png +0 -0
  381. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_paint.png +0 -0
  382. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_paintbrush.png +0 -0
  383. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_paste.png +0 -0
  384. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_php.png +0 -0
  385. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_picture.png +0 -0
  386. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_powerpoint.png +0 -0
  387. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_put.png +0 -0
  388. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_ruby.png +0 -0
  389. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_stack.png +0 -0
  390. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_star.png +0 -0
  391. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_swoosh.png +0 -0
  392. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_text.png +0 -0
  393. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_text_width.png +0 -0
  394. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_tux.png +0 -0
  395. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_vector.png +0 -0
  396. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_visualstudio.png +0 -0
  397. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_width.png +0 -0
  398. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_word.png +0 -0
  399. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_world.png +0 -0
  400. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_wrench.png +0 -0
  401. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_white_zip.png +0 -0
  402. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_word.png +0 -0
  403. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/icons/page_world.png +0 -0
  404. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/public/style.css +141 -0
  405. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/lib/utils.js +451 -0
  406. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/package.json +24 -0
  407. data/node_modules/jasmine-runner/node_modules/express/node_modules/connect/test.js +11 -0
  408. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/LICENSE +19 -0
  409. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/README.md +50 -0
  410. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/mime.js +92 -0
  411. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/package.json +22 -0
  412. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/test.js +79 -0
  413. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/types/mime.types +1479 -0
  414. data/node_modules/jasmine-runner/node_modules/express/node_modules/mime/types/node.types +43 -0
  415. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/.gitignore +1 -0
  416. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/.gitmodules +6 -0
  417. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/History.md +57 -0
  418. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/Makefile +7 -0
  419. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/Readme.md +49 -0
  420. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/benchmark.js +17 -0
  421. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/examples.js +48 -0
  422. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/index.js +2 -0
  423. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/lib/querystring.js +236 -0
  424. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/package.json +16 -0
  425. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/test/parse.test.js +156 -0
  426. data/node_modules/jasmine-runner/node_modules/express/node_modules/qs/test/stringify.test.js +95 -0
  427. data/node_modules/jasmine-runner/node_modules/express/package.json +22 -0
  428. data/node_modules/jasmine-runner/node_modules/growl/History.md +10 -0
  429. data/node_modules/jasmine-runner/node_modules/growl/Readme.md +74 -0
  430. data/node_modules/jasmine-runner/node_modules/growl/lib/growl.js +80 -0
  431. data/node_modules/jasmine-runner/node_modules/growl/package.json +6 -0
  432. data/node_modules/jasmine-runner/node_modules/growl/seed.yml +4 -0
  433. data/node_modules/jasmine-runner/node_modules/growl/test.js +17 -0
  434. data/node_modules/jasmine-runner/node_modules/jade/.gitignore +3 -0
  435. data/node_modules/jasmine-runner/node_modules/jade/.gitmodules +21 -0
  436. data/node_modules/jasmine-runner/node_modules/jade/.npmignore +4 -0
  437. data/node_modules/jasmine-runner/node_modules/jade/CNAME +1 -0
  438. data/node_modules/jasmine-runner/node_modules/jade/History.md +163 -0
  439. data/node_modules/jasmine-runner/node_modules/jade/LICENSE +22 -0
  440. data/node_modules/jasmine-runner/node_modules/jade/Makefile +25 -0
  441. data/node_modules/jasmine-runner/node_modules/jade/Readme.md +408 -0
  442. data/node_modules/jasmine-runner/node_modules/jade/api.html +850 -0
  443. data/node_modules/jasmine-runner/node_modules/jade/bin/jade +92 -0
  444. data/node_modules/jasmine-runner/node_modules/jade/index.js +2 -0
  445. data/node_modules/jasmine-runner/node_modules/jade/lib/compiler.js +273 -0
  446. data/node_modules/jasmine-runner/node_modules/jade/lib/doctypes.js +18 -0
  447. data/node_modules/jasmine-runner/node_modules/jade/lib/filters.js +70 -0
  448. data/node_modules/jasmine-runner/node_modules/jade/lib/index.js +314 -0
  449. data/node_modules/jasmine-runner/node_modules/jade/lib/jade.js +314 -0
  450. data/node_modules/jasmine-runner/node_modules/jade/lib/lexer.js +359 -0
  451. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/block.js +29 -0
  452. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/code.js +35 -0
  453. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/comment.js +32 -0
  454. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/doctype.js +29 -0
  455. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/each.js +35 -0
  456. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/filter.js +33 -0
  457. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/index.js +16 -0
  458. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/node.js +20 -0
  459. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/tag.js +80 -0
  460. data/node_modules/jasmine-runner/node_modules/jade/lib/nodes/text.js +29 -0
  461. data/node_modules/jasmine-runner/node_modules/jade/lib/parser.js +358 -0
  462. data/node_modules/jasmine-runner/node_modules/jade/lib/self-closing.js +17 -0
  463. data/node_modules/jasmine-runner/node_modules/jade/lib/utils.js +49 -0
  464. data/node_modules/jasmine-runner/node_modules/jade/package.json +9 -0
  465. data/node_modules/jasmine-runner/node_modules/libnotify/.gitignore +2 -0
  466. data/node_modules/jasmine-runner/node_modules/libnotify/README.md +59 -0
  467. data/node_modules/jasmine-runner/node_modules/libnotify/lib/libnotify.js +72 -0
  468. data/node_modules/jasmine-runner/node_modules/libnotify/package.json +11 -0
  469. data/node_modules/jasmine-runner/node_modules/libnotify/seed.yml +5 -0
  470. data/node_modules/jasmine-runner/node_modules/libnotify/test.js +5 -0
  471. data/node_modules/jasmine-runner/node_modules/socket.io/.gitignore +8 -0
  472. data/node_modules/jasmine-runner/node_modules/socket.io/Makefile +10 -0
  473. data/node_modules/jasmine-runner/node_modules/socket.io/README.md +218 -0
  474. data/node_modules/jasmine-runner/node_modules/socket.io/example/chat.html +61 -0
  475. data/node_modules/jasmine-runner/node_modules/socket.io/example/json.js +18 -0
  476. data/node_modules/jasmine-runner/node_modules/socket.io/example/server.js +58 -0
  477. data/node_modules/jasmine-runner/node_modules/socket.io/index.js +1 -0
  478. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/client.js +191 -0
  479. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/index.js +4 -0
  480. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/listener.js +166 -0
  481. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/transports/flashsocket.js +44 -0
  482. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/transports/htmlfile.js +45 -0
  483. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/transports/jsonp-polling.js +32 -0
  484. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/transports/websocket.js +137 -0
  485. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/transports/xhr-multipart.js +63 -0
  486. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/transports/xhr-polling.js +75 -0
  487. data/node_modules/jasmine-runner/node_modules/socket.io/lib/socket.io/utils.js +52 -0
  488. data/node_modules/jasmine-runner/node_modules/socket.io/package.json +17 -0
  489. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/.gitignore +3 -0
  490. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/.gitmodules +3 -0
  491. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/History.md +97 -0
  492. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/Makefile +53 -0
  493. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/Readme.md +39 -0
  494. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/bin/expresso +837 -0
  495. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/COPYING +339 -0
  496. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/Makefile.am +81 -0
  497. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/Makefile.in +884 -0
  498. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/Readme.md +8 -0
  499. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/aclocal.m4 +872 -0
  500. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/config.guess +1526 -0
  501. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/config.h.in +92 -0
  502. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/config.rpath +666 -0
  503. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/config.sub +1658 -0
  504. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/configure +7971 -0
  505. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/configure.ac +88 -0
  506. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/depcomp +589 -0
  507. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/encoding.c +315 -0
  508. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/encoding.h +33 -0
  509. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/generate-resources.c +58 -0
  510. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/global.h +29 -0
  511. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/highlight.c +478 -0
  512. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/highlight.h +37 -0
  513. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-connection.c +192 -0
  514. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-exchange.c +494 -0
  515. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-host.c +95 -0
  516. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-message.c +900 -0
  517. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-server.c +236 -0
  518. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-server.h +208 -0
  519. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/http-url.c +156 -0
  520. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/install-sh +519 -0
  521. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/instrument-js.cpp +1873 -0
  522. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/instrument-js.h +81 -0
  523. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/instrument.c +226 -0
  524. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/instrument.h +31 -0
  525. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/GNUmakefile +15 -0
  526. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/Makefile.ref +483 -0
  527. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/README.html +54 -0
  528. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/SpiderMonkey.rsp +11 -0
  529. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/aclocal.m4 +9 -0
  530. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/bench.sh +5 -0
  531. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/builtins.tbl +98 -0
  532. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config.mk +206 -0
  533. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/Makefile.in +106 -0
  534. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/Moz/Milestone.pm +232 -0
  535. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/autoconf.mk.in +349 -0
  536. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/check-sync-dirs.py +108 -0
  537. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/check-sync-exceptions +6 -0
  538. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/config.mk +884 -0
  539. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/fastcwd.pl +66 -0
  540. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/gcc_hidden.h +2 -0
  541. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/insure.mk +53 -0
  542. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/make-system-wrappers.pl +59 -0
  543. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/milestone.pl +112 -0
  544. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/milestone.txt +13 -0
  545. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/Makefile.in +84 -0
  546. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/cppsetup.c +233 -0
  547. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/def.h +184 -0
  548. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/ifparser.c +549 -0
  549. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/ifparser.h +83 -0
  550. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/imakemdep.h +733 -0
  551. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/include.c +337 -0
  552. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/main.c +860 -0
  553. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/mkdepend.man +382 -0
  554. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/parse.c +686 -0
  555. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/mkdepend/pr.c +124 -0
  556. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/nfspwd.pl +50 -0
  557. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/nsinstall.c +481 -0
  558. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/nsinstall.py +139 -0
  559. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/pathsub.c +247 -0
  560. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/pathsub.h +74 -0
  561. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/preprocessor.pl +671 -0
  562. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/revdepth-nt.pl +48 -0
  563. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/revdepth.pl +51 -0
  564. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/rules.mk +2269 -0
  565. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/system-headers +1038 -0
  566. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/version.mk +85 -0
  567. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/config/version_win.pl +423 -0
  568. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/dtoa.c +3321 -0
  569. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/Makefile.ref +143 -0
  570. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/README +83 -0
  571. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/editline.3 +175 -0
  572. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/editline.c +1368 -0
  573. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/editline.h +135 -0
  574. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/sysunix.c +182 -0
  575. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/editline/unix.h +82 -0
  576. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/javascript-trace.d +73 -0
  577. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jitstats.tbl +52 -0
  578. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/js-config.h.in +55 -0
  579. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/js-config.in +111 -0
  580. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/js.cpp +4050 -0
  581. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/js.mdp +0 -0
  582. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/js.msg +309 -0
  583. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/js3240.rc +79 -0
  584. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsOS240.def +654 -0
  585. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsapi.cpp +6060 -0
  586. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsapi.h +2699 -0
  587. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsarena.cpp +450 -0
  588. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsarena.h +318 -0
  589. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsarray.cpp +3426 -0
  590. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsarray.h +191 -0
  591. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsatom.cpp +1064 -0
  592. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsatom.h +458 -0
  593. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsbit.h +253 -0
  594. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsbool.cpp +182 -0
  595. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsbool.h +75 -0
  596. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsbuiltins.cpp +497 -0
  597. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsbuiltins.h +374 -0
  598. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsclist.h +139 -0
  599. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jscntxt.cpp +1394 -0
  600. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jscntxt.h +1247 -0
  601. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jscompat.h +57 -0
  602. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsconfig.mk +181 -0
  603. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jscpucfg.cpp +388 -0
  604. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jscpucfg.h +212 -0
  605. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdate.cpp +2475 -0
  606. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdate.h +124 -0
  607. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdbgapi.cpp +1954 -0
  608. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdbgapi.h +500 -0
  609. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdhash.cpp +876 -0
  610. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdhash.h +588 -0
  611. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdtoa.cpp +572 -0
  612. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdtoa.h +131 -0
  613. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdtracef.c +318 -0
  614. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsdtracef.h +81 -0
  615. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsemit.cpp +6857 -0
  616. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsemit.h +777 -0
  617. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsexn.cpp +1376 -0
  618. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsexn.h +96 -0
  619. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsfile.cpp +2736 -0
  620. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsfile.h +56 -0
  621. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsfile.msg +90 -0
  622. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsfun.cpp +2706 -0
  623. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsfun.h +296 -0
  624. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsgc.cpp +3763 -0
  625. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsgc.h +427 -0
  626. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jshash.cpp +476 -0
  627. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jshash.h +151 -0
  628. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsify.pl +483 -0
  629. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsinterp.cpp +7225 -0
  630. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsinterp.h +591 -0
  631. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsinvoke.cpp +42 -0
  632. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsiter.cpp +1050 -0
  633. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsiter.h +140 -0
  634. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jskeyword.tbl +124 -0
  635. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jskwgen.cpp +460 -0
  636. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslibmath.h +69 -0
  637. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslock.cpp +1417 -0
  638. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslock.h +311 -0
  639. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslocko.asm +60 -0
  640. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslog2.cpp +94 -0
  641. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslong.cpp +264 -0
  642. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jslong.h +412 -0
  643. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsmath.cpp +721 -0
  644. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsmath.h +63 -0
  645. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsnum.cpp +1338 -0
  646. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsnum.h +287 -0
  647. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsobj.cpp +5563 -0
  648. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsobj.h +735 -0
  649. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/json.cpp +954 -0
  650. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/json.h +107 -0
  651. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsopcode.cpp +5304 -0
  652. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsopcode.h +404 -0
  653. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsopcode.tbl +557 -0
  654. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsoplengen.cpp +121 -0
  655. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsotypes.h +202 -0
  656. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsparse.cpp +6822 -0
  657. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsparse.h +508 -0
  658. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsprf.cpp +1262 -0
  659. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsprf.h +150 -0
  660. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsproto.tbl +129 -0
  661. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsprvtd.h +263 -0
  662. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jspubtd.h +727 -0
  663. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsregexp.cpp +4772 -0
  664. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsregexp.h +192 -0
  665. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsreops.tbl +145 -0
  666. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsscan.cpp +2017 -0
  667. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsscan.h +389 -0
  668. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsscope.cpp +1955 -0
  669. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsscope.h +419 -0
  670. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsscript.cpp +1891 -0
  671. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsscript.h +330 -0
  672. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsshell.msg +51 -0
  673. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsstaticcheck.h +57 -0
  674. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsstddef.h +87 -0
  675. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsstr.cpp +5347 -0
  676. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsstr.h +662 -0
  677. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jstracer.cpp +8276 -0
  678. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jstracer.h +552 -0
  679. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jstypes.h +490 -0
  680. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsutil.cpp +345 -0
  681. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsutil.h +168 -0
  682. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsversion.h +243 -0
  683. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsxdrapi.cpp +800 -0
  684. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsxdrapi.h +220 -0
  685. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsxml.cpp +8343 -0
  686. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/jsxml.h +298 -0
  687. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/lock_SunOS.s +119 -0
  688. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/plify_jsdhash.sed +35 -0
  689. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/prmjtime.cpp +846 -0
  690. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/prmjtime.h +103 -0
  691. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/AIX4.1.mk +65 -0
  692. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/AIX4.2.mk +64 -0
  693. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/AIX4.3.mk +65 -0
  694. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Cygwin.mk +14 -0
  695. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Darwin.mk +85 -0
  696. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Darwin1.3.mk +81 -0
  697. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Darwin1.4.mk +41 -0
  698. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Darwin5.2.mk +81 -0
  699. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Darwin5.3.mk +81 -0
  700. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Darwin64.mk +72 -0
  701. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/HP-UXB.10.10.mk +77 -0
  702. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/HP-UXB.10.20.mk +77 -0
  703. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/HP-UXB.11.00.mk +80 -0
  704. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/IRIX.mk +87 -0
  705. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/IRIX5.3.mk +44 -0
  706. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/IRIX6.1.mk +44 -0
  707. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/IRIX6.2.mk +44 -0
  708. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/IRIX6.3.mk +44 -0
  709. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/IRIX6.5.mk +44 -0
  710. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Linux_All.mk +105 -0
  711. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/MSYS.mk +7 -0
  712. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/Mac_OS10.0.mk +82 -0
  713. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/OSF1V4.0.mk +72 -0
  714. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/OSF1V5.0.mk +69 -0
  715. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS4.1.4.mk +101 -0
  716. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.10.mk +50 -0
  717. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.3.mk +91 -0
  718. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.4.mk +92 -0
  719. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.5.1.mk +44 -0
  720. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.5.mk +87 -0
  721. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.6.mk +89 -0
  722. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.7.mk +44 -0
  723. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.8.mk +44 -0
  724. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/SunOS5.9.mk +44 -0
  725. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/WINNT4.0.mk +118 -0
  726. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/WINNT5.0.mk +118 -0
  727. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/WINNT5.1.mk +118 -0
  728. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/WINNT5.2.mk +118 -0
  729. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/WINNT6.0.mk +118 -0
  730. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/ref-config/dgux.mk +64 -0
  731. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/resource.h +15 -0
  732. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/rules.mk +206 -0
  733. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/time.sh +13 -0
  734. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/js/win32.order +384 -0
  735. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-help.txt +12 -0
  736. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-highlight.css +38 -0
  737. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-ie.css +89 -0
  738. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-overlay.js +211 -0
  739. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-server-help.txt +17 -0
  740. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-server.1 +79 -0
  741. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-server.c +1307 -0
  742. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage-throbber.gif +0 -0
  743. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.1 +52 -0
  744. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.c +142 -0
  745. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.css +328 -0
  746. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.html +125 -0
  747. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.js +1024 -0
  748. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.jsm +22 -0
  749. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.manifest +2 -0
  750. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/jscoverage.xul +36 -0
  751. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/m4/iconv.m4 +180 -0
  752. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/m4/lib-ld.m4 +110 -0
  753. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/m4/lib-link.m4 +709 -0
  754. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/m4/lib-prefix.m4 +185 -0
  755. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/make-bin-dist.sh.in +24 -0
  756. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/make-dist.sh.in +43 -0
  757. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/missing +367 -0
  758. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/report.js +76 -0
  759. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/resource-manager.c +59 -0
  760. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/resource-manager.h +46 -0
  761. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/stream.c +129 -0
  762. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/stream.h +57 -0
  763. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/Makefile.am +130 -0
  764. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/Makefile.in +846 -0
  765. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/asprintf.c +42 -0
  766. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/asprintf.sh +19 -0
  767. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/charset.sh +110 -0
  768. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/chunked.sh +74 -0
  769. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/common.sh +7 -0
  770. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/destination-is-existing-directory.expected.err +2 -0
  771. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/destination-is-file.expected.err +2 -0
  772. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/encoding-requires-argument.expected.err +2 -0
  773. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/encodings.c +223 -0
  774. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/encodings.sh +19 -0
  775. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/exclude-requires-argument.expected.err +2 -0
  776. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/fatal.sh +110 -0
  777. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/gethostbyname.c +53 -0
  778. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/gethostbyname.sh +25 -0
  779. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/help.sh +35 -0
  780. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-client-bad-body.c +98 -0
  781. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-client-bad-url.c +77 -0
  782. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-client-close-after-request.c +57 -0
  783. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-server-bad-body.c +97 -0
  784. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-server-bad-headers.c +97 -0
  785. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-server-charset.c +144 -0
  786. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-server-chunked.c +196 -0
  787. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/http-server-close-immediately.c +60 -0
  788. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/invalid-option.expected.err +2 -0
  789. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/invalid-option.sh +29 -0
  790. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-ignore.expected/ignore.js +106 -0
  791. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-ignore.sh +28 -0
  792. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-ignore/ignore.js +44 -0
  793. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-invalid.expected.err +2 -0
  794. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-invalid/javascript-invalid.js +1 -0
  795. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-setter.expected.err +1 -0
  796. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-setter/javascript-setter.js +3 -0
  797. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-utf-8.expected/javascript-utf-8.js +15 -0
  798. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-utf-8.sh +43 -0
  799. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-utf-8/javascript-utf-8.js +2 -0
  800. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-xml.expected.err +1 -0
  801. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript-xml/javascript-xml.js +8 -0
  802. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-array-comprehension.js +32 -0
  803. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-assign.js +51 -0
  804. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-colon.js +24 -0
  805. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-comma.js +12 -0
  806. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-cr.js +12 -0
  807. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-crlf.js +12 -0
  808. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-debugger.js +21 -0
  809. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-dec.js +15 -0
  810. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-delete.js +12 -0
  811. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-destructuring.js +96 -0
  812. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-do.js +28 -0
  813. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-dot.js +30 -0
  814. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-empty.js +9 -0
  815. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-for.js +51 -0
  816. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-foreach.js +16 -0
  817. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-function.js +79 -0
  818. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-generator-expression.js +45 -0
  819. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-generator.js +32 -0
  820. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-getter-setter.js +31 -0
  821. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-hook.js +15 -0
  822. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-if.js +71 -0
  823. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-in.js +19 -0
  824. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-inc.js +15 -0
  825. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-iso-8859-1.js +15 -0
  826. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-lambda.js +14 -0
  827. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-let.js +148 -0
  828. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-lf.js +12 -0
  829. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-new.js +22 -0
  830. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-number.js +57 -0
  831. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-object.js +15 -0
  832. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-op.js +108 -0
  833. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-primary.js +21 -0
  834. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-rb.js +24 -0
  835. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-rc.js +15 -0
  836. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-rp.js +12 -0
  837. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-special-characters.js +30 -0
  838. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-string.js +36 -0
  839. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-switch.js +55 -0
  840. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-throw.js +21 -0
  841. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-try.js +66 -0
  842. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-unaryop.js +27 -0
  843. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-var.js +15 -0
  844. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-while.js +79 -0
  845. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.expected/javascript-with.js +30 -0
  846. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript.sh +53 -0
  847. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-array-comprehension.js +14 -0
  848. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-assign.js +14 -0
  849. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-colon.js +7 -0
  850. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-comma.js +1 -0
  851. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-cr.js +1 -0
  852. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-crlf.js +4 -0
  853. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-debugger.js +6 -0
  854. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-dec.js +2 -0
  855. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-delete.js +1 -0
  856. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-destructuring.js +42 -0
  857. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-do.js +10 -0
  858. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-dot.js +8 -0
  859. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-empty.js +0 -0
  860. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-for.js +22 -0
  861. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-foreach.js +8 -0
  862. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-function.js +38 -0
  863. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-generator-expression.js +18 -0
  864. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-generator.js +11 -0
  865. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-getter-setter.js +19 -0
  866. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-hook.js +2 -0
  867. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-if.js +30 -0
  868. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-in.js +4 -0
  869. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-inc.js +2 -0
  870. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-iso-8859-1.js +2 -0
  871. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-lambda.js +3 -0
  872. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-let.js +79 -0
  873. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-lf.js +4 -0
  874. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-new.js +4 -0
  875. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-number.js +19 -0
  876. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-object.js +2 -0
  877. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-op.js +55 -0
  878. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-primary.js +4 -0
  879. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-rb.js +5 -0
  880. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-rc.js +7 -0
  881. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-rp.js +1 -0
  882. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-special-characters.js +11 -0
  883. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-string.js +11 -0
  884. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-switch.js +21 -0
  885. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-throw.js +6 -0
  886. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-try.js +32 -0
  887. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-unaryop.js +6 -0
  888. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-var.js +2 -0
  889. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-while.js +35 -0
  890. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/javascript/javascript-with.js +9 -0
  891. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/json-cmp.js +65 -0
  892. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/json.c +48 -0
  893. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/json.sh +19 -0
  894. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/mkdirs.c +42 -0
  895. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/mkdirs.sh +19 -0
  896. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/netcat.pl +35 -0
  897. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/no-arguments.expected.err +2 -0
  898. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/no-arguments.sh +29 -0
  899. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/no-instrument-requires-argument.expected.err +2 -0
  900. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-bad-request-body.sh +58 -0
  901. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-bad-response-body-javascript.sh +53 -0
  902. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-bad-response-body.expected.err +1 -0
  903. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-bad-response-body.sh +54 -0
  904. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-bad-response-headers.sh +53 -0
  905. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-no-server.sh +49 -0
  906. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy-url.sh +67 -0
  907. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/proxy.sh +143 -0
  908. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive-crlf.sh +59 -0
  909. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive-dir-list.c +93 -0
  910. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive-dir-list.sh +19 -0
  911. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive-exclude.sh +41 -0
  912. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive-fatal.sh +40 -0
  913. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive-no-instrument.sh +41 -0
  914. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/1/1.css +3 -0
  915. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/1/1.html +12 -0
  916. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/1/1.js +12 -0
  917. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/1/2/2.css +3 -0
  918. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/1/2/2.html +11 -0
  919. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/1/2/2.js +12 -0
  920. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/image.png +0 -0
  921. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/index.html +12 -0
  922. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/script.js +19 -0
  923. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/style.css +3 -0
  924. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/unix.txt +3 -0
  925. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/windows.txt +3 -0
  926. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.expected/x +1 -0
  927. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive.sh +55 -0
  928. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/1/1.css +3 -0
  929. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/1/1.html +12 -0
  930. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/1/1.js +1 -0
  931. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/1/2/2.css +3 -0
  932. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/1/2/2.html +11 -0
  933. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/1/2/2.js +1 -0
  934. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/image.png +0 -0
  935. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/index.html +12 -0
  936. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/script.js +6 -0
  937. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/style.css +3 -0
  938. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/unix.txt +3 -0
  939. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/windows.txt +3 -0
  940. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/recursive/x +1 -0
  941. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/same-directory.expected.err +1 -0
  942. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/same-directory.sh +30 -0
  943. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-bad-requests.sh +104 -0
  944. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-close-after-request.sh +47 -0
  945. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-content-types.sh +68 -0
  946. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-directory-listing.expected +4 -0
  947. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-directory-listing.sh +57 -0
  948. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-directory-redirect.sh +50 -0
  949. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-encoded-url.sh +57 -0
  950. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-error.sh +61 -0
  951. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-help.sh +26 -0
  952. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-ip-address.sh +68 -0
  953. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-shutdown-bad-method.sh +49 -0
  954. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-shutdown.expected.err +1 -0
  955. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-shutdown.sh +42 -0
  956. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-special-file.sh +62 -0
  957. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-unreadable-directory.sh +61 -0
  958. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-unreadable-file.sh +62 -0
  959. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-verbose.expected.err +4 -0
  960. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-verbose.sh +54 -0
  961. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server-version.sh +25 -0
  962. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server.pl +61 -0
  963. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/server.sh +216 -0
  964. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/source-does-not-exist.expected.err +2 -0
  965. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/source-is-file.expected.err +2 -0
  966. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-bad-json.sh +50 -0
  967. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-bad-request-body.sh +48 -0
  968. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-bad-response-headers.sh +56 -0
  969. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-bad-source-urls.expected.err +3 -0
  970. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-bad-source-urls.expected.json +14 -0
  971. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-escaped-characters.expected.json +6 -0
  972. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-escaped-characters.js +11 -0
  973. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-escaped-characters.json +3 -0
  974. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-escaped-characters.sh +52 -0
  975. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-server-bad-body.sh +59 -0
  976. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-server-closes-immediately.sh +58 -0
  977. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-source-not-found.expected.err +1 -0
  978. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-source-not-found.expected.json +6 -0
  979. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-source-not-found.json +3 -0
  980. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-source-not-found.sh +50 -0
  981. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-source-urls.expected.err +3 -0
  982. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-source-urls.expected.json +14 -0
  983. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-unreachable-source-urls.expected.err +3 -0
  984. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-unreachable-source-urls.expected.json +14 -0
  985. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-unreadable-json.sh +66 -0
  986. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store-unwritable-json.sh +58 -0
  987. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store.expected.json +14 -0
  988. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store.json +5 -0
  989. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/store.sh +137 -0
  990. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/streams.c +107 -0
  991. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/streams.sh +19 -0
  992. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/too-many-arguments.expected.err +2 -0
  993. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/valgrind.sh +7 -0
  994. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/tests/version.sh +29 -0
  995. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/util.c +570 -0
  996. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/deps/jscoverage/util.h +133 -0
  997. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/docs/api.html +1048 -0
  998. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/docs/index.html +373 -0
  999. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/docs/index.md +290 -0
  1000. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/docs/layout/foot.html +3 -0
  1001. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/docs/layout/head.html +42 -0
  1002. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/lib/bar.js +4 -0
  1003. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/lib/foo.js +16 -0
  1004. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/package.json +12 -0
  1005. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/assert.test.js +84 -0
  1006. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/async.test.js +6 -0
  1007. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/bar.test.js +12 -0
  1008. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/foo.test.js +13 -0
  1009. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/http.test.js +82 -0
  1010. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/serial/async.test.js +38 -0
  1011. data/node_modules/jasmine-runner/node_modules/socket.io/support/expresso/test/serial/http.test.js +47 -0
  1012. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/LICENSE +27 -0
  1013. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/Makefile +8 -0
  1014. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/README.md +41 -0
  1015. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/examples/client-unix.js +12 -0
  1016. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/examples/client.js +10 -0
  1017. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/examples/server-unix.js +13 -0
  1018. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/lib/websocket.js +562 -0
  1019. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/package.json +22 -0
  1020. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/test/test-basic.js +63 -0
  1021. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/test/test-readonly-attrs.js +44 -0
  1022. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/test/test-ready-state.js +23 -0
  1023. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/test/test-unix-send-fd.js +63 -0
  1024. data/node_modules/jasmine-runner/node_modules/socket.io/support/node-websocket-client/test/test-unix-sockets.js +46 -0
  1025. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/.gitignore +1 -0
  1026. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/.gitmodules +3 -0
  1027. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/Makefile +2 -0
  1028. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/README.md +213 -0
  1029. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/io.js +24 -0
  1030. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/socket.js +157 -0
  1031. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transport.js +141 -0
  1032. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/flashsocket.js +53 -0
  1033. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/htmlfile.js +73 -0
  1034. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/jsonp-polling.js +116 -0
  1035. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/websocket.js +60 -0
  1036. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/xhr-multipart.js +36 -0
  1037. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/xhr-polling.js +68 -0
  1038. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/transports/xhr.js +131 -0
  1039. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/util.js +60 -0
  1040. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/.gitignore +1 -0
  1041. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/FABridge.js +604 -0
  1042. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/README.txt +109 -0
  1043. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/WebSocketMain.swf +0 -0
  1044. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/WebSocketMainInsecure.zip +0 -0
  1045. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/WebSocket.as +461 -0
  1046. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/WebSocketMain.as +94 -0
  1047. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/WebSocketMainInsecure.as +19 -0
  1048. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/WebSocketStateEvent.as +32 -0
  1049. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/bridge/FABridge.as +943 -0
  1050. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/build.sh +10 -0
  1051. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/adobe/net/proxies/RFC2817Socket.as +204 -0
  1052. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/gsolo/encryption/MD5.as +375 -0
  1053. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/Crypto.as +287 -0
  1054. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/MozillaRootCertificates.as +3235 -0
  1055. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/X509Certificate.as +218 -0
  1056. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/X509CertificateCollection.as +57 -0
  1057. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/HMAC.as +82 -0
  1058. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/IHMAC.as +27 -0
  1059. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/IHash.as +21 -0
  1060. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MAC.as +137 -0
  1061. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MD2.as +124 -0
  1062. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MD5.as +204 -0
  1063. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA1.as +106 -0
  1064. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA224.as +28 -0
  1065. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA256.as +115 -0
  1066. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHABase.as +71 -0
  1067. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/ARC4.as +90 -0
  1068. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/IPRNG.as +20 -0
  1069. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/Random.as +119 -0
  1070. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/TLSPRF.as +142 -0
  1071. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/rsa/RSAKey.as +339 -0
  1072. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/AESKey.as +2797 -0
  1073. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/BlowFishKey.as +375 -0
  1074. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CBCMode.as +55 -0
  1075. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CFB8Mode.as +61 -0
  1076. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CFBMode.as +64 -0
  1077. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CTRMode.as +58 -0
  1078. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/DESKey.as +365 -0
  1079. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ECBMode.as +86 -0
  1080. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ICipher.as +21 -0
  1081. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IMode.as +15 -0
  1082. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IPad.as +32 -0
  1083. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IStreamCipher.as +21 -0
  1084. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ISymmetricKey.as +35 -0
  1085. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IVMode.as +110 -0
  1086. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/NullPad.as +34 -0
  1087. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/OFBMode.as +52 -0
  1088. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/PKCS5.as +44 -0
  1089. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/SSLPad.as +44 -0
  1090. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/SimpleIVMode.as +60 -0
  1091. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/TLSPad.as +42 -0
  1092. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/TripleDESKey.as +88 -0
  1093. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/XTeaKey.as +94 -0
  1094. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/aeskey.pl +29 -0
  1095. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/dump.txt +2304 -0
  1096. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/AESKeyTest.as +1220 -0
  1097. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ARC4Test.as +58 -0
  1098. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/BigIntegerTest.as +39 -0
  1099. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/BlowFishKeyTest.as +148 -0
  1100. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CBCModeTest.as +160 -0
  1101. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CFB8ModeTest.as +71 -0
  1102. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CFBModeTest.as +98 -0
  1103. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CTRModeTest.as +109 -0
  1104. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/DESKeyTest.as +112 -0
  1105. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ECBModeTest.as +151 -0
  1106. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/HMACTest.as +184 -0
  1107. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ITestHarness.as +20 -0
  1108. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/MD2Test.as +56 -0
  1109. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/MD5Test.as +58 -0
  1110. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/OFBModeTest.as +101 -0
  1111. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/RSAKeyTest.as +92 -0
  1112. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA1Test.as +198 -0
  1113. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA224Test.as +58 -0
  1114. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA256Test.as +60 -0
  1115. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TLSPRFTest.as +51 -0
  1116. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TestCase.as +42 -0
  1117. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TripleDESKeyTest.as +59 -0
  1118. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/XTeaKeyTest.as +66 -0
  1119. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/BulkCiphers.as +102 -0
  1120. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/CipherSuites.as +117 -0
  1121. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/IConnectionState.as +14 -0
  1122. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/ISecurityParameters.as +29 -0
  1123. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/KeyExchanges.as +24 -0
  1124. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/MACs.as +38 -0
  1125. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLConnectionState.as +171 -0
  1126. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLEvent.as +26 -0
  1127. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLSecurityParameters.as +340 -0
  1128. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSConfig.as +70 -0
  1129. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSConnectionState.as +151 -0
  1130. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSEngine.as +895 -0
  1131. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSError.as +39 -0
  1132. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSEvent.as +27 -0
  1133. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSecurityParameters.as +197 -0
  1134. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSocket.as +370 -0
  1135. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSocketEvent.as +26 -0
  1136. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSTest.as +180 -0
  1137. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/BarrettReduction.as +90 -0
  1138. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/BigInteger.as +1543 -0
  1139. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/ClassicReduction.as +35 -0
  1140. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/IReduction.as +11 -0
  1141. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/MontgomeryReduction.as +85 -0
  1142. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/NullReduction.as +34 -0
  1143. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/math/bi_internal.as +11 -0
  1144. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/ArrayUtil.as +25 -0
  1145. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/Base64.as +189 -0
  1146. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/Hex.as +66 -0
  1147. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/Memory.as +28 -0
  1148. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/ByteString.as +43 -0
  1149. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/DER.as +210 -0
  1150. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/IAsn1Type.as +21 -0
  1151. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/Integer.as +44 -0
  1152. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/OID.as +35 -0
  1153. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/ObjectIdentifier.as +112 -0
  1154. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/PEM.as +118 -0
  1155. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/PrintableString.as +49 -0
  1156. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/Sequence.as +90 -0
  1157. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/Set.as +27 -0
  1158. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/Type.as +94 -0
  1159. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/flash-src/com/hurlant/util/der/UTCTime.as +60 -0
  1160. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/sample.html +76 -0
  1161. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/swfobject.js +4 -0
  1162. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/lib/vendor/web-socket-js/web_socket.js +388 -0
  1163. data/node_modules/jasmine-runner/node_modules/socket.io/support/socket.io-client/socket.io.js +1918 -0
  1164. data/node_modules/jasmine-runner/node_modules/socket.io/tests/index.js +17 -0
  1165. data/node_modules/jasmine-runner/node_modules/socket.io/tests/listener.js +152 -0
  1166. data/node_modules/jasmine-runner/node_modules/socket.io/tests/transports.flashsocket.js +48 -0
  1167. data/node_modules/jasmine-runner/node_modules/socket.io/tests/transports.htmlfile.js +214 -0
  1168. data/node_modules/jasmine-runner/node_modules/socket.io/tests/transports.jsonp-polling.js +148 -0
  1169. data/node_modules/jasmine-runner/node_modules/socket.io/tests/transports.websocket.js +245 -0
  1170. data/node_modules/jasmine-runner/node_modules/socket.io/tests/transports.xhr-multipart.js +215 -0
  1171. data/node_modules/jasmine-runner/node_modules/socket.io/tests/transports.xhr-polling.js +138 -0
  1172. data/node_modules/jasmine-runner/node_modules/socket.io/tests/utils.js +25 -0
  1173. data/node_modules/jasmine-runner/node_modules/vows/LICENSE +20 -0
  1174. data/node_modules/jasmine-runner/node_modules/vows/Makefile +7 -0
  1175. data/node_modules/jasmine-runner/node_modules/vows/README.md +39 -0
  1176. data/node_modules/jasmine-runner/node_modules/vows/bin/vows +421 -0
  1177. data/node_modules/jasmine-runner/node_modules/vows/lib/assert/error.js +27 -0
  1178. data/node_modules/jasmine-runner/node_modules/vows/lib/assert/macros.js +180 -0
  1179. data/node_modules/jasmine-runner/node_modules/vows/lib/vows.js +195 -0
  1180. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/console.js +93 -0
  1181. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/context.js +55 -0
  1182. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/extras.js +28 -0
  1183. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/reporters/dot-matrix.js +69 -0
  1184. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/reporters/json.js +10 -0
  1185. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/reporters/silent.js +8 -0
  1186. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/reporters/spec.js +74 -0
  1187. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/reporters/watch.js +38 -0
  1188. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/reporters/xunit.js +90 -0
  1189. data/node_modules/jasmine-runner/node_modules/vows/lib/vows/suite.js +321 -0
  1190. data/node_modules/jasmine-runner/node_modules/vows/package.json +14 -0
  1191. data/node_modules/jasmine-runner/node_modules/vows/test/assert-test.js +101 -0
  1192. data/node_modules/jasmine-runner/node_modules/vows/test/vows-test.js +373 -0
  1193. data/node_modules/jasmine-runner/node_modules/webworker/.gitignore +2 -0
  1194. data/node_modules/jasmine-runner/node_modules/webworker/LICENSE +27 -0
  1195. data/node_modules/jasmine-runner/node_modules/webworker/Makefile +15 -0
  1196. data/node_modules/jasmine-runner/node_modules/webworker/README.md +74 -0
  1197. data/node_modules/jasmine-runner/node_modules/webworker/docs/design.md +103 -0
  1198. data/node_modules/jasmine-runner/node_modules/webworker/examples/prefork/README.md +1 -0
  1199. data/node_modules/jasmine-runner/node_modules/webworker/examples/prefork/master.js +12 -0
  1200. data/node_modules/jasmine-runner/node_modules/webworker/examples/prefork/worker.js +20 -0
  1201. data/node_modules/jasmine-runner/node_modules/webworker/lib/webworker-child.js +173 -0
  1202. data/node_modules/jasmine-runner/node_modules/webworker/lib/webworker-util.js +185 -0
  1203. data/node_modules/jasmine-runner/node_modules/webworker/lib/webworker.js +304 -0
  1204. data/node_modules/jasmine-runner/node_modules/webworker/lib/ws.js +118 -0
  1205. data/node_modules/jasmine-runner/node_modules/webworker/lib/ws/connection.js +408 -0
  1206. data/node_modules/jasmine-runner/node_modules/webworker/lib/ws/manager.js +98 -0
  1207. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/LICENSE +27 -0
  1208. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/Makefile +8 -0
  1209. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/README.md +41 -0
  1210. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/examples/client-unix.js +12 -0
  1211. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/examples/client.js +10 -0
  1212. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/examples/server-unix.js +13 -0
  1213. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/lib/websocket.js +516 -0
  1214. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/package.json +22 -0
  1215. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/test/test-basic.js +63 -0
  1216. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/test/test-readonly-attrs.js +44 -0
  1217. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/test/test-ready-state.js +23 -0
  1218. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/test/test-unix-send-fd.js +63 -0
  1219. data/node_modules/jasmine-runner/node_modules/webworker/node_modules/websocket-client/test/test-unix-sockets.js +46 -0
  1220. data/node_modules/jasmine-runner/node_modules/webworker/package.json +25 -0
  1221. data/node_modules/jasmine-runner/node_modules/webworker/test/test-error.js +24 -0
  1222. data/node_modules/jasmine-runner/node_modules/webworker/test/test-fd.js +32 -0
  1223. data/node_modules/jasmine-runner/node_modules/webworker/test/test-simple.js +36 -0
  1224. data/node_modules/jasmine-runner/node_modules/webworker/test/workers/error.js +6 -0
  1225. data/node_modules/jasmine-runner/node_modules/webworker/test/workers/fd.js +17 -0
  1226. data/node_modules/jasmine-runner/node_modules/webworker/test/workers/simple.js +15 -0
  1227. data/node_modules/jasmine-runner/package.json +22 -0
  1228. data/node_modules/jasmine-runner/spec/ConsoleLoggerSpec.js +1 -0
  1229. data/node_modules/jasmine-runner/spec/ServerSpec.js +42 -0
  1230. data/node_modules/jasmine-runner/spec/TestRunner.js +72 -0
  1231. data/node_modules/jasmine-runner/spec/file.worker +8 -0
  1232. data/node_modules/jasmine-runner/spec/temp/spec/foo.spec.js +0 -0
  1233. data/node_modules/jasmine-runner/spec/temp/src/foo.hs +1 -0
  1234. data/node_modules/uglify-js/.gitignore +4 -0
  1235. data/node_modules/uglify-js/README.html +1026 -0
  1236. data/node_modules/uglify-js/README.org +571 -0
  1237. data/node_modules/uglify-js/bin/uglifyjs +317 -0
  1238. data/node_modules/uglify-js/docstyle.css +75 -0
  1239. data/node_modules/uglify-js/lib/object-ast.js +75 -0
  1240. data/node_modules/uglify-js/lib/parse-js.js +1339 -0
  1241. data/node_modules/uglify-js/lib/process.js +2001 -0
  1242. data/node_modules/uglify-js/lib/squeeze-more.js +51 -0
  1243. data/node_modules/uglify-js/package.json +24 -0
  1244. data/node_modules/uglify-js/package.json~ +24 -0
  1245. data/node_modules/uglify-js/test/beautify.js +28 -0
  1246. data/node_modules/uglify-js/test/testparser.js +403 -0
  1247. data/node_modules/uglify-js/test/unit/compress/expected/array1.js +1 -0
  1248. data/node_modules/uglify-js/test/unit/compress/expected/array2.js +1 -0
  1249. data/node_modules/uglify-js/test/unit/compress/expected/array3.js +1 -0
  1250. data/node_modules/uglify-js/test/unit/compress/expected/array4.js +1 -0
  1251. data/node_modules/uglify-js/test/unit/compress/expected/assignment.js +1 -0
  1252. data/node_modules/uglify-js/test/unit/compress/expected/concatstring.js +1 -0
  1253. data/node_modules/uglify-js/test/unit/compress/expected/const.js +1 -0
  1254. data/node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js +1 -0
  1255. data/node_modules/uglify-js/test/unit/compress/expected/forstatement.js +1 -0
  1256. data/node_modules/uglify-js/test/unit/compress/expected/if.js +1 -0
  1257. data/node_modules/uglify-js/test/unit/compress/expected/ifreturn.js +1 -0
  1258. data/node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js +1 -0
  1259. data/node_modules/uglify-js/test/unit/compress/expected/issue10.js +1 -0
  1260. data/node_modules/uglify-js/test/unit/compress/expected/issue11.js +1 -0
  1261. data/node_modules/uglify-js/test/unit/compress/expected/issue13.js +1 -0
  1262. data/node_modules/uglify-js/test/unit/compress/expected/issue14.js +1 -0
  1263. data/node_modules/uglify-js/test/unit/compress/expected/issue16.js +1 -0
  1264. data/node_modules/uglify-js/test/unit/compress/expected/issue17.js +1 -0
  1265. data/node_modules/uglify-js/test/unit/compress/expected/issue20.js +1 -0
  1266. data/node_modules/uglify-js/test/unit/compress/expected/issue21.js +1 -0
  1267. data/node_modules/uglify-js/test/unit/compress/expected/issue25.js +1 -0
  1268. data/node_modules/uglify-js/test/unit/compress/expected/issue27.js +1 -0
  1269. data/node_modules/uglify-js/test/unit/compress/expected/issue28.js +1 -0
  1270. data/node_modules/uglify-js/test/unit/compress/expected/issue29.js +1 -0
  1271. data/node_modules/uglify-js/test/unit/compress/expected/issue30.js +1 -0
  1272. data/node_modules/uglify-js/test/unit/compress/expected/issue34.js +1 -0
  1273. data/node_modules/uglify-js/test/unit/compress/expected/issue4.js +1 -0
  1274. data/node_modules/uglify-js/test/unit/compress/expected/issue48.js +1 -0
  1275. data/node_modules/uglify-js/test/unit/compress/expected/issue50.js +1 -0
  1276. data/node_modules/uglify-js/test/unit/compress/expected/issue53.js +1 -0
  1277. data/node_modules/uglify-js/test/unit/compress/expected/issue54.1.js +1 -0
  1278. data/node_modules/uglify-js/test/unit/compress/expected/issue68.js +1 -0
  1279. data/node_modules/uglify-js/test/unit/compress/expected/issue69.js +1 -0
  1280. data/node_modules/uglify-js/test/unit/compress/expected/issue9.js +1 -0
  1281. data/node_modules/uglify-js/test/unit/compress/expected/mangle.js +1 -0
  1282. data/node_modules/uglify-js/test/unit/compress/expected/null_string.js +1 -0
  1283. data/node_modules/uglify-js/test/unit/compress/expected/strict-equals.js +1 -0
  1284. data/node_modules/uglify-js/test/unit/compress/expected/var.js +1 -0
  1285. data/node_modules/uglify-js/test/unit/compress/expected/whitespace.js +1 -0
  1286. data/node_modules/uglify-js/test/unit/compress/expected/with.js +1 -0
  1287. data/node_modules/uglify-js/test/unit/compress/test/array1.js +3 -0
  1288. data/node_modules/uglify-js/test/unit/compress/test/array2.js +4 -0
  1289. data/node_modules/uglify-js/test/unit/compress/test/array3.js +4 -0
  1290. data/node_modules/uglify-js/test/unit/compress/test/array4.js +6 -0
  1291. data/node_modules/uglify-js/test/unit/compress/test/assignment.js +20 -0
  1292. data/node_modules/uglify-js/test/unit/compress/test/concatstring.js +3 -0
  1293. data/node_modules/uglify-js/test/unit/compress/test/const.js +5 -0
  1294. data/node_modules/uglify-js/test/unit/compress/test/empty-blocks.js +4 -0
  1295. data/node_modules/uglify-js/test/unit/compress/test/forstatement.js +10 -0
  1296. data/node_modules/uglify-js/test/unit/compress/test/if.js +6 -0
  1297. data/node_modules/uglify-js/test/unit/compress/test/ifreturn.js +9 -0
  1298. data/node_modules/uglify-js/test/unit/compress/test/ifreturn2.js +16 -0
  1299. data/node_modules/uglify-js/test/unit/compress/test/issue10.js +1 -0
  1300. data/node_modules/uglify-js/test/unit/compress/test/issue11.js +3 -0
  1301. data/node_modules/uglify-js/test/unit/compress/test/issue13.js +1 -0
  1302. data/node_modules/uglify-js/test/unit/compress/test/issue14.js +1 -0
  1303. data/node_modules/uglify-js/test/unit/compress/test/issue16.js +1 -0
  1304. data/node_modules/uglify-js/test/unit/compress/test/issue17.js +4 -0
  1305. data/node_modules/uglify-js/test/unit/compress/test/issue20.js +1 -0
  1306. data/node_modules/uglify-js/test/unit/compress/test/issue21.js +6 -0
  1307. data/node_modules/uglify-js/test/unit/compress/test/issue25.js +7 -0
  1308. data/node_modules/uglify-js/test/unit/compress/test/issue27.js +1 -0
  1309. data/node_modules/uglify-js/test/unit/compress/test/issue28.js +3 -0
  1310. data/node_modules/uglify-js/test/unit/compress/test/issue29.js +1 -0
  1311. data/node_modules/uglify-js/test/unit/compress/test/issue30.js +3 -0
  1312. data/node_modules/uglify-js/test/unit/compress/test/issue34.js +3 -0
  1313. data/node_modules/uglify-js/test/unit/compress/test/issue4.js +3 -0
  1314. data/node_modules/uglify-js/test/unit/compress/test/issue48.js +1 -0
  1315. data/node_modules/uglify-js/test/unit/compress/test/issue50.js +9 -0
  1316. data/node_modules/uglify-js/test/unit/compress/test/issue53.js +1 -0
  1317. data/node_modules/uglify-js/test/unit/compress/test/issue54.1.js +3 -0
  1318. data/node_modules/uglify-js/test/unit/compress/test/issue68.js +5 -0
  1319. data/node_modules/uglify-js/test/unit/compress/test/issue69.js +1 -0
  1320. data/node_modules/uglify-js/test/unit/compress/test/issue9.js +4 -0
  1321. data/node_modules/uglify-js/test/unit/compress/test/mangle.js +5 -0
  1322. data/node_modules/uglify-js/test/unit/compress/test/null_string.js +1 -0
  1323. data/node_modules/uglify-js/test/unit/compress/test/strict-equals.js +3 -0
  1324. data/node_modules/uglify-js/test/unit/compress/test/var.js +3 -0
  1325. data/node_modules/uglify-js/test/unit/compress/test/whitespace.js +21 -0
  1326. data/node_modules/uglify-js/test/unit/compress/test/with.js +2 -0
  1327. data/node_modules/uglify-js/test/unit/scripts.js +55 -0
  1328. data/node_modules/uglify-js/uglify-js.js +17 -0
  1329. data/node_modules/uglifycss/README.md +21 -0
  1330. data/node_modules/uglifycss/index.js +26 -0
  1331. data/node_modules/uglifycss/package.json +15 -0
  1332. data/node_modules/uglifycss/test.js +43 -0
  1333. data/node_modules/uglifycss/tests.yui.js +42 -0
  1334. data/node_modules/uglifycss/uglifycss +127 -0
  1335. data/node_modules/uglifycss/uglifycss-lib.js +461 -0
  1336. metadata +1383 -0
@@ -0,0 +1,3426 @@
1
+ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2
+ * vim: set sw=4 ts=8 et tw=78:
3
+ *
4
+ * ***** BEGIN LICENSE BLOCK *****
5
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6
+ *
7
+ * The contents of this file are subject to the Mozilla Public License Version
8
+ * 1.1 (the "License"); you may not use this file except in compliance with
9
+ * the License. You may obtain a copy of the License at
10
+ * http://www.mozilla.org/MPL/
11
+ *
12
+ * Software distributed under the License is distributed on an "AS IS" basis,
13
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14
+ * for the specific language governing rights and limitations under the
15
+ * License.
16
+ *
17
+ * The Original Code is Mozilla Communicator client code, released
18
+ * March 31, 1998.
19
+ *
20
+ * The Initial Developer of the Original Code is
21
+ * Netscape Communications Corporation.
22
+ * Portions created by the Initial Developer are Copyright (C) 1998
23
+ * the Initial Developer. All Rights Reserved.
24
+ *
25
+ * Contributor(s):
26
+ *
27
+ * Alternatively, the contents of this file may be used under the terms of
28
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
29
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30
+ * in which case the provisions of the GPL or the LGPL are applicable instead
31
+ * of those above. If you wish to allow use of your version of this file only
32
+ * under the terms of either the GPL or the LGPL, and not to allow others to
33
+ * use your version of this file under the terms of the MPL, indicate your
34
+ * decision by deleting the provisions above and replace them with the notice
35
+ * and other provisions required by the GPL or the LGPL. If you do not delete
36
+ * the provisions above, a recipient may use your version of this file under
37
+ * the terms of any one of the MPL, the GPL or the LGPL.
38
+ *
39
+ * ***** END LICENSE BLOCK ***** */
40
+
41
+ /*
42
+ * JS array class.
43
+ *
44
+ * Array objects begin as "dense" arrays, optimized for numeric-only property
45
+ * access over a vector of slots (obj->dslots) with high load factor. Array
46
+ * methods optimize for denseness by testing that the object's class is
47
+ * &js_ArrayClass, and can then directly manipulate the slots for efficiency.
48
+ *
49
+ * We track these pieces of metadata for arrays in dense mode:
50
+ * - the array's length property as a uint32, in JSSLOT_ARRAY_LENGTH,
51
+ * - the number of indices that are filled (non-holes), in JSSLOT_ARRAY_COUNT,
52
+ * - the net number of slots starting at dslots (DENSELEN), in dslots[-1] if
53
+ * dslots is non-NULL.
54
+ *
55
+ * In dense mode, holes in the array are represented by JSVAL_HOLE. The final
56
+ * slot in fslots (JSSLOT_ARRAY_LOOKUP_HOLDER) is used to store the single jsid
57
+ * "in use" by a lookupProperty caller.
58
+ *
59
+ * Arrays are converted to use js_SlowArrayClass when any of these conditions
60
+ * are met:
61
+ * - the load factor (COUNT / DENSELEN) is less than 0.25, and there are
62
+ * more than MIN_SPARSE_INDEX slots total
63
+ * - a property is set that is non-numeric (and not "length"); or
64
+ * - a hole is filled below DENSELEN (possibly implicitly through methods like
65
+ * |reverse| or |splice|).
66
+ *
67
+ * In the latter two cases, property creation order is no longer index order,
68
+ * which necessitates use of a structure that keeps track of property creation
69
+ * order. (ES4, due to expectations baked into web script, requires that
70
+ * enumeration order be the order in which properties were created.)
71
+ *
72
+ * An alternative in the latter case (out-of-order index set) would be to
73
+ * maintain the scope to track property enumeration order, but still use
74
+ * the fast slot access. That would have the same memory cost as just using
75
+ * a js_SlowArrayClass, but have the same performance characteristics as
76
+ * a dense array for slot accesses, at some cost in code complexity.
77
+ */
78
+ #include "jsstddef.h"
79
+ #include <stdlib.h>
80
+ #include <string.h>
81
+ #include "jstypes.h"
82
+ #include "jsutil.h" /* Added by JSIFY */
83
+ #include "jsapi.h"
84
+ #include "jsarray.h"
85
+ #include "jsatom.h"
86
+ #include "jsbit.h"
87
+ #include "jsbool.h"
88
+ #include "jsbuiltins.h"
89
+ #include "jscntxt.h"
90
+ #include "jsversion.h"
91
+ #include "jsdbgapi.h" /* for js_TraceWatchPoints */
92
+ #include "jsdtoa.h"
93
+ #include "jsfun.h"
94
+ #include "jsgc.h"
95
+ #include "jsinterp.h"
96
+ #include "jslock.h"
97
+ #include "jsnum.h"
98
+ #include "jsobj.h"
99
+ #include "jsscope.h"
100
+ #include "jsstr.h"
101
+ #include "jsstaticcheck.h"
102
+
103
+ /* 2^32 - 1 as a number and a string */
104
+ #define MAXINDEX 4294967295u
105
+ #define MAXSTR "4294967295"
106
+
107
+ /* Small arrays are dense, no matter what. */
108
+ #define MIN_SPARSE_INDEX 32
109
+
110
+ #define INDEX_TOO_BIG(index) ((index) > JS_BIT(29) - 1)
111
+ #define INDEX_TOO_SPARSE(array, index) \
112
+ (INDEX_TOO_BIG(index) || \
113
+ ((index) > ARRAY_DENSE_LENGTH(array) && (index) >= MIN_SPARSE_INDEX && \
114
+ (index) > (uint32)((array)->fslots[JSSLOT_ARRAY_COUNT] + 1) * 4))
115
+
116
+ JS_STATIC_ASSERT(sizeof(JSScopeProperty) > 4 * sizeof(jsval));
117
+
118
+ #define ENSURE_SLOW_ARRAY(cx, obj) \
119
+ (OBJ_GET_CLASS(cx, obj) == &js_SlowArrayClass || js_MakeArraySlow(cx, obj))
120
+
121
+ /*
122
+ * Determine if the id represents an array index or an XML property index.
123
+ *
124
+ * An id is an array index according to ECMA by (15.4):
125
+ *
126
+ * "Array objects give special treatment to a certain class of property names.
127
+ * A property name P (in the form of a string value) is an array index if and
128
+ * only if ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal
129
+ * to 2^32-1."
130
+ *
131
+ * In our implementation, it would be sufficient to check for JSVAL_IS_INT(id)
132
+ * except that by using signed 32-bit integers we miss the top half of the
133
+ * valid range. This function checks the string representation itself; note
134
+ * that calling a standard conversion routine might allow strings such as
135
+ * "08" or "4.0" as array indices, which they are not.
136
+ */
137
+ JSBool
138
+ js_IdIsIndex(jsval id, jsuint *indexp)
139
+ {
140
+ JSString *str;
141
+ jschar *cp;
142
+
143
+ if (JSVAL_IS_INT(id)) {
144
+ jsint i;
145
+ i = JSVAL_TO_INT(id);
146
+ if (i < 0)
147
+ return JS_FALSE;
148
+ *indexp = (jsuint)i;
149
+ return JS_TRUE;
150
+ }
151
+
152
+ /* NB: id should be a string, but jsxml.c may call us with an object id. */
153
+ if (!JSVAL_IS_STRING(id))
154
+ return JS_FALSE;
155
+
156
+ str = JSVAL_TO_STRING(id);
157
+ cp = JSSTRING_CHARS(str);
158
+ if (JS7_ISDEC(*cp) && JSSTRING_LENGTH(str) < sizeof(MAXSTR)) {
159
+ jsuint index = JS7_UNDEC(*cp++);
160
+ jsuint oldIndex = 0;
161
+ jsuint c = 0;
162
+ if (index != 0) {
163
+ while (JS7_ISDEC(*cp)) {
164
+ oldIndex = index;
165
+ c = JS7_UNDEC(*cp);
166
+ index = 10*index + c;
167
+ cp++;
168
+ }
169
+ }
170
+
171
+ /* Ensure that all characters were consumed and we didn't overflow. */
172
+ if (*cp == 0 &&
173
+ (oldIndex < (MAXINDEX / 10) ||
174
+ (oldIndex == (MAXINDEX / 10) && c < (MAXINDEX % 10))))
175
+ {
176
+ *indexp = index;
177
+ return JS_TRUE;
178
+ }
179
+ }
180
+ return JS_FALSE;
181
+ }
182
+
183
+ static jsuint
184
+ ValueIsLength(JSContext *cx, jsval* vp)
185
+ {
186
+ jsint i;
187
+ jsdouble d;
188
+ jsuint length;
189
+
190
+ if (JSVAL_IS_INT(*vp)) {
191
+ i = JSVAL_TO_INT(*vp);
192
+ if (i < 0)
193
+ goto error;
194
+ return (jsuint) i;
195
+ }
196
+
197
+ d = js_ValueToNumber(cx, vp);
198
+ if (JSVAL_IS_NULL(*vp))
199
+ goto error;
200
+
201
+ if (JSDOUBLE_IS_NaN(d))
202
+ goto error;
203
+ length = (jsuint) d;
204
+ if (d != (jsdouble) length)
205
+ goto error;
206
+ return length;
207
+
208
+ error:
209
+ JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
210
+ JSMSG_BAD_ARRAY_LENGTH);
211
+ *vp = JSVAL_NULL;
212
+ return 0;
213
+ }
214
+
215
+ JSBool
216
+ js_GetLengthProperty(JSContext *cx, JSObject *obj, jsuint *lengthp)
217
+ {
218
+ JSTempValueRooter tvr;
219
+ jsid id;
220
+ JSBool ok;
221
+ jsint i;
222
+
223
+ if (OBJ_IS_ARRAY(cx, obj)) {
224
+ *lengthp = obj->fslots[JSSLOT_ARRAY_LENGTH];
225
+ return JS_TRUE;
226
+ }
227
+
228
+ JS_PUSH_SINGLE_TEMP_ROOT(cx, JSVAL_NULL, &tvr);
229
+ id = ATOM_TO_JSID(cx->runtime->atomState.lengthAtom);
230
+ ok = OBJ_GET_PROPERTY(cx, obj, id, &tvr.u.value);
231
+ if (ok) {
232
+ if (JSVAL_IS_INT(tvr.u.value)) {
233
+ i = JSVAL_TO_INT(tvr.u.value);
234
+ *lengthp = (jsuint)i; /* jsuint cast does ToUint32 */
235
+ } else {
236
+ *lengthp = js_ValueToECMAUint32(cx, &tvr.u.value);
237
+ ok = !JSVAL_IS_NULL(tvr.u.value);
238
+ }
239
+ }
240
+ JS_POP_TEMP_ROOT(cx, &tvr);
241
+ return ok;
242
+ }
243
+
244
+ static JSBool
245
+ IndexToValue(JSContext *cx, jsuint index, jsval *vp)
246
+ {
247
+ if (index <= JSVAL_INT_MAX) {
248
+ *vp = INT_TO_JSVAL(index);
249
+ return JS_TRUE;
250
+ }
251
+ return JS_NewDoubleValue(cx, (jsdouble)index, vp);
252
+ }
253
+
254
+ JSBool JS_FASTCALL
255
+ js_IndexToId(JSContext *cx, jsuint index, jsid *idp)
256
+ {
257
+ JSString *str;
258
+
259
+ if (index <= JSVAL_INT_MAX) {
260
+ *idp = INT_TO_JSID(index);
261
+ return JS_TRUE;
262
+ }
263
+ str = js_NumberToString(cx, index);
264
+ if (!str)
265
+ return JS_FALSE;
266
+ return js_ValueToStringId(cx, STRING_TO_JSVAL(str), idp);
267
+ }
268
+
269
+ static JSBool
270
+ BigIndexToId(JSContext *cx, JSObject *obj, jsuint index, JSBool createAtom,
271
+ jsid *idp)
272
+ {
273
+ jschar buf[10], *start;
274
+ JSClass *clasp;
275
+ JSAtom *atom;
276
+ JS_STATIC_ASSERT((jsuint)-1 == 4294967295U);
277
+
278
+ JS_ASSERT(index > JSVAL_INT_MAX);
279
+
280
+ start = JS_ARRAY_END(buf);
281
+ do {
282
+ --start;
283
+ *start = (jschar)('0' + index % 10);
284
+ index /= 10;
285
+ } while (index != 0);
286
+
287
+ /*
288
+ * Skip the atomization if the class is known to store atoms corresponding
289
+ * to big indexes together with elements. In such case we know that the
290
+ * array does not have an element at the given index if its atom does not
291
+ * exist. Fast arrays (clasp == &js_ArrayClass) don't use atoms for
292
+ * any indexes, though it would be rare to see them have a big index
293
+ * in any case.
294
+ */
295
+ if (!createAtom &&
296
+ ((clasp = OBJ_GET_CLASS(cx, obj)) == &js_SlowArrayClass ||
297
+ clasp == &js_ArgumentsClass ||
298
+ clasp == &js_ObjectClass)) {
299
+ atom = js_GetExistingStringAtom(cx, start, JS_ARRAY_END(buf) - start);
300
+ if (!atom) {
301
+ *idp = JSVAL_VOID;
302
+ return JS_TRUE;
303
+ }
304
+ } else {
305
+ atom = js_AtomizeChars(cx, start, JS_ARRAY_END(buf) - start, 0);
306
+ if (!atom)
307
+ return JS_FALSE;
308
+ }
309
+
310
+ *idp = ATOM_TO_JSID(atom);
311
+ return JS_TRUE;
312
+ }
313
+
314
+ static JSBool
315
+ ResizeSlots(JSContext *cx, JSObject *obj, uint32 oldlen, uint32 len)
316
+ {
317
+ jsval *slots, *newslots;
318
+
319
+ if (len == 0) {
320
+ if (obj->dslots) {
321
+ JS_free(cx, obj->dslots - 1);
322
+ obj->dslots = NULL;
323
+ }
324
+ return JS_TRUE;
325
+ }
326
+
327
+ if (len > ~(uint32)0 / sizeof(jsval)) {
328
+ js_ReportAllocationOverflow(cx);
329
+ return JS_FALSE;
330
+ }
331
+
332
+ slots = obj->dslots ? obj->dslots - 1 : NULL;
333
+ newslots = (jsval *) JS_realloc(cx, slots, sizeof (jsval) * (len + 1));
334
+ if (!newslots)
335
+ return JS_FALSE;
336
+
337
+ obj->dslots = newslots + 1;
338
+ ARRAY_SET_DENSE_LENGTH(obj, len);
339
+
340
+ for (slots = obj->dslots + oldlen; slots < obj->dslots + len; slots++)
341
+ *slots = JSVAL_HOLE;
342
+
343
+ return JS_TRUE;
344
+ }
345
+
346
+ static JSBool
347
+ EnsureLength(JSContext *cx, JSObject *obj, uint32 len)
348
+ {
349
+ uint32 oldlen = ARRAY_DENSE_LENGTH(obj);
350
+
351
+ if (len > oldlen) {
352
+ return ResizeSlots(cx, obj, oldlen,
353
+ len + ARRAY_GROWBY - (len % ARRAY_GROWBY));
354
+ }
355
+ return JS_TRUE;
356
+ }
357
+
358
+ /*
359
+ * If the property at the given index exists, get its value into location
360
+ * pointed by vp and set *hole to false. Otherwise set *hole to true and *vp
361
+ * to JSVAL_VOID. This function assumes that the location pointed by vp is
362
+ * properly rooted and can be used as GC-protected storage for temporaries.
363
+ */
364
+ static JSBool
365
+ GetArrayElement(JSContext *cx, JSObject *obj, jsuint index, JSBool *hole,
366
+ jsval *vp)
367
+ {
368
+ jsid id;
369
+ JSObject *obj2;
370
+ JSProperty *prop;
371
+
372
+ if (OBJ_IS_DENSE_ARRAY(cx, obj) && index < ARRAY_DENSE_LENGTH(obj) &&
373
+ (*vp = obj->dslots[index]) != JSVAL_HOLE) {
374
+ *hole = JS_FALSE;
375
+ return JS_TRUE;
376
+ }
377
+
378
+ if (index <= JSVAL_INT_MAX) {
379
+ id = INT_TO_JSID(index);
380
+ } else {
381
+ if (!BigIndexToId(cx, obj, index, JS_FALSE, &id))
382
+ return JS_FALSE;
383
+ if (JSVAL_IS_VOID(id)) {
384
+ *hole = JS_TRUE;
385
+ *vp = JSVAL_VOID;
386
+ return JS_TRUE;
387
+ }
388
+ }
389
+
390
+ if (!OBJ_LOOKUP_PROPERTY(cx, obj, id, &obj2, &prop))
391
+ return JS_FALSE;
392
+ if (!prop) {
393
+ *hole = JS_TRUE;
394
+ *vp = JSVAL_VOID;
395
+ } else {
396
+ OBJ_DROP_PROPERTY(cx, obj2, prop);
397
+ if (!OBJ_GET_PROPERTY(cx, obj, id, vp))
398
+ return JS_FALSE;
399
+ *hole = JS_FALSE;
400
+ }
401
+ return JS_TRUE;
402
+ }
403
+
404
+ /*
405
+ * Set the value of the property at the given index to v assuming v is rooted.
406
+ */
407
+ static JSBool
408
+ SetArrayElement(JSContext *cx, JSObject *obj, jsuint index, jsval v)
409
+ {
410
+ jsid id;
411
+
412
+ if (OBJ_IS_DENSE_ARRAY(cx, obj)) {
413
+ /* Predicted/prefeched code should favor the remains-dense case. */
414
+ if (!INDEX_TOO_SPARSE(obj, index)) {
415
+ if (!EnsureLength(cx, obj, index + 1))
416
+ return JS_FALSE;
417
+ if (index >= (uint32)obj->fslots[JSSLOT_ARRAY_LENGTH])
418
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = index + 1;
419
+ if (obj->dslots[index] == JSVAL_HOLE)
420
+ obj->fslots[JSSLOT_ARRAY_COUNT]++;
421
+ obj->dslots[index] = v;
422
+ return JS_TRUE;
423
+ }
424
+
425
+ if (!js_MakeArraySlow(cx, obj))
426
+ return JS_FALSE;
427
+ }
428
+
429
+ if (index <= JSVAL_INT_MAX) {
430
+ id = INT_TO_JSID(index);
431
+ } else {
432
+ if (!BigIndexToId(cx, obj, index, JS_TRUE, &id))
433
+ return JS_FALSE;
434
+ JS_ASSERT(!JSVAL_IS_VOID(id));
435
+ }
436
+ return OBJ_SET_PROPERTY(cx, obj, id, &v);
437
+ }
438
+
439
+ static JSBool
440
+ DeleteArrayElement(JSContext *cx, JSObject *obj, jsuint index)
441
+ {
442
+ jsid id;
443
+ jsval junk;
444
+
445
+ if (OBJ_IS_DENSE_ARRAY(cx, obj)) {
446
+ if (index < ARRAY_DENSE_LENGTH(obj)) {
447
+ if (obj->dslots[index] != JSVAL_HOLE)
448
+ obj->fslots[JSSLOT_ARRAY_COUNT]--;
449
+ obj->dslots[index] = JSVAL_HOLE;
450
+ }
451
+ return JS_TRUE;
452
+ }
453
+
454
+ if (index <= JSVAL_INT_MAX) {
455
+ id = INT_TO_JSID(index);
456
+ } else {
457
+ if (!BigIndexToId(cx, obj, index, JS_FALSE, &id))
458
+ return JS_FALSE;
459
+ if (JSVAL_IS_VOID(id))
460
+ return JS_TRUE;
461
+ }
462
+ return OBJ_DELETE_PROPERTY(cx, obj, id, &junk);
463
+ }
464
+
465
+ /*
466
+ * When hole is true, delete the property at the given index. Otherwise set
467
+ * its value to v assuming v is rooted.
468
+ */
469
+ static JSBool
470
+ SetOrDeleteArrayElement(JSContext *cx, JSObject *obj, jsuint index,
471
+ JSBool hole, jsval v)
472
+ {
473
+ if (hole) {
474
+ JS_ASSERT(JSVAL_IS_VOID(v));
475
+ return DeleteArrayElement(cx, obj, index);
476
+ }
477
+ return SetArrayElement(cx, obj, index, v);
478
+ }
479
+
480
+ JSBool
481
+ js_SetLengthProperty(JSContext *cx, JSObject *obj, jsuint length)
482
+ {
483
+ jsval v;
484
+ jsid id;
485
+
486
+ if (!IndexToValue(cx, length, &v))
487
+ return JS_FALSE;
488
+ id = ATOM_TO_JSID(cx->runtime->atomState.lengthAtom);
489
+ return OBJ_SET_PROPERTY(cx, obj, id, &v);
490
+ }
491
+
492
+ JSBool
493
+ js_HasLengthProperty(JSContext *cx, JSObject *obj, jsuint *lengthp)
494
+ {
495
+ JSErrorReporter older;
496
+ JSTempValueRooter tvr;
497
+ jsid id;
498
+ JSBool ok;
499
+
500
+ older = JS_SetErrorReporter(cx, NULL);
501
+ JS_PUSH_SINGLE_TEMP_ROOT(cx, JSVAL_NULL, &tvr);
502
+ id = ATOM_TO_JSID(cx->runtime->atomState.lengthAtom);
503
+ ok = OBJ_GET_PROPERTY(cx, obj, id, &tvr.u.value);
504
+ JS_SetErrorReporter(cx, older);
505
+ if (ok) {
506
+ *lengthp = ValueIsLength(cx, &tvr.u.value);
507
+ ok = !JSVAL_IS_NULL(tvr.u.value);
508
+ }
509
+ JS_POP_TEMP_ROOT(cx, &tvr);
510
+ return ok;
511
+ }
512
+
513
+ JSBool
514
+ js_IsArrayLike(JSContext *cx, JSObject *obj, JSBool *answerp, jsuint *lengthp)
515
+ {
516
+ JSClass *clasp;
517
+
518
+ clasp = OBJ_GET_CLASS(cx, obj);
519
+ *answerp = (clasp == &js_ArgumentsClass || clasp == &js_ArrayClass ||
520
+ clasp == &js_SlowArrayClass);
521
+ if (!*answerp) {
522
+ *lengthp = 0;
523
+ return JS_TRUE;
524
+ }
525
+ return js_GetLengthProperty(cx, obj, lengthp);
526
+ }
527
+
528
+ /*
529
+ * The 'length' property of all native Array instances is a shared permanent
530
+ * property of Array.prototype, so it appears to be a direct property of each
531
+ * array instance delegating to that Array.prototype. It accesses the private
532
+ * slot reserved by js_ArrayClass.
533
+ *
534
+ * Since SpiderMonkey supports cross-class prototype-based delegation, we have
535
+ * to be careful about the length getter and setter being called on an object
536
+ * not of Array class. For the getter, we search obj's prototype chain for the
537
+ * array that caused this getter to be invoked. In the setter case to overcome
538
+ * the JSPROP_SHARED attribute, we must define a shadowing length property.
539
+ */
540
+ static JSBool
541
+ array_length_getter(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
542
+ {
543
+ do {
544
+ if (OBJ_IS_ARRAY(cx, obj))
545
+ return IndexToValue(cx, obj->fslots[JSSLOT_ARRAY_LENGTH], vp);
546
+ } while ((obj = OBJ_GET_PROTO(cx, obj)) != NULL);
547
+ return JS_TRUE;
548
+ }
549
+
550
+ static JSBool
551
+ array_length_setter(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
552
+ {
553
+ jsuint newlen, oldlen, gap, index;
554
+ jsval junk;
555
+ JSObject *iter;
556
+ JSTempValueRooter tvr;
557
+ JSBool ok;
558
+
559
+ if (!OBJ_IS_ARRAY(cx, obj)) {
560
+ jsid lengthId = ATOM_TO_JSID(cx->runtime->atomState.lengthAtom);
561
+
562
+ return OBJ_DEFINE_PROPERTY(cx, obj, lengthId, *vp, NULL, NULL,
563
+ JSPROP_ENUMERATE, NULL);
564
+ }
565
+
566
+ newlen = ValueIsLength(cx, vp);
567
+ if (JSVAL_IS_NULL(*vp))
568
+ return JS_FALSE;
569
+ oldlen = obj->fslots[JSSLOT_ARRAY_LENGTH];
570
+
571
+ if (oldlen == newlen)
572
+ return JS_TRUE;
573
+
574
+ if (!IndexToValue(cx, newlen, vp))
575
+ return JS_FALSE;
576
+
577
+ if (oldlen < newlen) {
578
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = newlen;
579
+ return JS_TRUE;
580
+ }
581
+
582
+ if (OBJ_IS_DENSE_ARRAY(cx, obj)) {
583
+ if (ARRAY_DENSE_LENGTH(obj) && !ResizeSlots(cx, obj, oldlen, newlen))
584
+ return JS_FALSE;
585
+ } else if (oldlen - newlen < (1 << 24)) {
586
+ do {
587
+ --oldlen;
588
+ if (!JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) ||
589
+ !DeleteArrayElement(cx, obj, oldlen)) {
590
+ return JS_FALSE;
591
+ }
592
+ } while (oldlen != newlen);
593
+ } else {
594
+ /*
595
+ * We are going to remove a lot of indexes in a presumably sparse
596
+ * array. So instead of looping through indexes between newlen and
597
+ * oldlen, we iterate through all properties and remove those that
598
+ * correspond to indexes in the half-open range [newlen, oldlen). See
599
+ * bug 322135.
600
+ */
601
+ iter = JS_NewPropertyIterator(cx, obj);
602
+ if (!iter)
603
+ return JS_FALSE;
604
+
605
+ /* Protect iter against GC in OBJ_DELETE_PROPERTY. */
606
+ JS_PUSH_TEMP_ROOT_OBJECT(cx, iter, &tvr);
607
+ gap = oldlen - newlen;
608
+ for (;;) {
609
+ ok = (JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) &&
610
+ JS_NextProperty(cx, iter, &id));
611
+ if (!ok)
612
+ break;
613
+ if (JSVAL_IS_VOID(id))
614
+ break;
615
+ if (js_IdIsIndex(id, &index) && index - newlen < gap) {
616
+ ok = OBJ_DELETE_PROPERTY(cx, obj, id, &junk);
617
+ if (!ok)
618
+ break;
619
+ }
620
+ }
621
+ JS_POP_TEMP_ROOT(cx, &tvr);
622
+ if (!ok)
623
+ return JS_FALSE;
624
+ }
625
+
626
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = newlen;
627
+ return JS_TRUE;
628
+ }
629
+
630
+ static JSBool
631
+ array_lookupProperty(JSContext *cx, JSObject *obj, jsid id, JSObject **objp,
632
+ JSProperty **propp)
633
+ {
634
+ uint32 i;
635
+ union { JSProperty *p; jsval *v; } u;
636
+
637
+ if (!OBJ_IS_DENSE_ARRAY(cx, obj))
638
+ return js_LookupProperty(cx, obj, id, objp, propp);
639
+
640
+ /*
641
+ * We have only indexed properties up to DENSELEN (excepting holes), plus
642
+ * the length property. For all else, we delegate to the prototype.
643
+ */
644
+ if (id != ATOM_TO_JSID(cx->runtime->atomState.lengthAtom) &&
645
+ (!js_IdIsIndex(id, &i) ||
646
+ obj->fslots[JSSLOT_ARRAY_LENGTH] == 0 ||
647
+ i >= ARRAY_DENSE_LENGTH(obj) ||
648
+ obj->dslots[i] == JSVAL_HOLE))
649
+ {
650
+ JSObject *proto = STOBJ_GET_PROTO(obj);
651
+
652
+ if (!proto) {
653
+ *objp = NULL;
654
+ *propp = NULL;
655
+ return JS_TRUE;
656
+ }
657
+
658
+ return OBJ_LOOKUP_PROPERTY(cx, proto, id, objp, propp);
659
+ }
660
+
661
+ /* FIXME 417501: threadsafety: could race with a lookup on another thread.
662
+ * If we can only have a single lookup active per context, we could
663
+ * pigeonhole this on the context instead. */
664
+ JS_ASSERT(JSVAL_IS_VOID(obj->fslots[JSSLOT_ARRAY_LOOKUP_HOLDER]));
665
+ obj->fslots[JSSLOT_ARRAY_LOOKUP_HOLDER] = (jsval) id;
666
+ u.v = &(obj->fslots[JSSLOT_ARRAY_LOOKUP_HOLDER]);
667
+ *propp = u.p;
668
+ *objp = obj;
669
+ return JS_TRUE;
670
+ }
671
+
672
+ static void
673
+ array_dropProperty(JSContext *cx, JSObject *obj, JSProperty *prop)
674
+ {
675
+ JS_ASSERT_IF(OBJ_IS_DENSE_ARRAY(cx, obj),
676
+ !JSVAL_IS_VOID(obj->fslots[JSSLOT_ARRAY_LOOKUP_HOLDER]));
677
+ #ifdef DEBUG
678
+ obj->fslots[JSSLOT_ARRAY_LOOKUP_HOLDER] = JSVAL_VOID;
679
+ #endif
680
+ }
681
+
682
+ static JSBool
683
+ array_getProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
684
+ {
685
+ uint32 i;
686
+
687
+ if (id == ATOM_TO_JSID(cx->runtime->atomState.lengthAtom))
688
+ return IndexToValue(cx, obj->fslots[JSSLOT_ARRAY_LENGTH], vp);
689
+
690
+ if (id == ATOM_TO_JSID(cx->runtime->atomState.protoAtom)) {
691
+ *vp = STOBJ_GET_SLOT(obj, JSSLOT_PROTO);
692
+ return JS_TRUE;
693
+ }
694
+
695
+ if (!OBJ_IS_DENSE_ARRAY(cx, obj))
696
+ return js_GetProperty(cx, obj, id, vp);
697
+
698
+ if (!js_IdIsIndex(ID_TO_VALUE(id), &i) || i >= ARRAY_DENSE_LENGTH(obj) ||
699
+ obj->dslots[i] == JSVAL_HOLE) {
700
+ JSObject *obj2;
701
+ JSProperty *prop;
702
+ JSScopeProperty *sprop;
703
+
704
+ JSObject *proto = STOBJ_GET_PROTO(obj);
705
+ if (!proto) {
706
+ *vp = JSVAL_VOID;
707
+ return JS_TRUE;
708
+ }
709
+
710
+ *vp = JSVAL_VOID;
711
+ if (js_LookupPropertyWithFlags(cx, proto, id, cx->resolveFlags,
712
+ &obj2, &prop) < 0)
713
+ return JS_FALSE;
714
+
715
+ if (prop) {
716
+ if (OBJ_IS_NATIVE(obj2)) {
717
+ sprop = (JSScopeProperty *) prop;
718
+ if (!js_NativeGet(cx, obj, obj2, sprop, vp))
719
+ return JS_FALSE;
720
+ }
721
+ OBJ_DROP_PROPERTY(cx, obj2, prop);
722
+ }
723
+ return JS_TRUE;
724
+ }
725
+
726
+ *vp = obj->dslots[i];
727
+ return JS_TRUE;
728
+ }
729
+
730
+ static JSBool
731
+ slowarray_addProperty(JSContext *cx, JSObject *obj, jsval id, jsval *vp)
732
+ {
733
+ jsuint index, length;
734
+
735
+ if (!js_IdIsIndex(id, &index))
736
+ return JS_TRUE;
737
+ length = obj->fslots[JSSLOT_ARRAY_LENGTH];
738
+ if (index >= length)
739
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = index + 1;
740
+ return JS_TRUE;
741
+ }
742
+
743
+ static void
744
+ slowarray_trace(JSTracer *trc, JSObject *obj)
745
+ {
746
+ uint32 length = obj->fslots[JSSLOT_ARRAY_LENGTH];
747
+
748
+ JS_ASSERT(STOBJ_GET_CLASS(obj) == &js_SlowArrayClass);
749
+
750
+ /*
751
+ * Move JSSLOT_ARRAY_LENGTH aside to prevent the GC from treating
752
+ * untagged integer values as objects or strings.
753
+ */
754
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = JSVAL_VOID;
755
+ js_TraceObject(trc, obj);
756
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = length;
757
+ }
758
+
759
+ static JSObjectOps js_SlowArrayObjectOps;
760
+
761
+ static JSObjectOps *
762
+ slowarray_getObjectOps(JSContext *cx, JSClass *clasp)
763
+ {
764
+ return &js_SlowArrayObjectOps;
765
+ }
766
+
767
+ static JSBool
768
+ array_setProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
769
+ {
770
+ uint32 i;
771
+
772
+ if (id == ATOM_TO_JSID(cx->runtime->atomState.lengthAtom))
773
+ return array_length_setter(cx, obj, id, vp);
774
+
775
+ if (!OBJ_IS_DENSE_ARRAY(cx, obj))
776
+ return js_SetProperty(cx, obj, id, vp);
777
+
778
+ if (!js_IdIsIndex(id, &i) || INDEX_TOO_SPARSE(obj, i)) {
779
+ if (!js_MakeArraySlow(cx, obj))
780
+ return JS_FALSE;
781
+ return js_SetProperty(cx, obj, id, vp);
782
+ }
783
+
784
+ if (!EnsureLength(cx, obj, i + 1))
785
+ return JS_FALSE;
786
+
787
+ if (i >= (uint32)obj->fslots[JSSLOT_ARRAY_LENGTH])
788
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = i + 1;
789
+ if (obj->dslots[i] == JSVAL_HOLE)
790
+ obj->fslots[JSSLOT_ARRAY_COUNT]++;
791
+ obj->dslots[i] = *vp;
792
+ return JS_TRUE;
793
+ }
794
+
795
+ #ifdef JS_TRACER
796
+ JSBool FASTCALL
797
+ js_Array_dense_setelem(JSContext* cx, JSObject* obj, jsint i, jsval v)
798
+ {
799
+ JS_ASSERT(OBJ_IS_DENSE_ARRAY(cx, obj));
800
+
801
+ do {
802
+ jsuint length = ARRAY_DENSE_LENGTH(obj);
803
+ if ((jsuint)i < length) {
804
+ if (obj->dslots[i] == JSVAL_HOLE) {
805
+ if (cx->runtime->anyArrayProtoHasElement)
806
+ break;
807
+ if (i >= obj->fslots[JSSLOT_ARRAY_LENGTH])
808
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = i + 1;
809
+ obj->fslots[JSSLOT_ARRAY_COUNT]++;
810
+ }
811
+ obj->dslots[i] = v;
812
+ return JS_TRUE;
813
+ }
814
+ } while (0);
815
+ return OBJ_SET_PROPERTY(cx, obj, INT_TO_JSID(i), &v);
816
+ }
817
+ #endif
818
+
819
+ static JSBool
820
+ array_defineProperty(JSContext *cx, JSObject *obj, jsid id, jsval value,
821
+ JSPropertyOp getter, JSPropertyOp setter, uintN attrs,
822
+ JSProperty **propp)
823
+ {
824
+ uint32 i;
825
+ JSBool isIndex;
826
+
827
+ if (id == ATOM_TO_JSID(cx->runtime->atomState.lengthAtom))
828
+ return JS_TRUE;
829
+
830
+ isIndex = js_IdIsIndex(ID_TO_VALUE(id), &i);
831
+ if (!isIndex || attrs != JSPROP_ENUMERATE) {
832
+ if (!ENSURE_SLOW_ARRAY(cx, obj))
833
+ return JS_FALSE;
834
+ if (isIndex && STOBJ_IS_DELEGATE(obj))
835
+ cx->runtime->anyArrayProtoHasElement = JS_TRUE;
836
+ return js_DefineProperty(cx, obj, id, value, getter, setter, attrs, propp);
837
+ }
838
+
839
+ return array_setProperty(cx, obj, id, &value);
840
+ }
841
+
842
+ static JSBool
843
+ array_getAttributes(JSContext *cx, JSObject *obj, jsid id, JSProperty *prop,
844
+ uintN *attrsp)
845
+ {
846
+ *attrsp = id == ATOM_TO_JSID(cx->runtime->atomState.lengthAtom)
847
+ ? JSPROP_PERMANENT : JSPROP_ENUMERATE;
848
+ return JS_TRUE;
849
+ }
850
+
851
+ static JSBool
852
+ array_setAttributes(JSContext *cx, JSObject *obj, jsid id, JSProperty *prop,
853
+ uintN *attrsp)
854
+ {
855
+ JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
856
+ JSMSG_CANT_SET_ARRAY_ATTRS);
857
+ return JS_FALSE;
858
+ }
859
+
860
+ static JSBool
861
+ array_deleteProperty(JSContext *cx, JSObject *obj, jsval id, jsval *rval)
862
+ {
863
+ uint32 i;
864
+
865
+ if (!OBJ_IS_DENSE_ARRAY(cx, obj))
866
+ return js_DeleteProperty(cx, obj, id, rval);
867
+
868
+ if (id == ATOM_TO_JSID(cx->runtime->atomState.lengthAtom)) {
869
+ *rval = JSVAL_FALSE;
870
+ return JS_TRUE;
871
+ }
872
+
873
+ if (js_IdIsIndex(id, &i) && i < ARRAY_DENSE_LENGTH(obj) &&
874
+ obj->dslots[i] != JSVAL_HOLE) {
875
+ obj->fslots[JSSLOT_ARRAY_COUNT]--;
876
+ obj->dslots[i] = JSVAL_HOLE;
877
+ }
878
+
879
+ *rval = JSVAL_TRUE;
880
+ return JS_TRUE;
881
+ }
882
+
883
+ /*
884
+ * JSObjectOps.enumerate implementation.
885
+ *
886
+ * For a fast array, JSENUMERATE_INIT captures in the enumeration state both
887
+ * the length of the array and the bitmap indicating the positions of holes in
888
+ * the array. This ensures that adding or deleting array elements does not
889
+ * affect the sequence of indexes JSENUMERATE_NEXT returns.
890
+ *
891
+ * For a common case of an array without holes, to represent the state we pack
892
+ * the (nextEnumerationIndex, arrayLength) pair as a pseudo-boolean jsval.
893
+ * This is possible when length <= PACKED_UINT_PAIR_BITS. For arrays with
894
+ * greater length or holes we allocate the JSIndexIterState structure and
895
+ * store it as an int-tagged private pointer jsval. For a slow array we
896
+ * delegate the enumeration implementation to js_Enumerate in
897
+ * slowarray_enumerate.
898
+ *
899
+ * Array mutations can turn a fast array into a slow one after the enumeration
900
+ * starts. When this happens, slowarray_enumerate receives a state created
901
+ * when the array was fast. To distinguish such fast state from a slow state,
902
+ * which is an int-tagged pointer that js_Enumerate creates, we set not one
903
+ * but two lowest bits when tagging a JSIndexIterState pointer -- see
904
+ * INDEX_ITER_TAG usage below. Thus, when slowarray_enumerate receives a state
905
+ * tagged with JSVAL_BOOLEAN or with two lowest bits set, it knows that this
906
+ * is a fast state so it calls array_enumerate to continue enumerating the
907
+ * indexes present in the original fast array.
908
+ */
909
+
910
+ #define PACKED_UINT_PAIR_BITS 14
911
+ #define PACKED_UINT_PAIR_MASK JS_BITMASK(PACKED_UINT_PAIR_BITS)
912
+
913
+ #define UINT_PAIR_TO_BOOLEAN_JSVAL(i,j) \
914
+ (JS_ASSERT((uint32) (i) <= PACKED_UINT_PAIR_MASK), \
915
+ JS_ASSERT((uint32) (j) <= PACKED_UINT_PAIR_MASK), \
916
+ ((jsval) (i) << (PACKED_UINT_PAIR_BITS + JSVAL_TAGBITS)) | \
917
+ ((jsval) (j) << (JSVAL_TAGBITS)) | \
918
+ (jsval) JSVAL_BOOLEAN)
919
+
920
+ #define BOOLEAN_JSVAL_TO_UINT_PAIR(v,i,j) \
921
+ (JS_ASSERT(JSVAL_TAG(v) == JSVAL_BOOLEAN), \
922
+ (i) = (uint32) ((v) >> (PACKED_UINT_PAIR_BITS + JSVAL_TAGBITS)), \
923
+ (j) = (uint32) ((v) >> JSVAL_TAGBITS) & PACKED_UINT_PAIR_MASK, \
924
+ JS_ASSERT((i) <= PACKED_UINT_PAIR_MASK))
925
+
926
+ JS_STATIC_ASSERT(PACKED_UINT_PAIR_BITS * 2 + JSVAL_TAGBITS <= JS_BITS_PER_WORD);
927
+
928
+ typedef struct JSIndexIterState {
929
+ uint32 index;
930
+ uint32 length;
931
+ JSBool hasHoles;
932
+
933
+ /*
934
+ * Variable-length bitmap representing array's holes. It must not be
935
+ * accessed when hasHoles is false.
936
+ */
937
+ jsbitmap holes[1];
938
+ } JSIndexIterState;
939
+
940
+ #define INDEX_ITER_TAG 3
941
+
942
+ JS_STATIC_ASSERT(JSVAL_INT == 1);
943
+
944
+ static JSBool
945
+ array_enumerate(JSContext *cx, JSObject *obj, JSIterateOp enum_op,
946
+ jsval *statep, jsid *idp)
947
+ {
948
+ uint32 length, i;
949
+ JSIndexIterState *ii;
950
+
951
+ switch (enum_op) {
952
+ case JSENUMERATE_INIT:
953
+ JS_ASSERT(OBJ_IS_DENSE_ARRAY(cx, obj));
954
+ length = ARRAY_DENSE_LENGTH(obj);
955
+ if (idp)
956
+ *idp = INT_TO_JSVAL(obj->fslots[JSSLOT_ARRAY_COUNT]);
957
+ ii = NULL;
958
+ for (i = 0; i != length; ++i) {
959
+ if (obj->dslots[i] == JSVAL_HOLE) {
960
+ if (!ii) {
961
+ ii = (JSIndexIterState *)
962
+ JS_malloc(cx, offsetof(JSIndexIterState, holes) +
963
+ JS_BITMAP_SIZE(length));
964
+ if (!ii)
965
+ return JS_FALSE;
966
+ ii->hasHoles = JS_TRUE;
967
+ memset(ii->holes, 0, JS_BITMAP_SIZE(length));
968
+ }
969
+ JS_SET_BIT(ii->holes, i);
970
+ }
971
+ }
972
+ if (!ii) {
973
+ /* Array has no holes. */
974
+ if (length <= PACKED_UINT_PAIR_MASK) {
975
+ *statep = UINT_PAIR_TO_BOOLEAN_JSVAL(0, length);
976
+ break;
977
+ }
978
+ ii = (JSIndexIterState *)
979
+ JS_malloc(cx, offsetof(JSIndexIterState, holes));
980
+ if (!ii)
981
+ return JS_FALSE;
982
+ ii->hasHoles = JS_FALSE;
983
+ }
984
+ ii->index = 0;
985
+ ii->length = length;
986
+ *statep = (jsval) ii | INDEX_ITER_TAG;
987
+ JS_ASSERT(*statep & JSVAL_INT);
988
+ break;
989
+
990
+ case JSENUMERATE_NEXT:
991
+ if (JSVAL_TAG(*statep) == JSVAL_BOOLEAN) {
992
+ BOOLEAN_JSVAL_TO_UINT_PAIR(*statep, i, length);
993
+ if (i != length) {
994
+ *idp = INT_TO_JSID(i);
995
+ *statep = UINT_PAIR_TO_BOOLEAN_JSVAL(i + 1, length);
996
+ break;
997
+ }
998
+ } else {
999
+ JS_ASSERT((*statep & INDEX_ITER_TAG) == INDEX_ITER_TAG);
1000
+ ii = (JSIndexIterState *) (*statep & ~INDEX_ITER_TAG);
1001
+ i = ii->index;
1002
+ if (i != ii->length) {
1003
+ /* Skip holes if any. */
1004
+ if (ii->hasHoles) {
1005
+ while (JS_TEST_BIT(ii->holes, i) && ++i != ii->length)
1006
+ continue;
1007
+ }
1008
+ if (i != ii->length) {
1009
+ ii->index = i + 1;
1010
+ return js_IndexToId(cx, i, idp);
1011
+ }
1012
+ }
1013
+ }
1014
+ /* FALL THROUGH */
1015
+
1016
+ case JSENUMERATE_DESTROY:
1017
+ if (JSVAL_TAG(*statep) != JSVAL_BOOLEAN) {
1018
+ JS_ASSERT((*statep & INDEX_ITER_TAG) == INDEX_ITER_TAG);
1019
+ ii = (JSIndexIterState *) (*statep & ~INDEX_ITER_TAG);
1020
+ JS_free(cx, ii);
1021
+ }
1022
+ *statep = JSVAL_NULL;
1023
+ break;
1024
+ }
1025
+ return JS_TRUE;
1026
+ }
1027
+
1028
+ static JSBool
1029
+ slowarray_enumerate(JSContext *cx, JSObject *obj, JSIterateOp enum_op,
1030
+ jsval *statep, jsid *idp)
1031
+ {
1032
+ JSBool ok;
1033
+
1034
+ /* Are we continuing an enumeration that started when we were dense? */
1035
+ if (enum_op != JSENUMERATE_INIT) {
1036
+ if (JSVAL_TAG(*statep) == JSVAL_BOOLEAN ||
1037
+ (*statep & INDEX_ITER_TAG) == INDEX_ITER_TAG) {
1038
+ return array_enumerate(cx, obj, enum_op, statep, idp);
1039
+ }
1040
+ JS_ASSERT((*statep & INDEX_ITER_TAG) == JSVAL_INT);
1041
+ }
1042
+ ok = js_Enumerate(cx, obj, enum_op, statep, idp);
1043
+ JS_ASSERT(*statep == JSVAL_NULL || (*statep & INDEX_ITER_TAG) == JSVAL_INT);
1044
+ return ok;
1045
+ }
1046
+
1047
+ static void
1048
+ array_finalize(JSContext *cx, JSObject *obj)
1049
+ {
1050
+ if (obj->dslots)
1051
+ JS_free(cx, obj->dslots - 1);
1052
+ obj->dslots = NULL;
1053
+ }
1054
+
1055
+ static void
1056
+ array_trace(JSTracer *trc, JSObject *obj)
1057
+ {
1058
+ uint32 length;
1059
+ size_t i;
1060
+ jsval v;
1061
+
1062
+ JS_ASSERT(OBJ_IS_DENSE_ARRAY(cx, obj));
1063
+
1064
+ length = ARRAY_DENSE_LENGTH(obj);
1065
+ for (i = 0; i < length; i++) {
1066
+ v = obj->dslots[i];
1067
+ if (JSVAL_IS_TRACEABLE(v)) {
1068
+ JS_SET_TRACING_INDEX(trc, "array_dslots", i);
1069
+ JS_CallTracer(trc, JSVAL_TO_TRACEABLE(v), JSVAL_TRACE_KIND(v));
1070
+ }
1071
+ }
1072
+
1073
+ for (i = JSSLOT_PROTO; i <= JSSLOT_PARENT; ++i) {
1074
+ v = STOBJ_GET_SLOT(obj, i);
1075
+ if (JSVAL_IS_TRACEABLE(v)) {
1076
+ JS_SET_TRACING_DETAILS(trc, js_PrintObjectSlotName, obj, i);
1077
+ JS_CallTracer(trc, JSVAL_TO_TRACEABLE(v), JSVAL_TRACE_KIND(v));
1078
+ }
1079
+ }
1080
+ }
1081
+
1082
+ static JSObjectMap *
1083
+ array_newObjectMap(JSContext *cx, jsrefcount nrefs, JSObjectOps *ops,
1084
+ JSClass *clasp, JSObject *obj)
1085
+ {
1086
+ #ifdef DEBUG
1087
+ extern JSClass js_ArrayClass;
1088
+ extern JSObjectOps js_ArrayObjectOps;
1089
+ #endif
1090
+ JSObjectMap *map = (JSObjectMap *) JS_malloc(cx, sizeof(*map));
1091
+ if (!map)
1092
+ return NULL;
1093
+
1094
+ map->nrefs = nrefs;
1095
+ JS_ASSERT(ops == &js_ArrayObjectOps);
1096
+ map->ops = ops;
1097
+ JS_ASSERT(clasp == &js_ArrayClass);
1098
+ map->freeslot = JSSLOT_FREE(clasp);
1099
+
1100
+ return map;
1101
+ }
1102
+
1103
+ void
1104
+ array_destroyObjectMap(JSContext *cx, JSObjectMap *map)
1105
+ {
1106
+ JS_free(cx, map);
1107
+ }
1108
+
1109
+ JSObjectOps js_ArrayObjectOps = {
1110
+ array_newObjectMap, array_destroyObjectMap,
1111
+ array_lookupProperty, array_defineProperty,
1112
+ array_getProperty, array_setProperty,
1113
+ array_getAttributes, array_setAttributes,
1114
+ array_deleteProperty, js_DefaultValue,
1115
+ array_enumerate, js_CheckAccess,
1116
+ NULL, array_dropProperty,
1117
+ NULL, NULL,
1118
+ NULL, js_HasInstance,
1119
+ js_SetProtoOrParent, js_SetProtoOrParent,
1120
+ array_trace, NULL,
1121
+ NULL, NULL
1122
+ };
1123
+
1124
+ static JSObjectOps *
1125
+ array_getObjectOps(JSContext *cx, JSClass *clasp)
1126
+ {
1127
+ return &js_ArrayObjectOps;
1128
+ }
1129
+
1130
+ JSClass js_ArrayClass = {
1131
+ "Array",
1132
+ JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Array) |
1133
+ JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_NEW_ENUMERATE,
1134
+ JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
1135
+ JS_EnumerateStub, JS_ResolveStub, js_TryValueOf, array_finalize,
1136
+ array_getObjectOps, NULL, NULL, NULL,
1137
+ NULL, NULL, NULL, NULL
1138
+ };
1139
+
1140
+ JSClass js_SlowArrayClass = {
1141
+ "Array",
1142
+ JSCLASS_HAS_PRIVATE | JSCLASS_HAS_CACHED_PROTO(JSProto_Array),
1143
+ slowarray_addProperty, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
1144
+ JS_EnumerateStub, JS_ResolveStub, js_TryValueOf, JS_FinalizeStub,
1145
+ slowarray_getObjectOps, NULL, NULL, NULL,
1146
+ NULL, NULL, NULL, NULL
1147
+ };
1148
+
1149
+ /*
1150
+ * Convert an array object from fast-and-dense to slow-and-flexible.
1151
+ */
1152
+ JSBool
1153
+ js_MakeArraySlow(JSContext *cx, JSObject *obj)
1154
+ {
1155
+ JSObjectMap *map, *oldmap;
1156
+ uint32 i, length;
1157
+
1158
+ JS_ASSERT(OBJ_GET_CLASS(cx, obj) == &js_ArrayClass);
1159
+
1160
+ /* Create a native scope. */
1161
+ map = js_NewObjectMap(cx, obj->map->nrefs, &js_SlowArrayObjectOps,
1162
+ &js_SlowArrayClass, obj);
1163
+ if (!map)
1164
+ return JS_FALSE;
1165
+
1166
+ length = ARRAY_DENSE_LENGTH(obj);
1167
+ if (length) {
1168
+ map->freeslot = STOBJ_NSLOTS(obj) + JS_INITIAL_NSLOTS;
1169
+ obj->dslots[-1] = JS_INITIAL_NSLOTS + length;
1170
+ } else {
1171
+ map->freeslot = STOBJ_NSLOTS(obj);
1172
+ }
1173
+
1174
+ /* Create new properties pointing to existing values in dslots */
1175
+ for (i = 0; i < length; i++) {
1176
+ jsid id;
1177
+ JSScopeProperty *sprop;
1178
+
1179
+ if (!JS_ValueToId(cx, INT_TO_JSVAL(i), &id))
1180
+ goto out_bad;
1181
+
1182
+ if (obj->dslots[i] == JSVAL_HOLE) {
1183
+ obj->dslots[i] = JSVAL_VOID;
1184
+ continue;
1185
+ }
1186
+
1187
+ sprop = js_AddScopeProperty(cx, (JSScope *)map, id, NULL, NULL,
1188
+ i + JS_INITIAL_NSLOTS, JSPROP_ENUMERATE,
1189
+ 0, 0);
1190
+ if (!sprop)
1191
+ goto out_bad;
1192
+ }
1193
+
1194
+ /*
1195
+ * Render our formerly-reserved count property GC-safe. If length fits in
1196
+ * a jsval, set our slow/sparse COUNT to the current length as a jsval, so
1197
+ * we can tell when only named properties have been added to a dense array
1198
+ * to make it slow-but-not-sparse.
1199
+ */
1200
+ length = obj->fslots[JSSLOT_ARRAY_LENGTH];
1201
+ obj->fslots[JSSLOT_ARRAY_COUNT] = INT_FITS_IN_JSVAL(length)
1202
+ ? INT_TO_JSVAL(length)
1203
+ : JSVAL_VOID;
1204
+
1205
+ /* Make sure we preserve any flags borrowing bits in classword. */
1206
+ obj->classword ^= (jsuword) &js_ArrayClass;
1207
+ obj->classword |= (jsuword) &js_SlowArrayClass;
1208
+
1209
+ /* Swap in our new map. */
1210
+ oldmap = obj->map;
1211
+ obj->map = map;
1212
+ array_destroyObjectMap(cx, oldmap);
1213
+
1214
+ return JS_TRUE;
1215
+
1216
+ out_bad:
1217
+ js_DestroyObjectMap(cx, map);
1218
+ return JS_FALSE;
1219
+ }
1220
+
1221
+ enum ArrayToStringOp {
1222
+ TO_STRING,
1223
+ TO_LOCALE_STRING,
1224
+ TO_SOURCE
1225
+ };
1226
+
1227
+ /*
1228
+ * When op is TO_STRING or TO_LOCALE_STRING sep indicates a separator to use
1229
+ * or "," when sep is NULL.
1230
+ * When op is TO_SOURCE sep must be NULL.
1231
+ */
1232
+ static JSBool
1233
+ array_join_sub(JSContext *cx, JSObject *obj, enum ArrayToStringOp op,
1234
+ JSString *sep, jsval *rval)
1235
+ {
1236
+ JSBool ok, hole;
1237
+ jsuint length, index;
1238
+ jschar *chars, *ochars;
1239
+ size_t nchars, growth, seplen, tmplen, extratail;
1240
+ const jschar *sepstr;
1241
+ JSString *str;
1242
+ JSHashEntry *he;
1243
+ JSAtom *atom;
1244
+
1245
+ JS_CHECK_RECURSION(cx, return JS_FALSE);
1246
+
1247
+ ok = js_GetLengthProperty(cx, obj, &length);
1248
+ if (!ok)
1249
+ return JS_FALSE;
1250
+
1251
+ he = js_EnterSharpObject(cx, obj, NULL, &chars);
1252
+ if (!he)
1253
+ return JS_FALSE;
1254
+ #ifdef DEBUG
1255
+ growth = (size_t) -1;
1256
+ #endif
1257
+
1258
+ if (op == TO_SOURCE) {
1259
+ if (IS_SHARP(he)) {
1260
+ #if JS_HAS_SHARP_VARS
1261
+ nchars = js_strlen(chars);
1262
+ #else
1263
+ chars[0] = '[';
1264
+ chars[1] = ']';
1265
+ chars[2] = 0;
1266
+ nchars = 2;
1267
+ #endif
1268
+ goto make_string;
1269
+ }
1270
+
1271
+ /*
1272
+ * Always allocate 2 extra chars for closing ']' and terminating 0
1273
+ * and then preallocate 1 + extratail to include starting '['.
1274
+ */
1275
+ extratail = 2;
1276
+ growth = (1 + extratail) * sizeof(jschar);
1277
+ if (!chars) {
1278
+ nchars = 0;
1279
+ chars = (jschar *) malloc(growth);
1280
+ if (!chars)
1281
+ goto done;
1282
+ } else {
1283
+ MAKE_SHARP(he);
1284
+ nchars = js_strlen(chars);
1285
+ growth += nchars * sizeof(jschar);
1286
+ chars = (jschar *)realloc((ochars = chars), growth);
1287
+ if (!chars) {
1288
+ free(ochars);
1289
+ goto done;
1290
+ }
1291
+ }
1292
+ chars[nchars++] = '[';
1293
+ JS_ASSERT(sep == NULL);
1294
+ sepstr = NULL; /* indicates to use ", " as separator */
1295
+ seplen = 2;
1296
+ } else {
1297
+ /*
1298
+ * Free any sharp variable definition in chars. Normally, we would
1299
+ * MAKE_SHARP(he) so that only the first sharp variable annotation is
1300
+ * a definition, and all the rest are references, but in the current
1301
+ * case of (op != TO_SOURCE), we don't need chars at all.
1302
+ */
1303
+ if (chars)
1304
+ JS_free(cx, chars);
1305
+ chars = NULL;
1306
+ nchars = 0;
1307
+ extratail = 1; /* allocate extra char for terminating 0 */
1308
+
1309
+ /* Return the empty string on a cycle as well as on empty join. */
1310
+ if (IS_BUSY(he) || length == 0) {
1311
+ js_LeaveSharpObject(cx, NULL);
1312
+ *rval = JS_GetEmptyStringValue(cx);
1313
+ return ok;
1314
+ }
1315
+
1316
+ /* Flag he as BUSY so we can distinguish a cycle from a join-point. */
1317
+ MAKE_BUSY(he);
1318
+
1319
+ if (sep) {
1320
+ JSSTRING_CHARS_AND_LENGTH(sep, sepstr, seplen);
1321
+ } else {
1322
+ sepstr = NULL; /* indicates to use "," as separator */
1323
+ seplen = 1;
1324
+ }
1325
+ }
1326
+
1327
+ /* Use rval to locally root each element value as we loop and convert. */
1328
+ for (index = 0; index < length; index++) {
1329
+ ok = (JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) &&
1330
+ GetArrayElement(cx, obj, index, &hole, rval));
1331
+ if (!ok)
1332
+ goto done;
1333
+ if (hole ||
1334
+ (op != TO_SOURCE &&
1335
+ (JSVAL_IS_VOID(*rval) || JSVAL_IS_NULL(*rval)))) {
1336
+ str = cx->runtime->emptyString;
1337
+ } else {
1338
+ if (op == TO_LOCALE_STRING) {
1339
+ JSObject *robj;
1340
+
1341
+ atom = cx->runtime->atomState.toLocaleStringAtom;
1342
+ ok = js_ValueToObject(cx, *rval, &robj);
1343
+ if (ok) {
1344
+ /* Re-use *rval to protect robj temporarily. */
1345
+ *rval = OBJECT_TO_JSVAL(robj);
1346
+ ok = js_TryMethod(cx, robj, atom, 0, NULL, rval);
1347
+ }
1348
+ if (!ok)
1349
+ goto done;
1350
+ str = js_ValueToString(cx, *rval);
1351
+ } else if (op == TO_STRING) {
1352
+ str = js_ValueToString(cx, *rval);
1353
+ } else {
1354
+ JS_ASSERT(op == TO_SOURCE);
1355
+ str = js_ValueToSource(cx, *rval);
1356
+ }
1357
+ if (!str) {
1358
+ ok = JS_FALSE;
1359
+ goto done;
1360
+ }
1361
+ }
1362
+
1363
+ /*
1364
+ * Do not append separator after the last element unless it is a hole
1365
+ * and we are in toSource. In that case we append single ",".
1366
+ */
1367
+ if (index + 1 == length)
1368
+ seplen = (hole && op == TO_SOURCE) ? 1 : 0;
1369
+
1370
+ /* Allocate 1 at end for closing bracket and zero. */
1371
+ tmplen = JSSTRING_LENGTH(str);
1372
+ growth = nchars + tmplen + seplen + extratail;
1373
+ if (nchars > growth || tmplen > growth ||
1374
+ growth > (size_t)-1 / sizeof(jschar)) {
1375
+ if (chars) {
1376
+ free(chars);
1377
+ chars = NULL;
1378
+ }
1379
+ goto done;
1380
+ }
1381
+ growth *= sizeof(jschar);
1382
+ JS_COUNT_OPERATION(cx, JSOW_ALLOCATION);
1383
+ if (!chars) {
1384
+ chars = (jschar *) malloc(growth);
1385
+ if (!chars)
1386
+ goto done;
1387
+ } else {
1388
+ chars = (jschar *) realloc((ochars = chars), growth);
1389
+ if (!chars) {
1390
+ free(ochars);
1391
+ goto done;
1392
+ }
1393
+ }
1394
+
1395
+ js_strncpy(&chars[nchars], JSSTRING_CHARS(str), tmplen);
1396
+ nchars += tmplen;
1397
+
1398
+ if (seplen) {
1399
+ if (sepstr) {
1400
+ js_strncpy(&chars[nchars], sepstr, seplen);
1401
+ } else {
1402
+ JS_ASSERT(seplen == 1 || seplen == 2);
1403
+ chars[nchars] = ',';
1404
+ if (seplen == 2)
1405
+ chars[nchars + 1] = ' ';
1406
+ }
1407
+ nchars += seplen;
1408
+ }
1409
+ }
1410
+
1411
+ done:
1412
+ if (op == TO_SOURCE) {
1413
+ if (chars)
1414
+ chars[nchars++] = ']';
1415
+ } else {
1416
+ CLEAR_BUSY(he);
1417
+ }
1418
+ js_LeaveSharpObject(cx, NULL);
1419
+ if (!ok) {
1420
+ if (chars)
1421
+ free(chars);
1422
+ return ok;
1423
+ }
1424
+
1425
+ make_string:
1426
+ if (!chars) {
1427
+ JS_ReportOutOfMemory(cx);
1428
+ return JS_FALSE;
1429
+ }
1430
+ chars[nchars] = 0;
1431
+ JS_ASSERT(growth == (size_t)-1 || (nchars + 1) * sizeof(jschar) == growth);
1432
+ str = js_NewString(cx, chars, nchars);
1433
+ if (!str) {
1434
+ free(chars);
1435
+ return JS_FALSE;
1436
+ }
1437
+ *rval = STRING_TO_JSVAL(str);
1438
+ return JS_TRUE;
1439
+ }
1440
+
1441
+ #if JS_HAS_TOSOURCE
1442
+ static JSBool
1443
+ array_toSource(JSContext *cx, uintN argc, jsval *vp)
1444
+ {
1445
+ JSObject *obj;
1446
+
1447
+ obj = JS_THIS_OBJECT(cx, vp);
1448
+ if (OBJ_GET_CLASS(cx, obj) != &js_SlowArrayClass &&
1449
+ !JS_InstanceOf(cx, obj, &js_ArrayClass, vp + 2)) {
1450
+ return JS_FALSE;
1451
+ }
1452
+ return array_join_sub(cx, obj, TO_SOURCE, NULL, vp);
1453
+ }
1454
+ #endif
1455
+
1456
+ static JSBool
1457
+ array_toString(JSContext *cx, uintN argc, jsval *vp)
1458
+ {
1459
+ JSObject *obj;
1460
+
1461
+ obj = JS_THIS_OBJECT(cx, vp);
1462
+ if (OBJ_GET_CLASS(cx, obj) != &js_SlowArrayClass &&
1463
+ !JS_InstanceOf(cx, obj, &js_ArrayClass, vp + 2)) {
1464
+ return JS_FALSE;
1465
+ }
1466
+ return array_join_sub(cx, obj, TO_STRING, NULL, vp);
1467
+ }
1468
+
1469
+ static JSBool
1470
+ array_toLocaleString(JSContext *cx, uintN argc, jsval *vp)
1471
+ {
1472
+ JSObject *obj;
1473
+
1474
+ obj = JS_THIS_OBJECT(cx, vp);
1475
+ if (OBJ_GET_CLASS(cx, obj) != &js_SlowArrayClass &&
1476
+ !JS_InstanceOf(cx, obj, &js_ArrayClass, vp + 2)) {
1477
+ return JS_FALSE;
1478
+ }
1479
+
1480
+ /*
1481
+ * Passing comma here as the separator. Need a way to get a
1482
+ * locale-specific version.
1483
+ */
1484
+ return array_join_sub(cx, obj, TO_LOCALE_STRING, NULL, vp);
1485
+ }
1486
+
1487
+ static JSBool
1488
+ InitArrayElements(JSContext *cx, JSObject *obj, jsuint start, jsuint end,
1489
+ jsval *vector)
1490
+ {
1491
+ if (OBJ_IS_DENSE_ARRAY(cx, obj)) {
1492
+ if (!EnsureLength(cx, obj, end))
1493
+ return JS_FALSE;
1494
+
1495
+ if (end > (uint32)obj->fslots[JSSLOT_ARRAY_LENGTH])
1496
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = end;
1497
+
1498
+ memcpy(obj->dslots + start, vector, sizeof(jsval) * (end - start));
1499
+ return JS_TRUE;
1500
+ }
1501
+
1502
+ while (start != end) {
1503
+ if (!JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) ||
1504
+ !SetArrayElement(cx, obj, start++, *vector++)) {
1505
+ return JS_FALSE;
1506
+ }
1507
+ }
1508
+ return JS_TRUE;
1509
+ }
1510
+
1511
+ static JSBool
1512
+ InitArrayObject(JSContext *cx, JSObject *obj, jsuint length, jsval *vector,
1513
+ JSBool holey = JS_FALSE)
1514
+ {
1515
+ JS_ASSERT(OBJ_IS_ARRAY(cx, obj));
1516
+
1517
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = length;
1518
+
1519
+ if (vector) {
1520
+ if (!EnsureLength(cx, obj, length))
1521
+ return JS_FALSE;
1522
+
1523
+ jsuint count = length;
1524
+ if (!holey) {
1525
+ memcpy(obj->dslots, vector, length * sizeof (jsval));
1526
+ } else {
1527
+ for (jsuint i = 0; i < length; i++) {
1528
+ if (vector[i] == JSVAL_HOLE)
1529
+ --count;
1530
+ obj->dslots[i] = vector[i];
1531
+ }
1532
+ }
1533
+ obj->fslots[JSSLOT_ARRAY_COUNT] = count;
1534
+ } else {
1535
+ obj->fslots[JSSLOT_ARRAY_COUNT] = 0;
1536
+ }
1537
+ return JS_TRUE;
1538
+ }
1539
+
1540
+ #ifdef JS_TRACER
1541
+ static JSString* FASTCALL
1542
+ Array_p_join(JSContext* cx, JSObject* obj, JSString *str)
1543
+ {
1544
+ jsval v;
1545
+ if (!array_join_sub(cx, obj, TO_STRING, str, &v))
1546
+ return NULL;
1547
+ JS_ASSERT(JSVAL_IS_STRING(v));
1548
+ return JSVAL_TO_STRING(v);
1549
+ }
1550
+
1551
+ static JSString* FASTCALL
1552
+ Array_p_toString(JSContext* cx, JSObject* obj)
1553
+ {
1554
+ jsval v;
1555
+ if (!array_join_sub(cx, obj, TO_STRING, NULL, &v))
1556
+ return NULL;
1557
+ JS_ASSERT(JSVAL_IS_STRING(v));
1558
+ return JSVAL_TO_STRING(v);
1559
+ }
1560
+ #endif
1561
+
1562
+ /*
1563
+ * Perl-inspired join, reverse, and sort.
1564
+ */
1565
+ static JSBool
1566
+ array_join(JSContext *cx, uintN argc, jsval *vp)
1567
+ {
1568
+ JSString *str;
1569
+ JSObject *obj;
1570
+
1571
+ if (argc == 0 || JSVAL_IS_VOID(vp[2])) {
1572
+ str = NULL;
1573
+ } else {
1574
+ str = js_ValueToString(cx, vp[2]);
1575
+ if (!str)
1576
+ return JS_FALSE;
1577
+ vp[2] = STRING_TO_JSVAL(str);
1578
+ }
1579
+ obj = JS_THIS_OBJECT(cx, vp);
1580
+ return obj && array_join_sub(cx, obj, TO_STRING, str, vp);
1581
+ }
1582
+
1583
+ static JSBool
1584
+ array_reverse(JSContext *cx, uintN argc, jsval *vp)
1585
+ {
1586
+ JSObject *obj;
1587
+ JSTempValueRooter tvr;
1588
+ jsuint len, half, i;
1589
+ JSBool ok, hole, hole2;
1590
+
1591
+ obj = JS_THIS_OBJECT(cx, vp);
1592
+ if (!obj || !js_GetLengthProperty(cx, obj, &len))
1593
+ return JS_FALSE;
1594
+
1595
+ ok = JS_TRUE;
1596
+ JS_PUSH_SINGLE_TEMP_ROOT(cx, JSVAL_NULL, &tvr);
1597
+ half = len / 2;
1598
+ for (i = 0; i < half; i++) {
1599
+ ok = JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) &&
1600
+ GetArrayElement(cx, obj, i, &hole, &tvr.u.value) &&
1601
+ GetArrayElement(cx, obj, len - i - 1, &hole2, vp) &&
1602
+ SetOrDeleteArrayElement(cx, obj, len - i - 1, hole, tvr.u.value) &&
1603
+ SetOrDeleteArrayElement(cx, obj, i, hole2, *vp);
1604
+ if (!ok)
1605
+ break;
1606
+ }
1607
+ JS_POP_TEMP_ROOT(cx, &tvr);
1608
+
1609
+ *vp = OBJECT_TO_JSVAL(obj);
1610
+ return ok;
1611
+ }
1612
+
1613
+ typedef struct MSortArgs {
1614
+ size_t elsize;
1615
+ JSComparator cmp;
1616
+ void *arg;
1617
+ JSBool fastcopy;
1618
+ } MSortArgs;
1619
+
1620
+ /* Helper function for js_MergeSort. */
1621
+ static JSBool
1622
+ MergeArrays(MSortArgs *msa, void *src, void *dest, size_t run1, size_t run2)
1623
+ {
1624
+ void *arg, *a, *b, *c;
1625
+ size_t elsize, runtotal;
1626
+ int cmp_result;
1627
+ JSComparator cmp;
1628
+ JSBool fastcopy;
1629
+
1630
+ runtotal = run1 + run2;
1631
+
1632
+ elsize = msa->elsize;
1633
+ cmp = msa->cmp;
1634
+ arg = msa->arg;
1635
+ fastcopy = msa->fastcopy;
1636
+
1637
+ #define CALL_CMP(a, b) \
1638
+ if (!cmp(arg, (a), (b), &cmp_result)) return JS_FALSE;
1639
+
1640
+ /* Copy runs already in sorted order. */
1641
+ b = (char *)src + run1 * elsize;
1642
+ a = (char *)b - elsize;
1643
+ CALL_CMP(a, b);
1644
+ if (cmp_result <= 0) {
1645
+ memcpy(dest, src, runtotal * elsize);
1646
+ return JS_TRUE;
1647
+ }
1648
+
1649
+ #define COPY_ONE(p,q,n) \
1650
+ (fastcopy ? (void)(*(jsval*)(p) = *(jsval*)(q)) : (void)memcpy(p, q, n))
1651
+
1652
+ a = src;
1653
+ c = dest;
1654
+ for (; runtotal != 0; runtotal--) {
1655
+ JSBool from_a = run2 == 0;
1656
+ if (!from_a && run1 != 0) {
1657
+ CALL_CMP(a,b);
1658
+ from_a = cmp_result <= 0;
1659
+ }
1660
+
1661
+ if (from_a) {
1662
+ COPY_ONE(c, a, elsize);
1663
+ run1--;
1664
+ a = (char *)a + elsize;
1665
+ } else {
1666
+ COPY_ONE(c, b, elsize);
1667
+ run2--;
1668
+ b = (char *)b + elsize;
1669
+ }
1670
+ c = (char *)c + elsize;
1671
+ }
1672
+ #undef COPY_ONE
1673
+ #undef CALL_CMP
1674
+
1675
+ return JS_TRUE;
1676
+ }
1677
+
1678
+ /*
1679
+ * This sort is stable, i.e. sequence of equal elements is preserved.
1680
+ * See also bug #224128.
1681
+ */
1682
+ JSBool
1683
+ js_MergeSort(void *src, size_t nel, size_t elsize,
1684
+ JSComparator cmp, void *arg, void *tmp)
1685
+ {
1686
+ void *swap, *vec1, *vec2;
1687
+ MSortArgs msa;
1688
+ size_t i, j, lo, hi, run;
1689
+ JSBool fastcopy;
1690
+ int cmp_result;
1691
+
1692
+ /* Avoid memcpy overhead for word-sized and word-aligned elements. */
1693
+ fastcopy = (elsize == sizeof(jsval) &&
1694
+ (((jsuword) src | (jsuword) tmp) & JSVAL_ALIGN) == 0);
1695
+ #define COPY_ONE(p,q,n) \
1696
+ (fastcopy ? (void)(*(jsval*)(p) = *(jsval*)(q)) : (void)memcpy(p, q, n))
1697
+ #define CALL_CMP(a, b) \
1698
+ if (!cmp(arg, (a), (b), &cmp_result)) return JS_FALSE;
1699
+ #define INS_SORT_INT 4
1700
+
1701
+ /*
1702
+ * Apply insertion sort to small chunks to reduce the number of merge
1703
+ * passes needed.
1704
+ */
1705
+ for (lo = 0; lo < nel; lo += INS_SORT_INT) {
1706
+ hi = lo + INS_SORT_INT;
1707
+ if (hi >= nel)
1708
+ hi = nel;
1709
+ for (i = lo + 1; i < hi; i++) {
1710
+ vec1 = (char *)src + i * elsize;
1711
+ vec2 = (char *)vec1 - elsize;
1712
+ for (j = i; j > lo; j--) {
1713
+ CALL_CMP(vec2, vec1);
1714
+ /* "<=" instead of "<" insures the sort is stable */
1715
+ if (cmp_result <= 0) {
1716
+ break;
1717
+ }
1718
+
1719
+ /* Swap elements, using "tmp" as tmp storage */
1720
+ COPY_ONE(tmp, vec2, elsize);
1721
+ COPY_ONE(vec2, vec1, elsize);
1722
+ COPY_ONE(vec1, tmp, elsize);
1723
+ vec1 = vec2;
1724
+ vec2 = (char *)vec1 - elsize;
1725
+ }
1726
+ }
1727
+ }
1728
+ #undef CALL_CMP
1729
+ #undef COPY_ONE
1730
+
1731
+ msa.elsize = elsize;
1732
+ msa.cmp = cmp;
1733
+ msa.arg = arg;
1734
+ msa.fastcopy = fastcopy;
1735
+
1736
+ vec1 = src;
1737
+ vec2 = tmp;
1738
+ for (run = INS_SORT_INT; run < nel; run *= 2) {
1739
+ for (lo = 0; lo < nel; lo += 2 * run) {
1740
+ hi = lo + run;
1741
+ if (hi >= nel) {
1742
+ memcpy((char *)vec2 + lo * elsize, (char *)vec1 + lo * elsize,
1743
+ (nel - lo) * elsize);
1744
+ break;
1745
+ }
1746
+ if (!MergeArrays(&msa, (char *)vec1 + lo * elsize,
1747
+ (char *)vec2 + lo * elsize, run,
1748
+ hi + run > nel ? nel - hi : run)) {
1749
+ return JS_FALSE;
1750
+ }
1751
+ }
1752
+ swap = vec1;
1753
+ vec1 = vec2;
1754
+ vec2 = swap;
1755
+ }
1756
+ if (src != vec1)
1757
+ memcpy(src, tmp, nel * elsize);
1758
+
1759
+ return JS_TRUE;
1760
+ }
1761
+
1762
+ typedef struct CompareArgs {
1763
+ JSContext *context;
1764
+ jsval fval;
1765
+ jsval *elemroot; /* stack needed for js_Invoke */
1766
+ } CompareArgs;
1767
+
1768
+ static JSBool
1769
+ sort_compare(void *arg, const void *a, const void *b, int *result)
1770
+ {
1771
+ jsval av = *(const jsval *)a, bv = *(const jsval *)b;
1772
+ CompareArgs *ca = (CompareArgs *) arg;
1773
+ JSContext *cx = ca->context;
1774
+ jsval *invokevp, *sp;
1775
+ jsdouble cmp;
1776
+
1777
+ /**
1778
+ * array_sort deals with holes and undefs on its own and they should not
1779
+ * come here.
1780
+ */
1781
+ JS_ASSERT(!JSVAL_IS_VOID(av));
1782
+ JS_ASSERT(!JSVAL_IS_VOID(bv));
1783
+
1784
+ if (!JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP))
1785
+ return JS_FALSE;
1786
+
1787
+ invokevp = ca->elemroot;
1788
+ sp = invokevp;
1789
+ *sp++ = ca->fval;
1790
+ *sp++ = JSVAL_NULL;
1791
+ *sp++ = av;
1792
+ *sp++ = bv;
1793
+
1794
+ if (!js_Invoke(cx, 2, invokevp, 0))
1795
+ return JS_FALSE;
1796
+
1797
+ cmp = js_ValueToNumber(cx, invokevp);
1798
+ if (JSVAL_IS_NULL(*invokevp))
1799
+ return JS_FALSE;
1800
+
1801
+ /* Clamp cmp to -1, 0, 1. */
1802
+ *result = 0;
1803
+ if (!JSDOUBLE_IS_NaN(cmp) && cmp != 0)
1804
+ *result = cmp > 0 ? 1 : -1;
1805
+
1806
+ /*
1807
+ * XXX else report some kind of error here? ECMA talks about 'consistent
1808
+ * compare functions' that don't return NaN, but is silent about what the
1809
+ * result should be. So we currently ignore it.
1810
+ */
1811
+
1812
+ return JS_TRUE;
1813
+ }
1814
+
1815
+ static int
1816
+ sort_compare_strings(void *arg, const void *a, const void *b, int *result)
1817
+ {
1818
+ jsval av = *(const jsval *)a, bv = *(const jsval *)b;
1819
+
1820
+ JS_ASSERT(JSVAL_IS_STRING(av));
1821
+ JS_ASSERT(JSVAL_IS_STRING(bv));
1822
+ if (!JS_CHECK_OPERATION_LIMIT((JSContext *)arg, JSOW_JUMP))
1823
+ return JS_FALSE;
1824
+
1825
+ *result = (int) js_CompareStrings(JSVAL_TO_STRING(av), JSVAL_TO_STRING(bv));
1826
+ return JS_TRUE;
1827
+ }
1828
+
1829
+ /*
1830
+ * The array_sort function below assumes JSVAL_NULL is zero in order to
1831
+ * perform initialization using memset. Other parts of SpiderMonkey likewise
1832
+ * "know" that JSVAL_NULL is zero; this static assertion covers all cases.
1833
+ */
1834
+ JS_STATIC_ASSERT(JSVAL_NULL == 0);
1835
+
1836
+ static JSBool
1837
+ array_sort(JSContext *cx, uintN argc, jsval *vp)
1838
+ {
1839
+ jsval *argv, fval, *vec, *mergesort_tmp, v;
1840
+ JSObject *obj;
1841
+ CompareArgs ca;
1842
+ jsuint len, newlen, i, undefs;
1843
+ JSTempValueRooter tvr;
1844
+ JSBool hole;
1845
+ bool ok;
1846
+ size_t elemsize;
1847
+ JSString *str;
1848
+
1849
+ /*
1850
+ * Optimize the default compare function case if all of obj's elements
1851
+ * have values of type string.
1852
+ */
1853
+ JSBool all_strings;
1854
+
1855
+ argv = JS_ARGV(cx, vp);
1856
+ if (argc > 0) {
1857
+ if (JSVAL_IS_PRIMITIVE(argv[0])) {
1858
+ JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
1859
+ JSMSG_BAD_SORT_ARG);
1860
+ return JS_FALSE;
1861
+ }
1862
+ fval = argv[0]; /* non-default compare function */
1863
+ } else {
1864
+ fval = JSVAL_NULL;
1865
+ }
1866
+
1867
+ obj = JS_THIS_OBJECT(cx, vp);
1868
+ if (!obj || !js_GetLengthProperty(cx, obj, &len))
1869
+ return JS_FALSE;
1870
+ if (len == 0) {
1871
+ *vp = OBJECT_TO_JSVAL(obj);
1872
+ return JS_TRUE;
1873
+ }
1874
+
1875
+ /*
1876
+ * We need a temporary array of 2 * len jsvals to hold the array elements
1877
+ * and the scratch space for merge sort. Check that its size does not
1878
+ * overflow size_t, which would allow for indexing beyond the end of the
1879
+ * malloc'd vector.
1880
+ */
1881
+ #if JS_BITS_PER_WORD == 32
1882
+ if ((size_t)len > ~(size_t)0 / (2 * sizeof(jsval))) {
1883
+ js_ReportAllocationOverflow(cx);
1884
+ return JS_FALSE;
1885
+ }
1886
+ #endif
1887
+ vec = (jsval *) JS_malloc(cx, 2 * (size_t) len * sizeof(jsval));
1888
+ if (!vec)
1889
+ return JS_FALSE;
1890
+
1891
+ /*
1892
+ * Initialize vec as a root. We will clear elements of vec one by
1893
+ * one while increasing tvr.count when we know that the property at
1894
+ * the corresponding index exists and its value must be rooted.
1895
+ *
1896
+ * In this way when sorting a huge mostly sparse array we will not
1897
+ * access the tail of vec corresponding to properties that do not
1898
+ * exist, allowing OS to avoiding committing RAM. See bug 330812.
1899
+ *
1900
+ * After this point control must flow through label out: to exit.
1901
+ */
1902
+ JS_PUSH_TEMP_ROOT(cx, 0, vec, &tvr);
1903
+
1904
+ /*
1905
+ * By ECMA 262, 15.4.4.11, a property that does not exist (which we
1906
+ * call a "hole") is always greater than an existing property with
1907
+ * value undefined and that is always greater than any other property.
1908
+ * Thus to sort holes and undefs we simply count them, sort the rest
1909
+ * of elements, append undefs after them and then make holes after
1910
+ * undefs.
1911
+ */
1912
+ undefs = 0;
1913
+ newlen = 0;
1914
+ all_strings = JS_TRUE;
1915
+ for (i = 0; i < len; i++) {
1916
+ ok = JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP);
1917
+ if (!ok)
1918
+ goto out;
1919
+
1920
+ /* Clear vec[newlen] before including it in the rooted set. */
1921
+ vec[newlen] = JSVAL_NULL;
1922
+ tvr.count = newlen + 1;
1923
+ ok = GetArrayElement(cx, obj, i, &hole, &vec[newlen]);
1924
+ if (!ok)
1925
+ goto out;
1926
+
1927
+ if (hole)
1928
+ continue;
1929
+
1930
+ if (JSVAL_IS_VOID(vec[newlen])) {
1931
+ ++undefs;
1932
+ continue;
1933
+ }
1934
+
1935
+ /* We know JSVAL_IS_STRING yields 0 or 1, so avoid a branch via &=. */
1936
+ all_strings &= JSVAL_IS_STRING(vec[newlen]);
1937
+
1938
+ ++newlen;
1939
+ }
1940
+
1941
+ if (newlen == 0) {
1942
+ /* The array has only holes and undefs. */
1943
+ ok = JS_TRUE;
1944
+ goto out;
1945
+ }
1946
+
1947
+ /*
1948
+ * The first newlen elements of vec are copied from the array object
1949
+ * (above). The remaining newlen positions are used as GC-rooted scratch
1950
+ * space for mergesort. We must clear the space before including it to
1951
+ * the root set covered by tvr.count. We assume JSVAL_NULL==0 to optimize
1952
+ * initialization using memset.
1953
+ */
1954
+ mergesort_tmp = vec + newlen;
1955
+ memset(mergesort_tmp, 0, newlen * sizeof(jsval));
1956
+ tvr.count = newlen * 2;
1957
+
1958
+ /* Here len == 2 * (newlen + undefs + number_of_holes). */
1959
+ if (fval == JSVAL_NULL) {
1960
+ /*
1961
+ * Sort using the default comparator converting all elements to
1962
+ * strings.
1963
+ */
1964
+ if (all_strings) {
1965
+ elemsize = sizeof(jsval);
1966
+ } else {
1967
+ /*
1968
+ * To avoid string conversion on each compare we do it only once
1969
+ * prior to sorting. But we also need the space for the original
1970
+ * values to recover the sorting result. To reuse
1971
+ * sort_compare_strings we move the original values to the odd
1972
+ * indexes in vec, put the string conversion results in the even
1973
+ * indexes and pass 2 * sizeof(jsval) as an element size to the
1974
+ * sorting function. In this way sort_compare_strings will only
1975
+ * see the string values when it casts the compare arguments as
1976
+ * pointers to jsval.
1977
+ *
1978
+ * This requires doubling the temporary storage including the
1979
+ * scratch space for the merge sort. Since vec already contains
1980
+ * the rooted scratch space for newlen elements at the tail, we
1981
+ * can use it to rearrange and convert to strings first and try
1982
+ * realloc only when we know that we successfully converted all
1983
+ * the elements.
1984
+ */
1985
+ #if JS_BITS_PER_WORD == 32
1986
+ if ((size_t)newlen > ~(size_t)0 / (4 * sizeof(jsval))) {
1987
+ js_ReportAllocationOverflow(cx);
1988
+ ok = JS_FALSE;
1989
+ goto out;
1990
+ }
1991
+ #endif
1992
+
1993
+ /*
1994
+ * Rearrange and string-convert the elements of the vector from
1995
+ * the tail here and, after sorting, move the results back
1996
+ * starting from the start to prevent overwrite the existing
1997
+ * elements.
1998
+ */
1999
+ i = newlen;
2000
+ do {
2001
+ --i;
2002
+ ok = JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP);
2003
+ if (!ok)
2004
+ goto out;
2005
+ v = vec[i];
2006
+ str = js_ValueToString(cx, v);
2007
+ if (!str) {
2008
+ ok = JS_FALSE;
2009
+ goto out;
2010
+ }
2011
+ vec[2 * i] = STRING_TO_JSVAL(str);
2012
+ vec[2 * i + 1] = v;
2013
+ } while (i != 0);
2014
+
2015
+ JS_ASSERT(tvr.u.array == vec);
2016
+ vec = (jsval *) JS_realloc(cx, vec,
2017
+ 4 * (size_t) newlen * sizeof(jsval));
2018
+ if (!vec) {
2019
+ vec = tvr.u.array;
2020
+ ok = JS_FALSE;
2021
+ goto out;
2022
+ }
2023
+ tvr.u.array = vec;
2024
+ mergesort_tmp = vec + 2 * newlen;
2025
+ memset(mergesort_tmp, 0, newlen * 2 * sizeof(jsval));
2026
+ tvr.count = newlen * 4;
2027
+ elemsize = 2 * sizeof(jsval);
2028
+ }
2029
+ ok = js_MergeSort(vec, (size_t) newlen, elemsize,
2030
+ sort_compare_strings, cx, mergesort_tmp);
2031
+ if (!ok)
2032
+ goto out;
2033
+ if (!all_strings) {
2034
+ /*
2035
+ * We want to make the following loop fast and to unroot the
2036
+ * cached results of toString invocations before the operation
2037
+ * callback has a chance to run the GC. For this reason we do
2038
+ * not call JS_CHECK_OPERATION_LIMIT in the loop.
2039
+ */
2040
+ i = 0;
2041
+ do {
2042
+ vec[i] = vec[2 * i + 1];
2043
+ } while (++i != newlen);
2044
+ }
2045
+ } else {
2046
+ void *mark;
2047
+
2048
+ ca.context = cx;
2049
+ ca.fval = fval;
2050
+ ca.elemroot = js_AllocStack(cx, 2 + 2, &mark);
2051
+ if (!ca.elemroot) {
2052
+ ok = JS_FALSE;
2053
+ goto out;
2054
+ }
2055
+ ok = js_MergeSort(vec, (size_t) newlen, sizeof(jsval),
2056
+ sort_compare, &ca, mergesort_tmp);
2057
+ js_FreeStack(cx, mark);
2058
+ if (!ok)
2059
+ goto out;
2060
+ }
2061
+
2062
+ /*
2063
+ * We no longer need to root the scratch space for the merge sort, so
2064
+ * unroot it now to make the job of a potential GC under InitArrayElements
2065
+ * easier.
2066
+ */
2067
+ tvr.count = newlen;
2068
+ ok = InitArrayElements(cx, obj, 0, newlen, vec);
2069
+ if (!ok)
2070
+ goto out;
2071
+
2072
+ out:
2073
+ JS_POP_TEMP_ROOT(cx, &tvr);
2074
+ JS_free(cx, vec);
2075
+ if (!ok)
2076
+ return JS_FALSE;
2077
+
2078
+ /* Set undefs that sorted after the rest of elements. */
2079
+ while (undefs != 0) {
2080
+ --undefs;
2081
+ if (!JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) ||
2082
+ !SetArrayElement(cx, obj, newlen++, JSVAL_VOID)) {
2083
+ return JS_FALSE;
2084
+ }
2085
+ }
2086
+
2087
+ /* Re-create any holes that sorted to the end of the array. */
2088
+ while (len > newlen) {
2089
+ if (!JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) ||
2090
+ !DeleteArrayElement(cx, obj, --len)) {
2091
+ return JS_FALSE;
2092
+ }
2093
+ }
2094
+ *vp = OBJECT_TO_JSVAL(obj);
2095
+ return JS_TRUE;
2096
+ }
2097
+
2098
+ /*
2099
+ * Perl-inspired push, pop, shift, unshift, and splice methods.
2100
+ */
2101
+ static JSBool
2102
+ array_push_slowly(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
2103
+ {
2104
+ jsuint length, newlength;
2105
+
2106
+ if (!js_GetLengthProperty(cx, obj, &length))
2107
+ return JS_FALSE;
2108
+ newlength = length + argc;
2109
+ if (!InitArrayElements(cx, obj, length, newlength, argv))
2110
+ return JS_FALSE;
2111
+
2112
+ /* Per ECMA-262, return the new array length. */
2113
+ if (!IndexToValue(cx, newlength, rval))
2114
+ return JS_FALSE;
2115
+ return js_SetLengthProperty(cx, obj, newlength);
2116
+ }
2117
+
2118
+ static JSBool
2119
+ array_push1_dense(JSContext* cx, JSObject* obj, jsval v, jsval *rval)
2120
+ {
2121
+ uint32 length = obj->fslots[JSSLOT_ARRAY_LENGTH];
2122
+ if (INDEX_TOO_SPARSE(obj, length)) {
2123
+ if (!js_MakeArraySlow(cx, obj))
2124
+ return JS_FALSE;
2125
+ return array_push_slowly(cx, obj, 1, &v, rval);
2126
+ }
2127
+
2128
+ if (!EnsureLength(cx, obj, length + 1))
2129
+ return JS_FALSE;
2130
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = length + 1;
2131
+
2132
+ JS_ASSERT(obj->dslots[length] == JSVAL_HOLE);
2133
+ obj->fslots[JSSLOT_ARRAY_COUNT]++;
2134
+ obj->dslots[length] = v;
2135
+ return IndexToValue(cx, obj->fslots[JSSLOT_ARRAY_LENGTH], rval);
2136
+ }
2137
+
2138
+ #ifdef JS_TRACER
2139
+ static jsval FASTCALL
2140
+ Array_p_push1(JSContext* cx, JSObject* obj, jsval v)
2141
+ {
2142
+ if (OBJ_IS_DENSE_ARRAY(cx, obj)
2143
+ ? array_push1_dense(cx, obj, v, &v)
2144
+ : array_push_slowly(cx, obj, 1, &v, &v)) {
2145
+ return v;
2146
+ }
2147
+ return JSVAL_ERROR_COOKIE;
2148
+ }
2149
+ #endif
2150
+
2151
+ static JSBool
2152
+ array_push(JSContext *cx, uintN argc, jsval *vp)
2153
+ {
2154
+ JSObject *obj;
2155
+
2156
+ /* Insist on one argument and obj of the expected class. */
2157
+ obj = JS_THIS_OBJECT(cx, vp);
2158
+ if (!obj)
2159
+ return JS_FALSE;
2160
+ if (argc != 1 || !OBJ_IS_DENSE_ARRAY(cx, obj))
2161
+ return array_push_slowly(cx, obj, argc, vp + 2, vp);
2162
+
2163
+ return array_push1_dense(cx, obj, vp[2], vp);
2164
+ }
2165
+
2166
+ static JSBool
2167
+ array_pop_slowly(JSContext *cx, JSObject* obj, jsval *vp)
2168
+ {
2169
+ jsuint index;
2170
+ JSBool hole;
2171
+
2172
+ if (!js_GetLengthProperty(cx, obj, &index))
2173
+ return JS_FALSE;
2174
+ if (index == 0) {
2175
+ *vp = JSVAL_VOID;
2176
+ } else {
2177
+ index--;
2178
+
2179
+ /* Get the to-be-deleted property's value into vp. */
2180
+ if (!GetArrayElement(cx, obj, index, &hole, vp))
2181
+ return JS_FALSE;
2182
+ if (!hole && !DeleteArrayElement(cx, obj, index))
2183
+ return JS_FALSE;
2184
+ }
2185
+ return js_SetLengthProperty(cx, obj, index);
2186
+ }
2187
+
2188
+ static JSBool
2189
+ array_pop_dense(JSContext *cx, JSObject* obj, jsval *vp)
2190
+ {
2191
+ jsuint index;
2192
+ JSBool hole;
2193
+
2194
+ index = obj->fslots[JSSLOT_ARRAY_LENGTH];
2195
+ if (index == 0) {
2196
+ *vp = JSVAL_VOID;
2197
+ return JS_TRUE;
2198
+ }
2199
+ index--;
2200
+ if (!GetArrayElement(cx, obj, index, &hole, vp))
2201
+ return JS_FALSE;
2202
+ if (!hole && !DeleteArrayElement(cx, obj, index))
2203
+ return JS_FALSE;
2204
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = index;
2205
+ return JS_TRUE;
2206
+
2207
+ }
2208
+
2209
+ #ifdef JS_TRACER
2210
+ static jsval FASTCALL
2211
+ Array_p_pop(JSContext* cx, JSObject* obj)
2212
+ {
2213
+ jsval v;
2214
+ if (OBJ_IS_DENSE_ARRAY(cx, obj)
2215
+ ? array_pop_dense(cx, obj, &v)
2216
+ : array_pop_slowly(cx, obj, &v)) {
2217
+ return v;
2218
+ }
2219
+ return JSVAL_ERROR_COOKIE;
2220
+ }
2221
+ #endif
2222
+
2223
+ static JSBool
2224
+ array_pop(JSContext *cx, uintN argc, jsval *vp)
2225
+ {
2226
+ JSObject *obj;
2227
+
2228
+ obj = JS_THIS_OBJECT(cx, vp);
2229
+ if (!obj)
2230
+ return JS_FALSE;
2231
+ if (OBJ_IS_DENSE_ARRAY(cx, obj))
2232
+ return array_pop_dense(cx, obj, vp);
2233
+ return array_pop_slowly(cx, obj, vp);
2234
+ }
2235
+
2236
+ static JSBool
2237
+ array_shift(JSContext *cx, uintN argc, jsval *vp)
2238
+ {
2239
+ JSObject *obj;
2240
+ jsuint length, i;
2241
+ JSBool hole, ok;
2242
+ JSTempValueRooter tvr;
2243
+
2244
+ obj = JS_THIS_OBJECT(cx, vp);
2245
+ if (!obj || !js_GetLengthProperty(cx, obj, &length))
2246
+ return JS_FALSE;
2247
+ if (length == 0) {
2248
+ *vp = JSVAL_VOID;
2249
+ } else {
2250
+ length--;
2251
+
2252
+ /* Get the to-be-deleted property's value into vp ASAP. */
2253
+ if (!GetArrayElement(cx, obj, 0, &hole, vp))
2254
+ return JS_FALSE;
2255
+
2256
+ /* Slide down the array above the first element. */
2257
+ ok = JS_TRUE;
2258
+ JS_PUSH_SINGLE_TEMP_ROOT(cx, JSVAL_NULL, &tvr);
2259
+ for (i = 0; i != length; i++) {
2260
+ ok = JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) &&
2261
+ GetArrayElement(cx, obj, i + 1, &hole, &tvr.u.value) &&
2262
+ SetOrDeleteArrayElement(cx, obj, i, hole, tvr.u.value);
2263
+ if (!ok)
2264
+ break;
2265
+ }
2266
+ JS_POP_TEMP_ROOT(cx, &tvr);
2267
+ if (!ok)
2268
+ return JS_FALSE;
2269
+
2270
+ /* Delete the only or last element when it exist. */
2271
+ if (!hole && !DeleteArrayElement(cx, obj, length))
2272
+ return JS_FALSE;
2273
+ }
2274
+ return js_SetLengthProperty(cx, obj, length);
2275
+ }
2276
+
2277
+ static JSBool
2278
+ array_unshift(JSContext *cx, uintN argc, jsval *vp)
2279
+ {
2280
+ JSObject *obj;
2281
+ jsval *argv;
2282
+ jsuint length, last;
2283
+ JSBool hole, ok;
2284
+ JSTempValueRooter tvr;
2285
+
2286
+ obj = JS_THIS_OBJECT(cx, vp);
2287
+ if (!obj || !js_GetLengthProperty(cx, obj, &length))
2288
+ return JS_FALSE;
2289
+ if (argc > 0) {
2290
+ /* Slide up the array to make room for argc at the bottom. */
2291
+ argv = JS_ARGV(cx, vp);
2292
+ if (length > 0) {
2293
+ last = length;
2294
+ ok = JS_TRUE;
2295
+ JS_PUSH_SINGLE_TEMP_ROOT(cx, JSVAL_NULL, &tvr);
2296
+ do {
2297
+ --last;
2298
+ ok = JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) &&
2299
+ GetArrayElement(cx, obj, last, &hole, &tvr.u.value) &&
2300
+ SetOrDeleteArrayElement(cx, obj, last + argc, hole,
2301
+ tvr.u.value);
2302
+ if (!ok)
2303
+ break;
2304
+ } while (last != 0);
2305
+ JS_POP_TEMP_ROOT(cx, &tvr);
2306
+ if (!ok)
2307
+ return JS_FALSE;
2308
+ }
2309
+
2310
+ /* Copy from argv to the bottom of the array. */
2311
+ if (!InitArrayElements(cx, obj, 0, argc, argv))
2312
+ return JS_FALSE;
2313
+
2314
+ length += argc;
2315
+ if (!js_SetLengthProperty(cx, obj, length))
2316
+ return JS_FALSE;
2317
+ }
2318
+
2319
+ /* Follow Perl by returning the new array length. */
2320
+ return IndexToValue(cx, length, vp);
2321
+ }
2322
+
2323
+ static JSBool
2324
+ array_splice(JSContext *cx, uintN argc, jsval *vp)
2325
+ {
2326
+ jsval *argv;
2327
+ JSObject *obj;
2328
+ jsuint length, begin, end, count, delta, last;
2329
+ jsdouble d;
2330
+ JSBool hole, ok;
2331
+ JSObject *obj2;
2332
+ JSTempValueRooter tvr;
2333
+
2334
+ /*
2335
+ * Create a new array value to return. Our ECMA v2 proposal specs
2336
+ * that splice always returns an array value, even when given no
2337
+ * arguments. We think this is best because it eliminates the need
2338
+ * for callers to do an extra test to handle the empty splice case.
2339
+ */
2340
+ obj2 = js_NewArrayObject(cx, 0, NULL);
2341
+ if (!obj2)
2342
+ return JS_FALSE;
2343
+ *vp = OBJECT_TO_JSVAL(obj2);
2344
+
2345
+ /* Nothing to do if no args. Otherwise get length. */
2346
+ if (argc == 0)
2347
+ return JS_TRUE;
2348
+ argv = JS_ARGV(cx, vp);
2349
+ obj = JS_THIS_OBJECT(cx, vp);
2350
+ if (!obj || !js_GetLengthProperty(cx, obj, &length))
2351
+ return JS_FALSE;
2352
+
2353
+ /* Convert the first argument into a starting index. */
2354
+ d = js_ValueToNumber(cx, argv);
2355
+ if (JSVAL_IS_NULL(*argv))
2356
+ return JS_FALSE;
2357
+ d = js_DoubleToInteger(d);
2358
+ if (d < 0) {
2359
+ d += length;
2360
+ if (d < 0)
2361
+ d = 0;
2362
+ } else if (d > length) {
2363
+ d = length;
2364
+ }
2365
+ begin = (jsuint)d; /* d has been clamped to uint32 */
2366
+ argc--;
2367
+ argv++;
2368
+
2369
+ /* Convert the second argument from a count into a fencepost index. */
2370
+ delta = length - begin;
2371
+ if (argc == 0) {
2372
+ count = delta;
2373
+ end = length;
2374
+ } else {
2375
+ d = js_ValueToNumber(cx, argv);
2376
+ if (JSVAL_IS_NULL(*argv))
2377
+ return JS_FALSE;
2378
+ d = js_DoubleToInteger(d);
2379
+ if (d < 0)
2380
+ d = 0;
2381
+ else if (d > delta)
2382
+ d = delta;
2383
+ count = (jsuint)d;
2384
+ end = begin + count;
2385
+ argc--;
2386
+ argv++;
2387
+ }
2388
+
2389
+ MUST_FLOW_THROUGH("out");
2390
+ JS_PUSH_SINGLE_TEMP_ROOT(cx, JSVAL_NULL, &tvr);
2391
+
2392
+ /* If there are elements to remove, put them into the return value. */
2393
+ if (count > 0) {
2394
+ for (last = begin; last < end; last++) {
2395
+ ok = JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) &&
2396
+ GetArrayElement(cx, obj, last, &hole, &tvr.u.value);
2397
+ if (!ok)
2398
+ goto out;
2399
+
2400
+ /* Copy tvr.u.value to new array unless it's a hole. */
2401
+ if (!hole) {
2402
+ ok = SetArrayElement(cx, obj2, last - begin, tvr.u.value);
2403
+ if (!ok)
2404
+ goto out;
2405
+ }
2406
+ }
2407
+
2408
+ ok = js_SetLengthProperty(cx, obj2, end - begin);
2409
+ if (!ok)
2410
+ goto out;
2411
+ }
2412
+
2413
+ /* Find the direction (up or down) to copy and make way for argv. */
2414
+ if (argc > count) {
2415
+ delta = (jsuint)argc - count;
2416
+ last = length;
2417
+ /* (uint) end could be 0, so can't use vanilla >= test */
2418
+ while (last-- > end) {
2419
+ ok = JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) &&
2420
+ GetArrayElement(cx, obj, last, &hole, &tvr.u.value) &&
2421
+ SetOrDeleteArrayElement(cx, obj, last + delta, hole,
2422
+ tvr.u.value);
2423
+ if (!ok)
2424
+ goto out;
2425
+ }
2426
+ length += delta;
2427
+ } else if (argc < count) {
2428
+ delta = count - (jsuint)argc;
2429
+ for (last = end; last < length; last++) {
2430
+ ok = JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) &&
2431
+ GetArrayElement(cx, obj, last, &hole, &tvr.u.value) &&
2432
+ SetOrDeleteArrayElement(cx, obj, last - delta, hole,
2433
+ tvr.u.value);
2434
+ if (!ok)
2435
+ goto out;
2436
+ }
2437
+ length -= delta;
2438
+ }
2439
+
2440
+ /* Copy from argv into the hole to complete the splice. */
2441
+ ok = InitArrayElements(cx, obj, begin, begin + argc, argv);
2442
+ if (!ok)
2443
+ goto out;
2444
+
2445
+ /* Update length in case we deleted elements from the end. */
2446
+ ok = js_SetLengthProperty(cx, obj, length);
2447
+
2448
+ out:
2449
+ JS_POP_TEMP_ROOT(cx, &tvr);
2450
+ return ok;
2451
+ }
2452
+
2453
+ /*
2454
+ * Python-esque sequence operations.
2455
+ */
2456
+ static JSBool
2457
+ array_concat(JSContext *cx, uintN argc, jsval *vp)
2458
+ {
2459
+ jsval *argv, v;
2460
+ JSObject *aobj, *nobj;
2461
+ jsuint length, alength, slot;
2462
+ uintN i;
2463
+ JSBool hole, ok;
2464
+ JSTempValueRooter tvr;
2465
+
2466
+ /* Treat our |this| object as the first argument; see ECMA 15.4.4.4. */
2467
+ argv = JS_ARGV(cx, vp) - 1;
2468
+ JS_ASSERT(JS_THIS_OBJECT(cx, vp) == JSVAL_TO_OBJECT(argv[0]));
2469
+
2470
+ /* Create a new Array object and root it using *vp. */
2471
+ aobj = JS_THIS_OBJECT(cx, vp);
2472
+ if (OBJ_IS_DENSE_ARRAY(cx, aobj)) {
2473
+ /*
2474
+ * Clone aobj but pass the minimum of its length and capacity (aka
2475
+ * "dense length"), to handle a = [1,2,3]; a.length = 10000 "dense"
2476
+ * cases efficiently. In such a case we'll pass 8 (not 3) due to the
2477
+ * ARRAY_GROWBY over-allocation policy, which will cause nobj to be
2478
+ * over-allocated to 16. But in the normal case where length is <=
2479
+ * capacity, nobj and aobj will have the same dense length.
2480
+ */
2481
+ length = aobj->fslots[JSSLOT_ARRAY_LENGTH];
2482
+ jsuint capacity = ARRAY_DENSE_LENGTH(aobj);
2483
+ nobj = js_NewArrayObject(cx, JS_MIN(length, capacity), aobj->dslots,
2484
+ aobj->fslots[JSSLOT_ARRAY_COUNT] !=
2485
+ (jsval) length);
2486
+ if (!nobj)
2487
+ return JS_FALSE;
2488
+ nobj->fslots[JSSLOT_ARRAY_LENGTH] = length;
2489
+ *vp = OBJECT_TO_JSVAL(nobj);
2490
+ if (argc == 0)
2491
+ return JS_TRUE;
2492
+ argc--;
2493
+ argv++;
2494
+ } else {
2495
+ nobj = js_NewArrayObject(cx, 0, NULL);
2496
+ if (!nobj)
2497
+ return JS_FALSE;
2498
+ *vp = OBJECT_TO_JSVAL(nobj);
2499
+ length = 0;
2500
+ }
2501
+
2502
+ MUST_FLOW_THROUGH("out");
2503
+ JS_PUSH_SINGLE_TEMP_ROOT(cx, JSVAL_NULL, &tvr);
2504
+
2505
+ /* Loop over [0, argc] to concat args into nobj, expanding all Arrays. */
2506
+ for (i = 0; i <= argc; i++) {
2507
+ ok = JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP);
2508
+ if (!ok)
2509
+ goto out;
2510
+ v = argv[i];
2511
+ if (!JSVAL_IS_PRIMITIVE(v)) {
2512
+ JSObject *wobj;
2513
+
2514
+ aobj = JSVAL_TO_OBJECT(v);
2515
+ wobj = js_GetWrappedObject(cx, aobj);
2516
+ if (OBJ_IS_ARRAY(cx, wobj)) {
2517
+ ok = OBJ_GET_PROPERTY(cx, aobj,
2518
+ ATOM_TO_JSID(cx->runtime->atomState
2519
+ .lengthAtom),
2520
+ &tvr.u.value);
2521
+ if (!ok)
2522
+ goto out;
2523
+ alength = ValueIsLength(cx, &tvr.u.value);
2524
+ ok = !JSVAL_IS_NULL(tvr.u.value);
2525
+ if (!ok)
2526
+ goto out;
2527
+ for (slot = 0; slot < alength; slot++) {
2528
+ ok = JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) &&
2529
+ GetArrayElement(cx, aobj, slot, &hole,
2530
+ &tvr.u.value);
2531
+ if (!ok)
2532
+ goto out;
2533
+
2534
+ /*
2535
+ * Per ECMA 262, 15.4.4.4, step 9, ignore non-existent
2536
+ * properties.
2537
+ */
2538
+ if (!hole) {
2539
+ ok = SetArrayElement(cx, nobj, length + slot,
2540
+ tvr.u.value);
2541
+ if (!ok)
2542
+ goto out;
2543
+ }
2544
+ }
2545
+ length += alength;
2546
+ continue;
2547
+ }
2548
+ }
2549
+
2550
+ ok = SetArrayElement(cx, nobj, length, v);
2551
+ if (!ok)
2552
+ goto out;
2553
+ length++;
2554
+ }
2555
+
2556
+ ok = js_SetLengthProperty(cx, nobj, length);
2557
+
2558
+ out:
2559
+ JS_POP_TEMP_ROOT(cx, &tvr);
2560
+ return ok;
2561
+ }
2562
+
2563
+ static JSBool
2564
+ array_slice(JSContext *cx, uintN argc, jsval *vp)
2565
+ {
2566
+ jsval *argv;
2567
+ JSObject *nobj, *obj;
2568
+ jsuint length, begin, end, slot;
2569
+ jsdouble d;
2570
+ JSBool hole, ok;
2571
+ JSTempValueRooter tvr;
2572
+
2573
+ argv = JS_ARGV(cx, vp);
2574
+
2575
+ obj = JS_THIS_OBJECT(cx, vp);
2576
+ if (!obj || !js_GetLengthProperty(cx, obj, &length))
2577
+ return JS_FALSE;
2578
+ begin = 0;
2579
+ end = length;
2580
+
2581
+ if (argc > 0) {
2582
+ d = js_ValueToNumber(cx, &argv[0]);
2583
+ if (JSVAL_IS_NULL(argv[0]))
2584
+ return JS_FALSE;
2585
+ d = js_DoubleToInteger(d);
2586
+ if (d < 0) {
2587
+ d += length;
2588
+ if (d < 0)
2589
+ d = 0;
2590
+ } else if (d > length) {
2591
+ d = length;
2592
+ }
2593
+ begin = (jsuint)d;
2594
+
2595
+ if (argc > 1) {
2596
+ d = js_ValueToNumber(cx, &argv[1]);
2597
+ if (JSVAL_IS_NULL(argv[1]))
2598
+ return JS_FALSE;
2599
+ d = js_DoubleToInteger(d);
2600
+ if (d < 0) {
2601
+ d += length;
2602
+ if (d < 0)
2603
+ d = 0;
2604
+ } else if (d > length) {
2605
+ d = length;
2606
+ }
2607
+ end = (jsuint)d;
2608
+ }
2609
+ }
2610
+
2611
+ if (begin > end)
2612
+ begin = end;
2613
+
2614
+ if (OBJ_IS_DENSE_ARRAY(cx, obj) && end <= ARRAY_DENSE_LENGTH(obj)) {
2615
+ nobj = js_NewArrayObject(cx, end - begin, obj->dslots + begin,
2616
+ obj->fslots[JSSLOT_ARRAY_COUNT] !=
2617
+ obj->fslots[JSSLOT_ARRAY_LENGTH]);
2618
+ if (!nobj)
2619
+ return JS_FALSE;
2620
+ *vp = OBJECT_TO_JSVAL(nobj);
2621
+ return JS_TRUE;
2622
+ }
2623
+
2624
+ /* Create a new Array object and root it using *vp. */
2625
+ nobj = js_NewArrayObject(cx, 0, NULL);
2626
+ if (!nobj)
2627
+ return JS_FALSE;
2628
+ *vp = OBJECT_TO_JSVAL(nobj);
2629
+
2630
+ MUST_FLOW_THROUGH("out");
2631
+ JS_PUSH_SINGLE_TEMP_ROOT(cx, JSVAL_NULL, &tvr);
2632
+
2633
+ for (slot = begin; slot < end; slot++) {
2634
+ ok = JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) &&
2635
+ GetArrayElement(cx, obj, slot, &hole, &tvr.u.value);
2636
+ if (!ok)
2637
+ goto out;
2638
+ if (!hole) {
2639
+ ok = SetArrayElement(cx, nobj, slot - begin, tvr.u.value);
2640
+ if (!ok)
2641
+ goto out;
2642
+ }
2643
+ }
2644
+ ok = js_SetLengthProperty(cx, nobj, end - begin);
2645
+
2646
+ out:
2647
+ JS_POP_TEMP_ROOT(cx, &tvr);
2648
+ return ok;
2649
+ }
2650
+
2651
+ #if JS_HAS_ARRAY_EXTRAS
2652
+
2653
+ static JSBool
2654
+ array_indexOfHelper(JSContext *cx, JSBool isLast, uintN argc, jsval *vp)
2655
+ {
2656
+ JSObject *obj;
2657
+ jsuint length, i, stop;
2658
+ jsval tosearch;
2659
+ jsint direction;
2660
+ JSBool hole;
2661
+
2662
+ obj = JS_THIS_OBJECT(cx, vp);
2663
+ if (!obj || !js_GetLengthProperty(cx, obj, &length))
2664
+ return JS_FALSE;
2665
+ if (length == 0)
2666
+ goto not_found;
2667
+
2668
+ if (argc <= 1) {
2669
+ i = isLast ? length - 1 : 0;
2670
+ tosearch = (argc != 0) ? vp[2] : JSVAL_VOID;
2671
+ } else {
2672
+ jsdouble start;
2673
+
2674
+ tosearch = vp[2];
2675
+ start = js_ValueToNumber(cx, &vp[3]);
2676
+ if (JSVAL_IS_NULL(vp[3]))
2677
+ return JS_FALSE;
2678
+ start = js_DoubleToInteger(start);
2679
+ if (start < 0) {
2680
+ start += length;
2681
+ if (start < 0) {
2682
+ if (isLast)
2683
+ goto not_found;
2684
+ i = 0;
2685
+ } else {
2686
+ i = (jsuint)start;
2687
+ }
2688
+ } else if (start >= length) {
2689
+ if (!isLast)
2690
+ goto not_found;
2691
+ i = length - 1;
2692
+ } else {
2693
+ i = (jsuint)start;
2694
+ }
2695
+ }
2696
+
2697
+ if (isLast) {
2698
+ stop = 0;
2699
+ direction = -1;
2700
+ } else {
2701
+ stop = length - 1;
2702
+ direction = 1;
2703
+ }
2704
+
2705
+ for (;;) {
2706
+ if (!JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) ||
2707
+ !GetArrayElement(cx, obj, (jsuint)i, &hole, vp)) {
2708
+ return JS_FALSE;
2709
+ }
2710
+ if (!hole && js_StrictlyEqual(cx, *vp, tosearch))
2711
+ return js_NewNumberInRootedValue(cx, i, vp);
2712
+ if (i == stop)
2713
+ goto not_found;
2714
+ i += direction;
2715
+ }
2716
+
2717
+ not_found:
2718
+ *vp = INT_TO_JSVAL(-1);
2719
+ return JS_TRUE;
2720
+ }
2721
+
2722
+ static JSBool
2723
+ array_indexOf(JSContext *cx, uintN argc, jsval *vp)
2724
+ {
2725
+ return array_indexOfHelper(cx, JS_FALSE, argc, vp);
2726
+ }
2727
+
2728
+ static JSBool
2729
+ array_lastIndexOf(JSContext *cx, uintN argc, jsval *vp)
2730
+ {
2731
+ return array_indexOfHelper(cx, JS_TRUE, argc, vp);
2732
+ }
2733
+
2734
+ /* Order is important; extras that take a predicate funarg must follow MAP. */
2735
+ typedef enum ArrayExtraMode {
2736
+ FOREACH,
2737
+ REDUCE,
2738
+ REDUCE_RIGHT,
2739
+ MAP,
2740
+ FILTER,
2741
+ SOME,
2742
+ EVERY
2743
+ } ArrayExtraMode;
2744
+
2745
+ #define REDUCE_MODE(mode) ((mode) == REDUCE || (mode) == REDUCE_RIGHT)
2746
+
2747
+ static JSBool
2748
+ array_extra(JSContext *cx, ArrayExtraMode mode, uintN argc, jsval *vp)
2749
+ {
2750
+ JSObject *obj;
2751
+ jsuint length, newlen;
2752
+ jsval *argv, *elemroot, *invokevp, *sp;
2753
+ JSBool ok, cond, hole;
2754
+ JSObject *callable, *thisp, *newarr;
2755
+ jsint start, end, step, i;
2756
+ void *mark;
2757
+
2758
+ obj = JS_THIS_OBJECT(cx, vp);
2759
+ if (!obj || !js_GetLengthProperty(cx, obj, &length))
2760
+ return JS_FALSE;
2761
+
2762
+ /*
2763
+ * First, get or compute our callee, so that we error out consistently
2764
+ * when passed a non-callable object.
2765
+ */
2766
+ if (argc == 0) {
2767
+ js_ReportMissingArg(cx, vp, 0);
2768
+ return JS_FALSE;
2769
+ }
2770
+ argv = vp + 2;
2771
+ callable = js_ValueToCallableObject(cx, &argv[0], JSV2F_SEARCH_STACK);
2772
+ if (!callable)
2773
+ return JS_FALSE;
2774
+
2775
+ /*
2776
+ * Set our initial return condition, used for zero-length array cases
2777
+ * (and pre-size our map return to match our known length, for all cases).
2778
+ */
2779
+ #ifdef __GNUC__ /* quell GCC overwarning */
2780
+ newlen = 0;
2781
+ newarr = NULL;
2782
+ #endif
2783
+ start = 0, end = length, step = 1;
2784
+
2785
+ switch (mode) {
2786
+ case REDUCE_RIGHT:
2787
+ start = length - 1, end = -1, step = -1;
2788
+ /* FALL THROUGH */
2789
+ case REDUCE:
2790
+ if (length == 0 && argc == 1) {
2791
+ JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
2792
+ JSMSG_EMPTY_ARRAY_REDUCE);
2793
+ return JS_FALSE;
2794
+ }
2795
+ if (argc >= 2) {
2796
+ *vp = argv[1];
2797
+ } else {
2798
+ do {
2799
+ if (!GetArrayElement(cx, obj, start, &hole, vp))
2800
+ return JS_FALSE;
2801
+ start += step;
2802
+ } while (hole && start != end);
2803
+
2804
+ if (hole && start == end) {
2805
+ JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
2806
+ JSMSG_EMPTY_ARRAY_REDUCE);
2807
+ return JS_FALSE;
2808
+ }
2809
+ }
2810
+ break;
2811
+ case MAP:
2812
+ case FILTER:
2813
+ newlen = (mode == MAP) ? length : 0;
2814
+ newarr = js_NewArrayObject(cx, newlen, NULL);
2815
+ if (!newarr)
2816
+ return JS_FALSE;
2817
+ *vp = OBJECT_TO_JSVAL(newarr);
2818
+ break;
2819
+ case SOME:
2820
+ *vp = JSVAL_FALSE;
2821
+ break;
2822
+ case EVERY:
2823
+ *vp = JSVAL_TRUE;
2824
+ break;
2825
+ case FOREACH:
2826
+ *vp = JSVAL_VOID;
2827
+ break;
2828
+ }
2829
+
2830
+ if (length == 0)
2831
+ return JS_TRUE;
2832
+
2833
+ if (argc > 1 && !REDUCE_MODE(mode)) {
2834
+ if (!js_ValueToObject(cx, argv[1], &thisp))
2835
+ return JS_FALSE;
2836
+ argv[1] = OBJECT_TO_JSVAL(thisp);
2837
+ } else {
2838
+ thisp = NULL;
2839
+ }
2840
+
2841
+ /*
2842
+ * For all but REDUCE, we call with 3 args (value, index, array). REDUCE
2843
+ * requires 4 args (accum, value, index, array).
2844
+ */
2845
+ argc = 3 + REDUCE_MODE(mode);
2846
+ elemroot = js_AllocStack(cx, 1 + 2 + argc, &mark);
2847
+ if (!elemroot)
2848
+ return JS_FALSE;
2849
+
2850
+ MUST_FLOW_THROUGH("out");
2851
+ ok = JS_TRUE;
2852
+ invokevp = elemroot + 1;
2853
+
2854
+ for (i = start; i != end; i += step) {
2855
+ ok = JS_CHECK_OPERATION_LIMIT(cx, JSOW_JUMP) &&
2856
+ GetArrayElement(cx, obj, i, &hole, elemroot);
2857
+ if (!ok)
2858
+ goto out;
2859
+ if (hole)
2860
+ continue;
2861
+
2862
+ /*
2863
+ * Push callable and 'this', then args. We must do this for every
2864
+ * iteration around the loop since js_Invoke uses spbase[0] for return
2865
+ * value storage, while some native functions use spbase[1] for local
2866
+ * rooting.
2867
+ */
2868
+ sp = invokevp;
2869
+ *sp++ = OBJECT_TO_JSVAL(callable);
2870
+ *sp++ = OBJECT_TO_JSVAL(thisp);
2871
+ if (REDUCE_MODE(mode))
2872
+ *sp++ = *vp;
2873
+ *sp++ = *elemroot;
2874
+ *sp++ = INT_TO_JSVAL(i);
2875
+ *sp++ = OBJECT_TO_JSVAL(obj);
2876
+
2877
+ /* Do the call. */
2878
+ ok = js_Invoke(cx, argc, invokevp, 0);
2879
+ if (!ok)
2880
+ break;
2881
+
2882
+ if (mode > MAP)
2883
+ cond = js_ValueToBoolean(*invokevp);
2884
+ #ifdef __GNUC__ /* quell GCC overwarning */
2885
+ else
2886
+ cond = JS_FALSE;
2887
+ #endif
2888
+
2889
+ switch (mode) {
2890
+ case FOREACH:
2891
+ break;
2892
+ case REDUCE:
2893
+ case REDUCE_RIGHT:
2894
+ *vp = *invokevp;
2895
+ break;
2896
+ case MAP:
2897
+ ok = SetArrayElement(cx, newarr, i, *invokevp);
2898
+ if (!ok)
2899
+ goto out;
2900
+ break;
2901
+ case FILTER:
2902
+ if (!cond)
2903
+ break;
2904
+ /* The filter passed *elemroot, so push it onto our result. */
2905
+ ok = SetArrayElement(cx, newarr, newlen++, *elemroot);
2906
+ if (!ok)
2907
+ goto out;
2908
+ break;
2909
+ case SOME:
2910
+ if (cond) {
2911
+ *vp = JSVAL_TRUE;
2912
+ goto out;
2913
+ }
2914
+ break;
2915
+ case EVERY:
2916
+ if (!cond) {
2917
+ *vp = JSVAL_FALSE;
2918
+ goto out;
2919
+ }
2920
+ break;
2921
+ }
2922
+ }
2923
+
2924
+ out:
2925
+ js_FreeStack(cx, mark);
2926
+ if (ok && mode == FILTER)
2927
+ ok = js_SetLengthProperty(cx, newarr, newlen);
2928
+ return ok;
2929
+ }
2930
+
2931
+ static JSBool
2932
+ array_forEach(JSContext *cx, uintN argc, jsval *vp)
2933
+ {
2934
+ return array_extra(cx, FOREACH, argc, vp);
2935
+ }
2936
+
2937
+ static JSBool
2938
+ array_map(JSContext *cx, uintN argc, jsval *vp)
2939
+ {
2940
+ return array_extra(cx, MAP, argc, vp);
2941
+ }
2942
+
2943
+ static JSBool
2944
+ array_reduce(JSContext *cx, uintN argc, jsval *vp)
2945
+ {
2946
+ return array_extra(cx, REDUCE, argc, vp);
2947
+ }
2948
+
2949
+ static JSBool
2950
+ array_reduceRight(JSContext *cx, uintN argc, jsval *vp)
2951
+ {
2952
+ return array_extra(cx, REDUCE_RIGHT, argc, vp);
2953
+ }
2954
+
2955
+ static JSBool
2956
+ array_filter(JSContext *cx, uintN argc, jsval *vp)
2957
+ {
2958
+ return array_extra(cx, FILTER, argc, vp);
2959
+ }
2960
+
2961
+ static JSBool
2962
+ array_some(JSContext *cx, uintN argc, jsval *vp)
2963
+ {
2964
+ return array_extra(cx, SOME, argc, vp);
2965
+ }
2966
+
2967
+ static JSBool
2968
+ array_every(JSContext *cx, uintN argc, jsval *vp)
2969
+ {
2970
+ return array_extra(cx, EVERY, argc, vp);
2971
+ }
2972
+ #endif
2973
+
2974
+ static JSPropertySpec array_props[] = {
2975
+ {js_length_str, -1, JSPROP_SHARED | JSPROP_PERMANENT,
2976
+ array_length_getter, array_length_setter},
2977
+ {0,0,0,0,0}
2978
+ };
2979
+
2980
+ JS_DEFINE_TRCINFO_1(array_toString,
2981
+ (2, (static, STRING_FAIL, Array_p_toString, CONTEXT, THIS, 0, 0)))
2982
+ JS_DEFINE_TRCINFO_1(array_join,
2983
+ (3, (static, STRING_FAIL, Array_p_join, CONTEXT, THIS, STRING, 0, 0)))
2984
+ JS_DEFINE_TRCINFO_1(array_push,
2985
+ (3, (static, JSVAL_FAIL, Array_p_push1, CONTEXT, THIS, JSVAL, 0, 0)))
2986
+ JS_DEFINE_TRCINFO_1(array_pop,
2987
+ (2, (static, JSVAL_FAIL, Array_p_pop, CONTEXT, THIS, 0, 0)))
2988
+
2989
+ static JSFunctionSpec array_methods[] = {
2990
+ #if JS_HAS_TOSOURCE
2991
+ JS_FN(js_toSource_str, array_toSource, 0,0),
2992
+ #endif
2993
+ JS_TN(js_toString_str, array_toString, 0,0, array_toString_trcinfo),
2994
+ JS_FN(js_toLocaleString_str,array_toLocaleString,0,0),
2995
+
2996
+ /* Perl-ish methods. */
2997
+ JS_TN("join", array_join, 1,JSFUN_GENERIC_NATIVE, array_join_trcinfo),
2998
+ JS_FN("reverse", array_reverse, 0,JSFUN_GENERIC_NATIVE),
2999
+ JS_FN("sort", array_sort, 1,JSFUN_GENERIC_NATIVE),
3000
+ JS_TN("push", array_push, 1,JSFUN_GENERIC_NATIVE, array_push_trcinfo),
3001
+ JS_TN("pop", array_pop, 0,JSFUN_GENERIC_NATIVE, array_pop_trcinfo),
3002
+ JS_FN("shift", array_shift, 0,JSFUN_GENERIC_NATIVE),
3003
+ JS_FN("unshift", array_unshift, 1,JSFUN_GENERIC_NATIVE),
3004
+ JS_FN("splice", array_splice, 2,JSFUN_GENERIC_NATIVE),
3005
+
3006
+ /* Pythonic sequence methods. */
3007
+ JS_FN("concat", array_concat, 1,JSFUN_GENERIC_NATIVE),
3008
+ JS_FN("slice", array_slice, 2,JSFUN_GENERIC_NATIVE),
3009
+
3010
+ #if JS_HAS_ARRAY_EXTRAS
3011
+ JS_FN("indexOf", array_indexOf, 1,JSFUN_GENERIC_NATIVE),
3012
+ JS_FN("lastIndexOf", array_lastIndexOf, 1,JSFUN_GENERIC_NATIVE),
3013
+ JS_FN("forEach", array_forEach, 1,JSFUN_GENERIC_NATIVE),
3014
+ JS_FN("map", array_map, 1,JSFUN_GENERIC_NATIVE),
3015
+ JS_FN("reduce", array_reduce, 1,JSFUN_GENERIC_NATIVE),
3016
+ JS_FN("reduceRight", array_reduceRight, 1,JSFUN_GENERIC_NATIVE),
3017
+ JS_FN("filter", array_filter, 1,JSFUN_GENERIC_NATIVE),
3018
+ JS_FN("some", array_some, 1,JSFUN_GENERIC_NATIVE),
3019
+ JS_FN("every", array_every, 1,JSFUN_GENERIC_NATIVE),
3020
+ #endif
3021
+
3022
+ JS_FS_END
3023
+ };
3024
+
3025
+ JSBool
3026
+ js_Array(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
3027
+ {
3028
+ jsuint length;
3029
+ jsval *vector;
3030
+
3031
+ /* If called without new, replace obj with a new Array object. */
3032
+ if (!(cx->fp->flags & JSFRAME_CONSTRUCTING)) {
3033
+ obj = js_NewObject(cx, &js_ArrayClass, NULL, NULL, 0);
3034
+ if (!obj)
3035
+ return JS_FALSE;
3036
+ *rval = OBJECT_TO_JSVAL(obj);
3037
+ }
3038
+
3039
+ if (argc == 0) {
3040
+ length = 0;
3041
+ vector = NULL;
3042
+ } else if (argc > 1) {
3043
+ length = (jsuint) argc;
3044
+ vector = argv;
3045
+ } else if (!JSVAL_IS_NUMBER(argv[0])) {
3046
+ length = 1;
3047
+ vector = argv;
3048
+ } else {
3049
+ length = ValueIsLength(cx, &argv[0]);
3050
+ if (JSVAL_IS_NULL(argv[0]))
3051
+ return JS_FALSE;
3052
+ vector = NULL;
3053
+ }
3054
+ return InitArrayObject(cx, obj, length, vector);
3055
+ }
3056
+
3057
+ JS_STATIC_ASSERT(JSSLOT_PRIVATE == JSSLOT_ARRAY_LENGTH);
3058
+ JS_STATIC_ASSERT(JSSLOT_ARRAY_LENGTH + 1 == JSSLOT_ARRAY_COUNT);
3059
+
3060
+ #ifdef JS_TRACER
3061
+
3062
+ JSObject* FASTCALL
3063
+ js_FastNewArray(JSContext* cx, JSObject* proto)
3064
+ {
3065
+ JS_ASSERT(OBJ_IS_ARRAY(cx, proto));
3066
+
3067
+ JS_ASSERT(JS_ON_TRACE(cx));
3068
+ JSObject* obj = (JSObject*) js_NewGCThing(cx, GCX_OBJECT, sizeof(JSObject));
3069
+ if (!obj)
3070
+ return NULL;
3071
+
3072
+ JSClass* clasp = &js_ArrayClass;
3073
+ obj->classword = jsuword(clasp);
3074
+
3075
+ obj->fslots[JSSLOT_PROTO] = OBJECT_TO_JSVAL(proto);
3076
+ obj->fslots[JSSLOT_PARENT] = proto->fslots[JSSLOT_PARENT];
3077
+
3078
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = 0;
3079
+ obj->fslots[JSSLOT_ARRAY_COUNT] = 0;
3080
+ for (unsigned i = JSSLOT_ARRAY_COUNT + 1; i != JS_INITIAL_NSLOTS; ++i)
3081
+ obj->fslots[i] = JSVAL_VOID;
3082
+
3083
+ JSObjectOps* ops = clasp->getObjectOps(cx, clasp);
3084
+ obj->map = ops->newObjectMap(cx, 1, ops, clasp, obj);
3085
+ if (!obj->map)
3086
+ return NULL;
3087
+ obj->dslots = NULL;
3088
+ return obj;
3089
+ }
3090
+
3091
+ JSObject* FASTCALL
3092
+ js_Array_1int(JSContext* cx, JSObject* proto, int32 i)
3093
+ {
3094
+ JS_ASSERT(JS_ON_TRACE(cx));
3095
+ JSObject* obj = js_FastNewArray(cx, proto);
3096
+ if (obj)
3097
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = i;
3098
+ return obj;
3099
+ }
3100
+
3101
+ #define ARRAY_CTOR_GUTS(exact_len, newslots_code) \
3102
+ JS_ASSERT(JS_ON_TRACE(cx)); \
3103
+ JSObject* obj = js_FastNewArray(cx, proto); \
3104
+ if (obj) { \
3105
+ const uint32 len = ARRAY_GROWBY; \
3106
+ jsval* newslots = (jsval*) JS_malloc(cx, sizeof (jsval) * (len + 1)); \
3107
+ if (newslots) { \
3108
+ obj->dslots = newslots + 1; \
3109
+ ARRAY_SET_DENSE_LENGTH(obj, len); \
3110
+ {newslots_code} \
3111
+ while (++newslots < obj->dslots + len) \
3112
+ *newslots = JSVAL_HOLE; \
3113
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = (exact_len); \
3114
+ return obj; \
3115
+ } \
3116
+ } \
3117
+ return NULL;
3118
+
3119
+ JSObject* FASTCALL
3120
+ js_Array_1str(JSContext* cx, JSObject* proto, JSString *str)
3121
+ {
3122
+ ARRAY_CTOR_GUTS(1, *++newslots = STRING_TO_JSVAL(str);)
3123
+ }
3124
+
3125
+ JSObject* FASTCALL
3126
+ js_Array_2obj(JSContext* cx, JSObject* proto, JSObject *obj1, JSObject* obj2)
3127
+ {
3128
+ ARRAY_CTOR_GUTS(2,
3129
+ *++newslots = OBJECT_TO_JSVAL(obj1);
3130
+ *++newslots = OBJECT_TO_JSVAL(obj2);)
3131
+ }
3132
+
3133
+ JSObject* FASTCALL
3134
+ js_Array_3num(JSContext* cx, JSObject* proto, jsdouble n1, jsdouble n2, jsdouble n3)
3135
+ {
3136
+ ARRAY_CTOR_GUTS(3,
3137
+ if (!js_NewDoubleInRootedValue(cx, n1, ++newslots))
3138
+ return NULL;
3139
+ if (!js_NewDoubleInRootedValue(cx, n2, ++newslots))
3140
+ return NULL;
3141
+ if (!js_NewDoubleInRootedValue(cx, n3, ++newslots))
3142
+ return NULL;)
3143
+ }
3144
+
3145
+ #endif /* JS_TRACER */
3146
+
3147
+ JSObject *
3148
+ js_InitArrayClass(JSContext *cx, JSObject *obj)
3149
+ {
3150
+ JSObject *proto;
3151
+
3152
+ /* Initialize the ops structure used by slow arrays */
3153
+ memcpy(&js_SlowArrayObjectOps, &js_ObjectOps, sizeof(JSObjectOps));
3154
+ js_SlowArrayObjectOps.trace = slowarray_trace;
3155
+ js_SlowArrayObjectOps.enumerate = slowarray_enumerate;
3156
+ js_SlowArrayObjectOps.call = NULL;
3157
+
3158
+ proto = JS_InitClass(cx, obj, NULL, &js_ArrayClass, js_Array, 1,
3159
+ array_props, array_methods, NULL, NULL);
3160
+
3161
+ /* Initialize the Array prototype object so it gets a length property. */
3162
+ if (!proto || !InitArrayObject(cx, proto, 0, NULL))
3163
+ return NULL;
3164
+ return proto;
3165
+ }
3166
+
3167
+ JSObject *
3168
+ js_NewArrayObject(JSContext *cx, jsuint length, jsval *vector, JSBool holey)
3169
+ {
3170
+ JSTempValueRooter tvr;
3171
+ JSObject *obj;
3172
+
3173
+ obj = js_NewObject(cx, &js_ArrayClass, NULL, NULL, 0);
3174
+ if (!obj)
3175
+ return NULL;
3176
+
3177
+ JS_PUSH_TEMP_ROOT_OBJECT(cx, obj, &tvr);
3178
+ if (!InitArrayObject(cx, obj, length, vector, holey))
3179
+ obj = NULL;
3180
+ JS_POP_TEMP_ROOT(cx, &tvr);
3181
+
3182
+ /* Set/clear newborn root, in case we lost it. */
3183
+ cx->weakRoots.newborn[GCX_OBJECT] = obj;
3184
+ return obj;
3185
+ }
3186
+
3187
+ JSObject *
3188
+ js_NewSlowArrayObject(JSContext *cx)
3189
+ {
3190
+ JSObject *obj = js_NewObject(cx, &js_SlowArrayClass, NULL, NULL, 0);
3191
+ if (obj)
3192
+ obj->fslots[JSSLOT_ARRAY_LENGTH] = 0;
3193
+ return obj;
3194
+ }
3195
+
3196
+ #ifdef DEBUG_ARRAYS
3197
+ JSBool
3198
+ js_ArrayInfo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
3199
+ {
3200
+ uintN i;
3201
+ JSObject *array;
3202
+
3203
+ for (i = 0; i < argc; i++) {
3204
+ char *bytes;
3205
+
3206
+ bytes = js_DecompileValueGenerator(cx, JSDVG_SEARCH_STACK, argv[i],
3207
+ NULL);
3208
+ if (!bytes)
3209
+ return JS_FALSE;
3210
+ if (JSVAL_IS_PRIMITIVE(argv[i]) ||
3211
+ !OBJ_IS_ARRAY(cx, (array = JSVAL_TO_OBJECT(argv[i])))) {
3212
+ fprintf(stderr, "%s: not array\n", bytes);
3213
+ JS_free(cx, bytes);
3214
+ continue;
3215
+ }
3216
+ fprintf(stderr, "%s: %s (len %lu", bytes,
3217
+ OBJ_IS_DENSE_ARRAY(cx, array) ? "dense" : "sparse",
3218
+ array->fslots[JSSLOT_ARRAY_LENGTH]);
3219
+ if (OBJ_IS_DENSE_ARRAY(cx, array)) {
3220
+ fprintf(stderr, ", count %lu, denselen %lu",
3221
+ array->fslots[JSSLOT_ARRAY_COUNT],
3222
+ ARRAY_DENSE_LENGTH(array));
3223
+ }
3224
+ fputs(")\n", stderr);
3225
+ JS_free(cx, bytes);
3226
+ }
3227
+ return JS_TRUE;
3228
+ }
3229
+ #endif
3230
+
3231
+ JS_FRIEND_API(JSBool)
3232
+ js_ArrayToJSUint8Buffer(JSContext *cx, JSObject *obj, jsuint offset, jsuint count,
3233
+ JSUint8 *dest)
3234
+ {
3235
+ uint32 length;
3236
+
3237
+ if (!obj || !OBJ_IS_DENSE_ARRAY(cx, obj))
3238
+ return JS_FALSE;
3239
+
3240
+ length = obj->fslots[JSSLOT_ARRAY_LENGTH];
3241
+ if (length < offset + count)
3242
+ return JS_FALSE;
3243
+
3244
+ jsval v;
3245
+ jsint vi;
3246
+
3247
+ JSUint8 *dp = dest;
3248
+ for (uintN i = offset; i < offset+count; i++) {
3249
+ v = obj->dslots[i];
3250
+ if (!JSVAL_IS_INT(v) || (vi = JSVAL_TO_INT(v)) < 0)
3251
+ return JS_FALSE;
3252
+
3253
+ *dp++ = (JSUint8) vi;
3254
+ }
3255
+
3256
+ return JS_TRUE;
3257
+ }
3258
+
3259
+ JS_FRIEND_API(JSBool)
3260
+ js_ArrayToJSUint16Buffer(JSContext *cx, JSObject *obj, jsuint offset, jsuint count,
3261
+ JSUint16 *dest)
3262
+ {
3263
+ uint32 length;
3264
+
3265
+ if (!obj || !OBJ_IS_DENSE_ARRAY(cx, obj))
3266
+ return JS_FALSE;
3267
+
3268
+ length = obj->fslots[JSSLOT_ARRAY_LENGTH];
3269
+ if (length < offset + count)
3270
+ return JS_FALSE;
3271
+
3272
+ jsval v;
3273
+ jsint vi;
3274
+
3275
+ JSUint16 *dp = dest;
3276
+ for (uintN i = offset; i < offset+count; i++) {
3277
+ v = obj->dslots[i];
3278
+ if (!JSVAL_IS_INT(v) || (vi = JSVAL_TO_INT(v)) < 0)
3279
+ return JS_FALSE;
3280
+
3281
+ *dp++ = (JSUint16) vi;
3282
+ }
3283
+
3284
+ return JS_TRUE;
3285
+ }
3286
+
3287
+ JS_FRIEND_API(JSBool)
3288
+ js_ArrayToJSUint32Buffer(JSContext *cx, JSObject *obj, jsuint offset, jsuint count,
3289
+ JSUint32 *dest)
3290
+ {
3291
+ uint32 length;
3292
+
3293
+ if (!obj || !OBJ_IS_DENSE_ARRAY(cx, obj))
3294
+ return JS_FALSE;
3295
+
3296
+ length = obj->fslots[JSSLOT_ARRAY_LENGTH];
3297
+ if (length < offset + count)
3298
+ return JS_FALSE;
3299
+
3300
+ jsval v;
3301
+ jsint vi;
3302
+
3303
+ JSUint32 *dp = dest;
3304
+ for (uintN i = offset; i < offset+count; i++) {
3305
+ v = obj->dslots[i];
3306
+ if (!JSVAL_IS_INT(v) || (vi = JSVAL_TO_INT(v)) < 0)
3307
+ return JS_FALSE;
3308
+
3309
+ *dp++ = (JSUint32) vi;
3310
+ }
3311
+
3312
+ return JS_TRUE;
3313
+ }
3314
+
3315
+ JS_FRIEND_API(JSBool)
3316
+ js_ArrayToJSInt8Buffer(JSContext *cx, JSObject *obj, jsuint offset, jsuint count,
3317
+ JSInt8 *dest)
3318
+ {
3319
+ uint32 length;
3320
+
3321
+ if (!obj || !OBJ_IS_DENSE_ARRAY(cx, obj))
3322
+ return JS_FALSE;
3323
+
3324
+ length = obj->fslots[JSSLOT_ARRAY_LENGTH];
3325
+ if (length < offset + count)
3326
+ return JS_FALSE;
3327
+
3328
+ jsval v;
3329
+ JSInt8 *dp = dest;
3330
+ for (uintN i = offset; i < offset+count; i++) {
3331
+ v = obj->dslots[i];
3332
+ if (!JSVAL_IS_INT(v))
3333
+ return JS_FALSE;
3334
+
3335
+ *dp++ = (JSInt8) JSVAL_TO_INT(v);
3336
+ }
3337
+
3338
+ return JS_TRUE;
3339
+ }
3340
+
3341
+ JS_FRIEND_API(JSBool)
3342
+ js_ArrayToJSInt16Buffer(JSContext *cx, JSObject *obj, jsuint offset, jsuint count,
3343
+ JSInt16 *dest)
3344
+ {
3345
+ uint32 length;
3346
+
3347
+ if (!obj || !OBJ_IS_DENSE_ARRAY(cx, obj))
3348
+ return JS_FALSE;
3349
+
3350
+ length = obj->fslots[JSSLOT_ARRAY_LENGTH];
3351
+ if (length < offset + count)
3352
+ return JS_FALSE;
3353
+
3354
+ jsval v;
3355
+ JSInt16 *dp = dest;
3356
+ for (uintN i = offset; i < offset+count; i++) {
3357
+ v = obj->dslots[i];
3358
+ if (!JSVAL_IS_INT(v))
3359
+ return JS_FALSE;
3360
+
3361
+ *dp++ = (JSInt16) JSVAL_TO_INT(v);
3362
+ }
3363
+
3364
+ return JS_TRUE;
3365
+ }
3366
+
3367
+ JS_FRIEND_API(JSBool)
3368
+ js_ArrayToJSInt32Buffer(JSContext *cx, JSObject *obj, jsuint offset, jsuint count,
3369
+ JSInt32 *dest)
3370
+ {
3371
+ uint32 length;
3372
+
3373
+ if (!obj || !OBJ_IS_DENSE_ARRAY(cx, obj))
3374
+ return JS_FALSE;
3375
+
3376
+ length = obj->fslots[JSSLOT_ARRAY_LENGTH];
3377
+ if (length < offset + count)
3378
+ return JS_FALSE;
3379
+
3380
+ jsval v;
3381
+ JSInt32 *dp = dest;
3382
+ for (uintN i = offset; i < offset+count; i++) {
3383
+ v = obj->dslots[i];
3384
+ if (!JSVAL_IS_INT(v))
3385
+ return JS_FALSE;
3386
+
3387
+ *dp++ = (JSInt32) JSVAL_TO_INT(v);
3388
+ }
3389
+
3390
+ return JS_TRUE;
3391
+ }
3392
+
3393
+ JS_FRIEND_API(JSBool)
3394
+ js_ArrayToJSDoubleBuffer(JSContext *cx, JSObject *obj, jsuint offset, jsuint count,
3395
+ jsdouble *dest)
3396
+ {
3397
+ uint32 length;
3398
+
3399
+ if (!obj || !OBJ_IS_DENSE_ARRAY(cx, obj))
3400
+ return JS_FALSE;
3401
+
3402
+ length = obj->fslots[JSSLOT_ARRAY_LENGTH];
3403
+ if (length < offset + count)
3404
+ return JS_FALSE;
3405
+
3406
+ jsval v;
3407
+ jsdouble *dp = dest;
3408
+ for (uintN i = offset; i < offset+count; i++) {
3409
+ v = obj->dslots[i];
3410
+ if (JSVAL_IS_INT(v))
3411
+ *dp++ = (jsdouble) JSVAL_TO_INT(v);
3412
+ else if (JSVAL_IS_DOUBLE(v))
3413
+ *dp++ = *(JSVAL_TO_DOUBLE(v));
3414
+ else
3415
+ return JS_FALSE;
3416
+ }
3417
+
3418
+ return JS_TRUE;
3419
+ }
3420
+
3421
+ JS_DEFINE_CALLINFO_4(extern, BOOL, js_Array_dense_setelem, CONTEXT, OBJECT, INT32, JSVAL, 0, 0)
3422
+ JS_DEFINE_CALLINFO_2(extern, OBJECT, js_FastNewArray, CONTEXT, OBJECT, 0, 0)
3423
+ JS_DEFINE_CALLINFO_3(extern, OBJECT, js_Array_1int, CONTEXT, OBJECT, INT32, 0, 0)
3424
+ JS_DEFINE_CALLINFO_3(extern, OBJECT, js_Array_1str, CONTEXT, OBJECT, STRING, 0, 0)
3425
+ JS_DEFINE_CALLINFO_4(extern, OBJECT, js_Array_2obj, CONTEXT, OBJECT, OBJECT, OBJECT, 0, 0)
3426
+ JS_DEFINE_CALLINFO_5(extern, OBJECT, js_Array_3num, CONTEXT, OBJECT, DOUBLE, DOUBLE, DOUBLE, 0, 0)