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,5 +1,18 @@
1
- opal_filter "String" do
1
+ opal_unsupported_filter "String" do
2
2
  fails "BasicObject#__id__ returns a different value for two String literals"
3
+ fails "Ruby character strings Unicode escaping can be done with \\u{} and one to six hex digits"
4
+ fails "Ruby character strings Unicode escaping with ASCII_8BIT source encoding produces a UTF-8-encoded string when escaping non-ASCII characters via \\u" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:UTF-8>
5
+ fails "Ruby character strings Unicode escaping with ASCII_8BIT source encoding produces a UTF-8-encoded string when escaping non-ASCII characters via \\u{}" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:UTF-8>
6
+ fails "Ruby character strings Unicode escaping with ASCII_8BIT source encoding produces an ASCII string when escaping ASCII characters via \\u" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT>
7
+ fails "Ruby character strings Unicode escaping with ASCII_8BIT source encoding produces an ASCII string when escaping ASCII characters via \\u{}" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT>
8
+ fails "Ruby character strings Unicode escaping with US-ASCII source encoding produces a UTF-8-encoded string when escaping non-ASCII characters via \\u"
9
+ fails "Ruby character strings Unicode escaping with US-ASCII source encoding produces a UTF-8-encoded string when escaping non-ASCII characters via \\u{}"
10
+ fails "Ruby character strings Unicode escaping with US-ASCII source encoding produces an ASCII string when escaping ASCII characters via \\u"
11
+ fails "Ruby character strings Unicode escaping with US-ASCII source encoding produces an ASCII string when escaping ASCII characters via \\u{}"
12
+ fails "Ruby character strings are produced from control character shortcuts"
13
+ fails "Ruby character strings backslashes follow the same rules as interpolation"
14
+ fails "Ruby character strings taints the result of interpolation when an interpolated value is tainted"
15
+ fails "Ruby character strings untrusts the result of interpolation when an interpolated value is untrusted"
3
16
  fails "String#% always taints the result when the format string is tainted"
4
17
  fails "String#% supports negative bignums with %u or %d"
5
18
  fails "String#% taints result for %p when argument.inspect is tainted"
@@ -42,9 +55,9 @@ opal_filter "String" do
42
55
  fails "String#<< when the argument is in an ASCII-incompatible encoding incompatible with self's encoding uses the argument's encoding if self is empty"
43
56
  fails "String#<< with Integer concatencates the argument interpreted as a codepoint"
44
57
  fails "String#<< with Integer doesn't call to_int on its argument"
45
- fails "String#<< with Integer raises a RuntimeError when self is frozen"
46
58
  fails "String#<< with Integer raises RangeError if the argument is an invalid codepoint for self's encoding"
47
59
  fails "String#<< with Integer raises RangeError if the argument is negative"
60
+ fails "String#<< with Integer raises a RuntimeError when self is frozen"
48
61
  fails "String#<< with Integer returns a ASCII-8BIT string if self is US-ASCII and the argument is between 128-255 (inclusive)"
49
62
  fails "String#<=> with String compares the indices of the encodings when the strings have identical non-ASCII-compatible bytes"
50
63
  fails "String#<=> with String ignores encoding difference"
@@ -57,6 +70,62 @@ opal_filter "String" do
57
70
  fails "String#=== considers encoding compatibility"
58
71
  fails "String#=== considers encoding difference of incompatible string"
59
72
  fails "String#=== ignores encoding difference of compatible string"
