opal 0.10.0 → 0.11.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (460) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +19 -0
  3. data/.gitmodules +1 -1
  4. data/.jshintrc +1 -2
  5. data/.rspec +1 -2
  6. data/.travis.yml +28 -18
  7. data/.yardopts +3 -1
  8. data/CHANGELOG.md +139 -1
  9. data/Gemfile +16 -9
  10. data/HACKING.md +2 -0
  11. data/README.md +7 -6
  12. data/Rakefile +1 -1
  13. data/appveyor.yml +30 -0
  14. data/benchmark/bm_constant_lookup_big.rb +799 -0
  15. data/benchmark/bm_constant_lookup_small.rb +59 -0
  16. data/benchmark/bm_module_definition_big.rb +400 -0
  17. data/benchmark/bm_module_definition_small.rb +30 -0
  18. data/benchmark-ips/bm_case.rb +33 -0
  19. data/benchmark-ips/bm_constants_lookup.rb +13 -0
  20. data/benchmark-ips/bm_is_number.rb +29 -0
  21. data/benchmark-ips/bm_symbol_to_proc.rb +19 -0
  22. data/bin/opal +4 -2
  23. data/bin/opal-repl +23 -1
  24. data/docs/compiled_ruby.md +16 -14
  25. data/docs/faq.md +3 -3
  26. data/docs/rspec.md +2 -1
  27. data/docs/unsupported_features.md +6 -4
  28. data/examples/rack/Gemfile +1 -0
  29. data/examples/rack/Gemfile.lock +11 -7
  30. data/examples/rack/app/application.rb +14 -3
  31. data/examples/rack/app/user.rb +2 -0
  32. data/examples/rack/config.ru +1 -1
  33. data/examples/rack/index.html.erb +1 -0
  34. data/examples/sinatra/Gemfile +1 -1
  35. data/examples/sinatra/Gemfile.lock +8 -11
  36. data/examples/sinatra/app/application.rb +2 -0
  37. data/lib/opal/ast/builder.rb +17 -0
  38. data/lib/opal/ast/node.rb +30 -0
  39. data/lib/opal/builder.rb +14 -3
  40. data/lib/opal/builder_processors.rb +1 -0
  41. data/lib/opal/cli.rb +45 -59
  42. data/lib/opal/cli_options.rb +18 -11
  43. data/lib/opal/cli_runners/applescript.rb +3 -3
  44. data/lib/opal/cli_runners/nashorn.rb +1 -0
  45. data/lib/opal/cli_runners/nodejs.rb +4 -1
  46. data/lib/opal/cli_runners/phantom.js +1 -2
  47. data/lib/opal/cli_runners/phantomjs.rb +3 -2
  48. data/lib/opal/cli_runners/server.rb +1 -0
  49. data/lib/opal/cli_runners.rb +1 -0
  50. data/lib/opal/compiler.rb +145 -94
  51. data/lib/opal/config.rb +114 -36
  52. data/lib/opal/deprecations.rb +18 -0
  53. data/lib/opal/erb.rb +1 -0
  54. data/lib/opal/errors.rb +1 -0
  55. data/lib/opal/fragment.rb +1 -0
  56. data/lib/opal/hike_path_finder.rb +1 -0
  57. data/lib/opal/nodes/arglist.rb +2 -1
  58. data/lib/opal/nodes/args/initialize_kwargs.rb +1 -0
  59. data/lib/opal/nodes/args/kwarg.rb +7 -7
  60. data/lib/opal/nodes/args/kwoptarg.rb +6 -7
  61. data/lib/opal/nodes/args/kwrestarg.rb +5 -5
  62. data/lib/opal/nodes/args/mlhsarg.rb +3 -2
  63. data/lib/opal/nodes/args/normarg.rb +6 -7
  64. data/lib/opal/nodes/args/optarg.rb +5 -7
  65. data/lib/opal/nodes/args/post_args.rb +6 -5
  66. data/lib/opal/nodes/args/post_kwargs.rb +1 -0
  67. data/lib/opal/nodes/args/restarg.rb +7 -7
  68. data/lib/opal/nodes/array.rb +1 -0
  69. data/lib/opal/nodes/base.rb +24 -3
  70. data/lib/opal/nodes/call.rb +167 -155
  71. data/lib/opal/nodes/call_special.rb +31 -217
  72. data/lib/opal/nodes/case.rb +36 -22
  73. data/lib/opal/nodes/class.rb +4 -3
  74. data/lib/opal/nodes/constants.rb +28 -48
  75. data/lib/opal/nodes/csend.rb +25 -0
  76. data/lib/opal/nodes/def.rb +57 -17
  77. data/lib/opal/nodes/defined.rb +170 -60
  78. data/lib/opal/nodes/definitions.rb +40 -133
  79. data/lib/opal/nodes/defs.rb +29 -0
  80. data/lib/opal/nodes/for.rb +52 -25
  81. data/lib/opal/nodes/hash.rb +12 -35
  82. data/lib/opal/nodes/helpers.rb +27 -54
  83. data/lib/opal/nodes/if.rb +21 -32
  84. data/lib/opal/nodes/inline_args.rb +12 -13
  85. data/lib/opal/nodes/iter.rb +61 -36
  86. data/lib/opal/nodes/literal.rb +194 -114
  87. data/lib/opal/nodes/logic.rb +20 -25
  88. data/lib/opal/nodes/masgn.rb +20 -18
  89. data/lib/opal/nodes/module.rb +10 -11
  90. data/lib/opal/nodes/node_with_args.rb +14 -17
  91. data/lib/opal/nodes/rescue.rb +37 -70
  92. data/lib/opal/nodes/runtime_helpers.rb +8 -3
  93. data/lib/opal/nodes/scope.rb +9 -5
  94. data/lib/opal/nodes/singleton_class.rb +4 -3
  95. data/lib/opal/nodes/super.rb +115 -87
  96. data/lib/opal/nodes/top.rb +7 -2
  97. data/lib/opal/nodes/variables.rb +46 -35
  98. data/lib/opal/nodes/while.rb +11 -1
  99. data/lib/opal/nodes/yield.rb +1 -17
  100. data/lib/opal/nodes.rb +3 -0
  101. data/lib/opal/parser.rb +28 -770
  102. data/lib/opal/path_reader.rb +5 -1
  103. data/lib/opal/paths.rb +10 -4
  104. data/lib/opal/regexp_anchors.rb +1 -0
  105. data/lib/opal/rewriter.rb +60 -0
  106. data/lib/opal/rewriters/base.rb +60 -0
  107. data/lib/opal/rewriters/binary_operator_assignment.rb +144 -0
  108. data/lib/opal/rewriters/block_to_iter.rb +17 -0
  109. data/lib/opal/rewriters/break_finder.rb +34 -0
  110. data/lib/opal/rewriters/dot_js_syntax.rb +60 -0
  111. data/lib/opal/rewriters/explicit_writer_return.rb +58 -0
  112. data/lib/opal/rewriters/js_reserved_words.rb +111 -0
  113. data/lib/opal/rewriters/logical_operator_assignment.rb +155 -0
  114. data/lib/opal/rewriters/opal_engine_check.rb +42 -0
  115. data/lib/opal/rewriters/rubyspec/filters_rewriter.rb +67 -0
  116. data/lib/opal/server.rb +4 -0
  117. data/lib/opal/simple_server.rb +100 -0
  118. data/lib/opal/source_map.rb +1 -1
  119. data/lib/opal/util.rb +5 -5
  120. data/lib/opal/version.rb +2 -1
  121. data/lib/opal.rb +6 -1
  122. data/lib/tilt/opal.rb +1 -0
  123. data/opal/README.md +1 -1
  124. data/opal/corelib/array.rb +137 -83
  125. data/opal/corelib/basic_object.rb +6 -6
  126. data/opal/corelib/class.rb +14 -11
  127. data/opal/corelib/complex.rb +5 -1
  128. data/opal/corelib/constants.rb +3 -3
  129. data/opal/corelib/enumerable.rb +129 -11
  130. data/opal/corelib/error.rb +35 -17
  131. data/opal/corelib/file.rb +65 -170
  132. data/opal/corelib/hash.rb +128 -13
  133. data/opal/corelib/helpers.rb +12 -15
  134. data/opal/corelib/io.rb +1 -0
  135. data/opal/corelib/kernel.rb +40 -21
  136. data/opal/corelib/marshal/read_buffer.rb +1 -1
  137. data/opal/corelib/method.rb +33 -13
  138. data/opal/corelib/module.rb +134 -82
  139. data/opal/corelib/number.rb +141 -25
  140. data/opal/corelib/numeric.rb +0 -8
  141. data/opal/corelib/process.rb +44 -4
  142. data/opal/corelib/random/seedrandom.js.rb +15 -0
  143. data/opal/corelib/random.rb +117 -0
  144. data/opal/corelib/range.rb +133 -10
  145. data/opal/corelib/regexp.rb +37 -9
  146. data/opal/corelib/runtime.js +604 -394
  147. data/opal/corelib/string/encoding.rb +51 -7
  148. data/opal/corelib/string.rb +39 -8
  149. data/opal/corelib/struct.rb +20 -0
  150. data/opal/corelib/time.rb +2 -2
  151. data/opal/corelib/variables.rb +1 -1
  152. data/opal/opal.rb +1 -0
  153. data/opal.gemspec +9 -8
  154. data/spec/filters/bugs/array.rb +5 -1
  155. data/spec/filters/bugs/basicobject.rb +2 -5
  156. data/spec/filters/bugs/bigdecimal.rb +8 -22
  157. data/spec/filters/bugs/class.rb +2 -1
  158. data/spec/filters/bugs/comparable.rb +5 -0
  159. data/spec/filters/bugs/date.rb +3 -3
  160. data/spec/filters/bugs/enumerable.rb +4 -11
  161. data/spec/filters/bugs/enumerator.rb +2 -4
  162. data/spec/filters/bugs/exception.rb +16 -2
  163. data/spec/filters/bugs/file.rb +8 -0
  164. data/spec/filters/bugs/float.rb +7 -1
  165. data/spec/filters/bugs/hash.rb +6 -2
  166. data/spec/filters/bugs/integer.rb +2 -0
  167. data/spec/filters/bugs/io.rb +8 -0
  168. data/spec/filters/bugs/kernel.rb +9 -138
  169. data/spec/filters/bugs/language.rb +89 -174
  170. data/spec/filters/bugs/marshal.rb +33 -35
  171. data/spec/filters/bugs/method.rb +0 -24
  172. data/spec/filters/bugs/module.rb +19 -57
  173. data/spec/filters/bugs/numeric.rb +0 -119
  174. data/spec/filters/bugs/pathname.rb +2 -0
  175. data/spec/filters/bugs/proc.rb +5 -4
  176. data/spec/filters/bugs/random.rb +7 -0
  177. data/spec/filters/bugs/range.rb +12 -120
  178. data/spec/filters/bugs/rational.rb +1 -1
  179. data/spec/filters/bugs/regexp.rb +2 -40
  180. data/spec/filters/bugs/set.rb +0 -1
  181. data/spec/filters/bugs/string.rb +5 -8
  182. data/spec/filters/bugs/stringscanner.rb +11 -19
  183. data/spec/filters/bugs/time.rb +7 -1
  184. data/spec/filters/bugs/unboundmethod.rb +1 -11
  185. data/spec/filters/unsupported/array.rb +5 -1
  186. data/spec/filters/unsupported/basicobject.rb +1 -1
  187. data/spec/filters/unsupported/bignum.rb +4 -1
  188. data/spec/filters/unsupported/class.rb +1 -1
  189. data/spec/filters/unsupported/delegator.rb +1 -1
  190. data/spec/filters/unsupported/enumerable.rb +1 -1
  191. data/spec/filters/unsupported/enumerator.rb +1 -1
  192. data/spec/filters/unsupported/file.rb +4 -0
  193. data/spec/filters/unsupported/fixnum.rb +1 -1
  194. data/spec/filters/unsupported/float.rb +4 -1
  195. data/spec/filters/unsupported/freeze.rb +27 -5
  196. data/spec/filters/unsupported/hash.rb +7 -15
  197. data/spec/filters/unsupported/integer.rb +1 -1
  198. data/spec/filters/unsupported/kernel.rb +2 -1
  199. data/spec/filters/unsupported/language.rb +6 -1
  200. data/spec/filters/unsupported/marshal.rb +1 -1
  201. data/spec/filters/unsupported/matchdata.rb +4 -1
  202. data/spec/filters/unsupported/math.rb +1 -1
  203. data/spec/filters/unsupported/pathname.rb +1 -1
  204. data/spec/filters/unsupported/privacy.rb +141 -9
  205. data/spec/filters/unsupported/proc.rb +1 -1
  206. data/spec/filters/unsupported/random.rb +4 -0
  207. data/spec/filters/unsupported/range.rb +7 -0
  208. data/spec/filters/unsupported/regexp.rb +25 -15
  209. data/spec/filters/unsupported/set.rb +1 -1
  210. data/spec/filters/unsupported/singleton.rb +1 -1
  211. data/spec/filters/unsupported/string.rb +110 -101
  212. data/spec/filters/unsupported/struct.rb +1 -1
  213. data/spec/filters/unsupported/symbol.rb +2 -1
  214. data/spec/filters/unsupported/taint.rb +22 -7
  215. data/spec/filters/unsupported/thread.rb +1 -1
  216. data/spec/filters/unsupported/time.rb +1 -1
  217. data/spec/lib/builder_spec.rb +17 -0
  218. data/spec/lib/cli_runners/phantomjs_spec.rb +2 -2
  219. data/spec/lib/cli_spec.rb +37 -8
  220. data/spec/lib/compiler/call_spec.rb +98 -66
  221. data/spec/lib/compiler_spec.rb +41 -32
  222. data/spec/lib/config_spec.rb +97 -0
  223. data/spec/lib/dependency_resolver_spec.rb +2 -2
  224. data/spec/lib/deprecations_spec.rb +16 -0
  225. data/spec/lib/fixtures/source_location_test.rb +7 -0
  226. data/spec/lib/path_reader_spec.rb +3 -3
  227. data/spec/lib/rewriters/binary_operator_assignment_spec.rb +151 -0
  228. data/spec/lib/rewriters/block_to_iter_spec.rb +28 -0
  229. data/spec/lib/rewriters/dot_js_syntax_spec.rb +108 -0
  230. data/spec/lib/rewriters/explicit_writer_return_spec.rb +186 -0
  231. data/spec/lib/rewriters/js_reserved_words_spec.rb +116 -0
  232. data/spec/lib/rewriters/logical_operator_assignment_spec.rb +202 -0
  233. data/spec/lib/rewriters/opal_engine_check_spec.rb +82 -0
  234. data/spec/lib/rewriters/rubyspec/filters_rewriter_spec.rb +53 -0
  235. data/spec/lib/simple_server_spec.rb +54 -0
  236. data/spec/lib/spec_helper.rb +88 -4
  237. data/spec/mspec-opal/formatters.rb +65 -17
  238. data/spec/mspec-opal/runner.rb +47 -67
  239. data/spec/opal/core/date_spec.rb +14 -0
  240. data/spec/opal/core/exception_spec.rb +10 -0
  241. data/spec/opal/core/hash/internals_spec.rb +10 -10
  242. data/spec/opal/core/kernel/rand_spec.rb +0 -4
  243. data/spec/opal/core/kernel/respond_to_spec.rb +5 -2
  244. data/spec/opal/core/language/constant_lookup_spec.rb +38 -0
  245. data/spec/opal/core/language/safe_navigator_spec.rb +7 -0
  246. data/spec/opal/core/language/send_spec.rb +1 -9
  247. data/spec/opal/core/language/string_spec.rb +8 -8
  248. data/spec/opal/core/language/versions/def_2_0_spec.rb +0 -4
  249. data/spec/opal/core/language_spec.rb +32 -0
  250. data/spec/opal/core/module/const_get_spec.rb +1 -1
  251. data/spec/opal/core/runtime/is_a_spec.rb +36 -0
  252. data/spec/opal/core/runtime/rescue_spec.rb +35 -0
  253. data/spec/opal/core/runtime_spec.rb +4 -4
  254. data/spec/opal/core/string_spec.rb +8 -8
  255. data/spec/opal/core/time_spec.rb +38 -0
  256. data/spec/opal/stdlib/erb/quoted.opalerb +1 -1
  257. data/spec/opal/stdlib/json/parse_spec.rb +4 -0
  258. data/spec/opal/stdlib/native/hash_spec.rb +16 -0
  259. data/spec/ruby_specs +2 -1
  260. data/spec/spec_helper.rb +1 -0
  261. data/spec/support/rewriters_helper.rb +24 -0
  262. data/stdlib/base64.rb +4 -2
  263. data/stdlib/bigdecimal/bignumber.js.rb +1 -1
  264. data/stdlib/date.rb +18 -19
  265. data/stdlib/json.rb +16 -4
  266. data/stdlib/nashorn/file.rb +15 -0
  267. data/stdlib/native.rb +21 -12
  268. data/stdlib/nodejs/dir.rb +1 -1
  269. data/stdlib/nodejs/file.rb +49 -20
  270. data/stdlib/nodejs/io.rb +22 -1
  271. data/stdlib/nodejs/{node_modules/js-yaml/dist/js-yaml.js → js-yaml-3-6-1.js} +815 -626
  272. data/stdlib/nodejs/kernel.rb +3 -1
  273. data/stdlib/nodejs/package.json +0 -1
  274. data/stdlib/nodejs/stacktrace.rb +163 -0
  275. data/stdlib/nodejs/yaml.rb +2 -1
  276. data/stdlib/opal/platform.rb +5 -13
  277. data/stdlib/opal-platform.rb +15 -0
  278. data/stdlib/pathname.rb +1 -1
  279. data/stdlib/strscan.rb +15 -1
  280. data/stdlib/yaml.rb +1 -1
  281. data/tasks/benchmarking.rake +9 -0
  282. data/tasks/building.rake +24 -20
  283. data/tasks/linting.rake +24 -13
  284. data/tasks/testing/mspec_special_calls.rb +44 -15
  285. data/tasks/testing/opal_rspec_smoketest.Gemfile +13 -0
  286. data/tasks/testing.rake +322 -205
  287. data/test/nodejs/fixtures/hello.rb +1 -0
  288. data/test/nodejs/test_file.rb +57 -0
  289. data/test/nodejs/test_io.rb +18 -0
  290. data/test/nodejs/test_opal_builder.rb +12 -0
  291. data/test/opal/unsupported_and_bugs.rb +9 -0
  292. metadata +131 -242
  293. data/lib/opal/parser/grammar.rb +0 -6157
  294. data/lib/opal/parser/grammar.y +0 -2011
  295. data/lib/opal/parser/keywords.rb +0 -66
  296. data/lib/opal/parser/lexer.rb +0 -1352
  297. data/lib/opal/parser/parser_scope.rb +0 -28
  298. data/lib/opal/parser/sexp.rb +0 -90
  299. data/lib/opal/sprockets/environment.rb +0 -23
  300. data/lib/opal/sprockets/erb.rb +0 -23
  301. data/lib/opal/sprockets/path_reader.rb +0 -36
  302. data/lib/opal/sprockets/processor.rb +0 -145
  303. data/lib/opal/sprockets/server.rb +0 -133
  304. data/lib/opal/sprockets/source_map_header_patch.rb +0 -41
  305. data/lib/opal/sprockets/source_map_server.rb +0 -115
  306. data/lib/opal/sprockets.rb +0 -91
  307. data/spec/filters/bugs/compiler_opal.rb +0 -5
  308. data/spec/filters/bugs/language_opal.rb +0 -88
  309. data/spec/filters/unsupported/module.rb +0 -8
  310. data/spec/lib/compiler/pre_processed_conditionals_spec.rb +0 -87
  311. data/spec/lib/lexer_spec.rb +0 -110
  312. data/spec/lib/parser/alias_spec.rb +0 -26
  313. data/spec/lib/parser/and_spec.rb +0 -13
  314. data/spec/lib/parser/aref_spec.rb +0 -10
  315. data/spec/lib/parser/attrasgn_spec.rb +0 -28
  316. data/spec/lib/parser/begin_spec.rb +0 -42
  317. data/spec/lib/parser/block_spec.rb +0 -12
  318. data/spec/lib/parser/break_spec.rb +0 -17
  319. data/spec/lib/parser/call_spec.rb +0 -201
  320. data/spec/lib/parser/class_spec.rb +0 -35
  321. data/spec/lib/parser/comments_spec.rb +0 -11
  322. data/spec/lib/parser/def_spec.rb +0 -109
  323. data/spec/lib/parser/if_spec.rb +0 -26
  324. data/spec/lib/parser/iter_spec.rb +0 -59
  325. data/spec/lib/parser/lambda_spec.rb +0 -219
  326. data/spec/lib/parser/literal_spec.rb +0 -118
  327. data/spec/lib/parser/masgn_spec.rb +0 -37
  328. data/spec/lib/parser/module_spec.rb +0 -27
  329. data/spec/lib/parser/not_spec.rb +0 -21
  330. data/spec/lib/parser/op_asgn1_spec.rb +0 -23
  331. data/spec/lib/parser/op_asgn2_spec.rb +0 -23
  332. data/spec/lib/parser/op_asgn_spec.rb +0 -17
  333. data/spec/lib/parser/or_spec.rb +0 -13
  334. data/spec/lib/parser/return_spec.rb +0 -22
  335. data/spec/lib/parser/sclass_spec.rb +0 -21
  336. data/spec/lib/parser/string_spec.rb +0 -286
  337. data/spec/lib/parser/super_spec.rb +0 -20
  338. data/spec/lib/parser/unary_spec.rb +0 -52
  339. data/spec/lib/parser/undef_spec.rb +0 -19
  340. data/spec/lib/parser/unless_spec.rb +0 -13
  341. data/spec/lib/parser/variables_spec.rb +0 -116
  342. data/spec/lib/parser/while_spec.rb +0 -15
  343. data/spec/lib/parser/yield_spec.rb +0 -20
  344. data/spec/lib/sprockets/erb_spec.rb +0 -38
  345. data/spec/lib/sprockets/path_reader_spec.rb +0 -41
  346. data/spec/lib/sprockets/processor_spec.rb +0 -79
  347. data/spec/lib/sprockets/server_spec.rb +0 -102
  348. data/spec/lib/sprockets_spec.rb +0 -32
  349. data/spec/lib/tilt/opal_spec.rb +0 -37
  350. data/spec/opal/core/language/block_spec.rb +0 -538
  351. data/spec/opal/core/language/proc_spec.rb +0 -263
  352. data/spec/opal/core/language/variables_spec.rb +0 -1366
  353. data/spec/opal/core/runtime/block_send_spec.rb +0 -28
  354. data/spec/opal/core/runtime/send_spec.rb +0 -34
  355. data/spec/support/parser_helpers.rb +0 -37
  356. data/stdlib/nodejs/node_modules/js-yaml/HISTORY.md +0 -277
  357. data/stdlib/nodejs/node_modules/js-yaml/LICENSE +0 -21
  358. data/stdlib/nodejs/node_modules/js-yaml/README.md +0 -288
  359. data/stdlib/nodejs/node_modules/js-yaml/bin/js-yaml.js +0 -140
  360. data/stdlib/nodejs/node_modules/js-yaml/bower.json +0 -23
  361. data/stdlib/nodejs/node_modules/js-yaml/dist/js-yaml.min.js +0 -3
  362. data/stdlib/nodejs/node_modules/js-yaml/examples/custom_types.js +0 -102
  363. data/stdlib/nodejs/node_modules/js-yaml/examples/custom_types.yml +0 -18
  364. data/stdlib/nodejs/node_modules/js-yaml/examples/dumper.js +0 -31
  365. data/stdlib/nodejs/node_modules/js-yaml/examples/dumper.json +0 -22
  366. data/stdlib/nodejs/node_modules/js-yaml/examples/sample_document.js +0 -18
  367. data/stdlib/nodejs/node_modules/js-yaml/examples/sample_document.yml +0 -197
  368. data/stdlib/nodejs/node_modules/js-yaml/index.js +0 -7
  369. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/common.js +0 -62
  370. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/dumper.js +0 -554
  371. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/exception.js +0 -25
  372. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/loader.js +0 -1581
  373. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/mark.js +0 -78
  374. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/core.js +0 -18
  375. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +0 -25
  376. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +0 -28
  377. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +0 -17
  378. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/json.js +0 -25
  379. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema.js +0 -103
  380. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/binary.js +0 -133
  381. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/bool.js +0 -37
  382. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/float.js +0 -110
  383. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/int.js +0 -183
  384. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/js/function.js +0 -85
  385. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +0 -84
  386. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +0 -27
  387. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/map.js +0 -8
  388. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/merge.js +0 -12
  389. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/null.js +0 -36
  390. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/omap.js +0 -56
  391. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/pairs.js +0 -61
  392. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/seq.js +0 -8
  393. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/set.js +0 -33
  394. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/str.js +0 -8
  395. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +0 -98
  396. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type.js +0 -61
  397. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml.js +0 -39
  398. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/HISTORY.md +0 -115
  399. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/LICENSE +0 -21
  400. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/README.md +0 -239
  401. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/arguments.js +0 -36
  402. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/choice.js +0 -22
  403. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/constants.js +0 -59
  404. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/help.js +0 -13
  405. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/nargs.js +0 -33
  406. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/parents.js +0 -28
  407. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js +0 -23
  408. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js +0 -49
  409. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/sum.js +0 -35
  410. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js +0 -270
  411. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/index.js +0 -1
  412. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js +0 -47
  413. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/append.js +0 -55
  414. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/count.js +0 -40
  415. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/help.js +0 -48
  416. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js +0 -43
  417. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js +0 -27
  418. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js +0 -26
  419. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store.js +0 -50
  420. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js +0 -148
  421. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/version.js +0 -50
  422. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action.js +0 -146
  423. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action_container.js +0 -481
  424. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argparse.js +0 -14
  425. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js +0 -50
  426. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js +0 -54
  427. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js +0 -75
  428. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js +0 -1168
  429. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/const.js +0 -18
  430. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js +0 -88
  431. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js +0 -798
  432. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/namespace.js +0 -77
  433. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/LICENSE +0 -23
  434. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/README.md +0 -22
  435. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json +0 -69
  436. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js +0 -6
  437. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js +0 -1415
  438. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.npmignore +0 -2
  439. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml +0 -8
  440. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown +0 -825
  441. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/bower.json +0 -33
  442. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json +0 -11
  443. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/foo.js +0 -10
  444. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/gulpfile.js +0 -26
  445. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js +0 -673
  446. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log +0 -0
  447. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json +0 -107
  448. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/package.json +0 -62
  449. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/README.md +0 -73
  450. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/bin/esparse.js +0 -117
  451. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js +0 -177
  452. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/esprima.js +0 -3908
  453. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/package.json +0 -69
  454. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/compat.js +0 -239
  455. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/reflect.js +0 -422
  456. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/run.js +0 -66
  457. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/runner.js +0 -387
  458. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/test.js +0 -20238
  459. data/stdlib/nodejs/node_modules/js-yaml/package.json +0 -83
  460. /data/{CODE_OF_CONDUCT.md → CONDUCT.md} +0 -0
