therubyracer 0.5.0-x86-linux → 0.11.0beta5-x86-linux

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of therubyracer might be problematic. Click here for more details.

Files changed (721) hide show
  1. data/.gitignore +23 -11
  2. data/.travis.yml +10 -0
  3. data/Changelog.md +242 -0
  4. data/Gemfile +16 -0
  5. data/README.md +185 -0
  6. data/Rakefile +42 -51
  7. data/benchmarks.rb +217 -0
  8. data/ext/v8/accessor.cc +181 -0
  9. data/ext/v8/array.cc +26 -0
  10. data/ext/v8/backref.cc +56 -0
  11. data/ext/v8/build.rb +52 -0
  12. data/ext/v8/constants.cc +34 -0
  13. data/ext/v8/constraints.cc +52 -0
  14. data/ext/v8/context.cc +130 -0
  15. data/ext/v8/date.cc +18 -0
  16. data/ext/v8/exception.cc +38 -0
  17. data/ext/v8/extconf.rb +16 -29
  18. data/ext/v8/external.cc +43 -0
  19. data/ext/v8/function.cc +58 -0
  20. data/ext/v8/gc.cc +43 -0
  21. data/ext/v8/handles.cc +34 -0
  22. data/ext/v8/heap.cc +31 -0
  23. data/ext/v8/init.cc +39 -0
  24. data/ext/v8/init.so +0 -0
  25. data/ext/v8/invocation.cc +86 -0
  26. data/ext/v8/locker.cc +77 -0
  27. data/ext/v8/message.cc +51 -0
  28. data/ext/v8/object.cc +334 -0
  29. data/ext/v8/primitive.cc +8 -0
  30. data/ext/v8/rr.cc +83 -0
  31. data/ext/v8/rr.h +883 -0
  32. data/ext/v8/script.cc +80 -0
  33. data/ext/v8/signature.cc +18 -0
  34. data/ext/v8/stack.cc +75 -0
  35. data/ext/v8/string.cc +47 -0
  36. data/ext/v8/template.cc +175 -0
  37. data/ext/v8/trycatch.cc +86 -0
  38. data/ext/v8/v8.cc +87 -0
  39. data/ext/v8/value.cc +239 -0
  40. data/lib/v8.rb +30 -9
  41. data/lib/v8/access.rb +5 -0
  42. data/lib/v8/access/indices.rb +40 -0
  43. data/lib/v8/access/invocation.rb +47 -0
  44. data/lib/v8/access/names.rb +65 -0
  45. data/lib/v8/array.rb +26 -0
  46. data/lib/v8/context.rb +217 -75
  47. data/lib/v8/conversion.rb +35 -0
  48. data/lib/v8/conversion/array.rb +11 -0
  49. data/lib/v8/conversion/class.rb +120 -0
  50. data/lib/v8/conversion/code.rb +38 -0
  51. data/lib/v8/conversion/fundamental.rb +11 -0
  52. data/lib/v8/conversion/hash.rb +11 -0
  53. data/lib/v8/conversion/indentity.rb +31 -0
  54. data/lib/v8/conversion/method.rb +26 -0
  55. data/lib/v8/conversion/object.rb +28 -0
  56. data/lib/v8/conversion/primitive.rb +7 -0
  57. data/lib/v8/conversion/proc.rb +5 -0
  58. data/lib/v8/conversion/reference.rb +16 -0
  59. data/lib/v8/conversion/string.rb +12 -0
  60. data/lib/v8/conversion/symbol.rb +7 -0
  61. data/lib/v8/conversion/time.rb +13 -0
  62. data/lib/v8/error.rb +25 -0
  63. data/lib/v8/error/protect.rb +20 -0
  64. data/lib/v8/error/try.rb +15 -0
  65. data/lib/v8/function.rb +28 -0
  66. data/lib/v8/object.rb +69 -28
  67. data/lib/v8/util/weakcell.rb +29 -0
  68. data/lib/v8/version.rb +3 -0
  69. data/spec/c/array_spec.rb +17 -0
  70. data/spec/c/constants_spec.rb +20 -0
  71. data/spec/c/exception_spec.rb +26 -0
  72. data/spec/c/external_spec.rb +9 -0
  73. data/spec/c/function_spec.rb +46 -0
  74. data/spec/c/handles_spec.rb +35 -0
  75. data/spec/c/locker_spec.rb +38 -0
  76. data/spec/c/object_spec.rb +46 -0
  77. data/spec/c/script_spec.rb +28 -0
  78. data/spec/c/string_spec.rb +16 -0
  79. data/spec/c/template_spec.rb +30 -0
  80. data/spec/c/trycatch_spec.rb +51 -0
  81. data/spec/mem/blunt_spec.rb +42 -0
  82. data/spec/redjs_spec.rb +10 -0
  83. data/spec/spec_helper.rb +43 -12
  84. data/spec/threading_spec.rb +52 -0
  85. data/spec/v8/context_spec.rb +19 -0
  86. data/spec/v8/conversion_spec.rb +9 -0
  87. data/spec/v8/error_spec.rb +21 -0
  88. data/spec/v8/function_spec.rb +9 -0
  89. data/spec/v8/object_spec.rb +15 -0
  90. data/thefrontside.png +0 -0
  91. data/therubyracer.gemspec +15 -676
  92. metadata +146 -680
  93. data/.gitmodules +0 -3
  94. data/Doxyfile +0 -1514
  95. data/History.txt +0 -51
  96. data/README.rdoc +0 -158
  97. data/docs/data_conversion.txt +0 -18
  98. data/ext/v8/callbacks.cpp +0 -160
  99. data/ext/v8/callbacks.h +0 -14
  100. data/ext/v8/convert_ruby.cpp +0 -8
  101. data/ext/v8/convert_ruby.h +0 -99
  102. data/ext/v8/convert_string.cpp +0 -10
  103. data/ext/v8/convert_string.h +0 -73
  104. data/ext/v8/convert_v8.cpp +0 -9
  105. data/ext/v8/convert_v8.h +0 -121
  106. data/ext/v8/converters.cpp +0 -83
  107. data/ext/v8/converters.h +0 -23
  108. data/ext/v8/upstream/2.0.6/.gitignore +0 -26
  109. data/ext/v8/upstream/2.0.6/AUTHORS +0 -23
  110. data/ext/v8/upstream/2.0.6/ChangeLog +0 -1479
  111. data/ext/v8/upstream/2.0.6/LICENSE +0 -55
  112. data/ext/v8/upstream/2.0.6/SConstruct +0 -1028
  113. data/ext/v8/upstream/2.0.6/include/v8-debug.h +0 -275
  114. data/ext/v8/upstream/2.0.6/include/v8.h +0 -3236
  115. data/ext/v8/upstream/2.0.6/src/SConscript +0 -283
  116. data/ext/v8/upstream/2.0.6/src/accessors.cc +0 -695
  117. data/ext/v8/upstream/2.0.6/src/accessors.h +0 -114
  118. data/ext/v8/upstream/2.0.6/src/allocation.cc +0 -198
  119. data/ext/v8/upstream/2.0.6/src/allocation.h +0 -169
  120. data/ext/v8/upstream/2.0.6/src/api.cc +0 -3831
  121. data/ext/v8/upstream/2.0.6/src/api.h +0 -479
  122. data/ext/v8/upstream/2.0.6/src/apinatives.js +0 -110
  123. data/ext/v8/upstream/2.0.6/src/apiutils.h +0 -69
  124. data/ext/v8/upstream/2.0.6/src/arguments.h +0 -97
  125. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm-inl.h +0 -277
  126. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.cc +0 -1821
  127. data/ext/v8/upstream/2.0.6/src/arm/assembler-arm.h +0 -1027
  128. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2-inl.h +0 -267
  129. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.cc +0 -1821
  130. data/ext/v8/upstream/2.0.6/src/arm/assembler-thumb2.h +0 -1027
  131. data/ext/v8/upstream/2.0.6/src/arm/builtins-arm.cc +0 -1271
  132. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm-inl.h +0 -74
  133. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.cc +0 -6682
  134. data/ext/v8/upstream/2.0.6/src/arm/codegen-arm.h +0 -535
  135. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.cc +0 -112
  136. data/ext/v8/upstream/2.0.6/src/arm/constants-arm.h +0 -347
  137. data/ext/v8/upstream/2.0.6/src/arm/cpu-arm.cc +0 -132
  138. data/ext/v8/upstream/2.0.6/src/arm/debug-arm.cc +0 -213
  139. data/ext/v8/upstream/2.0.6/src/arm/disasm-arm.cc +0 -1166
  140. data/ext/v8/upstream/2.0.6/src/arm/fast-codegen-arm.cc +0 -1698
  141. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.cc +0 -123
  142. data/ext/v8/upstream/2.0.6/src/arm/frames-arm.h +0 -162
  143. data/ext/v8/upstream/2.0.6/src/arm/ic-arm.cc +0 -849
  144. data/ext/v8/upstream/2.0.6/src/arm/jump-target-arm.cc +0 -238
  145. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.cc +0 -1259
  146. data/ext/v8/upstream/2.0.6/src/arm/macro-assembler-arm.h +0 -423
  147. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.cc +0 -1266
  148. data/ext/v8/upstream/2.0.6/src/arm/regexp-macro-assembler-arm.h +0 -282
  149. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm-inl.h +0 -103
  150. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.cc +0 -59
  151. data/ext/v8/upstream/2.0.6/src/arm/register-allocator-arm.h +0 -43
  152. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.cc +0 -2264
  153. data/ext/v8/upstream/2.0.6/src/arm/simulator-arm.h +0 -306
  154. data/ext/v8/upstream/2.0.6/src/arm/stub-cache-arm.cc +0 -1516
  155. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.cc +0 -412
  156. data/ext/v8/upstream/2.0.6/src/arm/virtual-frame-arm.h +0 -532
  157. data/ext/v8/upstream/2.0.6/src/array.js +0 -1154
  158. data/ext/v8/upstream/2.0.6/src/assembler.cc +0 -772
  159. data/ext/v8/upstream/2.0.6/src/assembler.h +0 -525
  160. data/ext/v8/upstream/2.0.6/src/ast.cc +0 -512
  161. data/ext/v8/upstream/2.0.6/src/ast.h +0 -1820
  162. data/ext/v8/upstream/2.0.6/src/bootstrapper.cc +0 -1680
  163. data/ext/v8/upstream/2.0.6/src/bootstrapper.h +0 -103
  164. data/ext/v8/upstream/2.0.6/src/builtins.cc +0 -851
  165. data/ext/v8/upstream/2.0.6/src/builtins.h +0 -245
  166. data/ext/v8/upstream/2.0.6/src/bytecodes-irregexp.h +0 -104
  167. data/ext/v8/upstream/2.0.6/src/char-predicates-inl.h +0 -86
  168. data/ext/v8/upstream/2.0.6/src/char-predicates.h +0 -65
  169. data/ext/v8/upstream/2.0.6/src/checks.cc +0 -100
  170. data/ext/v8/upstream/2.0.6/src/checks.h +0 -284
  171. data/ext/v8/upstream/2.0.6/src/code-stubs.cc +0 -164
  172. data/ext/v8/upstream/2.0.6/src/code-stubs.h +0 -164
  173. data/ext/v8/upstream/2.0.6/src/code.h +0 -68
  174. data/ext/v8/upstream/2.0.6/src/codegen-inl.h +0 -88
  175. data/ext/v8/upstream/2.0.6/src/codegen.cc +0 -504
  176. data/ext/v8/upstream/2.0.6/src/codegen.h +0 -522
  177. data/ext/v8/upstream/2.0.6/src/compilation-cache.cc +0 -490
  178. data/ext/v8/upstream/2.0.6/src/compilation-cache.h +0 -98
  179. data/ext/v8/upstream/2.0.6/src/compiler.cc +0 -1132
  180. data/ext/v8/upstream/2.0.6/src/compiler.h +0 -107
  181. data/ext/v8/upstream/2.0.6/src/contexts.cc +0 -256
  182. data/ext/v8/upstream/2.0.6/src/contexts.h +0 -345
  183. data/ext/v8/upstream/2.0.6/src/conversions-inl.h +0 -95
  184. data/ext/v8/upstream/2.0.6/src/conversions.cc +0 -709
  185. data/ext/v8/upstream/2.0.6/src/conversions.h +0 -118
  186. data/ext/v8/upstream/2.0.6/src/counters.cc +0 -78
  187. data/ext/v8/upstream/2.0.6/src/counters.h +0 -239
  188. data/ext/v8/upstream/2.0.6/src/cpu.h +0 -65
  189. data/ext/v8/upstream/2.0.6/src/d8-debug.cc +0 -345
  190. data/ext/v8/upstream/2.0.6/src/d8-debug.h +0 -155
  191. data/ext/v8/upstream/2.0.6/src/d8-posix.cc +0 -675
  192. data/ext/v8/upstream/2.0.6/src/d8-readline.cc +0 -128
  193. data/ext/v8/upstream/2.0.6/src/d8-windows.cc +0 -42
  194. data/ext/v8/upstream/2.0.6/src/d8.cc +0 -776
  195. data/ext/v8/upstream/2.0.6/src/d8.h +0 -225
  196. data/ext/v8/upstream/2.0.6/src/d8.js +0 -1625
  197. data/ext/v8/upstream/2.0.6/src/date-delay.js +0 -1138
  198. data/ext/v8/upstream/2.0.6/src/dateparser-inl.h +0 -114
  199. data/ext/v8/upstream/2.0.6/src/dateparser.cc +0 -186
  200. data/ext/v8/upstream/2.0.6/src/dateparser.h +0 -240
  201. data/ext/v8/upstream/2.0.6/src/debug-agent.cc +0 -425
  202. data/ext/v8/upstream/2.0.6/src/debug-agent.h +0 -129
  203. data/ext/v8/upstream/2.0.6/src/debug-delay.js +0 -2073
  204. data/ext/v8/upstream/2.0.6/src/debug.cc +0 -2751
  205. data/ext/v8/upstream/2.0.6/src/debug.h +0 -866
  206. data/ext/v8/upstream/2.0.6/src/disasm.h +0 -77
  207. data/ext/v8/upstream/2.0.6/src/disassembler.cc +0 -318
  208. data/ext/v8/upstream/2.0.6/src/disassembler.h +0 -56
  209. data/ext/v8/upstream/2.0.6/src/dtoa-config.c +0 -91
  210. data/ext/v8/upstream/2.0.6/src/execution.cc +0 -701
  211. data/ext/v8/upstream/2.0.6/src/execution.h +0 -312
  212. data/ext/v8/upstream/2.0.6/src/factory.cc +0 -957
  213. data/ext/v8/upstream/2.0.6/src/factory.h +0 -393
  214. data/ext/v8/upstream/2.0.6/src/fast-codegen.cc +0 -725
  215. data/ext/v8/upstream/2.0.6/src/fast-codegen.h +0 -371
  216. data/ext/v8/upstream/2.0.6/src/flag-definitions.h +0 -426
  217. data/ext/v8/upstream/2.0.6/src/flags.cc +0 -555
  218. data/ext/v8/upstream/2.0.6/src/flags.h +0 -81
  219. data/ext/v8/upstream/2.0.6/src/frame-element.cc +0 -45
  220. data/ext/v8/upstream/2.0.6/src/frame-element.h +0 -235
  221. data/ext/v8/upstream/2.0.6/src/frames-inl.h +0 -215
  222. data/ext/v8/upstream/2.0.6/src/frames.cc +0 -749
  223. data/ext/v8/upstream/2.0.6/src/frames.h +0 -659
  224. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.cc +0 -76
  225. data/ext/v8/upstream/2.0.6/src/func-name-inferrer.h +0 -135
  226. data/ext/v8/upstream/2.0.6/src/global-handles.cc +0 -516
  227. data/ext/v8/upstream/2.0.6/src/global-handles.h +0 -180
  228. data/ext/v8/upstream/2.0.6/src/globals.h +0 -608
  229. data/ext/v8/upstream/2.0.6/src/handles-inl.h +0 -76
  230. data/ext/v8/upstream/2.0.6/src/handles.cc +0 -811
  231. data/ext/v8/upstream/2.0.6/src/handles.h +0 -367
  232. data/ext/v8/upstream/2.0.6/src/hashmap.cc +0 -226
  233. data/ext/v8/upstream/2.0.6/src/hashmap.h +0 -120
  234. data/ext/v8/upstream/2.0.6/src/heap-inl.h +0 -407
  235. data/ext/v8/upstream/2.0.6/src/heap-profiler.cc +0 -695
  236. data/ext/v8/upstream/2.0.6/src/heap-profiler.h +0 -277
  237. data/ext/v8/upstream/2.0.6/src/heap.cc +0 -4204
  238. data/ext/v8/upstream/2.0.6/src/heap.h +0 -1704
  239. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32-inl.h +0 -325
  240. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.cc +0 -2375
  241. data/ext/v8/upstream/2.0.6/src/ia32/assembler-ia32.h +0 -914
  242. data/ext/v8/upstream/2.0.6/src/ia32/builtins-ia32.cc +0 -1222
  243. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32-inl.h +0 -46
  244. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.cc +0 -9770
  245. data/ext/v8/upstream/2.0.6/src/ia32/codegen-ia32.h +0 -834
  246. data/ext/v8/upstream/2.0.6/src/ia32/cpu-ia32.cc +0 -79
  247. data/ext/v8/upstream/2.0.6/src/ia32/debug-ia32.cc +0 -208
  248. data/ext/v8/upstream/2.0.6/src/ia32/disasm-ia32.cc +0 -1357
  249. data/ext/v8/upstream/2.0.6/src/ia32/fast-codegen-ia32.cc +0 -1813
  250. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.cc +0 -111
  251. data/ext/v8/upstream/2.0.6/src/ia32/frames-ia32.h +0 -135
  252. data/ext/v8/upstream/2.0.6/src/ia32/ic-ia32.cc +0 -1490
  253. data/ext/v8/upstream/2.0.6/src/ia32/jump-target-ia32.cc +0 -432
  254. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.cc +0 -1517
  255. data/ext/v8/upstream/2.0.6/src/ia32/macro-assembler-ia32.h +0 -528
  256. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.cc +0 -1219
  257. data/ext/v8/upstream/2.0.6/src/ia32/regexp-macro-assembler-ia32.h +0 -230
  258. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32-inl.h +0 -82
  259. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.cc +0 -99
  260. data/ext/v8/upstream/2.0.6/src/ia32/register-allocator-ia32.h +0 -43
  261. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.cc +0 -30
  262. data/ext/v8/upstream/2.0.6/src/ia32/simulator-ia32.h +0 -62
  263. data/ext/v8/upstream/2.0.6/src/ia32/stub-cache-ia32.cc +0 -1961
  264. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.cc +0 -1105
  265. data/ext/v8/upstream/2.0.6/src/ia32/virtual-frame-ia32.h +0 -580
  266. data/ext/v8/upstream/2.0.6/src/ic-inl.h +0 -93
  267. data/ext/v8/upstream/2.0.6/src/ic.cc +0 -1426
  268. data/ext/v8/upstream/2.0.6/src/ic.h +0 -443
  269. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.cc +0 -646
  270. data/ext/v8/upstream/2.0.6/src/interpreter-irregexp.h +0 -48
  271. data/ext/v8/upstream/2.0.6/src/json-delay.js +0 -254
  272. data/ext/v8/upstream/2.0.6/src/jsregexp.cc +0 -5234
  273. data/ext/v8/upstream/2.0.6/src/jsregexp.h +0 -1439
  274. data/ext/v8/upstream/2.0.6/src/jump-target-inl.h +0 -49
  275. data/ext/v8/upstream/2.0.6/src/jump-target.cc +0 -383
  276. data/ext/v8/upstream/2.0.6/src/jump-target.h +0 -280
  277. data/ext/v8/upstream/2.0.6/src/list-inl.h +0 -166
  278. data/ext/v8/upstream/2.0.6/src/list.h +0 -158
  279. data/ext/v8/upstream/2.0.6/src/log-inl.h +0 -126
  280. data/ext/v8/upstream/2.0.6/src/log-utils.cc +0 -503
  281. data/ext/v8/upstream/2.0.6/src/log-utils.h +0 -292
  282. data/ext/v8/upstream/2.0.6/src/log.cc +0 -1457
  283. data/ext/v8/upstream/2.0.6/src/log.h +0 -371
  284. data/ext/v8/upstream/2.0.6/src/macro-assembler.h +0 -93
  285. data/ext/v8/upstream/2.0.6/src/macros.py +0 -137
  286. data/ext/v8/upstream/2.0.6/src/mark-compact.cc +0 -2007
  287. data/ext/v8/upstream/2.0.6/src/mark-compact.h +0 -442
  288. data/ext/v8/upstream/2.0.6/src/math.js +0 -263
  289. data/ext/v8/upstream/2.0.6/src/memory.h +0 -74
  290. data/ext/v8/upstream/2.0.6/src/messages.cc +0 -177
  291. data/ext/v8/upstream/2.0.6/src/messages.h +0 -112
  292. data/ext/v8/upstream/2.0.6/src/messages.js +0 -937
  293. data/ext/v8/upstream/2.0.6/src/mirror-delay.js +0 -2332
  294. data/ext/v8/upstream/2.0.6/src/mksnapshot.cc +0 -169
  295. data/ext/v8/upstream/2.0.6/src/natives.h +0 -63
  296. data/ext/v8/upstream/2.0.6/src/objects-debug.cc +0 -1317
  297. data/ext/v8/upstream/2.0.6/src/objects-inl.h +0 -3044
  298. data/ext/v8/upstream/2.0.6/src/objects.cc +0 -8306
  299. data/ext/v8/upstream/2.0.6/src/objects.h +0 -4960
  300. data/ext/v8/upstream/2.0.6/src/oprofile-agent.cc +0 -116
  301. data/ext/v8/upstream/2.0.6/src/oprofile-agent.h +0 -69
  302. data/ext/v8/upstream/2.0.6/src/parser.cc +0 -4810
  303. data/ext/v8/upstream/2.0.6/src/parser.h +0 -195
  304. data/ext/v8/upstream/2.0.6/src/platform-freebsd.cc +0 -645
  305. data/ext/v8/upstream/2.0.6/src/platform-linux.cc +0 -808
  306. data/ext/v8/upstream/2.0.6/src/platform-macos.cc +0 -643
  307. data/ext/v8/upstream/2.0.6/src/platform-nullos.cc +0 -454
  308. data/ext/v8/upstream/2.0.6/src/platform-openbsd.cc +0 -597
  309. data/ext/v8/upstream/2.0.6/src/platform-posix.cc +0 -380
  310. data/ext/v8/upstream/2.0.6/src/platform-win32.cc +0 -1908
  311. data/ext/v8/upstream/2.0.6/src/platform.h +0 -556
  312. data/ext/v8/upstream/2.0.6/src/prettyprinter.cc +0 -1511
  313. data/ext/v8/upstream/2.0.6/src/prettyprinter.h +0 -219
  314. data/ext/v8/upstream/2.0.6/src/property.cc +0 -96
  315. data/ext/v8/upstream/2.0.6/src/property.h +0 -327
  316. data/ext/v8/upstream/2.0.6/src/regexp-delay.js +0 -406
  317. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp-inl.h +0 -78
  318. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.cc +0 -464
  319. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-irregexp.h +0 -141
  320. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.cc +0 -356
  321. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler-tracer.h +0 -103
  322. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.cc +0 -240
  323. data/ext/v8/upstream/2.0.6/src/regexp-macro-assembler.h +0 -220
  324. data/ext/v8/upstream/2.0.6/src/regexp-stack.cc +0 -103
  325. data/ext/v8/upstream/2.0.6/src/regexp-stack.h +0 -123
  326. data/ext/v8/upstream/2.0.6/src/register-allocator-inl.h +0 -74
  327. data/ext/v8/upstream/2.0.6/src/register-allocator.cc +0 -100
  328. data/ext/v8/upstream/2.0.6/src/register-allocator.h +0 -295
  329. data/ext/v8/upstream/2.0.6/src/rewriter.cc +0 -855
  330. data/ext/v8/upstream/2.0.6/src/rewriter.h +0 -54
  331. data/ext/v8/upstream/2.0.6/src/runtime.cc +0 -8163
  332. data/ext/v8/upstream/2.0.6/src/runtime.h +0 -432
  333. data/ext/v8/upstream/2.0.6/src/runtime.js +0 -626
  334. data/ext/v8/upstream/2.0.6/src/scanner.cc +0 -1098
  335. data/ext/v8/upstream/2.0.6/src/scanner.h +0 -425
  336. data/ext/v8/upstream/2.0.6/src/scopeinfo.cc +0 -649
  337. data/ext/v8/upstream/2.0.6/src/scopeinfo.h +0 -236
  338. data/ext/v8/upstream/2.0.6/src/scopes.cc +0 -963
  339. data/ext/v8/upstream/2.0.6/src/scopes.h +0 -401
  340. data/ext/v8/upstream/2.0.6/src/serialize.cc +0 -1260
  341. data/ext/v8/upstream/2.0.6/src/serialize.h +0 -404
  342. data/ext/v8/upstream/2.0.6/src/shell.h +0 -55
  343. data/ext/v8/upstream/2.0.6/src/simulator.h +0 -41
  344. data/ext/v8/upstream/2.0.6/src/smart-pointer.h +0 -109
  345. data/ext/v8/upstream/2.0.6/src/snapshot-common.cc +0 -97
  346. data/ext/v8/upstream/2.0.6/src/snapshot-empty.cc +0 -40
  347. data/ext/v8/upstream/2.0.6/src/snapshot.h +0 -59
  348. data/ext/v8/upstream/2.0.6/src/spaces-inl.h +0 -372
  349. data/ext/v8/upstream/2.0.6/src/spaces.cc +0 -2864
  350. data/ext/v8/upstream/2.0.6/src/spaces.h +0 -2072
  351. data/ext/v8/upstream/2.0.6/src/string-stream.cc +0 -584
  352. data/ext/v8/upstream/2.0.6/src/string-stream.h +0 -189
  353. data/ext/v8/upstream/2.0.6/src/string.js +0 -901
  354. data/ext/v8/upstream/2.0.6/src/stub-cache.cc +0 -1108
  355. data/ext/v8/upstream/2.0.6/src/stub-cache.h +0 -578
  356. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/COPYING +0 -15
  357. data/ext/v8/upstream/2.0.6/src/third_party/dtoa/dtoa.c +0 -3330
  358. data/ext/v8/upstream/2.0.6/src/third_party/valgrind/valgrind.h +0 -3925
  359. data/ext/v8/upstream/2.0.6/src/token.cc +0 -56
  360. data/ext/v8/upstream/2.0.6/src/token.h +0 -270
  361. data/ext/v8/upstream/2.0.6/src/top.cc +0 -991
  362. data/ext/v8/upstream/2.0.6/src/top.h +0 -459
  363. data/ext/v8/upstream/2.0.6/src/unicode-inl.h +0 -238
  364. data/ext/v8/upstream/2.0.6/src/unicode.cc +0 -749
  365. data/ext/v8/upstream/2.0.6/src/unicode.h +0 -279
  366. data/ext/v8/upstream/2.0.6/src/uri.js +0 -415
  367. data/ext/v8/upstream/2.0.6/src/usage-analyzer.cc +0 -426
  368. data/ext/v8/upstream/2.0.6/src/usage-analyzer.h +0 -40
  369. data/ext/v8/upstream/2.0.6/src/utils.cc +0 -322
  370. data/ext/v8/upstream/2.0.6/src/utils.h +0 -592
  371. data/ext/v8/upstream/2.0.6/src/v8-counters.cc +0 -55
  372. data/ext/v8/upstream/2.0.6/src/v8-counters.h +0 -198
  373. data/ext/v8/upstream/2.0.6/src/v8.cc +0 -193
  374. data/ext/v8/upstream/2.0.6/src/v8.h +0 -119
  375. data/ext/v8/upstream/2.0.6/src/v8natives.js +0 -846
  376. data/ext/v8/upstream/2.0.6/src/v8threads.cc +0 -450
  377. data/ext/v8/upstream/2.0.6/src/v8threads.h +0 -144
  378. data/ext/v8/upstream/2.0.6/src/variables.cc +0 -163
  379. data/ext/v8/upstream/2.0.6/src/variables.h +0 -235
  380. data/ext/v8/upstream/2.0.6/src/version.cc +0 -88
  381. data/ext/v8/upstream/2.0.6/src/version.h +0 -64
  382. data/ext/v8/upstream/2.0.6/src/virtual-frame.cc +0 -381
  383. data/ext/v8/upstream/2.0.6/src/virtual-frame.h +0 -44
  384. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64-inl.h +0 -352
  385. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.cc +0 -2539
  386. data/ext/v8/upstream/2.0.6/src/x64/assembler-x64.h +0 -1399
  387. data/ext/v8/upstream/2.0.6/src/x64/builtins-x64.cc +0 -1255
  388. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64-inl.h +0 -46
  389. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.cc +0 -8223
  390. data/ext/v8/upstream/2.0.6/src/x64/codegen-x64.h +0 -785
  391. data/ext/v8/upstream/2.0.6/src/x64/cpu-x64.cc +0 -79
  392. data/ext/v8/upstream/2.0.6/src/x64/debug-x64.cc +0 -202
  393. data/ext/v8/upstream/2.0.6/src/x64/disasm-x64.cc +0 -1596
  394. data/ext/v8/upstream/2.0.6/src/x64/fast-codegen-x64.cc +0 -1820
  395. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.cc +0 -109
  396. data/ext/v8/upstream/2.0.6/src/x64/frames-x64.h +0 -121
  397. data/ext/v8/upstream/2.0.6/src/x64/ic-x64.cc +0 -1392
  398. data/ext/v8/upstream/2.0.6/src/x64/jump-target-x64.cc +0 -432
  399. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.cc +0 -2409
  400. data/ext/v8/upstream/2.0.6/src/x64/macro-assembler-x64.h +0 -765
  401. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.cc +0 -1337
  402. data/ext/v8/upstream/2.0.6/src/x64/regexp-macro-assembler-x64.h +0 -295
  403. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64-inl.h +0 -86
  404. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.cc +0 -84
  405. data/ext/v8/upstream/2.0.6/src/x64/register-allocator-x64.h +0 -43
  406. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.cc +0 -27
  407. data/ext/v8/upstream/2.0.6/src/x64/simulator-x64.h +0 -63
  408. data/ext/v8/upstream/2.0.6/src/x64/stub-cache-x64.cc +0 -1884
  409. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.cc +0 -1089
  410. data/ext/v8/upstream/2.0.6/src/x64/virtual-frame-x64.h +0 -560
  411. data/ext/v8/upstream/2.0.6/src/zone-inl.h +0 -297
  412. data/ext/v8/upstream/2.0.6/src/zone.cc +0 -193
  413. data/ext/v8/upstream/2.0.6/src/zone.h +0 -305
  414. data/ext/v8/upstream/2.0.6/tools/codemap.js +0 -258
  415. data/ext/v8/upstream/2.0.6/tools/consarray.js +0 -93
  416. data/ext/v8/upstream/2.0.6/tools/csvparser.js +0 -98
  417. data/ext/v8/upstream/2.0.6/tools/gyp/v8.gyp +0 -620
  418. data/ext/v8/upstream/2.0.6/tools/js2c.py +0 -376
  419. data/ext/v8/upstream/2.0.6/tools/jsmin.py +0 -280
  420. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor +0 -24
  421. data/ext/v8/upstream/2.0.6/tools/linux-tick-processor.py +0 -78
  422. data/ext/v8/upstream/2.0.6/tools/logreader.js +0 -320
  423. data/ext/v8/upstream/2.0.6/tools/mac-nm +0 -18
  424. data/ext/v8/upstream/2.0.6/tools/mac-tick-processor +0 -6
  425. data/ext/v8/upstream/2.0.6/tools/oprofile/annotate +0 -7
  426. data/ext/v8/upstream/2.0.6/tools/oprofile/common +0 -19
  427. data/ext/v8/upstream/2.0.6/tools/oprofile/dump +0 -7
  428. data/ext/v8/upstream/2.0.6/tools/oprofile/report +0 -7
  429. data/ext/v8/upstream/2.0.6/tools/oprofile/reset +0 -7
  430. data/ext/v8/upstream/2.0.6/tools/oprofile/run +0 -14
  431. data/ext/v8/upstream/2.0.6/tools/oprofile/shutdown +0 -7
  432. data/ext/v8/upstream/2.0.6/tools/oprofile/start +0 -7
  433. data/ext/v8/upstream/2.0.6/tools/presubmit.py +0 -299
  434. data/ext/v8/upstream/2.0.6/tools/process-heap-prof.py +0 -120
  435. data/ext/v8/upstream/2.0.6/tools/profile.js +0 -621
  436. data/ext/v8/upstream/2.0.6/tools/profile_view.js +0 -224
  437. data/ext/v8/upstream/2.0.6/tools/run-valgrind.py +0 -77
  438. data/ext/v8/upstream/2.0.6/tools/splaytree.js +0 -322
  439. data/ext/v8/upstream/2.0.6/tools/splaytree.py +0 -226
  440. data/ext/v8/upstream/2.0.6/tools/stats-viewer.py +0 -456
  441. data/ext/v8/upstream/2.0.6/tools/test.py +0 -1370
  442. data/ext/v8/upstream/2.0.6/tools/tickprocessor-driver.js +0 -53
  443. data/ext/v8/upstream/2.0.6/tools/tickprocessor.js +0 -731
  444. data/ext/v8/upstream/2.0.6/tools/tickprocessor.py +0 -535
  445. data/ext/v8/upstream/2.0.6/tools/utils.py +0 -82
  446. data/ext/v8/upstream/2.0.6/tools/visual_studio/README.txt +0 -71
  447. data/ext/v8/upstream/2.0.6/tools/visual_studio/arm.vsprops +0 -14
  448. data/ext/v8/upstream/2.0.6/tools/visual_studio/common.vsprops +0 -35
  449. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8.vcproj +0 -199
  450. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_arm.vcproj +0 -199
  451. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8_x64.vcproj +0 -201
  452. data/ext/v8/upstream/2.0.6/tools/visual_studio/d8js2c.cmd +0 -6
  453. data/ext/v8/upstream/2.0.6/tools/visual_studio/debug.vsprops +0 -17
  454. data/ext/v8/upstream/2.0.6/tools/visual_studio/ia32.vsprops +0 -13
  455. data/ext/v8/upstream/2.0.6/tools/visual_studio/js2c.cmd +0 -6
  456. data/ext/v8/upstream/2.0.6/tools/visual_studio/release.vsprops +0 -24
  457. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.sln +0 -101
  458. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8.vcproj +0 -223
  459. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.sln +0 -74
  460. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_arm.vcproj +0 -223
  461. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base.vcproj +0 -971
  462. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_arm.vcproj +0 -983
  463. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_base_x64.vcproj +0 -959
  464. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest.vcproj +0 -255
  465. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_arm.vcproj +0 -243
  466. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_cctest_x64.vcproj +0 -257
  467. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot.vcproj +0 -151
  468. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_mksnapshot_x64.vcproj +0 -151
  469. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample.vcproj +0 -151
  470. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_arm.vcproj +0 -151
  471. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_process_sample_x64.vcproj +0 -151
  472. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample.vcproj +0 -151
  473. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_arm.vcproj +0 -151
  474. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_shell_sample_x64.vcproj +0 -153
  475. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot.vcproj +0 -142
  476. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc.vcproj +0 -92
  477. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_cc_x64.vcproj +0 -92
  478. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_snapshot_x64.vcproj +0 -142
  479. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.sln +0 -101
  480. data/ext/v8/upstream/2.0.6/tools/visual_studio/v8_x64.vcproj +0 -223
  481. data/ext/v8/upstream/2.0.6/tools/visual_studio/x64.vsprops +0 -13
  482. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.bat +0 -5
  483. data/ext/v8/upstream/2.0.6/tools/windows-tick-processor.py +0 -137
  484. data/ext/v8/upstream/Makefile +0 -32
  485. data/ext/v8/upstream/fpic-on-linux-amd64.patch +0 -13
  486. data/ext/v8/upstream/no-strict-aliasing.patch +0 -13
  487. data/ext/v8/upstream/scons/CHANGES.txt +0 -5183
  488. data/ext/v8/upstream/scons/LICENSE.txt +0 -20
  489. data/ext/v8/upstream/scons/MANIFEST +0 -202
  490. data/ext/v8/upstream/scons/PKG-INFO +0 -13
  491. data/ext/v8/upstream/scons/README.txt +0 -273
  492. data/ext/v8/upstream/scons/RELEASE.txt +0 -1040
  493. data/ext/v8/upstream/scons/engine/SCons/Action.py +0 -1256
  494. data/ext/v8/upstream/scons/engine/SCons/Builder.py +0 -868
  495. data/ext/v8/upstream/scons/engine/SCons/CacheDir.py +0 -217
  496. data/ext/v8/upstream/scons/engine/SCons/Conftest.py +0 -794
  497. data/ext/v8/upstream/scons/engine/SCons/Debug.py +0 -237
  498. data/ext/v8/upstream/scons/engine/SCons/Defaults.py +0 -485
  499. data/ext/v8/upstream/scons/engine/SCons/Environment.py +0 -2327
  500. data/ext/v8/upstream/scons/engine/SCons/Errors.py +0 -207
  501. data/ext/v8/upstream/scons/engine/SCons/Executor.py +0 -636
  502. data/ext/v8/upstream/scons/engine/SCons/Job.py +0 -435
  503. data/ext/v8/upstream/scons/engine/SCons/Memoize.py +0 -292
  504. data/ext/v8/upstream/scons/engine/SCons/Node/Alias.py +0 -153
  505. data/ext/v8/upstream/scons/engine/SCons/Node/FS.py +0 -3220
  506. data/ext/v8/upstream/scons/engine/SCons/Node/Python.py +0 -128
  507. data/ext/v8/upstream/scons/engine/SCons/Node/__init__.py +0 -1341
  508. data/ext/v8/upstream/scons/engine/SCons/Options/BoolOption.py +0 -50
  509. data/ext/v8/upstream/scons/engine/SCons/Options/EnumOption.py +0 -50
  510. data/ext/v8/upstream/scons/engine/SCons/Options/ListOption.py +0 -50
  511. data/ext/v8/upstream/scons/engine/SCons/Options/PackageOption.py +0 -50
  512. data/ext/v8/upstream/scons/engine/SCons/Options/PathOption.py +0 -76
  513. data/ext/v8/upstream/scons/engine/SCons/Options/__init__.py +0 -74
  514. data/ext/v8/upstream/scons/engine/SCons/PathList.py +0 -232
  515. data/ext/v8/upstream/scons/engine/SCons/Platform/__init__.py +0 -236
  516. data/ext/v8/upstream/scons/engine/SCons/Platform/aix.py +0 -70
  517. data/ext/v8/upstream/scons/engine/SCons/Platform/cygwin.py +0 -55
  518. data/ext/v8/upstream/scons/engine/SCons/Platform/darwin.py +0 -46
  519. data/ext/v8/upstream/scons/engine/SCons/Platform/hpux.py +0 -46
  520. data/ext/v8/upstream/scons/engine/SCons/Platform/irix.py +0 -44
  521. data/ext/v8/upstream/scons/engine/SCons/Platform/os2.py +0 -58
  522. data/ext/v8/upstream/scons/engine/SCons/Platform/posix.py +0 -264
  523. data/ext/v8/upstream/scons/engine/SCons/Platform/sunos.py +0 -50
  524. data/ext/v8/upstream/scons/engine/SCons/Platform/win32.py +0 -386
  525. data/ext/v8/upstream/scons/engine/SCons/SConf.py +0 -1038
  526. data/ext/v8/upstream/scons/engine/SCons/SConsign.py +0 -381
  527. data/ext/v8/upstream/scons/engine/SCons/Scanner/C.py +0 -132
  528. data/ext/v8/upstream/scons/engine/SCons/Scanner/D.py +0 -74
  529. data/ext/v8/upstream/scons/engine/SCons/Scanner/Dir.py +0 -111
  530. data/ext/v8/upstream/scons/engine/SCons/Scanner/Fortran.py +0 -320
  531. data/ext/v8/upstream/scons/engine/SCons/Scanner/IDL.py +0 -48
  532. data/ext/v8/upstream/scons/engine/SCons/Scanner/LaTeX.py +0 -378
  533. data/ext/v8/upstream/scons/engine/SCons/Scanner/Prog.py +0 -103
  534. data/ext/v8/upstream/scons/engine/SCons/Scanner/RC.py +0 -55
  535. data/ext/v8/upstream/scons/engine/SCons/Scanner/__init__.py +0 -415
  536. data/ext/v8/upstream/scons/engine/SCons/Script/Interactive.py +0 -386
  537. data/ext/v8/upstream/scons/engine/SCons/Script/Main.py +0 -1360
  538. data/ext/v8/upstream/scons/engine/SCons/Script/SConsOptions.py +0 -944
  539. data/ext/v8/upstream/scons/engine/SCons/Script/SConscript.py +0 -642
  540. data/ext/v8/upstream/scons/engine/SCons/Script/__init__.py +0 -414
  541. data/ext/v8/upstream/scons/engine/SCons/Sig.py +0 -63
  542. data/ext/v8/upstream/scons/engine/SCons/Subst.py +0 -911
  543. data/ext/v8/upstream/scons/engine/SCons/Taskmaster.py +0 -1030
  544. data/ext/v8/upstream/scons/engine/SCons/Tool/386asm.py +0 -61
  545. data/ext/v8/upstream/scons/engine/SCons/Tool/BitKeeper.py +0 -65
  546. data/ext/v8/upstream/scons/engine/SCons/Tool/CVS.py +0 -73
  547. data/ext/v8/upstream/scons/engine/SCons/Tool/FortranCommon.py +0 -247
  548. data/ext/v8/upstream/scons/engine/SCons/Tool/JavaCommon.py +0 -324
  549. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/__init__.py +0 -56
  550. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/arch.py +0 -61
  551. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/common.py +0 -210
  552. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/netframework.py +0 -84
  553. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/sdk.py +0 -321
  554. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vc.py +0 -367
  555. data/ext/v8/upstream/scons/engine/SCons/Tool/MSCommon/vs.py +0 -497
  556. data/ext/v8/upstream/scons/engine/SCons/Tool/Perforce.py +0 -104
  557. data/ext/v8/upstream/scons/engine/SCons/Tool/PharLapCommon.py +0 -138
  558. data/ext/v8/upstream/scons/engine/SCons/Tool/RCS.py +0 -64
  559. data/ext/v8/upstream/scons/engine/SCons/Tool/SCCS.py +0 -64
  560. data/ext/v8/upstream/scons/engine/SCons/Tool/Subversion.py +0 -71
  561. data/ext/v8/upstream/scons/engine/SCons/Tool/__init__.py +0 -675
  562. data/ext/v8/upstream/scons/engine/SCons/Tool/aixc++.py +0 -82
  563. data/ext/v8/upstream/scons/engine/SCons/Tool/aixcc.py +0 -74
  564. data/ext/v8/upstream/scons/engine/SCons/Tool/aixf77.py +0 -80
  565. data/ext/v8/upstream/scons/engine/SCons/Tool/aixlink.py +0 -76
  566. data/ext/v8/upstream/scons/engine/SCons/Tool/applelink.py +0 -71
  567. data/ext/v8/upstream/scons/engine/SCons/Tool/ar.py +0 -63
  568. data/ext/v8/upstream/scons/engine/SCons/Tool/as.py +0 -78
  569. data/ext/v8/upstream/scons/engine/SCons/Tool/bcc32.py +0 -82
  570. data/ext/v8/upstream/scons/engine/SCons/Tool/c++.py +0 -99
  571. data/ext/v8/upstream/scons/engine/SCons/Tool/cc.py +0 -114
  572. data/ext/v8/upstream/scons/engine/SCons/Tool/cvf.py +0 -58
  573. data/ext/v8/upstream/scons/engine/SCons/Tool/default.py +0 -50
  574. data/ext/v8/upstream/scons/engine/SCons/Tool/dmd.py +0 -224
  575. data/ext/v8/upstream/scons/engine/SCons/Tool/dvi.py +0 -64
  576. data/ext/v8/upstream/scons/engine/SCons/Tool/dvipdf.py +0 -125
  577. data/ext/v8/upstream/scons/engine/SCons/Tool/dvips.py +0 -94
  578. data/ext/v8/upstream/scons/engine/SCons/Tool/f77.py +0 -62
  579. data/ext/v8/upstream/scons/engine/SCons/Tool/f90.py +0 -62
  580. data/ext/v8/upstream/scons/engine/SCons/Tool/f95.py +0 -63
  581. data/ext/v8/upstream/scons/engine/SCons/Tool/filesystem.py +0 -98
  582. data/ext/v8/upstream/scons/engine/SCons/Tool/fortran.py +0 -63
  583. data/ext/v8/upstream/scons/engine/SCons/Tool/g++.py +0 -90
  584. data/ext/v8/upstream/scons/engine/SCons/Tool/g77.py +0 -73
  585. data/ext/v8/upstream/scons/engine/SCons/Tool/gas.py +0 -53
  586. data/ext/v8/upstream/scons/engine/SCons/Tool/gcc.py +0 -80
  587. data/ext/v8/upstream/scons/engine/SCons/Tool/gfortran.py +0 -64
  588. data/ext/v8/upstream/scons/engine/SCons/Tool/gnulink.py +0 -63
  589. data/ext/v8/upstream/scons/engine/SCons/Tool/gs.py +0 -81
  590. data/ext/v8/upstream/scons/engine/SCons/Tool/hpc++.py +0 -85
  591. data/ext/v8/upstream/scons/engine/SCons/Tool/hpcc.py +0 -53
  592. data/ext/v8/upstream/scons/engine/SCons/Tool/hplink.py +0 -77
  593. data/ext/v8/upstream/scons/engine/SCons/Tool/icc.py +0 -59
  594. data/ext/v8/upstream/scons/engine/SCons/Tool/icl.py +0 -52
  595. data/ext/v8/upstream/scons/engine/SCons/Tool/ifl.py +0 -72
  596. data/ext/v8/upstream/scons/engine/SCons/Tool/ifort.py +0 -90
  597. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink.py +0 -59
  598. data/ext/v8/upstream/scons/engine/SCons/Tool/ilink32.py +0 -60
  599. data/ext/v8/upstream/scons/engine/SCons/Tool/install.py +0 -229
  600. data/ext/v8/upstream/scons/engine/SCons/Tool/intelc.py +0 -490
  601. data/ext/v8/upstream/scons/engine/SCons/Tool/ipkg.py +0 -71
  602. data/ext/v8/upstream/scons/engine/SCons/Tool/jar.py +0 -110
  603. data/ext/v8/upstream/scons/engine/SCons/Tool/javac.py +0 -234
  604. data/ext/v8/upstream/scons/engine/SCons/Tool/javah.py +0 -138
  605. data/ext/v8/upstream/scons/engine/SCons/Tool/latex.py +0 -79
  606. data/ext/v8/upstream/scons/engine/SCons/Tool/lex.py +0 -99
  607. data/ext/v8/upstream/scons/engine/SCons/Tool/link.py +0 -121
  608. data/ext/v8/upstream/scons/engine/SCons/Tool/linkloc.py +0 -112
  609. data/ext/v8/upstream/scons/engine/SCons/Tool/m4.py +0 -63
  610. data/ext/v8/upstream/scons/engine/SCons/Tool/masm.py +0 -77
  611. data/ext/v8/upstream/scons/engine/SCons/Tool/midl.py +0 -90
  612. data/ext/v8/upstream/scons/engine/SCons/Tool/mingw.py +0 -159
  613. data/ext/v8/upstream/scons/engine/SCons/Tool/mslib.py +0 -64
  614. data/ext/v8/upstream/scons/engine/SCons/Tool/mslink.py +0 -266
  615. data/ext/v8/upstream/scons/engine/SCons/Tool/mssdk.py +0 -50
  616. data/ext/v8/upstream/scons/engine/SCons/Tool/msvc.py +0 -269
  617. data/ext/v8/upstream/scons/engine/SCons/Tool/msvs.py +0 -1439
  618. data/ext/v8/upstream/scons/engine/SCons/Tool/mwcc.py +0 -208
  619. data/ext/v8/upstream/scons/engine/SCons/Tool/mwld.py +0 -107
  620. data/ext/v8/upstream/scons/engine/SCons/Tool/nasm.py +0 -72
  621. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/__init__.py +0 -314
  622. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/ipk.py +0 -185
  623. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/msi.py +0 -526
  624. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/rpm.py +0 -367
  625. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_tarbz2.py +0 -43
  626. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_targz.py +0 -43
  627. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/src_zip.py +0 -43
  628. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/tarbz2.py +0 -44
  629. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/targz.py +0 -44
  630. data/ext/v8/upstream/scons/engine/SCons/Tool/packaging/zip.py +0 -44
  631. data/ext/v8/upstream/scons/engine/SCons/Tool/pdf.py +0 -78
  632. data/ext/v8/upstream/scons/engine/SCons/Tool/pdflatex.py +0 -83
  633. data/ext/v8/upstream/scons/engine/SCons/Tool/pdftex.py +0 -108
  634. data/ext/v8/upstream/scons/engine/SCons/Tool/qt.py +0 -336
  635. data/ext/v8/upstream/scons/engine/SCons/Tool/rmic.py +0 -121
  636. data/ext/v8/upstream/scons/engine/SCons/Tool/rpcgen.py +0 -70
  637. data/ext/v8/upstream/scons/engine/SCons/Tool/rpm.py +0 -132
  638. data/ext/v8/upstream/scons/engine/SCons/Tool/sgiar.py +0 -68
  639. data/ext/v8/upstream/scons/engine/SCons/Tool/sgic++.py +0 -58
  640. data/ext/v8/upstream/scons/engine/SCons/Tool/sgicc.py +0 -53
  641. data/ext/v8/upstream/scons/engine/SCons/Tool/sgilink.py +0 -63
  642. data/ext/v8/upstream/scons/engine/SCons/Tool/sunar.py +0 -67
  643. data/ext/v8/upstream/scons/engine/SCons/Tool/sunc++.py +0 -142
  644. data/ext/v8/upstream/scons/engine/SCons/Tool/suncc.py +0 -58
  645. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf77.py +0 -63
  646. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf90.py +0 -64
  647. data/ext/v8/upstream/scons/engine/SCons/Tool/sunf95.py +0 -64
  648. data/ext/v8/upstream/scons/engine/SCons/Tool/sunlink.py +0 -77
  649. data/ext/v8/upstream/scons/engine/SCons/Tool/swig.py +0 -186
  650. data/ext/v8/upstream/scons/engine/SCons/Tool/tar.py +0 -73
  651. data/ext/v8/upstream/scons/engine/SCons/Tool/tex.py +0 -805
  652. data/ext/v8/upstream/scons/engine/SCons/Tool/textfile.py +0 -175
  653. data/ext/v8/upstream/scons/engine/SCons/Tool/tlib.py +0 -53
  654. data/ext/v8/upstream/scons/engine/SCons/Tool/wix.py +0 -100
  655. data/ext/v8/upstream/scons/engine/SCons/Tool/yacc.py +0 -131
  656. data/ext/v8/upstream/scons/engine/SCons/Tool/zip.py +0 -100
  657. data/ext/v8/upstream/scons/engine/SCons/Util.py +0 -1645
  658. data/ext/v8/upstream/scons/engine/SCons/Variables/BoolVariable.py +0 -91
  659. data/ext/v8/upstream/scons/engine/SCons/Variables/EnumVariable.py +0 -107
  660. data/ext/v8/upstream/scons/engine/SCons/Variables/ListVariable.py +0 -139
  661. data/ext/v8/upstream/scons/engine/SCons/Variables/PackageVariable.py +0 -109
  662. data/ext/v8/upstream/scons/engine/SCons/Variables/PathVariable.py +0 -147
  663. data/ext/v8/upstream/scons/engine/SCons/Variables/__init__.py +0 -317
  664. data/ext/v8/upstream/scons/engine/SCons/Warnings.py +0 -228
  665. data/ext/v8/upstream/scons/engine/SCons/__init__.py +0 -49
  666. data/ext/v8/upstream/scons/engine/SCons/compat/__init__.py +0 -302
  667. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_UserString.py +0 -98
  668. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_hashlib.py +0 -91
  669. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_itertools.py +0 -124
  670. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_optparse.py +0 -1725
  671. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets.py +0 -583
  672. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_sets15.py +0 -176
  673. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_shlex.py +0 -325
  674. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_subprocess.py +0 -1296
  675. data/ext/v8/upstream/scons/engine/SCons/compat/_scons_textwrap.py +0 -382
  676. data/ext/v8/upstream/scons/engine/SCons/compat/builtins.py +0 -187
  677. data/ext/v8/upstream/scons/engine/SCons/cpp.py +0 -598
  678. data/ext/v8/upstream/scons/engine/SCons/dblite.py +0 -248
  679. data/ext/v8/upstream/scons/engine/SCons/exitfuncs.py +0 -77
  680. data/ext/v8/upstream/scons/os_spawnv_fix.diff +0 -83
  681. data/ext/v8/upstream/scons/scons-time.1 +0 -1017
  682. data/ext/v8/upstream/scons/scons.1 +0 -15179
  683. data/ext/v8/upstream/scons/sconsign.1 +0 -208
  684. data/ext/v8/upstream/scons/script/scons +0 -184
  685. data/ext/v8/upstream/scons/script/scons-time +0 -1529
  686. data/ext/v8/upstream/scons/script/scons.bat +0 -31
  687. data/ext/v8/upstream/scons/script/sconsign +0 -508
  688. data/ext/v8/upstream/scons/setup.cfg +0 -6
  689. data/ext/v8/upstream/scons/setup.py +0 -427
  690. data/ext/v8/v8.cpp +0 -89
  691. data/ext/v8/v8_cxt.cpp +0 -92
  692. data/ext/v8/v8_cxt.h +0 -20
  693. data/ext/v8/v8_func.cpp +0 -10
  694. data/ext/v8/v8_func.h +0 -11
  695. data/ext/v8/v8_msg.cpp +0 -54
  696. data/ext/v8/v8_msg.h +0 -18
  697. data/ext/v8/v8_obj.cpp +0 -52
  698. data/ext/v8/v8_obj.h +0 -13
  699. data/ext/v8/v8_ref.cpp +0 -26
  700. data/ext/v8/v8_ref.h +0 -31
  701. data/ext/v8/v8_script.cpp +0 -20
  702. data/ext/v8/v8_script.h +0 -8
  703. data/ext/v8/v8_standalone.cpp +0 -69
  704. data/ext/v8/v8_standalone.h +0 -31
  705. data/ext/v8/v8_str.cpp +0 -17
  706. data/ext/v8/v8_str.h +0 -9
  707. data/ext/v8/v8_template.cpp +0 -53
  708. data/ext/v8/v8_template.h +0 -13
  709. data/lib/v8/to.rb +0 -33
  710. data/lib/v8/v8.so +0 -0
  711. data/script/console +0 -10
  712. data/script/destroy +0 -14
  713. data/script/generate +0 -14
  714. data/spec/ext/cxt_spec.rb +0 -25
  715. data/spec/ext/obj_spec.rb +0 -13
  716. data/spec/redjs/jsapi_spec.rb +0 -405
  717. data/spec/redjs/tap.rb +0 -8
  718. data/spec/redjs_helper.rb +0 -3
  719. data/spec/spec.opts +0 -1
  720. data/spec/v8/to_spec.rb +0 -15
  721. data/tasks/rspec.rake +0 -21