73
+ fails "String#[] with Range always taints resulting strings when self is tainted"
74
+ fails "String#[] with Regexp, index always taints resulting strings when self or regexp is tainted"
75
+ fails "String#[] with String taints resulting strings when other is tainted"
76
+ fails "String#[] with Symbol raises TypeError"
77
+ fails "String#[] with index, length always taints resulting strings when self is tainted"
78
+ fails "String#[]= with Fixnum index allows assignment to the zero'th element of an empty String"
79
+ fails "String#[]= with Fixnum index calls #to_str to convert other to a String"
80
+ fails "String#[]= with Fixnum index calls to_int on index"
81
+ fails "String#[]= with Fixnum index raises IndexError if the string index doesn't match a position in the string"
82
+ fails "String#[]= with Fixnum index raises a RuntimeError when self is frozen"
83
+ fails "String#[]= with Fixnum index raises a TypeError if other_str can't be converted to a String"
84
+ fails "String#[]= with Fixnum index raises an IndexError without changing self if idx is outside of self"
85
+ fails "String#[]= with Fixnum index replaces the char at idx with other_str"
86
+ fails "String#[]= with Fixnum index taints self if other_str is tainted"
87
+ fails "String#[]= with Fixnum index, count appends other_str to the end of the string if idx == the length of the string"
88
+ fails "String#[]= with Fixnum index, count calls #to_int to convert the index and count objects"
89
+ fails "String#[]= with Fixnum index, count calls #to_str to convert the replacement object"
90
+ fails "String#[]= with Fixnum index, count counts negative idx values from end of the string"
91
+ fails "String#[]= with Fixnum index, count deletes characters if other_str is an empty string"
92
+ fails "String#[]= with Fixnum index, count deletes characters up to the maximum length of the existing string"
93
+ fails "String#[]= with Fixnum index, count overwrites and deletes characters if count is more than the length of other_str"
94
+ fails "String#[]= with Fixnum index, count raises a TypeError if #to_int for count does not return an Integer"
95
+ fails "String#[]= with Fixnum index, count raises a TypeError if #to_int for index does not return an Integer"
96
+ fails "String#[]= with Fixnum index, count raises a TypeError if other_str is a type other than String"
97
+ fails "String#[]= with Fixnum index, count raises a TypeError of #to_str does not return a String"
98
+ fails "String#[]= with Fixnum index, count raises an IndexError if count < 0"
99
+ fails "String#[]= with Fixnum index, count raises an IndexError if |idx| is greater than the length of the string"
100
+ fails "String#[]= with Fixnum index, count starts at idx and overwrites count characters before inserting the rest of other_str"
101
+ fails "String#[]= with Fixnum index, count taints self if other_str is tainted"
102
+ fails "String#[]= with String index raises an IndexError if the search String is not found"
103
+ fails "String#[]= with String index replaces characters with no characters"
104
+ fails "String#[]= with String index replaces fewer characters with more characters"
105
+ fails "String#[]= with String index replaces more characters with fewer characters"
106
+ fails "String#[]= with a Range index raises a RangeError if negative Range begin is out of range"
107
+ fails "String#[]= with a Range index raises a RangeError if positive Range begin is greater than String size"
108
+ fails "String#[]= with a Range index replaces a partial string"
109
+ fails "String#[]= with a Range index replaces the contents with a longer String"
110
+ fails "String#[]= with a Range index replaces the contents with a shorter String"
111
+ fails "String#[]= with a Range index treats a negative out-of-range Range end with a negative Range begin as a zero count"
112
+ fails "String#[]= with a Range index treats a negative out-of-range Range end with a positive Range begin as a zero count"
113
+ fails "String#[]= with a Range index uses the Range end as an index rather than a count"
114
+ fails "String#[]= with a Range index with an empty replacement does not replace a character with a zero exclude-end range"
115
+ fails "String#[]= with a Range index with an empty replacement does not replace a character with a zero-index, zero exclude-end range"
116
+ fails "String#[]= with a Range index with an empty replacement replaces a character with a zero non-exclude-end range"
117
+ fails "String#[]= with a Range index with an empty replacement replaces a character with zero-index, zero non-exclude-end range"
118
+ fails "String#[]= with a Regexp index calls #to_str to convert the replacement"
119
+ fails "String#[]= with a Regexp index checks the match before calling #to_str to convert the replacement"
120
+ fails "String#[]= with a Regexp index raises IndexError if the regexp index doesn't match a position in the string"
121
+ fails "String#[]= with a Regexp index replaces the matched text with the rhs"
122
+ fails "String#[]= with a Regexp index with 3 arguments allows the specified capture to be negative and count from the end"
123
+ fails "String#[]= with a Regexp index with 3 arguments calls #to_int to convert the second object"
124
+ fails "String#[]= with a Regexp index with 3 arguments checks the match index before calling #to_str to convert the replacement"
125
+ fails "String#[]= with a Regexp index with 3 arguments raises IndexError if the specified capture isn't available"
126
+ fails "String#[]= with a Regexp index with 3 arguments raises a TypeError if #to_int does not return a Fixnum"
127
+ fails "String#[]= with a Regexp index with 3 arguments uses the 2nd of 3 arguments as which capture should be replaced"
128
+ fails "String#[]= with a Regexp index with 3 arguments when the optional capture does not match raises an IndexError before setting the replacement"
60
129
  fails "String#capitalize is locale insensitive (only upcases a-z and only downcases A-Z)"
61
130
  fails "String#capitalize taints resulting string when self is tainted"
62
131
  fails "String#capitalize! capitalizes self in place"
@@ -142,9 +211,9 @@ opal_filter "String" do
142
211
  fails "String#concat when the argument is in an ASCII-incompatible encoding incompatible with self's encoding uses the argument's encoding if self is empty"
143
212
  fails "String#concat with Integer concatencates the argument interpreted as a codepoint"
144
213
  fails "String#concat with Integer doesn't call to_int on its argument"
145
- fails "String#concat with Integer raises a RuntimeError when self is frozen"
146
214
  fails "String#concat with Integer raises RangeError if the argument is an invalid codepoint for self's encoding"
147
215
  fails "String#concat with Integer raises RangeError if the argument is negative"
216
+ fails "String#concat with Integer raises a RuntimeError when self is frozen"
148
217
  fails "String#concat with Integer returns a ASCII-8BIT string if self is US-ASCII and the argument is between 128-255 (inclusive)"
149
218
  fails "String#count returns the number of occurrences of a multi-byte character"
150
219
  fails "String#delete taints result when self is tainted"
@@ -156,6 +225,7 @@ opal_filter "String" do
156
225
  fails "String#downcase! modifies self in place"
157
226
  fails "String#downcase! raises a RuntimeError when self is frozen"
158
227
  fails "String#downcase! returns nil if no modifications were made"