@@ -1,107 +0,0 @@
1
- {
2
- "name": "underscore.string",
3
- "version": "2.4.0",
4
- "description": "String manipulation extensions for Underscore.js javascript library.",
5
- "homepage": "http://epeli.github.com/underscore.string/",
6
- "contributors": [
7
- {
8
- "name": "Esa-Matti Suuronen",
9
- "email": "esa-matti@suuronen.org",
10
- "url": "http://esa-matti.suuronen.org/"
11
- },
12
- {
13
- "name": "Edward Tsech",
14
- "email": "edtsech@gmail.com"
15
- },
16
- {
17
- "name": "Pavel Pravosud",
18
- "email": "pavel@pravosud.com",
19
- "url": "<https://github.com/rwz>"
20
- },
21
- {
22
- "name": "Sasha Koss",
23
- "email": "kossnocorp@gmail.com",
24
- "url": "http://koss.nocorp.me/"
25
- },
26
- {
27
- "name": "Vladimir Dronnikov",
28
- "email": "dronnikov@gmail.com"
29
- },
30
- {
31
- "name": "Pete Kruckenberg",
32
- "email": "https://github.com/kruckenb",
33
- "url": "<https://github.com/kruckenb>"
34
- },
35
- {
36
- "name": "Paul Chavard",
37
- "email": "paul@chavard.net",
38
- "url": "<http://tchak.net>"
39
- },
40
- {
41
- "name": "Ed Finkler",
42
- "email": "coj@funkatron.com",
43
- "url": "<http://funkatron.com>"
44
- }
45
- ],
46
- "keywords": [
47
- "underscore",
48
- "string"
49
- ],
50
- "main": "./lib/underscore.string.js",
51
- "directories": {
52
- "lib": "./lib"
53
- },
54
- "engines": {
55
- "node": "*"
56
- },
57
- "repository": {
58
- "type": "git",
59
- "url": "https://github.com/epeli/underscore.string.git"
60
- },
61
- "bugs": {
62
- "url": "https://github.com/epeli/underscore.string/issues"
63
- },
64
- "licenses": [
65
- {
66
- "type": "MIT"
67
- }
68
- ],
69
- "scripts": {
70
- "test": "gulp test"
71
- },
72
- "devDependencies": {
73
- "gulp": "~3.8.10",
74
- "gulp-uglify": "~1.0.1",
75
- "gulp-qunit": "~1.0.0",
76
- "gulp-clean": "~0.3.1",
77
- "gulp-rename": "~1.2.0"
78
- },
79
- "_id": "underscore.string@2.4.0",
80
- "dist": {
81
- "shasum": "8cdd8fbac4e2d2ea1e7e2e8097c42f442280f85b",
82
- "tarball": "http://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz"
83
- },
84
- "_from": "underscore.string@>=2.4.0 <2.5.0",
85
- "_npmVersion": "1.3.24",
86
- "_npmUser": {
87
- "name": "epeli",
88
- "email": "esa-matti@suuronen.org"
89
- },
90
- "maintainers": [
91
- {
92
- "name": "edtsech",
93
- "email": "edtsech@gmail.com"
94
- },
95
- {
96
- "name": "rwz",
97
- "email": "rwz@duckroll.ru"
98
- },
99
- {
100
- "name": "epeli",
101
- "email": "esa-matti@suuronen.org"
102
- }
103
- ],
104
- "_shasum": "8cdd8fbac4e2d2ea1e7e2e8097c42f442280f85b",
105
- "_resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-2.4.0.tgz",
106
- "readme": "ERROR: No README data found!"
107
- }
@@ -1,62 +0,0 @@
1
- {
2
- "name": "argparse",
3
- "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library",
4
- "version": "0.1.16",
5
- "keywords": [
6
- "cli",
7
- "parser",
8
- "argparse",
9
- "option",
10
- "args"
11
- ],
12
- "homepage": "https://github.com/nodeca/argparse",
13
- "contributors": [
14
- {
15
- "name": "Eugene Shkuropat"
16
- },
17
- {
18
- "name": "Paul Jacobson"
19
- }
20
- ],
21
- "bugs": {
22
- "url": "https://github.com/nodeca/argparse/issues"
23
- },
24
- "license": "MIT",
25
- "repository": {
26
- "type": "git",
27
- "url": "git://github.com/nodeca/argparse.git"
28
- },
29
- "main": "./index.js",
30
- "scripts": {
31
- "test": "make test"
32
- },
33
- "dependencies": {
34
- "underscore": "~1.7.0",
35
- "underscore.string": "~2.4.0"
36
- },
37
- "devDependencies": {
38
- "mocha": "*"
39
- },
40
- "gitHead": "9c32eb1405d5d4b5686087d95bac010774979659",
41
- "_id": "argparse@0.1.16",
42
- "_shasum": "cfd01e0fbba3d6caed049fbd758d40f65196f57c",
43
- "_from": "argparse@>=0.1.11 <0.2.0",
44
- "_npmVersion": "1.4.28",
45
- "_npmUser": {
46
- "name": "vitaly",
47
- "email": "vitaly@rcdesign.ru"
48
- },
49
- "maintainers": [
50
- {
51
- "name": "vitaly",
52
- "email": "vitaly@rcdesign.ru"
53
- }
54
- ],
55
- "dist": {
56
- "shasum": "cfd01e0fbba3d6caed049fbd758d40f65196f57c",
57
- "tarball": "http://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz"
58
- },
59
- "directories": {},
60
- "_resolved": "https://registry.npmjs.org/argparse/-/argparse-0.1.16.tgz",
61
- "readme": "ERROR: No README data found!"
62
- }
@@ -1,73 +0,0 @@
1
- **Esprima** ([esprima.org](http://esprima.org)) is a high performance,
2
- standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
3
- parser written in ECMAScript (also popularly known as
4
- [JavaScript](http://en.wikipedia.org/wiki/JavaScript>JavaScript)).
5
- Esprima is created and maintained by [Ariya Hidayat](http://twitter.com/ariyahidayat),
6
- with the help of [many contributors](https://github.com/ariya/esprima/contributors).
7
-
8
- Esprima runs on web browsers (IE 6+, Firefox 1+, Safari 3+, Chrome 1+, Konqueror 4.6+, Opera 8+) as well as
9
- [Node.js](http://nodejs.org).
10
-
11
- ### Features
12
-
13
- - Full support for [ECMAScript 5.1](http://www.ecma-international.org/publications/standards/Ecma-262.htm)(ECMA-262)
14
- - Sensible [syntax tree format](http://esprima.org/doc/index.html#ast) compatible with Mozilla
15
- [Parser AST](https://developer.mozilla.org/en/SpiderMonkey/Parser_API)
16
- - Heavily tested (> 550 [unit tests](http://esprima.org/test/) with solid 100% statement coverage)
17
- - Optional tracking of syntax node location (index-based and line-column)
18
- - Experimental support for ES6/Harmony (module, class, destructuring, ...)
19
-
20
- Esprima is blazing fast (see the [benchmark suite](http://esprima.org/test/benchmarks.html)).
21
- It is up to 3x faster than UglifyJS v1 and it is still [competitive](http://esprima.org/test/compare.html)
22
- with the new generation of fast parsers.
23
-
24
- ### Applications
25
-
26
- Esprima serves as the basis for many popular JavaScript development tools:
27
-
28
- - Code coverage analysis: [node-cover](https://github.com/itay/node-cover), [Istanbul](https://github.com/yahoo/Istanbul)
29
- - Documentation tool: [JFDoc](https://github.com/thejohnfreeman/jfdoc), [JSDuck](https://github.com/senchalabs/jsduck)
30
- - Language extension: [LLJS](http://mbebenita.github.com/LLJS/) (low-level JS),
31
- [Sweet.js](http://sweetjs.org/) (macro)
32
- - ES6/Harmony transpiler: [Six](https://github.com/matthewrobb/six), [Harmonizr](https://github.com/jdiamond/harmonizr)
33
- - Eclipse Orion smart editing ([outline view](https://github.com/aclement/esprima-outline), [content assist](http://contraptionsforprogramming.blogspot.com/2012/02/better-javascript-content-assist-in.html))
34
- - Source code modification: [Esmorph](https://github.com/ariya/esmorph), [Code Painter](https://github.com/fawek/codepainter),
35
- - Source transformation: [node-falafel](https://github.com/substack/node-falafel), [Esmangle](https://github.com/Constellation/esmangle), [escodegen](https://github.com/Constellation/escodegen)
36
-
37
- ### Questions?
38
- - [Documentation](http://esprima.org/doc)
39
- - [Issue tracker](http://issues.esprima.org): [known problems](http://code.google.com/p/esprima/issues/list?q=Defect)
40
- and [future plans](http://code.google.com/p/esprima/issues/list?q=Enhancement)
41
- - [Mailing list](http://groups.google.com/group/esprima)
42
- - [Contribution guide](http://esprima.org/doc/index.html#contribution)
43
-
44
- Follow [@Esprima](http://twitter.com/Esprima) on Twitter to get the
45
- development updates.
46
- Feedback and contribution are welcomed!
47
-
48
- ### License
49
-
50
- Copyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about)
51
- and other contributors.
52
-
53
- Redistribution and use in source and binary forms, with or without
54
- modification, are permitted provided that the following conditions are met:
55
-
56
- * Redistributions of source code must retain the above copyright
57
- notice, this list of conditions and the following disclaimer.
58
-
59
- * Redistributions in binary form must reproduce the above copyright
60
- notice, this list of conditions and the following disclaimer in the
61
- documentation and/or other materials provided with the distribution.
62
-
63
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
64
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
65
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
66
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
67
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
68
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
69
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
70
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
71
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
72
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
73
-
@@ -1,117 +0,0 @@
1
- #!/usr/bin/env node
2
- /*
3
- Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
4
- Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>
5
-
6
- Redistribution and use in source and binary forms, with or without
7
- modification, are permitted provided that the following conditions are met:
8
-
9
- * Redistributions of source code must retain the above copyright
10
- notice, this list of conditions and the following disclaimer.
11
- * Redistributions in binary form must reproduce the above copyright
12
- notice, this list of conditions and the following disclaimer in the
13
- documentation and/or other materials provided with the distribution.
14
-
15
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
19
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
- */
26
-
27
- /*jslint sloppy:true node:true rhino:true */
28
-
29
- var fs, esprima, fname, content, options, syntax;
30
-
31
- if (typeof require === 'function') {
32
- fs = require('fs');
33
- esprima = require('esprima');
34
- } else if (typeof load === 'function') {
35
- try {
36
- load('esprima.js');
37
- } catch (e) {
38
- load('../esprima.js');
39
- }
40
- }
41
-
42
- // Shims to Node.js objects when running under Rhino.
43
- if (typeof console === 'undefined' && typeof process === 'undefined') {
44
- console = { log: print };
45
- fs = { readFileSync: readFile };
46
- process = { argv: arguments, exit: quit };
47
- process.argv.unshift('esparse.js');
48
- process.argv.unshift('rhino');
49
- }
50
-
51
- function showUsage() {
52
- console.log('Usage:');
53
- console.log(' esparse [options] file.js');
54
- console.log();
55
- console.log('Available options:');
56
- console.log();
57
- console.log(' --comment Gather all line and block comments in an array');
58
- console.log(' --loc Include line-column location info for each syntax node');
59
- console.log(' --range Include index-based range for each syntax node');
60
- console.log(' --raw Display the raw value of literals');
61
- console.log(' --tokens List all tokens in an array');
62
- console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)');
63
- console.log(' -v, --version Shows program version');
64
- console.log();
65
- process.exit(1);
66
- }
67
-
68
- if (process.argv.length <= 2) {
69
- showUsage();
70
- }
71
-
72
- options = {};
73
-
74
- process.argv.splice(2).forEach(function (entry) {
75
-
76
- if (entry === '-h' || entry === '--help') {
77
- showUsage();
78
- } else if (entry === '-v' || entry === '--version') {
79
- console.log('ECMAScript Parser (using Esprima version', esprima.version, ')');
80
- console.log();
81
- process.exit(0);
82
- } else if (entry === '--comment') {
83
- options.comment = true;
84
- } else if (entry === '--loc') {
85
- options.loc = true;
86
- } else if (entry === '--range') {
87
- options.range = true;
88
- } else if (entry === '--raw') {
89
- options.raw = true;
90
- } else if (entry === '--tokens') {
91
- options.tokens = true;
92
- } else if (entry === '--tolerant') {
93
- options.tolerant = true;
94
- } else if (entry.slice(0, 2) === '--') {
95
- console.log('Error: unknown option ' + entry + '.');
96
- process.exit(1);
97
- } else if (typeof fname === 'string') {
98
- console.log('Error: more than one input file.');
99
- process.exit(1);
100
- } else {
101
- fname = entry;
102
- }
103
- });
104
-
105
- if (typeof fname !== 'string') {
106
- console.log('Error: no input file.');
107
- process.exit(1);
108
- }
109
-
110
- try {
111
- content = fs.readFileSync(fname, 'utf-8');
112
- syntax = esprima.parse(content, options);
113
- console.log(JSON.stringify(syntax, null, 4));
114
- } catch (e) {
115
- console.log('Error: ' + e.message);
116
- process.exit(1);
117
- }
@@ -1,177 +0,0 @@
1
- #!/usr/bin/env node
2
- /*
3
- Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
4
-
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are met:
7
-
8
- * Redistributions of source code must retain the above copyright
9
- notice, this list of conditions and the following disclaimer.
10
- * Redistributions in binary form must reproduce the above copyright
11
- notice, this list of conditions and the following disclaimer in the
12
- documentation and/or other materials provided with the distribution.
13
-
14
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
- ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
18
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
- */
25
-
26
- /*jslint sloppy:true plusplus:true node:true rhino:true */
27
-
28
- var fs, esprima, options, fnames, count;
29
-
30
- if (typeof require === 'function') {
31
- fs = require('fs');
32
- esprima = require('esprima');
33
- } else if (typeof load === 'function') {
34
- try {
35
- load('esprima.js');
36
- } catch (e) {
37
- load('../esprima.js');
38
- }
39
- }
40
-
41
- // Shims to Node.js objects when running under Rhino.
42
- if (typeof console === 'undefined' && typeof process === 'undefined') {
43
- console = { log: print };
44
- fs = { readFileSync: readFile };
45
- process = { argv: arguments, exit: quit };
46
- process.argv.unshift('esvalidate.js');
47
- process.argv.unshift('rhino');
48
- }
49
-
50
- function showUsage() {
51
- console.log('Usage:');
52
- console.log(' esvalidate [options] file.js');
53
- console.log();
54
- console.log('Available options:');
55
- console.log();
56
- console.log(' --format=type Set the report format, plain (default) or junit');
57
- console.log(' -v, --version Print program version');
58
- console.log();
59
- process.exit(1);
60
- }
61
-
62
- if (process.argv.length <= 2) {
63
- showUsage();
64
- }
65
-
66
- options = {
67
- format: 'plain'
68
- };
69
-
70
- fnames = [];
71
-
72
- process.argv.splice(2).forEach(function (entry) {
73
-
74
- if (entry === '-h' || entry === '--help') {
75
- showUsage();
76
- } else if (entry === '-v' || entry === '--version') {
77
- console.log('ECMAScript Validator (using Esprima version', esprima.version, ')');
78
- console.log();
79
- process.exit(0);
80
- } else if (entry.slice(0, 9) === '--format=') {
81
- options.format = entry.slice(9);
82
- if (options.format !== 'plain' && options.format !== 'junit') {
83
- console.log('Error: unknown report format ' + options.format + '.');
84
- process.exit(1);
85
- }
86
- } else if (entry.slice(0, 2) === '--') {
87
- console.log('Error: unknown option ' + entry + '.');
88
- process.exit(1);
89
- } else {
90
- fnames.push(entry);
91
- }
92
- });
93
-
94
- if (fnames.length === 0) {
95
- console.log('Error: no input file.');
96
- process.exit(1);
97
- }
98
-
99
- if (options.format === 'junit') {
100
- console.log('<?xml version="1.0" encoding="UTF-8"?>');
101
- console.log('<testsuites>');
102
- }
103
-
104
- count = 0;
105
- fnames.forEach(function (fname) {
106
- var content, timestamp, syntax, name;
107
- try {
108
- content = fs.readFileSync(fname, 'utf-8');
109
-
110
- if (content[0] === '#' && content[1] === '!') {
111
- content = '//' + content.substr(2, content.length);
112
- }
113
-
114
- timestamp = Date.now();
115
- syntax = esprima.parse(content, { tolerant: true });
116
-
117
- if (options.format === 'junit') {
118
-
119
- name = fname;
120
- if (name.lastIndexOf('/') >= 0) {
121
- name = name.slice(name.lastIndexOf('/') + 1);
122
- }
123
-
124
- console.log('<testsuite name="' + fname + '" errors="0" ' +
125
- ' failures="' + syntax.errors.length + '" ' +
126
- ' tests="' + syntax.errors.length + '" ' +
127
- ' time="' + Math.round((Date.now() - timestamp) / 1000) +
128
- '">');
129
-
130
- syntax.errors.forEach(function (error) {
131
- var msg = error.message;
132
- msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
133
- console.log(' <testcase name="Line ' + error.lineNumber + ': ' + msg + '" ' +
134
- ' time="0">');
135
- console.log(' <error type="SyntaxError" message="' + error.message + '">' +
136
- error.message + '(' + name + ':' + error.lineNumber + ')' +
137
- '</error>');
138
- console.log(' </testcase>');
139
- });
140
-
141
- console.log('</testsuite>');
142
-
143
- } else if (options.format === 'plain') {
144
-
145
- syntax.errors.forEach(function (error) {
146
- var msg = error.message;
147
- msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
148
- msg = fname + ':' + error.lineNumber + ': ' + msg;
149
- console.log(msg);
150
- ++count;
151
- });
152
-
153
- }
154
- } catch (e) {
155
- ++count;
156
- if (options.format === 'junit') {
157
- console.log('<testsuite name="' + fname + '" errors="1" failures="0" tests="1" ' +
158
- ' time="' + Math.round((Date.now() - timestamp) / 1000) + '">');
159
- console.log(' <testcase name="' + e.message + '" ' + ' time="0">');
160
- console.log(' <error type="ParseError" message="' + e.message + '">' +
161
- e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') +
162
- ')</error>');
163
- console.log(' </testcase>');
164
- console.log('</testsuite>');
165
- } else {
166
- console.log('Error: ' + e.message);
167
- }
168
- }
169
- });
170
-
171
- if (options.format === 'junit') {
172
- console.log('</testsuites>');
173
- }
174
-
175
- if (count > 0) {
176
- process.exit(1);
177
- }