@@ -1,225 +0,0 @@
1
- // Copyright 2009 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #ifndef V8_D8_H_
29
- #define V8_D8_H_
30
-
31
- #include "v8.h"
32
- #include "hashmap.h"
33
-
34
-
35
- namespace v8 {
36
-
37
-
38
- namespace i = v8::internal;
39
-
40
-
41
- // A single counter in a counter collection.
42
- class Counter {
43
- public:
44
- static const int kMaxNameSize = 64;
45
- int32_t* Bind(const char* name, bool histogram);
46
- int32_t* ptr() { return &count_; }
47
- int32_t count() { return count_; }
48
- int32_t sample_total() { return sample_total_; }
49
- bool is_histogram() { return is_histogram_; }
50
- void AddSample(int32_t sample);
51
- private:
52
- int32_t count_;
53
- int32_t sample_total_;
54
- bool is_histogram_;
55
- uint8_t name_[kMaxNameSize];
56
- };
57
-
58
-
59
- // A set of counters and associated information. An instance of this
60
- // class is stored directly in the memory-mapped counters file if
61
- // the --map-counters options is used
62
- class CounterCollection {
63
- public:
64
- CounterCollection();
65
- Counter* GetNextCounter();
66
- private:
67
- static const unsigned kMaxCounters = 256;
68
- uint32_t magic_number_;
69
- uint32_t max_counters_;
70
- uint32_t max_name_size_;
71
- uint32_t counters_in_use_;
72
- Counter counters_[kMaxCounters];
73
- };
74
-
75
-
76
- class CounterMap {
77
- public:
78
- CounterMap(): hash_map_(Match) { }
79
- Counter* Lookup(const char* name) {
80
- i::HashMap::Entry* answer = hash_map_.Lookup(
81
- const_cast<char*>(name),
82
- Hash(name),
83
- false);
84
- if (!answer) return NULL;
85
- return reinterpret_cast<Counter*>(answer->value);
86
- }
87
- void Set(const char* name, Counter* value) {
88
- i::HashMap::Entry* answer = hash_map_.Lookup(
89
- const_cast<char*>(name),
90
- Hash(name),
91
- true);
92
- ASSERT(answer != NULL);
93
- answer->value = value;
94
- }
95
- class Iterator {
96
- public:
97
- explicit Iterator(CounterMap* map)
98
- : map_(&map->hash_map_), entry_(map_->Start()) { }
99
- void Next() { entry_ = map_->Next(entry_); }
100
- bool More() { return entry_ != NULL; }
101
- const char* CurrentKey() { return static_cast<const char*>(entry_->key); }
102
- Counter* CurrentValue() { return static_cast<Counter*>(entry_->value); }
103
- private:
104
- i::HashMap* map_;
105
- i::HashMap::Entry* entry_;
106
- };
107
- private:
108
- static int Hash(const char* name);
109
- static bool Match(void* key1, void* key2);
110
- i::HashMap hash_map_;
111
- };
112
-
113
-
114
- class Shell: public i::AllStatic {
115
- public:
116
- static bool ExecuteString(Handle<String> source,
117
- Handle<Value> name,
118
- bool print_result,
119
- bool report_exceptions);
120
- static void ReportException(TryCatch* try_catch);
121
- static void Initialize();
122
- static void OnExit();
123
- static int* LookupCounter(const char* name);
124
- static void* CreateHistogram(const char* name,
125
- int min,
126
- int max,
127
- size_t buckets);
128
- static void AddHistogramSample(void* histogram, int sample);
129
- static void MapCounters(const char* name);
130
- static Handle<String> ReadFile(const char* name);
131
- static void RunShell();
132
- static int Main(int argc, char* argv[]);
133
- static Handle<Array> GetCompletions(Handle<String> text,
134
- Handle<String> full);
135
- #ifdef ENABLE_DEBUGGER_SUPPORT
136
- static Handle<Object> DebugMessageDetails(Handle<String> message);
137
- static Handle<Value> DebugCommandToJSONRequest(Handle<String> command);
138
- #endif
139
-
140
- static Handle<Value> Print(const Arguments& args);
141
- static Handle<Value> Write(const Arguments& args);
142
- static Handle<Value> Yield(const Arguments& args);
143
- static Handle<Value> Quit(const Arguments& args);
144
- static Handle<Value> Version(const Arguments& args);
145
- static Handle<Value> Read(const Arguments& args);
146
- static Handle<Value> ReadLine(const Arguments& args);
147
- static Handle<Value> Load(const Arguments& args);
148
- // The OS object on the global object contains methods for performing
149
- // operating system calls:
150
- //
151
- // os.system("program_name", ["arg1", "arg2", ...], timeout1, timeout2) will
152
- // run the command, passing the arguments to the program. The standard output
153
- // of the program will be picked up and returned as a multiline string. If
154
- // timeout1 is present then it should be a number. -1 indicates no timeout
155
- // and a positive number is used as a timeout in milliseconds that limits the
156
- // time spent waiting between receiving output characters from the program.
157
- // timeout2, if present, should be a number indicating the limit in
158
- // milliseconds on the total running time of the program. Exceptions are
159
- // thrown on timeouts or other errors or if the exit status of the program
160
- // indicates an error.
161
- //
162
- // os.chdir(dir) changes directory to the given directory. Throws an
163
- // exception/ on error.
164
- //
165
- // os.setenv(variable, value) sets an environment variable. Repeated calls to
166
- // this method leak memory due to the API of setenv in the standard C library.
167
- //
168
- // os.umask(alue) calls the umask system call and returns the old umask.
169
- //
170
- // os.mkdirp(name, mask) creates a directory. The mask (if present) is anded
171
- // with the current umask. Intermediate directories are created if necessary.
172
- // An exception is not thrown if the directory already exists. Analogous to
173
- // the "mkdir -p" command.
174
- static Handle<Value> OSObject(const Arguments& args);
175
- static Handle<Value> System(const Arguments& args);
176
- static Handle<Value> ChangeDirectory(const Arguments& args);
177
- static Handle<Value> SetEnvironment(const Arguments& args);
178
- static Handle<Value> SetUMask(const Arguments& args);
179
- static Handle<Value> MakeDirectory(const Arguments& args);
180
- static Handle<Value> RemoveDirectory(const Arguments& args);
181
-
182
- static void AddOSMethods(Handle<ObjectTemplate> os_template);
183
-
184
- static Handle<Context> utility_context() { return utility_context_; }
185
-
186
- static const char* kHistoryFileName;
187
- static const char* kPrompt;
188
- private:
189
- static Persistent<Context> utility_context_;
190
- static Persistent<Context> evaluation_context_;
191
- static CounterMap* counter_map_;
192
- // We statically allocate a set of local counters to be used if we
193
- // don't want to store the stats in a memory-mapped file
194
- static CounterCollection local_counters_;
195
- static CounterCollection* counters_;
196
- static i::OS::MemoryMappedFile* counters_file_;
197
- static Counter* GetCounter(const char* name, bool is_histogram);
198
- };
199
-
200
-
201
- class LineEditor {
202
- public:
203
- enum Type { DUMB = 0, READLINE = 1 };
204
- LineEditor(Type type, const char* name);
205
- virtual ~LineEditor() { }
206
-
207
- virtual i::SmartPointer<char> Prompt(const char* prompt) = 0;
208
- virtual bool Open() { return true; }
209
- virtual bool Close() { return true; }
210
- virtual void AddHistory(const char* str) { }
211
-
212
- const char* name() { return name_; }
213
- static LineEditor* Get();
214
- private:
215
- Type type_;
216
- const char* name_;
217
- LineEditor* next_;
218
- static LineEditor* first_;
219
- };
220
-
221
-
222
- } // namespace v8
223
-
224
-
225
- #endif // V8_D8_H_
@@ -1,1625 +0,0 @@
1
- // Copyright 2008 the V8 project authors. All rights reserved.
2
- // Redistribution and use in source and binary forms, with or without
3
- // modification, are permitted provided that the following conditions are
4
- // met:
5
- //
6
- // * Redistributions of source code must retain the above copyright
7
- // notice, this list of conditions and the following disclaimer.
8
- // * Redistributions in binary form must reproduce the above
9
- // copyright notice, this list of conditions and the following
10
- // disclaimer in the documentation and/or other materials provided
11
- // with the distribution.
12
- // * Neither the name of Google Inc. nor the names of its
13
- // contributors may be used to endorse or promote products derived
14
- // from this software without specific prior written permission.
15
- //
16
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- String.prototype.startsWith = function (str) {
29
- if (str.length > this.length)
30
- return false;
31
- return this.substr(0, str.length) == str;
32
- }
33
-
34
- function log10(num) {
35
- return Math.log(num)/Math.log(10);
36
- }
37
-
38
- function ToInspectableObject(obj) {
39
- if (!obj && typeof obj === 'object') {
40
- return void 0;
41
- } else {
42
- return Object(obj);
43
- }
44
- }
45
-
46
- function GetCompletions(global, last, full) {
47
- var full_tokens = full.split();
48
- full = full_tokens.pop();
49
- var parts = full.split('.');
50
- parts.pop();
51
- var current = global;
52
- for (var i = 0; i < parts.length; i++) {
53
- var part = parts[i];
54
- var next = current[part];
55
- if (!next)
56
- return [];
57
- current = next;
58
- }
59
- var result = [];
60
- current = ToInspectableObject(current);
61
- while (typeof current !== 'undefined') {
62
- var mirror = new $debug.ObjectMirror(current);
63
- var properties = mirror.properties();
64
- for (var i = 0; i < properties.length; i++) {
65
- var name = properties[i].name();
66
- if (typeof name === 'string' && name.startsWith(last))
67
- result.push(name);
68
- }
69
- current = ToInspectableObject(current.__proto__);
70
- }
71
- return result;
72
- }
73
-
74
-
75
- // Global object holding debugger related constants and state.
76
- const Debug = {};
77
-
78
-
79
- // Debug events which can occour in the V8 JavaScript engine. These originate
80
- // from the API include file v8-debug.h.
81
- Debug.DebugEvent = { Break: 1,
82
- Exception: 2,
83
- NewFunction: 3,
84
- BeforeCompile: 4,
85
- AfterCompile: 5 };
86
-
87
-
88
- // The different types of scripts matching enum ScriptType in objects.h.
89
- Debug.ScriptType = { Native: 0,
90
- Extension: 1,
91
- Normal: 2 };
92
-
93
-
94
- // The different types of script compilations matching enum
95
- // Script::CompilationType in objects.h.
96
- Debug.ScriptCompilationType = { Host: 0,
97
- Eval: 1,
98
- JSON: 2 };
99
-
100
-
101
- // The different types of scopes matching constants runtime.cc.
102
- Debug.ScopeType = { Global: 0,
103
- Local: 1,
104
- With: 2,
105
- Closure: 3,
106
- Catch: 4 };
107
-
108
-
109
- // Current debug state.
110
- const kNoFrame = -1;
111
- Debug.State = {
112
- currentFrame: kNoFrame,
113
- currentSourceLine: -1
114
- }
115
- var trace_compile = false; // Tracing all compile events?
116
-
117
-
118
- // Process a debugger JSON message into a display text and a running status.
119
- // This function returns an object with properties "text" and "running" holding
120
- // this information.
121
- function DebugMessageDetails(message) {
122
- // Convert the JSON string to an object.
123
- var response = new ProtocolPackage(message);
124
-
125
- if (response.type() == 'event') {
126
- return DebugEventDetails(response);
127
- } else {
128
- return DebugResponseDetails(response);
129
- }
130
- }
131
-
132
- function DebugEventDetails(response) {
133
- details = {text:'', running:false}
134
-
135
- // Get the running state.
136
- details.running = response.running();
137
-
138
- var body = response.body();
139
- var result = '';
140
- switch (response.event()) {
141
- case 'break':
142
- if (body.breakpoints) {
143
- result += 'breakpoint';
144
- if (body.breakpoints.length > 1) {
145
- result += 's';
146
- }
147
- result += ' #';
148
- for (var i = 0; i < body.breakpoints.length; i++) {
149
- if (i > 0) {
150
- result += ', #';
151
- }
152
- result += body.breakpoints[i];
153
- }
154
- } else {
155
- result += 'break';
156
- }
157
- result += ' in ';
158
- result += body.invocationText;
159
- result += ', ';
160
- result += SourceInfo(body);
161
- result += '\n';
162
- result += SourceUnderline(body.sourceLineText, body.sourceColumn);
163
- Debug.State.currentSourceLine = body.sourceLine;
164
- Debug.State.currentFrame = 0;
165
- details.text = result;
166
- break;
167
-
168
- case 'exception':
169
- if (body.uncaught) {
170
- result += 'Uncaught: ';
171
- } else {
172
- result += 'Exception: ';
173
- }
174
- result += '"';
175
- result += body.exception.text;
176
- result += '"';
177
- if (body.sourceLine >= 0) {
178
- result += ', ';
179
- result += SourceInfo(body);
180
- result += '\n';
181
- result += SourceUnderline(body.sourceLineText, body.sourceColumn);
182
- Debug.State.currentSourceLine = body.sourceLine;
183
- Debug.State.currentFrame = 0;
184
- } else {
185
- result += ' (empty stack)';
186
- Debug.State.currentSourceLine = -1;
187
- Debug.State.currentFrame = kNoFrame;
188
- }
189
- details.text = result;
190
- break;
191
-
192
- case 'afterCompile':
193
- if (trace_compile) {
194
- result = 'Source ' + body.script.name + ' compiled:\n'
195
- var source = body.script.source;
196
- if (!(source[source.length - 1] == '\n')) {
197
- result += source;
198
- } else {
199
- result += source.substring(0, source.length - 1);
200
- }
201
- }
202
- details.text = result;
203
- break;
204
-
205
- default:
206
- details.text = 'Unknown debug event ' + response.event();
207
- }
208
-
209
- return details;
210
- };
211
-
212
-
213
- function SourceInfo(body) {
214
- var result = '';
215
-
216
- if (body.script) {
217
- if (body.script.name) {
218
- result += body.script.name;
219
- } else {
220
- result += '[unnamed]';
221
- }
222
- }
223
- result += ' line ';
224
- result += body.sourceLine + 1;
225
- result += ' column ';
226
- result += body.sourceColumn + 1;
227
-
228
- return result;
229
- }
230
-
231
-
232
- function SourceUnderline(source_text, position) {
233
- if (!source_text) {
234
- return;
235
- }
236
-
237
- // Create an underline with a caret pointing to the source position. If the
238
- // source contains a tab character the underline will have a tab character in
239
- // the same place otherwise the underline will have a space character.
240
- var underline = '';
241
- for (var i = 0; i < position; i++) {
242
- if (source_text[i] == '\t') {
243
- underline += '\t';
244
- } else {
245
- underline += ' ';
246
- }
247
- }
248
- underline += '^';
249
-
250
- // Return the source line text with the underline beneath.
251
- return source_text + '\n' + underline;
252
- };
253
-
254
-
255
- // Converts a text command to a JSON request.
256
- function DebugCommandToJSONRequest(cmd_line) {
257
- return new DebugRequest(cmd_line).JSONRequest();
258
- };
259
-
260
-
261
- function DebugRequest(cmd_line) {
262
- // If the very first character is a { assume that a JSON request have been
263
- // entered as a command. Converting that to a JSON request is trivial.
264
- if (cmd_line && cmd_line.length > 0 && cmd_line.charAt(0) == '{') {
265
- this.request_ = cmd_line;
266
- return;
267
- }
268
-
269
- // Trim string for leading and trailing whitespace.
270
- cmd_line = cmd_line.replace(/^\s+|\s+$/g, '');
271
-
272
- // Find the command.
273
- var pos = cmd_line.indexOf(' ');
274
- var cmd;
275
- var args;
276
- if (pos == -1) {
277
- cmd = cmd_line;
278
- args = '';
279
- } else {
280
- cmd = cmd_line.slice(0, pos);
281
- args = cmd_line.slice(pos).replace(/^\s+|\s+$/g, '');
282
- }
283
-
284
- // Switch on command.
285
- switch (cmd) {
286
- case 'continue':
287
- case 'c':
288
- this.request_ = this.continueCommandToJSONRequest_(args);
289
- break;
290
-
291
- case 'step':
292
- case 's':
293
- this.request_ = this.stepCommandToJSONRequest_(args);
294
- break;
295
-
296
- case 'backtrace':
297
- case 'bt':
298
- this.request_ = this.backtraceCommandToJSONRequest_(args);
299
- break;
300
-
301
- case 'frame':
302
- case 'f':
303
- this.request_ = this.frameCommandToJSONRequest_(args);
304
- break;
305
-
306
- case 'scopes':
307
- this.request_ = this.scopesCommandToJSONRequest_(args);
308
- break;
309
-
310
- case 'scope':
311
- this.request_ = this.scopeCommandToJSONRequest_(args);
312
- break;
313
-
314
- case 'print':
315
- case 'p':
316
- this.request_ = this.printCommandToJSONRequest_(args);
317
- break;
318
-
319
- case 'dir':
320
- this.request_ = this.dirCommandToJSONRequest_(args);
321
- break;
322
-
323
- case 'references':
324
- this.request_ = this.referencesCommandToJSONRequest_(args);
325
- break;
326
-
327
- case 'instances':
328
- this.request_ = this.instancesCommandToJSONRequest_(args);
329
- break;
330
-
331
- case 'source':
332
- this.request_ = this.sourceCommandToJSONRequest_(args);
333
- break;
334
-
335
- case 'scripts':
336
- this.request_ = this.scriptsCommandToJSONRequest_(args);
337
- break;
338
-
339
- case 'break':
340
- case 'b':
341
- this.request_ = this.breakCommandToJSONRequest_(args);
342
- break;
343
-
344
- case 'clear':
345
- this.request_ = this.clearCommandToJSONRequest_(args);
346
- break;
347
-
348
- case 'threads':
349
- this.request_ = this.threadsCommandToJSONRequest_(args);
350
- break;
351
-
352
- case 'trace':
353
- // Return undefined to indicate command handled internally (no JSON).
354
- this.request_ = void 0;
355
- this.traceCommand_(args);
356
- break;
357
-
358
- case 'help':
359
- case '?':
360
- this.helpCommand_(args);
361
- // Return undefined to indicate command handled internally (no JSON).
362
- this.request_ = void 0;
363
- break;
364
-
365
- default:
366
- throw new Error('Unknown command "' + cmd + '"');
367
- }
368
-
369
- last_cmd = cmd;
370
- }
371
-
372
- DebugRequest.prototype.JSONRequest = function() {
373
- return this.request_;
374
- }
375
-
376
-
377
- function RequestPacket(command) {
378
- this.seq = 0;
379
- this.type = 'request';
380
- this.command = command;
381
- }
382
-
383
-
384
- RequestPacket.prototype.toJSONProtocol = function() {
385
- // Encode the protocol header.
386
- var json = '{';
387
- json += '"seq":' + this.seq;
388
- json += ',"type":"' + this.type + '"';
389
- if (this.command) {
390
- json += ',"command":' + StringToJSON_(this.command);
391
- }
392
- if (this.arguments) {
393
- json += ',"arguments":';
394
- // Encode the arguments part.
395
- if (this.arguments.toJSONProtocol) {
396
- json += this.arguments.toJSONProtocol()
397
- } else {
398
- json += SimpleObjectToJSON_(this.arguments);
399
- }
400
- }
401
- json += '}';
402
- return json;
403
- }
404
-
405
-
406
- DebugRequest.prototype.createRequest = function(command) {
407
- return new RequestPacket(command);
408
- };
409
-
410
-
411
- // Create a JSON request for the evaluation command.
412
- DebugRequest.prototype.makeEvaluateJSONRequest_ = function(expression) {
413
- // Global varaible used to store whether a handle was requested.
414
- lookup_handle = null;
415
- // Check if the expression is a handle id in the form #<handle>#.
416
- var handle_match = expression.match(/^#([0-9]*)#$/);
417
- if (handle_match) {
418
- // Remember the handle requested in a global variable.
419
- lookup_handle = parseInt(handle_match[1]);
420
- // Build a lookup request.
421
- var request = this.createRequest('lookup');
422
- request.arguments = {};
423
- request.arguments.handles = [ lookup_handle ];
424
- return request.toJSONProtocol();
425
- } else {
426
- // Build an evaluate request.
427
- var request = this.createRequest('evaluate');
428
- request.arguments = {};
429
- request.arguments.expression = expression;
430
- // Request a global evaluation if there is no current frame.
431
- if (Debug.State.currentFrame == kNoFrame) {
432
- request.arguments.global = true;
433
- }
434
- return request.toJSONProtocol();
435
- }
436
- };
437
-
438
-
439
- // Create a JSON request for the references/instances command.
440
- DebugRequest.prototype.makeReferencesJSONRequest_ = function(handle, type) {
441
- // Build a references request.
442
- var handle_match = handle.match(/^#([0-9]*)#$/);
443
- if (handle_match) {
444
- var request = this.createRequest('references');
445
- request.arguments = {};
446
- request.arguments.type = type;
447
- request.arguments.handle = parseInt(handle_match[1]);
448
- return request.toJSONProtocol();
449
- } else {
450
- throw new Error('Invalid object id.');
451
- }
452
- };
453
-
454
-
455
- // Create a JSON request for the continue command.
456
- DebugRequest.prototype.continueCommandToJSONRequest_ = function(args) {
457
- var request = this.createRequest('continue');
458
- return request.toJSONProtocol();
459
- };
460
-
461
-
462
- // Create a JSON request for the step command.
463
- DebugRequest.prototype.stepCommandToJSONRequest_ = function(args) {
464
- // Requesting a step is through the continue command with additional
465
- // arguments.
466
- var request = this.createRequest('continue');
467
- request.arguments = {};
468
-
469
- // Process arguments if any.
470
- if (args && args.length > 0) {
471
- args = args.split(/\s*[ ]+\s*/g);
472
-
473
- if (args.length > 2) {
474
- throw new Error('Invalid step arguments.');
475
- }
476
-
477
- if (args.length > 0) {
478
- // Get step count argument if any.
479
- if (args.length == 2) {
480
- var stepcount = parseInt(args[1]);
481
- if (isNaN(stepcount) || stepcount <= 0) {
482
- throw new Error('Invalid step count argument "' + args[0] + '".');
483
- }
484
- request.arguments.stepcount = stepcount;
485
- }
486
-
487
- // Get the step action.
488
- switch (args[0]) {
489
- case 'in':
490
- case 'i':
491
- request.arguments.stepaction = 'in';
492
- break;
493
-
494
- case 'min':
495
- case 'm':
496
- request.arguments.stepaction = 'min';
497
- break;
498
-
499
- case 'next':
500
- case 'n':
501
- request.arguments.stepaction = 'next';
502
- break;
503
-
504
- case 'out':
505
- case 'o':
506
- request.arguments.stepaction = 'out';
507
- break;
508
-
509
- default:
510
- throw new Error('Invalid step argument "' + args[0] + '".');
511
- }
512
- }
513
- } else {
514
- // Default is step next.
515
- request.arguments.stepaction = 'next';
516
- }
517
-
518
- return request.toJSONProtocol();
519
- };
520
-
521
-
522
- // Create a JSON request for the backtrace command.
523
- DebugRequest.prototype.backtraceCommandToJSONRequest_ = function(args) {
524
- // Build a backtrace request from the text command.
525
- var request = this.createRequest('backtrace');
526
-
527
- // Default is to show top 10 frames.
528
- request.arguments = {};
529
- request.arguments.fromFrame = 0;
530
- request.arguments.toFrame = 10;
531
-
532
- args = args.split(/\s*[ ]+\s*/g);
533
- if (args.length == 1 && args[0].length > 0) {
534
- var frameCount = parseInt(args[0]);
535
- if (frameCount > 0) {
536
- // Show top frames.
537
- request.arguments.fromFrame = 0;
538
- request.arguments.toFrame = frameCount;
539
- } else {
540
- // Show bottom frames.
541
- request.arguments.fromFrame = 0;
542
- request.arguments.toFrame = -frameCount;
543
- request.arguments.bottom = true;
544
- }
545
- } else if (args.length == 2) {
546
- var fromFrame = parseInt(args[0]);
547
- var toFrame = parseInt(args[1]);
548
- if (isNaN(fromFrame) || fromFrame < 0) {
549
- throw new Error('Invalid start frame argument "' + args[0] + '".');
550
- }
551
- if (isNaN(toFrame) || toFrame < 0) {
552
- throw new Error('Invalid end frame argument "' + args[1] + '".');
553
- }
554
- if (fromFrame > toFrame) {
555
- throw new Error('Invalid arguments start frame cannot be larger ' +
556
- 'than end frame.');
557
- }
558
- // Show frame range.
559
- request.arguments.fromFrame = fromFrame;
560
- request.arguments.toFrame = toFrame + 1;
561
- } else if (args.length > 2) {
562
- throw new Error('Invalid backtrace arguments.');
563
- }
564
-
565
- return request.toJSONProtocol();
566
- };
567
-
568
-
569
- // Create a JSON request for the frame command.
570
- DebugRequest.prototype.frameCommandToJSONRequest_ = function(args) {
571
- // Build a frame request from the text command.
572
- var request = this.createRequest('frame');
573
- args = args.split(/\s*[ ]+\s*/g);
574
- if (args.length > 0 && args[0].length > 0) {
575
- request.arguments = {};
576
- request.arguments.number = args[0];
577
- }
578
- return request.toJSONProtocol();
579
- };
580
-
581
-
582
- // Create a JSON request for the scopes command.
583
- DebugRequest.prototype.scopesCommandToJSONRequest_ = function(args) {
584
- // Build a scopes request from the text command.
585
- var request = this.createRequest('scopes');
586
- return request.toJSONProtocol();
587
- };
588
-
589
-
590
- // Create a JSON request for the scope command.
591
- DebugRequest.prototype.scopeCommandToJSONRequest_ = function(args) {
592
- // Build a scope request from the text command.
593
- var request = this.createRequest('scope');
594
- args = args.split(/\s*[ ]+\s*/g);
595
- if (args.length > 0 && args[0].length > 0) {
596
- request.arguments = {};
597
- request.arguments.number = args[0];
598
- }
599
- return request.toJSONProtocol();
600
- };
601
-
602
-
603
- // Create a JSON request for the print command.
604
- DebugRequest.prototype.printCommandToJSONRequest_ = function(args) {
605
- // Build an evaluate request from the text command.
606
- if (args.length == 0) {
607
- throw new Error('Missing expression.');
608
- }
609
- return this.makeEvaluateJSONRequest_(args);
610
- };
611
-
612
-
613
- // Create a JSON request for the dir command.
614
- DebugRequest.prototype.dirCommandToJSONRequest_ = function(args) {
615
- // Build an evaluate request from the text command.
616
- if (args.length == 0) {
617
- throw new Error('Missing expression.');
618
- }
619
- return this.makeEvaluateJSONRequest_(args);
620
- };
621
-
622
-
623
- // Create a JSON request for the references command.
624
- DebugRequest.prototype.referencesCommandToJSONRequest_ = function(args) {
625
- // Build an evaluate request from the text command.
626
- if (args.length == 0) {
627
- throw new Error('Missing object id.');
628
- }
629
-
630
- return this.makeReferencesJSONRequest_(args, 'referencedBy');
631
- };
632
-
633
-
634
- // Create a JSON request for the instances command.
635
- DebugRequest.prototype.instancesCommandToJSONRequest_ = function(args) {
636
- // Build an evaluate request from the text command.
637
- if (args.length == 0) {
638
- throw new Error('Missing object id.');
639
- }
640
-
641
- // Build a references request.
642
- return this.makeReferencesJSONRequest_(args, 'constructedBy');
643
- };
644
-
645
-
646
- // Create a JSON request for the source command.
647
- DebugRequest.prototype.sourceCommandToJSONRequest_ = function(args) {
648
- // Build a evaluate request from the text command.
649
- var request = this.createRequest('source');
650
-
651
- // Default is ten lines starting five lines before the current location.
652
- var from = Debug.State.currentSourceLine - 5;
653
- var lines = 10;
654
-
655
- // Parse the arguments.
656
- args = args.split(/\s*[ ]+\s*/g);
657
- if (args.length > 1 && args[0].length > 0 && args[1].length > 0) {
658
- from = parseInt(args[0]) - 1;
659
- lines = parseInt(args[1]);
660
- } else if (args.length > 0 && args[0].length > 0) {
661
- from = parseInt(args[0]) - 1;
662
- }
663
-
664
- if (from < 0) from = 0;
665
- if (lines < 0) lines = 10;
666
-
667
- // Request source arround current source location.
668
- request.arguments = {};
669
- request.arguments.fromLine = from;
670
- request.arguments.toLine = from + lines;
671
-
672
- return request.toJSONProtocol();
673
- };
674
-
675
-
676
- // Create a JSON request for the scripts command.
677
- DebugRequest.prototype.scriptsCommandToJSONRequest_ = function(args) {
678
- // Build a evaluate request from the text command.
679
- var request = this.createRequest('scripts');
680
-
681
- // Process arguments if any.
682
- if (args && args.length > 0) {
683
- args = args.split(/\s*[ ]+\s*/g);
684
-
685
- if (args.length > 1) {
686
- throw new Error('Invalid scripts arguments.');
687
- }
688
-
689
- request.arguments = {};
690
- switch (args[0]) {
691
- case 'natives':
692
- request.arguments.types = ScriptTypeFlag(Debug.ScriptType.Native);
693
- break;
694
-
695
- case 'extensions':
696
- request.arguments.types = ScriptTypeFlag(Debug.ScriptType.Extension);
697
- break;
698
-
699
- case 'all':
700
- request.arguments.types =
701
- ScriptTypeFlag(Debug.ScriptType.Normal) |
702
- ScriptTypeFlag(Debug.ScriptType.Native) |
703
- ScriptTypeFlag(Debug.ScriptType.Extension);
704
- break;
705
-
706
- default:
707
- throw new Error('Invalid argument "' + args[0] + '".');
708
- }
709
- }
710
-
711
- return request.toJSONProtocol();
712
- };
713
-
714
-
715
- // Create a JSON request for the break command.
716
- DebugRequest.prototype.breakCommandToJSONRequest_ = function(args) {
717
- // Build a evaluate request from the text command.
718
- var request = this.createRequest('setbreakpoint');
719
-
720
- // Process arguments if any.
721
- if (args && args.length > 0) {
722
- var target = args;
723
- var type = 'function';
724
- var line;
725
- var column;
726
- var condition;
727
- var pos;
728
-
729
- // Check for breakpoint condition.
730
- pos = args.indexOf(' ');
731
- if (pos > 0) {
732
- target = args.substring(0, pos);
733
- condition = args.substring(pos + 1, args.length);
734
- }
735
-
736
- // Check for script breakpoint (name:line[:column]). If no ':' in break
737
- // specification it is considered a function break point.
738
- pos = target.indexOf(':');
739
- if (pos > 0) {
740
- type = 'script';
741
- var tmp = target.substring(pos + 1, target.length);
742
- target = target.substring(0, pos);
743
-
744
- // Check for both line and column.
745
- pos = tmp.indexOf(':');
746
- if (pos > 0) {
747
- column = parseInt(tmp.substring(pos + 1, tmp.length)) - 1;
748
- line = parseInt(tmp.substring(0, pos)) - 1;
749
- } else {
750
- line = parseInt(tmp) - 1;
751
- }
752
- } else if (target[0] == '#' && target[target.length - 1] == '#') {
753
- type = 'handle';
754
- target = target.substring(1, target.length - 1);
755
- } else {
756
- type = 'function';
757
- }
758
-
759
- request.arguments = {};
760
- request.arguments.type = type;
761
- request.arguments.target = target;
762
- request.arguments.line = line;
763
- request.arguments.column = column;
764
- request.arguments.condition = condition;
765
- } else {
766
- throw new Error('Invalid break arguments.');
767
- }
768
-
769
- return request.toJSONProtocol();
770
- };
771
-
772
-
773
- // Create a JSON request for the clear command.
774
- DebugRequest.prototype.clearCommandToJSONRequest_ = function(args) {
775
- // Build a evaluate request from the text command.
776
- var request = this.createRequest('clearbreakpoint');
777
-
778
- // Process arguments if any.
779
- if (args && args.length > 0) {
780
- request.arguments = {};
781
- request.arguments.breakpoint = parseInt(args);
782
- } else {
783
- throw new Error('Invalid break arguments.');
784
- }
785
-
786
- return request.toJSONProtocol();
787
- };
788
-
789
-
790
- // Create a JSON request for the threads command.
791
- DebugRequest.prototype.threadsCommandToJSONRequest_ = function(args) {
792
- // Build a threads request from the text command.
793
- var request = this.createRequest('threads');
794
- return request.toJSONProtocol();
795
- };
796
-
797
-
798
- // Handle the trace command.
799
- DebugRequest.prototype.traceCommand_ = function(args) {
800
- // Process arguments.
801
- if (args && args.length > 0) {
802
- if (args == 'compile') {
803
- trace_compile = !trace_compile;
804
- print('Tracing of compiled scripts ' + (trace_compile ? 'on' : 'off'));
805
- } else {
806
- throw new Error('Invalid trace arguments.');
807
- }
808
- } else {
809
- throw new Error('Invalid trace arguments.');
810
- }
811
- }
812
-
813
- // Handle the help command.
814
- DebugRequest.prototype.helpCommand_ = function(args) {
815
- // Help os quite simple.
816
- if (args && args.length > 0) {
817
- print('warning: arguments to \'help\' are ignored');
818
- }
819
-
820
- print('break location [condition]');
821
- print(' break on named function: location is a function name');
822
- print(' break on function: location is #<id>#');
823
- print(' break on script position: location is name:line[:column]');
824
- print('clear <breakpoint #>');
825
- print('backtrace [n] | [-n] | [from to]');
826
- print('frame <frame #>');
827
- print('scopes');
828
- print('scope <scope #>');
829
- print('step [in | next | out| min [step count]]');
830
- print('print <expression>');
831
- print('dir <expression>');
832
- print('source [from line [num lines]]');
833
- print('scripts');
834
- print('continue');
835
- print('trace compile');
836
- print('help');
837
- }
838
-
839
-
840
- function formatHandleReference_(value) {
841
- if (value.handle() >= 0) {
842
- return '#' + value.handle() + '#';
843
- } else {
844
- return '#Transient#';
845
- }
846
- }
847
-
848
-
849
- function formatObject_(value, include_properties) {
850
- var result = '';
851
- result += formatHandleReference_(value);
852
- result += ', type: object'
853
- result += ', constructor ';
854
- var ctor = value.constructorFunctionValue();
855
- result += formatHandleReference_(ctor);
856
- result += ', __proto__ ';
857
- var proto = value.protoObjectValue();
858
- result += formatHandleReference_(proto);
859
- result += ', ';
860
- result += value.propertyCount();
861
- result += ' properties.';
862
- if (include_properties) {
863
- result += '\n';
864
- for (var i = 0; i < value.propertyCount(); i++) {
865
- result += ' ';
866
- result += value.propertyName(i);
867
- result += ': ';
868
- var property_value = value.propertyValue(i);
869
- if (property_value instanceof ProtocolReference) {
870
- result += '<no type>';
871
- } else {
872
- if (property_value && property_value.type()) {
873
- result += property_value.type();
874
- } else {
875
- result += '<no type>';
876
- }
877
- }
878
- result += ' ';
879
- result += formatHandleReference_(property_value);
880
- result += '\n';
881
- }
882
- }
883
- return result;
884
- }
885
-
886
-
887
- function formatScope_(scope) {
888
- var result = '';
889
- var index = scope.index;
890
- result += '#' + (index <= 9 ? '0' : '') + index;
891
- result += ' ';
892
- switch (scope.type) {
893
- case Debug.ScopeType.Global:
894
- result += 'Global, ';
895
- result += '#' + scope.object.ref + '#';
896
- break;
897
- case Debug.ScopeType.Local:
898
- result += 'Local';
899
- break;
900
- case Debug.ScopeType.With:
901
- result += 'With, ';
902
- result += '#' + scope.object.ref + '#';
903
- break;
904
- case Debug.ScopeType.Catch:
905
- result += 'Catch, ';
906
- result += '#' + scope.object.ref + '#';
907
- break;
908
- case Debug.ScopeType.Closure:
909
- result += 'Closure';
910
- break;
911
- default:
912
- result += 'UNKNOWN';
913
- }
914
- return result;
915
- }
916
-
917
-
918
- // Convert a JSON response to text for display in a text based debugger.
919
- function DebugResponseDetails(response) {
920
- details = {text:'', running:false}
921
-
922
- try {
923
- if (!response.success()) {
924
- details.text = response.message();
925
- return details;
926
- }
927
-
928
- // Get the running state.
929
- details.running = response.running();
930
-
931
- var body = response.body();
932
- var result = '';
933
- switch (response.command()) {
934
- case 'setbreakpoint':
935
- result = 'set breakpoint #';
936
- result += body.breakpoint;
937
- details.text = result;
938
- break;
939
-
940
- case 'clearbreakpoint':
941
- result = 'cleared breakpoint #';
942
- result += body.breakpoint;
943
- details.text = result;
944
- break;
945
-
946
- case 'backtrace':
947
- if (body.totalFrames == 0) {
948
- result = '(empty stack)';
949
- } else {
950
- var result = 'Frames #' + body.fromFrame + ' to #' +
951
- (body.toFrame - 1) + ' of ' + body.totalFrames + '\n';
952
- for (i = 0; i < body.frames.length; i++) {
953
- if (i != 0) result += '\n';
954
- result += body.frames[i].text;
955
- }
956
- }
957
- details.text = result;
958
- break;
959
-
960
- case 'frame':
961
- details.text = SourceUnderline(body.sourceLineText,
962
- body.column);
963
- Debug.State.currentSourceLine = body.line;
964
- Debug.State.currentFrame = body.index;
965
- break;
966
-
967
- case 'scopes':
968
- if (body.totalScopes == 0) {
969
- result = '(no scopes)';
970
- } else {
971
- result = 'Scopes #' + body.fromScope + ' to #' +
972
- (body.toScope - 1) + ' of ' + body.totalScopes + '\n';
973
- for (i = 0; i < body.scopes.length; i++) {
974
- if (i != 0) {
975
- result += '\n';
976
- }
977
- result += formatScope_(body.scopes[i]);
978
- }
979
- }
980
- details.text = result;
981
- break;
982
-
983
- case 'scope':
984
- result += formatScope_(body);
985
- result += '\n';
986
- var scope_object_value = response.lookup(body.object.ref);
987
- result += formatObject_(scope_object_value, true);
988
- details.text = result;
989
- break;
990
-
991
- case 'evaluate':
992
- case 'lookup':
993
- if (last_cmd == 'p' || last_cmd == 'print') {
994
- result = body.text;
995
- } else {
996
- var value;
997
- if (lookup_handle) {
998
- value = response.bodyValue(lookup_handle);
999
- } else {
1000
- value = response.bodyValue();
1001
- }
1002
- if (value.isObject()) {
1003
- result += formatObject_(value, true);
1004
- } else {
1005
- result += 'type: ';
1006
- result += value.type();
1007
- if (!value.isUndefined() && !value.isNull()) {
1008
- result += ', ';
1009
- if (value.isString()) {
1010
- result += '"';
1011
- }
1012
- result += value.value();
1013
- if (value.isString()) {
1014
- result += '"';
1015
- }
1016
- }
1017
- result += '\n';
1018
- }
1019
- }
1020
- details.text = result;
1021
- break;
1022
-
1023
- case 'references':
1024
- var count = body.length;
1025
- result += 'found ' + count + ' objects';
1026
- result += '\n';
1027
- for (var i = 0; i < count; i++) {
1028
- var value = response.bodyValue(i);
1029
- result += formatObject_(value, false);
1030
- result += '\n';
1031
- }
1032
- details.text = result;
1033
- break;
1034
-
1035
- case 'source':
1036
- // Get the source from the response.
1037
- var source = body.source;
1038
- var from_line = body.fromLine + 1;
1039
- var lines = source.split('\n');
1040
- var maxdigits = 1 + Math.floor(log10(from_line + lines.length));
1041
- if (maxdigits < 3) {
1042
- maxdigits = 3;
1043
- }
1044
- var result = '';
1045
- for (var num = 0; num < lines.length; num++) {
1046
- // Check if there's an extra newline at the end.
1047
- if (num == (lines.length - 1) && lines[num].length == 0) {
1048
- break;
1049
- }
1050
-
1051
- var current_line = from_line + num;
1052
- spacer = maxdigits - (1 + Math.floor(log10(current_line)));
1053
- if (current_line == Debug.State.currentSourceLine + 1) {
1054
- for (var i = 0; i < maxdigits; i++) {
1055
- result += '>';
1056
- }
1057
- result += ' ';
1058
- } else {
1059
- for (var i = 0; i < spacer; i++) {
1060
- result += ' ';
1061
- }
1062
- result += current_line + ': ';
1063
- }
1064
- result += lines[num];
1065
- result += '\n';
1066
- }
1067
- details.text = result;
1068
- break;
1069
-
1070
- case 'scripts':
1071
- var result = '';
1072
- for (i = 0; i < body.length; i++) {
1073
- if (i != 0) result += '\n';
1074
- if (body[i].id) {
1075
- result += body[i].id;
1076
- } else {
1077
- result += '[no id]';
1078
- }
1079
- result += ', ';
1080
- if (body[i].name) {
1081
- result += body[i].name;
1082
- } else {
1083
- if (body[i].compilationType == Debug.ScriptCompilationType.Eval) {
1084
- result += 'eval from ';
1085
- var script_value = response.lookup(body[i].evalFromScript.ref);
1086
- result += ' ' + script_value.field('name');
1087
- result += ':' + (body[i].evalFromLocation.line + 1);
1088
- result += ':' + body[i].evalFromLocation.column;
1089
- } else if (body[i].compilationType ==
1090
- Debug.ScriptCompilationType.JSON) {
1091
- result += 'JSON ';
1092
- } else { // body[i].compilation == Debug.ScriptCompilationType.Host
1093
- result += '[unnamed] ';
1094
- }
1095
- }
1096
- result += ' (lines: ';
1097
- result += body[i].lineCount;
1098
- result += ', length: ';
1099
- result += body[i].sourceLength;
1100
- if (body[i].type == Debug.ScriptType.Native) {
1101
- result += ', native';
1102
- } else if (body[i].type == Debug.ScriptType.Extension) {
1103
- result += ', extension';
1104
- }
1105
- result += '), [';
1106
- var sourceStart = body[i].sourceStart;
1107
- if (sourceStart.length > 40) {
1108
- sourceStart = sourceStart.substring(0, 37) + '...';
1109
- }
1110
- result += sourceStart;
1111
- result += ']';
1112
- }
1113
- details.text = result;
1114
- break;
1115
-
1116
- case 'threads':
1117
- var result = 'Active V8 threads: ' + body.totalThreads + '\n';
1118
- body.threads.sort(function(a, b) { return a.id - b.id; });
1119
- for (i = 0; i < body.threads.length; i++) {
1120
- result += body.threads[i].current ? '*' : ' ';
1121
- result += ' ';
1122
- result += body.threads[i].id;
1123
- result += '\n';
1124
- }
1125
- details.text = result;
1126
- break;
1127
-
1128
- case 'continue':
1129
- details.text = "(running)";
1130
- break;
1131
-
1132
- default:
1133
- details.text =
1134
- 'Response for unknown command \'' + response.command + '\'' +
1135
- ' (' + json_response + ')';
1136
- }
1137
- } catch (e) {
1138
- details.text = 'Error: "' + e + '" formatting response';
1139
- }
1140
-
1141
- return details;
1142
- };
1143
-
1144
-
1145
- /**
1146
- * Protocol packages send from the debugger.
1147
- * @param {string} json - raw protocol packet as JSON string.
1148
- * @constructor
1149
- */
1150
- function ProtocolPackage(json) {
1151
- this.packet_ = JSON.parse(json);
1152
- this.refs_ = [];
1153
- if (this.packet_.refs) {
1154
- for (var i = 0; i < this.packet_.refs.length; i++) {
1155
- this.refs_[this.packet_.refs[i].handle] = this.packet_.refs[i];
1156
- }
1157
- }
1158
- }
1159
-
1160
-
1161
- /**
1162
- * Get the packet type.
1163
- * @return {String} the packet type
1164
- */
1165
- ProtocolPackage.prototype.type = function() {
1166
- return this.packet_.type;
1167
- }
1168
-
1169
-
1170
- /**
1171
- * Get the packet event.
1172
- * @return {Object} the packet event
1173
- */
1174
- ProtocolPackage.prototype.event = function() {
1175
- return this.packet_.event;
1176
- }
1177
-
1178
-
1179
- /**
1180
- * Get the packet request sequence.
1181
- * @return {number} the packet request sequence
1182
- */
1183
- ProtocolPackage.prototype.requestSeq = function() {
1184
- return this.packet_.request_seq;
1185
- }
1186
-
1187
-
1188
- /**
1189
- * Get the packet request sequence.
1190
- * @return {number} the packet request sequence
1191
- */
1192
- ProtocolPackage.prototype.running = function() {
1193
- return this.packet_.running ? true : false;
1194
- }
1195
-
1196
-
1197
- ProtocolPackage.prototype.success = function() {
1198
- return this.packet_.success ? true : false;
1199
- }
1200
-
1201
-
1202
- ProtocolPackage.prototype.message = function() {
1203
- return this.packet_.message;
1204
- }
1205
-
1206
-
1207
- ProtocolPackage.prototype.command = function() {
1208
- return this.packet_.command;
1209
- }
1210
-
1211
-
1212
- ProtocolPackage.prototype.body = function() {
1213
- return this.packet_.body;
1214
- }
1215
-
1216
-
1217
- ProtocolPackage.prototype.bodyValue = function(index) {
1218
- if (index != null) {
1219
- return new ProtocolValue(this.packet_.body[index], this);
1220
- } else {
1221
- return new ProtocolValue(this.packet_.body, this);
1222
- }
1223
- }
1224
-
1225
-
1226
- ProtocolPackage.prototype.body = function() {
1227
- return this.packet_.body;
1228
- }
1229
-
1230
-
1231
- ProtocolPackage.prototype.lookup = function(handle) {
1232
- var value = this.refs_[handle];
1233
- if (value) {
1234
- return new ProtocolValue(value, this);
1235
- } else {
1236
- return new ProtocolReference(handle);
1237
- }
1238
- }
1239
-
1240
-
1241
- function ProtocolValue(value, packet) {
1242
- this.value_ = value;
1243
- this.packet_ = packet;
1244
- }
1245
-
1246
-
1247
- /**
1248
- * Get the value type.
1249
- * @return {String} the value type
1250
- */
1251
- ProtocolValue.prototype.type = function() {
1252
- return this.value_.type;
1253
- }
1254
-
1255
-
1256
- /**
1257
- * Get a metadata field from a protocol value.
1258
- * @return {Object} the metadata field value
1259
- */
1260
- ProtocolValue.prototype.field = function(name) {
1261
- return this.value_[name];
1262
- }
1263
-
1264
-
1265
- /**
1266
- * Check is the value is a primitive value.
1267
- * @return {boolean} true if the value is primitive
1268
- */
1269
- ProtocolValue.prototype.isPrimitive = function() {
1270
- return this.isUndefined() || this.isNull() || this.isBoolean() ||
1271
- this.isNumber() || this.isString();
1272
- }
1273
-
1274
-
1275
- /**
1276
- * Get the object handle.
1277
- * @return {number} the value handle
1278
- */
1279
- ProtocolValue.prototype.handle = function() {
1280
- return this.value_.handle;
1281
- }
1282
-
1283
-
1284
- /**
1285
- * Check is the value is undefined.
1286
- * @return {boolean} true if the value is undefined
1287
- */
1288
- ProtocolValue.prototype.isUndefined = function() {
1289
- return this.value_.type == 'undefined';
1290
- }
1291
-
1292
-
1293
- /**
1294
- * Check is the value is null.
1295
- * @return {boolean} true if the value is null
1296
- */
1297
- ProtocolValue.prototype.isNull = function() {
1298
- return this.value_.type == 'null';
1299
- }
1300
-
1301
-
1302
- /**
1303
- * Check is the value is a boolean.
1304
- * @return {boolean} true if the value is a boolean
1305
- */
1306
- ProtocolValue.prototype.isBoolean = function() {
1307
- return this.value_.type == 'boolean';
1308
- }
1309
-
1310
-
1311
- /**
1312
- * Check is the value is a number.
1313
- * @return {boolean} true if the value is a number
1314
- */
1315
- ProtocolValue.prototype.isNumber = function() {
1316
- return this.value_.type == 'number';
1317
- }
1318
-
1319
-
1320
- /**
1321
- * Check is the value is a string.
1322
- * @return {boolean} true if the value is a string
1323
- */
1324
- ProtocolValue.prototype.isString = function() {
1325
- return this.value_.type == 'string';
1326
- }
1327
-
1328
-
1329
- /**
1330
- * Check is the value is an object.
1331
- * @return {boolean} true if the value is an object
1332
- */
1333
- ProtocolValue.prototype.isObject = function() {
1334
- return this.value_.type == 'object' || this.value_.type == 'function' ||
1335
- this.value_.type == 'error' || this.value_.type == 'regexp';
1336
- }
1337
-
1338
-
1339
- /**
1340
- * Get the constructor function
1341
- * @return {ProtocolValue} constructor function
1342
- */
1343
- ProtocolValue.prototype.constructorFunctionValue = function() {
1344
- var ctor = this.value_.constructorFunction;
1345
- return this.packet_.lookup(ctor.ref);
1346
- }
1347
-
1348
-
1349
- /**
1350
- * Get the __proto__ value
1351
- * @return {ProtocolValue} __proto__ value
1352
- */
1353
- ProtocolValue.prototype.protoObjectValue = function() {
1354
- var proto = this.value_.protoObject;
1355
- return this.packet_.lookup(proto.ref);
1356
- }
1357
-
1358
-
1359
- /**
1360
- * Get the number og properties.
1361
- * @return {number} the number of properties
1362
- */
1363
- ProtocolValue.prototype.propertyCount = function() {
1364
- return this.value_.properties ? this.value_.properties.length : 0;
1365
- }
1366
-
1367
-
1368
- /**
1369
- * Get the specified property name.
1370
- * @return {string} property name
1371
- */
1372
- ProtocolValue.prototype.propertyName = function(index) {
1373
- var property = this.value_.properties[index];
1374
- return property.name;
1375
- }
1376
-
1377
-
1378
- /**
1379
- * Return index for the property name.
1380
- * @param name The property name to look for
1381
- * @return {number} index for the property name
1382
- */
1383
- ProtocolValue.prototype.propertyIndex = function(name) {
1384
- for (var i = 0; i < this.propertyCount(); i++) {
1385
- if (this.value_.properties[i].name == name) {
1386
- return i;
1387
- }
1388
- }
1389
- return null;
1390
- }
1391
-
1392
-
1393
- /**
1394
- * Get the specified property value.
1395
- * @return {ProtocolValue} property value
1396
- */
1397
- ProtocolValue.prototype.propertyValue = function(index) {
1398
- var property = this.value_.properties[index];
1399
- return this.packet_.lookup(property.ref);
1400
- }
1401
-
1402
-
1403
- /**
1404
- * Check is the value is a string.
1405
- * @return {boolean} true if the value is a string
1406
- */
1407
- ProtocolValue.prototype.value = function() {
1408
- return this.value_.value;
1409
- }
1410
-
1411
-
1412
- function ProtocolReference(handle) {
1413
- this.handle_ = handle;
1414
- }
1415
-
1416
-
1417
- ProtocolReference.prototype.handle = function() {
1418
- return this.handle_;
1419
- }
1420
-
1421
-
1422
- function MakeJSONPair_(name, value) {
1423
- return '"' + name + '":' + value;
1424
- }
1425
-
1426
-
1427
- function ArrayToJSONObject_(content) {
1428
- return '{' + content.join(',') + '}';
1429
- }
1430
-
1431
-
1432
- function ArrayToJSONArray_(content) {
1433
- return '[' + content.join(',') + ']';
1434
- }
1435
-
1436
-
1437
- function BooleanToJSON_(value) {
1438
- return String(value);
1439
- }
1440
-
1441
-
1442
- function NumberToJSON_(value) {
1443
- return String(value);
1444
- }
1445
-
1446
-
1447
- // Mapping of some control characters to avoid the \uXXXX syntax for most
1448
- // commonly used control cahracters.
1449
- const ctrlCharMap_ = {
1450
- '\b': '\\b',
1451
- '\t': '\\t',
1452
- '\n': '\\n',
1453
- '\f': '\\f',
1454
- '\r': '\\r',
1455
- '"' : '\\"',
1456
- '\\': '\\\\'
1457
- };
1458
-
1459
-
1460
- // Regular expression testing for ", \ and control characters (0x00 - 0x1F).
1461
- const ctrlCharTest_ = new RegExp('["\\\\\x00-\x1F]');
1462
-
1463
-
1464
- // Regular expression matching ", \ and control characters (0x00 - 0x1F)
1465
- // globally.
1466
- const ctrlCharMatch_ = new RegExp('["\\\\\x00-\x1F]', 'g');
1467
-
1468
-
1469
- /**
1470
- * Convert a String to its JSON representation (see http://www.json.org/). To
1471
- * avoid depending on the String object this method calls the functions in
1472
- * string.js directly and not through the value.
1473
- * @param {String} value The String value to format as JSON
1474
- * @return {string} JSON formatted String value
1475
- */
1476
- function StringToJSON_(value) {
1477
- // Check for" , \ and control characters (0x00 - 0x1F). No need to call
1478
- // RegExpTest as ctrlchar is constructed using RegExp.
1479
- if (ctrlCharTest_.test(value)) {
1480
- // Replace ", \ and control characters (0x00 - 0x1F).
1481
- return '"' +
1482
- value.replace(ctrlCharMatch_, function (char) {
1483
- // Use charmap if possible.
1484
- var mapped = ctrlCharMap_[char];
1485
- if (mapped) return mapped;
1486
- mapped = char.charCodeAt();
1487
- // Convert control character to unicode escape sequence.
1488
- return '\\u00' +
1489
- '0' + // TODO %NumberToRadixString(Math.floor(mapped / 16), 16) +
1490
- '0' // TODO %NumberToRadixString(mapped % 16, 16);
1491
- })
1492
- + '"';
1493
- }
1494
-
1495
- // Simple string with no special characters.
1496
- return '"' + value + '"';
1497
- }
1498
-
1499
-
1500
- /**
1501
- * Convert a Date to ISO 8601 format. To avoid depending on the Date object
1502
- * this method calls the functions in date.js directly and not through the
1503
- * value.
1504
- * @param {Date} value The Date value to format as JSON
1505
- * @return {string} JSON formatted Date value
1506
- */
1507
- function DateToISO8601_(value) {
1508
- function f(n) {
1509
- return n < 10 ? '0' + n : n;
1510
- }
1511
- function g(n) {
1512
- return n < 10 ? '00' + n : n < 100 ? '0' + n : n;
1513
- }
1514
- return builtins.GetUTCFullYearFrom(value) + '-' +
1515
- f(builtins.GetUTCMonthFrom(value) + 1) + '-' +
1516
- f(builtins.GetUTCDateFrom(value)) + 'T' +
1517
- f(builtins.GetUTCHoursFrom(value)) + ':' +
1518
- f(builtins.GetUTCMinutesFrom(value)) + ':' +
1519
- f(builtins.GetUTCSecondsFrom(value)) + '.' +
1520
- g(builtins.GetUTCMillisecondsFrom(value)) + 'Z';
1521
- }
1522
-
1523
-
1524
- /**
1525
- * Convert a Date to ISO 8601 format. To avoid depending on the Date object
1526
- * this method calls the functions in date.js directly and not through the
1527
- * value.
1528
- * @param {Date} value The Date value to format as JSON
1529
- * @return {string} JSON formatted Date value
1530
- */
1531
- function DateToJSON_(value) {
1532
- return '"' + DateToISO8601_(value) + '"';
1533
- }
1534
-
1535
-
1536
- /**
1537
- * Convert an Object to its JSON representation (see http://www.json.org/).
1538
- * This implementation simply runs through all string property names and adds
1539
- * each property to the JSON representation for some predefined types. For type
1540
- * "object" the function calls itself recursively unless the object has the
1541
- * function property "toJSONProtocol" in which case that is used. This is not
1542
- * a general implementation but sufficient for the debugger. Note that circular
1543
- * structures will cause infinite recursion.
1544
- * @param {Object} object The object to format as JSON
1545
- * @return {string} JSON formatted object value
1546
- */
1547
- function SimpleObjectToJSON_(object) {
1548
- var content = [];
1549
- for (var key in object) {
1550
- // Only consider string keys.
1551
- if (typeof key == 'string') {
1552
- var property_value = object[key];
1553
-
1554
- // Format the value based on its type.
1555
- var property_value_json;
1556
- switch (typeof property_value) {
1557
- case 'object':
1558
- if (typeof property_value.toJSONProtocol == 'function') {
1559
- property_value_json = property_value.toJSONProtocol(true)
1560
- } else if (property_value.constructor.name == 'Array'){
1561
- property_value_json = SimpleArrayToJSON_(property_value);
1562
- } else {
1563
- property_value_json = SimpleObjectToJSON_(property_value);
1564
- }
1565
- break;
1566
-
1567
- case 'boolean':
1568
- property_value_json = BooleanToJSON_(property_value);
1569
- break;
1570
-
1571
- case 'number':
1572
- property_value_json = NumberToJSON_(property_value);
1573
- break;
1574
-
1575
- case 'string':
1576
- property_value_json = StringToJSON_(property_value);
1577
- break;
1578
-
1579
- default:
1580
- property_value_json = null;
1581
- }
1582
-
1583
- // Add the property if relevant.
1584
- if (property_value_json) {
1585
- content.push(StringToJSON_(key) + ':' + property_value_json);
1586
- }
1587
- }
1588
- }
1589
-
1590
- // Make JSON object representation.
1591
- return '{' + content.join(',') + '}';
1592
- }
1593
-
1594
-
1595
- /**
1596
- * Convert an array to its JSON representation. This is a VERY simple
1597
- * implementation just to support what is needed for the debugger.
1598
- * @param {Array} arrya The array to format as JSON
1599
- * @return {string} JSON formatted array value
1600
- */
1601
- function SimpleArrayToJSON_(array) {
1602
- // Make JSON array representation.
1603
- var json = '[';
1604
- for (var i = 0; i < array.length; i++) {
1605
- if (i != 0) {
1606
- json += ',';
1607
- }
1608
- var elem = array[i];
1609
- if (elem.toJSONProtocol) {
1610
- json += elem.toJSONProtocol(true)
1611
- } else if (typeof(elem) === 'object') {
1612
- json += SimpleObjectToJSON_(elem);
1613
- } else if (typeof(elem) === 'boolean') {
1614
- json += BooleanToJSON_(elem);
1615
- } else if (typeof(elem) === 'number') {
1616
- json += NumberToJSON_(elem);
1617
- } else if (typeof(elem) === 'string') {
1618
- json += StringToJSON_(elem);
1619
- } else {
1620
- json += elem;
1621
- }
1622
- }
1623
- json += ']';
1624
- return json;
1625
- }