228
+ fails "String#dump untrusts the result if self is untrusted"
159
229
  fails "String#dup does not modify the original string when changing dupped string"
160
230
  fails "String#each_char is unicode aware"
161
231
  fails "String#each_line does not care if the string is modified while substituting"
@@ -164,29 +234,22 @@ opal_filter "String" do
164
234
  fails "String#eql? considers encoding compatibility"
165
235
  fails "String#eql? considers encoding difference of incompatible string"
166
236
  fails "String#eql? ignores encoding difference of compatible string"
167
- fails "String#gsub with pattern and block raises an Encoding::CompatibilityError if the encodings are not compatible"
168
- fails "String#gsub with pattern and block replaces the incompatible part properly even if the encodings are not compatible"
169
- fails "String#gsub with pattern and block untrusts the result if the original string or replacement is untrusted"
170
- fails "String#gsub with pattern and block uses the compatible encoding if they are compatible"
171
237
  fails "String#gsub with pattern and Hash ignores non-String keys"
172
238
  fails "String#gsub with pattern and Hash taints the result if a hash value is tainted"
173
239
  fails "String#gsub with pattern and Hash taints the result if the original string is tainted"
174
240
  fails "String#gsub with pattern and Hash untrusts the result if a hash value is untrusted"
175
241
  fails "String#gsub with pattern and Hash untrusts the result if the original string is untrusted"
242
+ fails "String#gsub with pattern and block raises an ArgumentError if encoding is not valid"
243
+ fails "String#gsub with pattern and block raises an Encoding::CompatibilityError if the encodings are not compatible"
244
+ fails "String#gsub with pattern and block replaces the incompatible part properly even if the encodings are not compatible"
245
+ fails "String#gsub with pattern and block untrusts the result if the original string or replacement is untrusted"
246
+ fails "String#gsub with pattern and block uses the compatible encoding if they are compatible"
176
247
  fails "String#gsub with pattern and replacement doesn't freak out when replacing ^" #Only fails "Text\nFoo".gsub(/^/, ' ').should == " Text\n Foo"
177
248
  fails "String#gsub with pattern and replacement replaces \\k named backreferences with the regexp's corresponding capture"
178
249
  fails "String#gsub with pattern and replacement returns a copy of self with all occurrences of pattern replaced with replacement" #Only fails str.gsub(/\Ah\S+\s*/, "huh? ").should == "huh? homely world. hah!"
179
250
  fails "String#gsub with pattern and replacement supports \\G which matches at the beginning of the remaining (non-matched) string"
180
251
  fails "String#gsub with pattern and replacement taints the result if the original string or replacement is tainted"
181
252
  fails "String#gsub with pattern and replacement untrusts the result if the original string or replacement is untrusted"
182
- fails "String#gsub! with pattern and block modifies self in place and returns self"
183
- fails "String#gsub! with pattern and block raises a RuntimeError when self is frozen"
184
- fails "String#gsub! with pattern and block raises an Encoding::CompatibilityError if the encodings are not compatible"
185
- fails "String#gsub! with pattern and block replaces the incompatible part properly even if the encodings are not compatible"
186
- fails "String#gsub! with pattern and block returns nil if no modifications were made"
187
- fails "String#gsub! with pattern and block taints self if block's result is tainted"
188
- fails "String#gsub! with pattern and block untrusts self if block's result is untrusted"
189
- fails "String#gsub! with pattern and block uses the compatible encoding if they are compatible"
190
253
  fails "String#gsub! with pattern and Hash coerces the hash values with #to_s"
191
254
  fails "String#gsub! with pattern and Hash doesn't interpolate special sequences like \\1 for the block's return value"
192
255
  fails "String#gsub! with pattern and Hash ignores keys that don't correspond to matches"
@@ -201,12 +264,21 @@ opal_filter "String" do
201
264
  fails "String#gsub! with pattern and Hash uses a key's value as many times as needed"
202
265
  fails "String#gsub! with pattern and Hash uses the hash's default value for missing keys"
203
266
  fails "String#gsub! with pattern and Hash uses the hash's value set from default_proc for missing keys"
267
+ fails "String#gsub! with pattern and block modifies self in place and returns self"
268
+ fails "String#gsub! with pattern and block raises a RuntimeError when self is frozen"
269
+ fails "String#gsub! with pattern and block raises an ArgumentError if encoding is not valid"
270
+ fails "String#gsub! with pattern and block raises an Encoding::CompatibilityError if the encodings are not compatible"
271
+ fails "String#gsub! with pattern and block replaces the incompatible part properly even if the encodings are not compatible"
272
+ fails "String#gsub! with pattern and block returns nil if no modifications were made"
273
+ fails "String#gsub! with pattern and block taints self if block's result is tainted"
274
+ fails "String#gsub! with pattern and block untrusts self if block's result is untrusted"
275
+ fails "String#gsub! with pattern and block uses the compatible encoding if they are compatible"
204
276
  fails "String#gsub! with pattern and replacement modifies self in place and returns self"
277
+ fails "String#gsub! with pattern and replacement modifies self in place with multi-byte characters and returns self"
205
278
  fails "String#gsub! with pattern and replacement raises a RuntimeError when self is frozen"
206
279
  fails "String#gsub! with pattern and replacement returns nil if no modifications were made"
207
280
  fails "String#gsub! with pattern and replacement taints self if replacement is tainted"
208
281
  fails "String#gsub! with pattern and replacement untrusts self if replacement is untrusted"
209
- fails "String#gsub! with pattern and replacement modifies self in place with multi-byte characters and returns self"
210
282
  fails "String#gsub! with pattern and without replacement and block returned Enumerator size should return nil"
211
283
  fails "String#gsub! with pattern and without replacement and block returns an enumerator"
212
284
  fails "String#index raises a TypeError if passed a Symbol"
@@ -233,8 +305,8 @@ opal_filter "String" do
233
305
  fails "String#insert with index, other raises a TypeError if other can't be converted to string"
234
306
  fails "String#insert with index, other raises an IndexError if the index is beyond string"
235
307
  fails "String#insert with index, other taints self if string to insert is tainted"
236
- fails "String#inspect returns a string with non-printing characters replaced by \\x notation"
237
308
  fails "String#inspect returns a string with a NUL character replaced by \\x notation"
309
+ fails "String#inspect returns a string with non-printing characters replaced by \\x notation"
238
310
  fails "String#inspect taints the result if self is tainted"
239
311
  fails "String#inspect untrusts the result if self is untrusted"
240
312
  fails "String#lines does not care if the string is modified while substituting"
@@ -273,6 +345,7 @@ opal_filter "String" do
273
345
  fails "String#reverse! raises a RuntimeError on a frozen instance that is modified"
274
346
  fails "String#reverse! raises a RuntimeError on a frozen instance that would not be modified"
275
347
  fails "String#reverse! reverses self in place and always returns self"
348
+ fails "String#rindex with Regexp supports \\G which matches at the given start offset"
276
349
  fails "String#rjust with length, padding taints result when self or padstr is tainted"
277
350
  fails "String#rjust with length, padding when padding is tainted and self is untainted returns a tainted string if and only if length is longer than self"
278
351
  fails "String#rstrip taints the result when self is tainted"
@@ -304,11 +377,11 @@ opal_filter "String" do
304
377
  fails "String#setbyte regards a negative index as counting from the end of the String"
305
378
  fails "String#setbyte returns an Integer"
306
379
  fails "String#setbyte sets a byte at an index greater than String size"
307
- fails "String#slice with index, length always taints resulting strings when self is tainted"
308
380
  fails "String#slice with Range always taints resulting strings when self is tainted"
309
381
  fails "String#slice with Regexp, index always taints resulting strings when self or regexp is tainted"
310
382
  fails "String#slice with String taints resulting strings when other is tainted"
311
383
  fails "String#slice with Symbol raises TypeError"
384
+ fails "String#slice with index, length always taints resulting strings when self is tainted"
312
385
  fails "String#slice! Range always taints resulting strings when self is tainted"
313
386
  fails "String#slice! Range calls to_int on range arguments"
314
387
  fails "String#slice! Range deletes and return the substring given by the offsets of the range"
@@ -317,16 +390,6 @@ opal_filter "String" do
317
390
  fails "String#slice! Range returns nil if the given range is out of self"
318
391
  fails "String#slice! Range returns subclass instances"
319
392
  fails "String#slice! Range works with Range subclasses"
320
- fails "String#slice! with index calls to_int on index"
321
- fails "String#slice! with index deletes and return the char at the given position"
322
- fails "String#slice! with index raises a RuntimeError if self is frozen"
323
- fails "String#slice! with index returns nil if idx is outside of self"
324
- fails "String#slice! with index, length always taints resulting strings when self is tainted"
325
- fails "String#slice! with index, length calls to_int on idx and length"
326
- fails "String#slice! with index, length deletes and returns the substring at idx and the given length"
327
- fails "String#slice! with index, length raises a RuntimeError if self is frozen"
328
- fails "String#slice! with index, length returns nil if the length is negative"
329
- fails "String#slice! with index, length returns subclass instances"
330
393
  fails "String#slice! with Regexp always taints resulting strings when self or regexp is tainted"
331
394
  fails "String#slice! with Regexp deletes and returns the first match from self"
332
395
  fails "String#slice! with Regexp doesn't taint self when regexp is tainted"
@@ -352,6 +415,16 @@ opal_filter "String" do
352
415
  fails "String#slice! with String returns a subclass instance when given a subclass instance"
353
416
  fails "String#slice! with String returns nil if self does not contain other"
354
417
  fails "String#slice! with String taints resulting strings when other is tainted"
418
+ fails "String#slice! with index calls to_int on index"
419
+ fails "String#slice! with index deletes and return the char at the given position"
420
+ fails "String#slice! with index raises a RuntimeError if self is frozen"
421
+ fails "String#slice! with index returns nil if idx is outside of self"
422
+ fails "String#slice! with index, length always taints resulting strings when self is tainted"
423
+ fails "String#slice! with index, length calls to_int on idx and length"
424
+ fails "String#slice! with index, length deletes and returns the substring at idx and the given length"
425
+ fails "String#slice! with index, length raises a RuntimeError if self is frozen"
426
+ fails "String#slice! with index, length returns nil if the length is negative"
427
+ fails "String#slice! with index, length returns subclass instances"
355
428
  fails "String#split with Regexp doesn't taints the resulting strings if the Regexp is tainted"
356
429
  fails "String#split with Regexp respects the encoding of the regexp when splitting between characters"
357
430
  fails "String#split with Regexp retains the encoding of the source string"
@@ -371,21 +444,16 @@ opal_filter "String" do
371
444
  fails "String#strip! raises a RuntimeError on a frozen instance that is modified"
372
445
  fails "String#strip! raises a RuntimeError on a frozen instance that would not be modified"
373
446
  fails "String#strip! returns nil if no modifications where made"
374
- fails "String#sub with pattern and block doesn't raise a RuntimeError if the string is modified while substituting"
375
- fails "String#sub with pattern and block taints the result if the original string or replacement is tainted"
376
447
  fails "String#sub with pattern and Hash ignores non-String keys"
377
448
  fails "String#sub with pattern and Hash taints the result if a hash value is tainted"
378
449
  fails "String#sub with pattern and Hash taints the result if the original string is tainted"
379
450
  fails "String#sub with pattern and Hash untrusts the result if a hash value is untrusted"
380
451
  fails "String#sub with pattern and Hash untrusts the result if the original string is untrusted"
452
+ fails "String#sub with pattern and block doesn't raise a RuntimeError if the string is modified while substituting"
453
+ fails "String#sub with pattern and block taints the result if the original string or replacement is tainted"
454
+ fails "String#sub with pattern, replacement raises a TypeError when pattern is a Symbol"
381
455
  fails "String#sub with pattern, replacement supports \\G which matches at the beginning of the string"
382
456
  fails "String#sub with pattern, replacement taints the result if the original string or replacement is tainted"
383
- fails "String#sub! with pattern and block modifies self in place and returns self"
384
- fails "String#sub! with pattern and block raises a RuntimeError if the string is modified while substituting"
385
- fails "String#sub! with pattern and block raises a RuntimeError when self is frozen"
386
- fails "String#sub! with pattern and block returns nil if no modifications were made"
387
- fails "String#sub! with pattern and block sets $~ for access from the block"
388
- fails "String#sub! with pattern and block taints self if block's result is tainted"
389
457
  fails "String#sub! with pattern and Hash coerces the hash values with #to_s"
390
458
  fails "String#sub! with pattern and Hash doesn't interpolate special sequences like \\1 for the block's return value"
391
459
  fails "String#sub! with pattern and Hash ignores non-String keys"
@@ -399,6 +467,12 @@ opal_filter "String" do
399
467
  fails "String#sub! with pattern and Hash uses a key's value only a single time"
400
468
  fails "String#sub! with pattern and Hash uses the hash's default value for missing keys"
401
469
  fails "String#sub! with pattern and Hash uses the hash's value set from default_proc for missing keys"
470
+ fails "String#sub! with pattern and block modifies self in place and returns self"
471
+ fails "String#sub! with pattern and block raises a RuntimeError if the string is modified while substituting"
472
+ fails "String#sub! with pattern and block raises a RuntimeError when self is frozen"
473
+ fails "String#sub! with pattern and block returns nil if no modifications were made"
474
+ fails "String#sub! with pattern and block sets $~ for access from the block"
475
+ fails "String#sub! with pattern and block taints self if block's result is tainted"
402
476
  fails "String#sub! with pattern and without replacement and block raises a ArgumentError"
403
477
  fails "String#sub! with pattern, replacement modifies self in place and returns self"
404
478
  fails "String#sub! with pattern, replacement raises a RuntimeError when self is frozen"
@@ -464,74 +538,9 @@ opal_filter "String" do
464
538
  fails "String#upcase! raises a RuntimeError when self is frozen"
465
539
  fails "String#upcase! returns nil if no modifications were made"
466
540
  fails "String#upto does not work with symbols"
467
- fails "String#[] with index, length always taints resulting strings when self is tainted"
468
- fails "String#[] with Range always taints resulting strings when self is tainted"
469
- fails "String#[] with Regexp, index always taints resulting strings when self or regexp is tainted"
470
- fails "String#[] with String taints resulting strings when other is tainted"
471
- fails "String#[] with Symbol raises TypeError"
472
- fails "String#[]= with a Range index raises a RangeError if negative Range begin is out of range"
473
- fails "String#[]= with a Range index raises a RangeError if positive Range begin is greater than String size"
474
- fails "String#[]= with a Range index replaces a partial string"
475
- fails "String#[]= with a Range index replaces the contents with a longer String"
476
- fails "String#[]= with a Range index replaces the contents with a shorter String"
477
- fails "String#[]= with a Range index treats a negative out-of-range Range end with a negative Range begin as a zero count"
478
- fails "String#[]= with a Range index treats a negative out-of-range Range end with a positive Range begin as a zero count"
479
- fails "String#[]= with a Range index uses the Range end as an index rather than a count"
480
- fails "String#[]= with a Range index with an empty replacement does not replace a character with a zero exclude-end range"
481
- fails "String#[]= with a Range index with an empty replacement does not replace a character with a zero-index, zero exclude-end range"
482
- fails "String#[]= with a Range index with an empty replacement replaces a character with a zero non-exclude-end range"
483
- fails "String#[]= with a Range index with an empty replacement replaces a character with zero-index, zero non-exclude-end range"
484
- fails "String#[]= with a Regexp index calls #to_str to convert the replacement"
485
- fails "String#[]= with a Regexp index checks the match before calling #to_str to convert the replacement"
486
- fails "String#[]= with a Regexp index raises IndexError if the regexp index doesn't match a position in the string"
487
- fails "String#[]= with a Regexp index replaces the matched text with the rhs"
488
- fails "String#[]= with a Regexp index with 3 arguments allows the specified capture to be negative and count from the end"
489
- fails "String#[]= with a Regexp index with 3 arguments calls #to_int to convert the second object"
490
- fails "String#[]= with a Regexp index with 3 arguments checks the match index before calling #to_str to convert the replacement"
491
- fails "String#[]= with a Regexp index with 3 arguments raises a TypeError if #to_int does not return a Fixnum"
492
- fails "String#[]= with a Regexp index with 3 arguments raises IndexError if the specified capture isn't available"
493
- fails "String#[]= with a Regexp index with 3 arguments uses the 2nd of 3 arguments as which capture should be replaced"
494
- fails "String#[]= with a Regexp index with 3 arguments when the optional capture does not match raises an IndexError before setting the replacement"
495
- fails "String#[]= with Fixnum index allows assignment to the zero'th element of an empty String"
496
- fails "String#[]= with Fixnum index calls #to_str to convert other to a String"
497
- fails "String#[]= with Fixnum index calls to_int on index"
498
- fails "String#[]= with Fixnum index raises a RuntimeError when self is frozen"
499
- fails "String#[]= with Fixnum index raises a TypeError if other_str can't be converted to a String"
500
- fails "String#[]= with Fixnum index raises an IndexError without changing self if idx is outside of self"
501
- fails "String#[]= with Fixnum index raises IndexError if the string index doesn't match a position in the string"
502
- fails "String#[]= with Fixnum index replaces the char at idx with other_str"
503
- fails "String#[]= with Fixnum index taints self if other_str is tainted"
504
- fails "String#[]= with Fixnum index, count appends other_str to the end of the string if idx == the length of the string"
505
- fails "String#[]= with Fixnum index, count calls #to_int to convert the index and count objects"
506
- fails "String#[]= with Fixnum index, count calls #to_str to convert the replacement object"
507
- fails "String#[]= with Fixnum index, count counts negative idx values from end of the string"
508
- fails "String#[]= with Fixnum index, count deletes characters if other_str is an empty string"
509
- fails "String#[]= with Fixnum index, count deletes characters up to the maximum length of the existing string"
510
- fails "String#[]= with Fixnum index, count overwrites and deletes characters if count is more than the length of other_str"
511
- fails "String#[]= with Fixnum index, count raises a TypeError if #to_int for count does not return an Integer"
512
- fails "String#[]= with Fixnum index, count raises a TypeError if #to_int for index does not return an Integer"
513
- fails "String#[]= with Fixnum index, count raises a TypeError if other_str is a type other than String"
514
- fails "String#[]= with Fixnum index, count raises a TypeError of #to_str does not return a String"
515
- fails "String#[]= with Fixnum index, count raises an IndexError if count < 0"
516
- fails "String#[]= with Fixnum index, count raises an IndexError if |idx| is greater than the length of the string"
517
- fails "String#[]= with Fixnum index, count starts at idx and overwrites count characters before inserting the rest of other_str"
518
- fails "String#[]= with Fixnum index, count taints self if other_str is tainted"
519
- fails "String#[]= with String index raises an IndexError if the search String is not found"
520
- fails "String#[]= with String index replaces characters with no characters"
521
- fails "String#[]= with String index replaces fewer characters with more characters"
522
- fails "String#[]= with String index replaces more characters with fewer characters"
523
541
  fails "String.allocate returns a binary String"
524
542
  fails "String.allocate returns a fully-formed String"
525
543
  fails "String.new returns a binary String"
526
544
  fails "String.new returns a fully-formed String"
527
545
  fails "String.new returns a new string given a string argument"
528
- fails "Ruby character strings taints the result of interpolation when an interpolated value is tainted"
529
- fails "Ruby character strings untrusts the result of interpolation when an interpolated value is untrusted"
530
- fails "Ruby character strings backslashes follow the same rules as interpolation"
531
- fails "Ruby character strings are produced from control character shortcuts"
532
- fails "Ruby character strings Unicode escaping can be done with \\u{} and one to six hex digits"
533
- fails "Ruby character strings Unicode escaping with US-ASCII source encoding produces an ASCII string when escaping ASCII characters via \\u"
534
- fails "Ruby character strings Unicode escaping with US-ASCII source encoding produces an ASCII string when escaping ASCII characters via \\u{}"
535
- fails "Ruby character strings Unicode escaping with US-ASCII source encoding produces a UTF-8-encoded string when escaping non-ASCII characters via \\u"
536
- fails "Ruby character strings Unicode escaping with US-ASCII source encoding produces a UTF-8-encoded string when escaping non-ASCII characters via \\u{}"
537
546
  end
@@ -1,4 +1,4 @@
1
- opal_filter "Struct" do
1
+ opal_unsupported_filter "Struct" do
2
2
  fails "Struct#initialize is private"
3
3
  fails "Struct.new does not create a constant with symbol as first argument"
4
4
  fails "Struct.new fails with invalid constant name as first argument" # this invalid name gets interpreted as a struct member
@@ -1,4 +1,4 @@
1
- opal_filter "Symbol" do
1
+ opal_unsupported_filter "Symbol" do
2
2
  fails "Numeric#coerce raises a TypeError when passed a Symbol"
3
3
  fails "Fixnum#coerce raises a TypeError when given an Object that does not respond to #to_f"
4
4
  fails "Symbol#to_proc produces a proc that always returns [[:rest]] for #parameters"
@@ -16,4 +16,5 @@ opal_filter "Symbol" do
16
16
  fails "Marshal.dump with a Symbol dumps an encoded Symbol"
17
17
  fails "Marshal.dump with a Symbol dumps a binary encoded Symbol"
18
18
  fails "Marshal.dump with an Array dumps a non-empty Array" # this particular spec dumps a Symbol, spec with String instead of Symbol is in spec/opal/
19
+ fails "Hash literal raises a TypeError if any splatted elements keys are not symbols"
19
20
  end
@@ -1,15 +1,30 @@
1
- opal_filter "taint" do
1
+ opal_unsupported_filter "taint" do
2
2
  fails "Hash#reject with extra state does not taint the resulting hash"
3
-
4
- fails "String#% doesn't taint the result for %e when argument is tainted"
3
+ fails "Kernel#inspect returns a tainted string if self is tainted"
4
+ fails "Module#append_features copies own tainted status to the given module"
5
+ fails "Module#append_features copies own untrusted status to the given module"
6
+ fails "Module#extend_object does not copy own tainted status to the given object"
7
+ fails "Module#extend_object does not copy own untrusted status to the given object"
8
+ fails "Module#prepend_features copies own tainted status to the given module"
9
+ fails "Module#prepend_features copies own untrusted status to the given module"
5
10
  fails "String#% doesn't taint the result for %E when argument is tainted"
11
+ fails "String#% doesn't taint the result for %G when argument is tainted"
12
+ fails "String#% doesn't taint the result for %e when argument is tainted"
6
13
  fails "String#% doesn't taint the result for %f when argument is tainted"
7
14
  fails "String#% doesn't taint the result for %g when argument is tainted"
8
- fails "String#% doesn't taint the result for %G when argument is tainted"
9
- fails "String#byteslice with index, length always taints resulting strings when self is tainted"
15
+ fails "String#[] with Regexp always taints resulting strings when self or regexp is tainted"
16
+ fails "String#[] with Regexp returns an untrusted string if the regexp is untrusted"
10
17
  fails "String#byteslice with Range always taints resulting strings when self is tainted"
11
-
12
- fails "StringScanner#pre_match taints the returned String if the input was tainted"
18
+ fails "String#byteslice with index, length always taints resulting strings when self is tainted"
19
+ fails "String#dump taints the result if self is tainted"
20
+ fails "String#slice with Regexp always taints resulting strings when self or regexp is tainted"
21
+ fails "String#slice with Regexp returns an untrusted string if the regexp is untrusted"
22
+ fails "StringScanner#getbyte taints the returned String if the input was tainted"
23
+ fails "StringScanner#getch taints the returned String if the input was tainted"
24
+ fails "StringScanner#matched taints the returned String if the input was tainted"
25
+ fails "StringScanner#peek taints the returned String if the input was tainted"
26
+ fails "StringScanner#peep taints the returned String if the input was tainted"
13
27
  fails "StringScanner#post_match taints the returned String if the input was tainted"
28
+ fails "StringScanner#pre_match taints the returned String if the input was tainted"
14
29
  fails "StringScanner#rest taints the returned String if the input was tainted"
15
30
  end
@@ -1,4 +1,4 @@
1
- opal_filter "Thread" do
1
+ opal_unsupported_filter "Thread" do
2
2
  fails "StandardError is a superclass of ThreadError"
3
3
  fails "The throw keyword raises an ArgumentError if used to exit a thread"
4
4
  fails "The throw keyword clears the current exception"
@@ -1,4 +1,4 @@
1
- opal_filter "Time" do
1
+ opal_unsupported_filter "Time" do
2
2
  fails "Time#+ accepts arguments that can be coerced into Rational"
3
3
  fails "Time#+ adds a negative Float"
4
4
  fails "Time#+ increments the time by the specified amount as rational numbers"
@@ -69,4 +69,21 @@ describe Opal::Builder do
69
69
  expect(builder.to_s).to start_with('(function(undefined)')
70
70
  end
71
71
  end
72
+
73
+ it 'defaults config from Opal::Config' do
74
+ Opal::Config.arity_check_enabled = false
75
+ expect(Opal::Config.arity_check_enabled).to eq(false)
76
+ expect(Opal::Config.compiler_options[:arity_check]).to eq(false)
77
+ builder = described_class.new
78
+ builder.build_str('def foo; end', 'foo')
79
+ expect(builder.to_s).not_to include('TMP_foo_1.$$parameters = []')
80
+
81
+ Opal::Config.arity_check_enabled = true
82
+ expect(Opal::Config.arity_check_enabled).to eq(true)
83
+ expect(Opal::Config.compiler_options[:arity_check]).to eq(true)
84
+ builder = described_class.new
85
+ builder.build_str('def foo; end', 'foo')
86
+ expect(builder.to_s).to include('TMP_foo_1.$$parameters = []')
87
+ end
88
+
72
89
  end
@@ -3,9 +3,9 @@ require 'opal/cli_runners/phantomjs'
3
3
  require 'stringio'
4
4
 
5
5
  describe Opal::CliRunners::Phantomjs do
6
- # FIXME: Unfotunately there are some issues on jruby and 1.9.3, probably
6
+ # FIXME: Unfotunately there are some issues on 1.9.3, probably
7
7
  # related to IO.pipe and process spawning in general.
8
- before { pending if RUBY_PLATFORM == 'java' or RUBY_VERSION == '1.9.3' }
8
+ before { pending if RUBY_VERSION == '1.9.3' }
9
9
 
10
10
  it 'accepts arguments' do
11
11
  expect(output_of(%{
data/spec/lib/cli_spec.rb CHANGED
@@ -30,7 +30,7 @@ describe Opal::CLI do
30
30
  expect { subject.run }.to raise_error(ArgumentError)
31
31
  end
32
32
 
33
- context 'with lib_only: true' do
33
+ context 'with lib_only: true and opal require' do
34
34
  let(:options) { super().merge lib_only: true }
35
35
 
36
36
  it 'does not raise an error' do
@@ -89,10 +89,16 @@ describe Opal::CLI do
89
89
  end
90
90
 
91
91
  context 'when true' do
92
- let(:options) { {lib_only: true, compile: true, skip_opal_require: true, no_exit: true} }
92
+ let(:options) { {lib_only: true, compile: true, no_exit: true} }
93
+ it 'appends code block at the end of the source' do
94
+ expect_output_of{ subject.run }.not_to eq("\n")
95
+ end
93
96
 
94
- it 'does not append code block at the end of the source' do
95
- expect_output_of{ subject.run }.to eq("\n")
97
+ context 'without any require' do
98
+ let(:options) { {lib_only: true, compile: true, skip_opal_require: true, no_exit: true} }
99
+ it 'raises ArgumentError' do
100
+ expect{subject.run}.to raise_error(ArgumentError)
101
+ end
96
102
  end
97
103
  end
98
104
  end
@@ -123,7 +129,7 @@ describe Opal::CLI do
123
129
  let(:options) { {:gems => [gem_name], :evals => ['']} }
124
130
 
125
131
  it "adds the gem's lib paths to Opal.path" do
126
- builder = cli.build
132
+ builder = cli.builder
127
133
 
128
134
  spec = Gem::Specification.find_by_name(gem_name)
129
135
  spec.require_paths.each do |require_path|
@@ -176,21 +182,44 @@ describe Opal::CLI do
176
182
  describe ':sexp option' do
177
183
  let(:options) { {evals: ['puts 4'], sexp: true} }
178
184
  it 'prints syntax expressions for the given code' do
179
- expect_output_of{ subject.run }.to eq("(:call, nil, :puts, (:arglist, (:int, 4)))\n")
185
+ expect_output_of{ subject.run }.to eq("s(:send, nil, :puts,\n s(:int, 4))\n")
180
186
  end
181
187
  end
182
188
 
183
189
  describe ':map option' do
184
- let(:options) { {:map => true, :evals => ['foo']} }
190
+ let(:map_path) { "#{Dir.mktmpdir 'opal-map'}/file.map" }
191
+ let(:options) { {map: map_path, evals: ['123']} }
185
192
 
186
193
  it 'sets the verbose flag (currently unused)' do
187
- expect_output_of{ subject.run }.to include(%{"version"=>3})
194
+ expect_output_of{ subject.run }.to eq('')
195
+ expect(File.read(map_path)).to include(%{"version":3})
188
196
  end
189
197
  end
190
198
 
199
+ describe ':parse_comments option' do
200
+ let(:code) do
201
+ <<-CODE
202
+ # multiline
203
+ # comment
204
+ def m
205
+ end
206
+ CODE
207
+ end
208
+ let(:options) { { parse_comments: true, evals: [code], compile: true } }
191
209
 
210
+ it 'sets $$comment prop for compiled methods' do
211
+ expect_output_of { subject.run }.to include('$$comments = ["# multiline", "# comment"]')
212
+ end
213
+ end
192
214
 
215
+ describe ':enable_source_location' do
216
+ let(:file) { File.expand_path('../fixtures/source_location_test.rb', __FILE__) }
217
+ let(:options) { { enable_source_location: true, compile: true, file: File.open(file) } }
193
218
 
219
+ it 'sets $$source_location prop for compiled methods' do
220
+ expect_output_of { subject.run }.to include("source_location_test.rb', 6]")
221
+ end
222
+ end
194
223
 
195
224
  private
196
225