opal-cj 0.7.0.beta1
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.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.gitmodules +27 -0
- data/.rspec +3 -0
- data/.spectator +2 -0
- data/.spectator-mspec +3 -0
- data/.travis.yml +45 -0
- data/CHANGELOG.md +406 -0
- data/CONTRIBUTING.md +41 -0
- data/Gemfile +27 -0
- data/Guardfile +77 -0
- data/LICENSE +19 -0
- data/README.md +178 -0
- data/Rakefile +116 -0
- data/benchmarks/operators.rb +11 -0
- data/bin/opal +22 -0
- data/bin/opal-build +77 -0
- data/bin/opal-mspec +10 -0
- data/bin/opal-repl +72 -0
- data/config.ru +14 -0
- data/examples/rack/Gemfile +3 -0
- data/examples/rack/app/application.rb +13 -0
- data/examples/rack/app/user.rb +21 -0
- data/examples/rack/config.ru +7 -0
- data/examples/rack/index.html.erb +10 -0
- data/examples/sinatra/Gemfile +4 -0
- data/examples/sinatra/app/application.rb +7 -0
- data/examples/sinatra/config.ru +28 -0
- data/lib/mspec/opal/main.rb.erb +9 -0
- data/lib/mspec/opal/rake_task.rb +278 -0
- data/lib/mspec/opal/runner.rb +206 -0
- data/lib/mspec/opal/sprockets.js +57 -0
- data/lib/opal.rb +11 -0
- data/lib/opal/builder.rb +135 -0
- data/lib/opal/builder_processors.rb +165 -0
- data/lib/opal/cli.rb +145 -0
- data/lib/opal/cli_options.rb +149 -0
- data/lib/opal/cli_runners.rb +10 -0
- data/lib/opal/cli_runners/nodejs.rb +56 -0
- data/lib/opal/cli_runners/phantom.js +35 -0
- data/lib/opal/cli_runners/phantomjs.rb +28 -0
- data/lib/opal/cli_runners/server.rb +54 -0
- data/lib/opal/compiler.rb +307 -0
- data/lib/opal/erb.rb +64 -0
- data/lib/opal/fragment.rb +41 -0
- data/lib/opal/hike_path_finder.rb +18 -0
- data/lib/opal/nodes.rb +26 -0
- data/lib/opal/nodes/arglist.rb +56 -0
- data/lib/opal/nodes/array.rb +54 -0
- data/lib/opal/nodes/base.rb +151 -0
- data/lib/opal/nodes/call.rb +283 -0
- data/lib/opal/nodes/call_special.rb +178 -0
- data/lib/opal/nodes/case.rb +96 -0
- data/lib/opal/nodes/class.rb +42 -0
- data/lib/opal/nodes/constants.rb +78 -0
- data/lib/opal/nodes/def.rb +157 -0
- data/lib/opal/nodes/defined.rb +113 -0
- data/lib/opal/nodes/definitions.rb +168 -0
- data/lib/opal/nodes/for.rb +35 -0
- data/lib/opal/nodes/hash.rb +67 -0
- data/lib/opal/nodes/helpers.rb +114 -0
- data/lib/opal/nodes/if.rb +67 -0
- data/lib/opal/nodes/iter.rb +131 -0
- data/lib/opal/nodes/literal.rb +230 -0
- data/lib/opal/nodes/logic.rb +217 -0
- data/lib/opal/nodes/masgn.rb +62 -0
- data/lib/opal/nodes/module.rb +46 -0
- data/lib/opal/nodes/rescue.rb +135 -0
- data/lib/opal/nodes/runtime_helpers.rb +45 -0
- data/lib/opal/nodes/scope.rb +293 -0
- data/lib/opal/nodes/singleton_class.rb +25 -0
- data/lib/opal/nodes/super.rb +97 -0
- data/lib/opal/nodes/top.rb +101 -0
- data/lib/opal/nodes/variables.rb +158 -0
- data/lib/opal/nodes/while.rb +65 -0
- data/lib/opal/nodes/yield.rb +95 -0
- data/lib/opal/parser.rb +658 -0
- data/lib/opal/parser/grammar.rb +5452 -0
- data/lib/opal/parser/grammar.y +1684 -0
- data/lib/opal/parser/keywords.rb +66 -0
- data/lib/opal/parser/lexer.rb +1208 -0
- data/lib/opal/parser/parser_scope.rb +25 -0
- data/lib/opal/parser/sexp.rb +75 -0
- data/lib/opal/path_reader.rb +28 -0
- data/lib/opal/paths.rb +38 -0
- data/lib/opal/source_map.rb +70 -0
- data/lib/opal/sprockets.rb +4 -0
- data/lib/opal/sprockets/cache_key_fix.rb +17 -0
- data/lib/opal/sprockets/environment.rb +37 -0
- data/lib/opal/sprockets/erb.rb +37 -0
- data/lib/opal/sprockets/path_reader.rb +34 -0
- data/lib/opal/sprockets/processor.rb +124 -0
- data/lib/opal/sprockets/server.rb +180 -0
- data/lib/opal/util.rb +64 -0
- data/lib/opal/version.rb +3 -0
- data/opal.gemspec +36 -0
- data/opal/README.md +6 -0
- data/opal/corelib/array.rb +1556 -0
- data/opal/corelib/array/inheritance.rb +113 -0
- data/opal/corelib/basic_object.rb +73 -0
- data/opal/corelib/boolean.rb +41 -0
- data/opal/corelib/class.rb +55 -0
- data/opal/corelib/comparable.rb +56 -0
- data/opal/corelib/complex.rb +3 -0
- data/opal/corelib/dir.rb +20 -0
- data/opal/corelib/enumerable.rb +1132 -0
- data/opal/corelib/enumerator.rb +422 -0
- data/opal/corelib/error.rb +63 -0
- data/opal/corelib/file.rb +56 -0
- data/opal/corelib/hash.rb +728 -0
- data/opal/corelib/helpers.rb +102 -0
- data/opal/corelib/io.rb +59 -0
- data/opal/corelib/kernel.rb +569 -0
- data/opal/corelib/main.rb +7 -0
- data/opal/corelib/match_data.rb +114 -0
- data/opal/corelib/method.rb +58 -0
- data/opal/corelib/module.rb +462 -0
- data/opal/corelib/nil_class.rb +62 -0
- data/opal/corelib/numeric.rb +532 -0
- data/opal/corelib/proc.rb +52 -0
- data/opal/corelib/range.rb +116 -0
- data/opal/corelib/rational.rb +3 -0
- data/opal/corelib/regexp.rb +133 -0
- data/opal/corelib/runtime.js +1240 -0
- data/opal/corelib/string.rb +1212 -0
- data/opal/corelib/string/inheritance.rb +78 -0
- data/opal/corelib/struct.rb +141 -0
- data/opal/corelib/time.rb +584 -0
- data/opal/corelib/variables.rb +24 -0
- data/opal/opal.rb +32 -0
- data/package.json +9 -0
- data/spec/filters/bugs/array.rb +232 -0
- data/spec/filters/bugs/basic_object.rb +14 -0
- data/spec/filters/bugs/class.rb +21 -0
- data/spec/filters/bugs/enumerable.rb +69 -0
- data/spec/filters/bugs/enumerator.rb +3 -0
- data/spec/filters/bugs/hash.rb +128 -0
- data/spec/filters/bugs/kernel.rb +10 -0
- data/spec/filters/bugs/language.rb +415 -0
- data/spec/filters/bugs/math.rb +95 -0
- data/spec/filters/bugs/module.rb +14 -0
- data/spec/filters/bugs/nil.rb +7 -0
- data/spec/filters/bugs/numeric.rb +20 -0
- data/spec/filters/bugs/opal.rb +14 -0
- data/spec/filters/bugs/regexp.rb +11 -0
- data/spec/filters/bugs/set.rb +7 -0
- data/spec/filters/bugs/singleton.rb +6 -0
- data/spec/filters/bugs/string.rb +360 -0
- data/spec/filters/bugs/stringscanner.rb +22 -0
- data/spec/filters/bugs/struct.rb +45 -0
- data/spec/filters/bugs/time.rb +177 -0
- data/spec/filters/bugs/unknown.rb +11 -0
- data/spec/filters/unsupported/encoding.rb +95 -0
- data/spec/filters/unsupported/enumerator.rb +14 -0
- data/spec/filters/unsupported/float.rb +5 -0
- data/spec/filters/unsupported/frozen.rb +90 -0
- data/spec/filters/unsupported/hash_compare_by_identity.rb +16 -0
- data/spec/filters/unsupported/integer_size.rb +7 -0
- data/spec/filters/unsupported/method_added.rb +10 -0
- data/spec/filters/unsupported/mutable_strings.rb +361 -0
- data/spec/filters/unsupported/private_constants.rb +30 -0
- data/spec/filters/unsupported/private_methods.rb +44 -0
- data/spec/filters/unsupported/random.rb +4 -0
- data/spec/filters/unsupported/ruby_exe.rb +5 -0
- data/spec/filters/unsupported/tainted.rb +155 -0
- data/spec/filters/unsupported/time.rb +21 -0
- data/spec/filters/unsupported/trusted.rb +80 -0
- data/spec/lib/builder_processors_spec.rb +27 -0
- data/spec/lib/builder_spec.rb +66 -0
- data/spec/lib/cli_spec.rb +134 -0
- data/spec/lib/compiler_spec.rb +197 -0
- data/spec/lib/dependency_resolver_spec.rb +40 -0
- data/spec/lib/fixtures/no_requires.rb +1 -0
- data/spec/lib/fixtures/opal_file.rb +2 -0
- data/spec/lib/fixtures/require_tree_test.rb +3 -0
- data/spec/lib/fixtures/required_tree_test/required_file1.rb +1 -0
- data/spec/lib/fixtures/required_tree_test/required_file2.rb +1 -0
- data/spec/lib/fixtures/requires.rb +7 -0
- data/spec/lib/fixtures/sprockets_file.js.rb +3 -0
- data/spec/lib/fixtures/sprockets_require_tree_test.rb +3 -0
- data/spec/lib/hike_path_finder_spec.rb +23 -0
- data/spec/lib/lexer_spec.rb +110 -0
- data/spec/lib/parser/alias_spec.rb +26 -0
- data/spec/lib/parser/and_spec.rb +13 -0
- data/spec/lib/parser/attrasgn_spec.rb +28 -0
- data/spec/lib/parser/begin_spec.rb +42 -0
- data/spec/lib/parser/block_spec.rb +12 -0
- data/spec/lib/parser/break_spec.rb +17 -0
- data/spec/lib/parser/call_spec.rb +139 -0
- data/spec/lib/parser/class_spec.rb +35 -0
- data/spec/lib/parser/comments_spec.rb +11 -0
- data/spec/lib/parser/def_spec.rb +61 -0
- data/spec/lib/parser/if_spec.rb +26 -0
- data/spec/lib/parser/iter_spec.rb +59 -0
- data/spec/lib/parser/lambda_spec.rb +64 -0
- data/spec/lib/parser/literal_spec.rb +118 -0
- data/spec/lib/parser/masgn_spec.rb +37 -0
- data/spec/lib/parser/module_spec.rb +27 -0
- data/spec/lib/parser/not_spec.rb +27 -0
- data/spec/lib/parser/op_asgn1_spec.rb +23 -0
- data/spec/lib/parser/op_asgn2_spec.rb +23 -0
- data/spec/lib/parser/or_spec.rb +13 -0
- data/spec/lib/parser/return_spec.rb +17 -0
- data/spec/lib/parser/sclass_spec.rb +21 -0
- data/spec/lib/parser/string_spec.rb +276 -0
- data/spec/lib/parser/super_spec.rb +20 -0
- data/spec/lib/parser/unary_spec.rb +48 -0
- data/spec/lib/parser/undef_spec.rb +15 -0
- data/spec/lib/parser/unless_spec.rb +13 -0
- data/spec/lib/parser/variables_spec.rb +92 -0
- data/spec/lib/parser/while_spec.rb +15 -0
- data/spec/lib/parser/yield_spec.rb +20 -0
- data/spec/lib/path_reader_spec.rb +24 -0
- data/spec/lib/shared/path_finder_shared.rb +19 -0
- data/spec/lib/shared/path_reader_shared.rb +31 -0
- data/spec/lib/spec_helper.rb +9 -0
- data/spec/lib/sprockets/environment_spec.rb +30 -0
- data/spec/lib/sprockets/erb_spec.rb +25 -0
- data/spec/lib/sprockets/path_reader_spec.rb +25 -0
- data/spec/lib/sprockets/processor_spec.rb +35 -0
- data/spec/lib/sprockets/server_spec.rb +20 -0
- data/spec/opal/compiler/irb_spec.rb +44 -0
- data/spec/opal/core/array/select_spec.rb +14 -0
- data/spec/opal/core/array/set_range_to_array_spec.rb +7 -0
- data/spec/opal/core/date_spec.rb +122 -0
- data/spec/opal/core/enumerable/all_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/any_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/collect_break_spec.rb +13 -0
- data/spec/opal/core/enumerable/count_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/detect_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/drop_while_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/each_slice_break.rb +6 -0
- data/spec/opal/core/enumerable/each_with_index_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/each_with_object_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/find_all_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/find_index_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/grep_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/max_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/max_by_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/min_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/min_by_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/none_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/one_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/reduce_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/take_while_break_spec.rb +5 -0
- data/spec/opal/core/fixtures/class.rb +124 -0
- data/spec/opal/core/fixtures/class_variables.rb +0 -0
- data/spec/opal/core/fixtures/constants.rb +33 -0
- data/spec/opal/core/fixtures/require_tree_files/file 1.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/file 2.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/file 3.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/file 4.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/file 5.rb +1 -0
- data/spec/opal/core/kernel/Array_spec.rb +10 -0
- data/spec/opal/core/kernel/block_given_spec.rb +30 -0
- data/spec/opal/core/kernel/class_spec.rb +6 -0
- data/spec/opal/core/kernel/define_singleton_method_spec.rb +21 -0
- data/spec/opal/core/kernel/equal_value_spec.rb +12 -0
- data/spec/opal/core/kernel/extend_spec.rb +21 -0
- data/spec/opal/core/kernel/format_spec.rb +122 -0
- data/spec/opal/core/kernel/freeze_spec.rb +15 -0
- data/spec/opal/core/kernel/instance_eval_spec.rb +28 -0
- data/spec/opal/core/kernel/instance_variable_defined_spec.rb +15 -0
- data/spec/opal/core/kernel/instance_variable_get_spec.rb +14 -0
- data/spec/opal/core/kernel/instance_variable_set_spec.rb +10 -0
- data/spec/opal/core/kernel/loop_spec.rb +23 -0
- data/spec/opal/core/kernel/match_spec.rb +5 -0
- data/spec/opal/core/kernel/method_spec.rb +31 -0
- data/spec/opal/core/kernel/methods_spec.rb +25 -0
- data/spec/opal/core/kernel/nil_spec.rb +7 -0
- data/spec/opal/core/kernel/p_spec.rb +15 -0
- data/spec/opal/core/kernel/printf_spec.rb +11 -0
- data/spec/opal/core/kernel/proc_spec.rb +13 -0
- data/spec/opal/core/kernel/rand_spec.rb +23 -0
- data/spec/opal/core/kernel/require_tree_spec.rb +7 -0
- data/spec/opal/core/kernel/respond_to_spec.rb +41 -0
- data/spec/opal/core/kernel/send_spec.rb +56 -0
- data/spec/opal/core/kernel/sprintf_spec.rb +5 -0
- data/spec/opal/core/language/block_spec.rb +538 -0
- data/spec/opal/core/language/fixtures/array.rb +11 -0
- data/spec/opal/core/language/fixtures/block.rb +57 -0
- data/spec/opal/core/language/fixtures/break.rb +240 -0
- data/spec/opal/core/language/fixtures/ensure.rb +72 -0
- data/spec/opal/core/language/fixtures/literal_lambda.rb +7 -0
- data/spec/opal/core/language/fixtures/metaclass.rb +33 -0
- data/spec/opal/core/language/fixtures/module.rb +24 -0
- data/spec/opal/core/language/fixtures/next.rb +128 -0
- data/spec/opal/core/language/fixtures/return.rb +118 -0
- data/spec/opal/core/language/fixtures/send.rb +110 -0
- data/spec/opal/core/language/fixtures/send_1.9.rb +22 -0
- data/spec/opal/core/language/fixtures/super.rb +308 -0
- data/spec/opal/core/language/fixtures/variables.rb +58 -0
- data/spec/opal/core/language/fixtures/yield.rb +28 -0
- data/spec/opal/core/language/predefined_spec.rb +85 -0
- data/spec/opal/core/language/proc_spec.rb +263 -0
- data/spec/opal/core/language/regexp_spec.rb +20 -0
- data/spec/opal/core/language/send_spec.rb +225 -0
- data/spec/opal/core/language/string_spec.rb +44 -0
- data/spec/opal/core/language/symbol_spec.rb +40 -0
- data/spec/opal/core/language/variables_spec.rb +1366 -0
- data/spec/opal/core/language/versions/array_1.9.rb +39 -0
- data/spec/opal/core/language/versions/block_1.9.rb +0 -0
- data/spec/opal/core/language/versions/break_1.9.rb +0 -0
- data/spec/opal/core/language/versions/case_1.9.rb +20 -0
- data/spec/opal/core/language/versions/hash_1.9.rb +18 -0
- data/spec/opal/core/language/versions/literal_lambda_1.9.rb +143 -0
- data/spec/opal/core/language/versions/not_1.9.rb +22 -0
- data/spec/opal/core/language/versions/send_1.9.rb +241 -0
- data/spec/opal/core/language/versions/symbol_1.9.rb +15 -0
- data/spec/opal/core/language/versions/variables_1.9.rb +8 -0
- data/spec/opal/core/module/alias_method_spec.rb +28 -0
- data/spec/opal/core/module/ancestors_spec.rb +11 -0
- data/spec/opal/core/module/append_features_spec.rb +14 -0
- data/spec/opal/core/module/attr_accessor_spec.rb +26 -0
- data/spec/opal/core/module/const_defined_spec.rb +85 -0
- data/spec/opal/core/module/const_get_spec.rb +85 -0
- data/spec/opal/core/module/const_missing_spec.rb +17 -0
- data/spec/opal/core/module/const_set_spec.rb +64 -0
- data/spec/opal/core/module/constants_spec.rb +49 -0
- data/spec/opal/core/module/fixtures/classes.rb +434 -0
- data/spec/opal/core/module/method_defined_spec.rb +48 -0
- data/spec/opal/core/module/module_function_spec.rb +25 -0
- data/spec/opal/core/module/name_spec.rb +52 -0
- data/spec/opal/core/module/public_method_defined_spec.rb +18 -0
- data/spec/opal/core/module/remove_const_spec.rb +22 -0
- data/spec/opal/core/module/undef_method_spec.rb +66 -0
- data/spec/opal/core/numeric/bit_and_spec.rb +7 -0
- data/spec/opal/core/numeric/bit_or_spec.rb +8 -0
- data/spec/opal/core/numeric/bit_xor_spec.rb +6 -0
- data/spec/opal/core/numeric/ceil_spec.rb +8 -0
- data/spec/opal/core/numeric/chr_spec.rb +8 -0
- data/spec/opal/core/numeric/comparison_spec.rb +24 -0
- data/spec/opal/core/numeric/complement_spec.rb +8 -0
- data/spec/opal/core/numeric/divide_spec.rb +10 -0
- data/spec/opal/core/numeric/eql_spec.rb +9 -0
- data/spec/opal/core/numeric/exponent_spec.rb +33 -0
- data/spec/opal/core/numeric/floor_spec.rb +8 -0
- data/spec/opal/core/numeric/gt_spec.rb +11 -0
- data/spec/opal/core/numeric/gte_spec.rb +12 -0
- data/spec/opal/core/numeric/integer_spec.rb +9 -0
- data/spec/opal/core/numeric/left_shift_spec.rb +21 -0
- data/spec/opal/core/numeric/lt_spec.rb +11 -0
- data/spec/opal/core/numeric/lte_spec.rb +12 -0
- data/spec/opal/core/numeric/minus_spec.rb +8 -0
- data/spec/opal/core/numeric/modulo_spec.rb +19 -0
- data/spec/opal/core/numeric/multiply_spec.rb +9 -0
- data/spec/opal/core/numeric/next_spec.rb +9 -0
- data/spec/opal/core/numeric/ord_spec.rb +9 -0
- data/spec/opal/core/numeric/plus_spec.rb +8 -0
- data/spec/opal/core/numeric/pred_spec.rb +7 -0
- data/spec/opal/core/numeric/right_shift_spec.rb +25 -0
- data/spec/opal/core/numeric/step_spec.rb +11 -0
- data/spec/opal/core/numeric/succ_spec.rb +9 -0
- data/spec/opal/core/numeric/times_spec.rb +36 -0
- data/spec/opal/core/numeric/to_f_spec.rb +7 -0
- data/spec/opal/core/numeric/to_i_spec.rb +7 -0
- data/spec/opal/core/numeric/to_json_spec.rb +8 -0
- data/spec/opal/core/numeric/to_s_spec.rb +26 -0
- data/spec/opal/core/numeric/uminus_spec.rb +9 -0
- data/spec/opal/core/numeric/upto_spec.rb +19 -0
- data/spec/opal/core/numeric/zero_spec.rb +7 -0
- data/spec/opal/core/proc/call_spec.rb +21 -0
- data/spec/opal/core/proc/element_reference_spec.rb +21 -0
- data/spec/opal/core/proc/proc_tricks_spec.rb +7 -0
- data/spec/opal/core/runtime/begin_spec.rb +39 -0
- data/spec/opal/core/runtime/block_send_spec.rb +28 -0
- data/spec/opal/core/runtime/block_spec.rb +23 -0
- data/spec/opal/core/runtime/bridged_classes_spec.rb +64 -0
- data/spec/opal/core/runtime/constants_spec.rb +13 -0
- data/spec/opal/core/runtime/eval_spec.rb +5 -0
- data/spec/opal/core/runtime/main_methods_spec.rb +27 -0
- data/spec/opal/core/runtime/method_missing_spec.rb +62 -0
- data/spec/opal/core/runtime/method_spec.rb +31 -0
- data/spec/opal/core/runtime/operator_call_spec.rb +13 -0
- data/spec/opal/core/runtime/paren_spec.rb +14 -0
- data/spec/opal/core/runtime/rescue_spec.rb +38 -0
- data/spec/opal/core/runtime/return_spec.rb +38 -0
- data/spec/opal/core/runtime/send_spec.rb +34 -0
- data/spec/opal/core/runtime/singleton_class_spec.rb +13 -0
- data/spec/opal/core/runtime/super_spec.rb +212 -0
- data/spec/opal/core/runtime/truthy_spec.rb +23 -0
- data/spec/opal/core/runtime/variables_spec.rb +20 -0
- data/spec/opal/core/source_map_spec.rb +15 -0
- data/spec/opal/core/string_spec.rb +11 -0
- data/spec/opal/stdlib/erb/erb_spec.rb +30 -0
- data/spec/opal/stdlib/erb/inline_block.opalerb +3 -0
- data/spec/opal/stdlib/erb/quoted.opalerb +1 -0
- data/spec/opal/stdlib/erb/simple.opalerb +1 -0
- data/spec/opal/stdlib/json/ext_spec.rb +48 -0
- data/spec/opal/stdlib/json/parse_spec.rb +33 -0
- data/spec/opal/stdlib/native/alias_native_spec.rb +27 -0
- data/spec/opal/stdlib/native/each_spec.rb +13 -0
- data/spec/opal/stdlib/native/element_reference_spec.rb +16 -0
- data/spec/opal/stdlib/native/exposure_spec.rb +33 -0
- data/spec/opal/stdlib/native/ext_spec.rb +19 -0
- data/spec/opal/stdlib/native/initialize_spec.rb +17 -0
- data/spec/opal/stdlib/native/method_missing_spec.rb +51 -0
- data/spec/opal/stdlib/native/native_reader_spec.rb +22 -0
- data/spec/opal/stdlib/native/native_writer_spec.rb +30 -0
- data/spec/opal/stdlib/native/new_spec.rb +8 -0
- data/spec/opal/stdlib/promise/error_spec.rb +15 -0
- data/spec/opal/stdlib/promise/rescue_spec.rb +35 -0
- data/spec/opal/stdlib/promise/then_spec.rb +54 -0
- data/spec/opal/stdlib/promise/trace_spec.rb +35 -0
- data/spec/opal/stdlib/promise/value_spec.rb +15 -0
- data/spec/opal/stdlib/promise/when_spec.rb +34 -0
- data/spec/opal/stdlib/template/paths_spec.rb +10 -0
- data/spec/opal/stdlib/thread/mutex_spec.rb +40 -0
- data/spec/opal/stdlib/thread/thread_queue_spec.rb +32 -0
- data/spec/opal/stdlib/thread/thread_spec.rb +60 -0
- data/spec/rubyspecs +329 -0
- data/spec/spec_helper.rb +42 -0
- data/spec/support/mspec_rspec_adapter.rb +33 -0
- data/spec/support/parser_helpers.rb +37 -0
- data/stdlib/README.md +3 -0
- data/stdlib/base64.rb +152 -0
- data/stdlib/benchmark.rb +10 -0
- data/stdlib/buffer.rb +40 -0
- data/stdlib/buffer/array.rb +66 -0
- data/stdlib/buffer/view.rb +70 -0
- data/stdlib/date.rb +170 -0
- data/stdlib/delegate.rb +29 -0
- data/stdlib/dir.rb +1 -0
- data/stdlib/encoding.rb +166 -0
- data/stdlib/enumerator.rb +1 -0
- data/stdlib/erb.rb +16 -0
- data/stdlib/file.rb +1 -0
- data/stdlib/forwardable.rb +71 -0
- data/stdlib/json.rb +182 -0
- data/stdlib/math.rb +370 -0
- data/stdlib/native.rb +530 -0
- data/stdlib/nodejs.rb +5 -0
- data/stdlib/nodejs/dir.rb +13 -0
- data/stdlib/nodejs/file.rb +98 -0
- data/stdlib/nodejs/fileutils.rb +26 -0
- data/stdlib/nodejs/io.rb +2 -0
- data/stdlib/nodejs/irb.rb +45 -0
- data/stdlib/nodejs/process.rb +16 -0
- data/stdlib/nodejs/require.rb +32 -0
- data/stdlib/nodejs/rubygems.rb +68 -0
- data/stdlib/nodejs/runtime.rb +25 -0
- data/stdlib/nodejs/yaml.rb +11 -0
- data/stdlib/observer.rb +202 -0
- data/stdlib/opal-parser.rb +53 -0
- data/stdlib/opal-source-maps.rb +2 -0
- data/stdlib/ostruct.rb +69 -0
- data/stdlib/pathname.rb +31 -0
- data/stdlib/phantomjs.rb +8 -0
- data/stdlib/pp.rb +12 -0
- data/stdlib/process.rb +10 -0
- data/stdlib/promise.rb +300 -0
- data/stdlib/racc/parser.rb +215 -0
- data/stdlib/rbconfig.rb +20 -0
- data/stdlib/securerandom.rb +12 -0
- data/stdlib/set.rb +116 -0
- data/stdlib/singleton.rb +40 -0
- data/stdlib/source_map.rb +5 -0
- data/stdlib/source_map/map.rb +220 -0
- data/stdlib/source_map/mapping.rb +26 -0
- data/stdlib/source_map/offset.rb +88 -0
- data/stdlib/source_map/version.rb +3 -0
- data/stdlib/source_map/vlq.rb +98 -0
- data/stdlib/sourcemap.rb +1 -0
- data/stdlib/stringio.rb +181 -0
- data/stdlib/strscan.rb +155 -0
- data/stdlib/template.rb +46 -0
- data/stdlib/thread.rb +160 -0
- data/stdlib/time.rb +9 -0
- data/tasks/github.rake +19 -0
- metadata +690 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# regexp matches
|
|
2
|
+
$& = $~ = $` = $' = nil
|
|
3
|
+
|
|
4
|
+
# requires
|
|
5
|
+
$LOADED_FEATURES = $" = `Opal.loaded_features`
|
|
6
|
+
$LOAD_PATH = $: = []
|
|
7
|
+
|
|
8
|
+
# split lines
|
|
9
|
+
$/ = "\n"
|
|
10
|
+
$, = nil
|
|
11
|
+
|
|
12
|
+
ARGV = []
|
|
13
|
+
ARGF = Object.new
|
|
14
|
+
ENV = {}
|
|
15
|
+
|
|
16
|
+
$VERBOSE = false
|
|
17
|
+
$DEBUG = false
|
|
18
|
+
$SAFE = 0
|
|
19
|
+
|
|
20
|
+
RUBY_PLATFORM = 'opal'
|
|
21
|
+
RUBY_ENGINE = 'opal'
|
|
22
|
+
RUBY_VERSION = '2.1.1'
|
|
23
|
+
RUBY_ENGINE_VERSION = '0.6.1'
|
|
24
|
+
RUBY_RELEASE_DATE = '2014-04-15'
|
data/opal/opal.rb
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require 'corelib/runtime'
|
|
2
|
+
require 'corelib/helpers'
|
|
3
|
+
require 'corelib/module'
|
|
4
|
+
require 'corelib/class'
|
|
5
|
+
require 'corelib/basic_object'
|
|
6
|
+
require 'corelib/kernel'
|
|
7
|
+
require 'corelib/nil_class'
|
|
8
|
+
require 'corelib/boolean'
|
|
9
|
+
require 'corelib/error'
|
|
10
|
+
require 'corelib/regexp'
|
|
11
|
+
require 'corelib/comparable'
|
|
12
|
+
require 'corelib/enumerable'
|
|
13
|
+
require 'corelib/enumerator'
|
|
14
|
+
require 'corelib/array'
|
|
15
|
+
require 'corelib/array/inheritance'
|
|
16
|
+
require 'corelib/hash'
|
|
17
|
+
require 'corelib/string'
|
|
18
|
+
require 'corelib/string/inheritance'
|
|
19
|
+
require 'corelib/match_data'
|
|
20
|
+
require 'corelib/numeric'
|
|
21
|
+
require 'corelib/complex'
|
|
22
|
+
require 'corelib/rational'
|
|
23
|
+
require 'corelib/proc'
|
|
24
|
+
require 'corelib/method'
|
|
25
|
+
require 'corelib/range'
|
|
26
|
+
require 'corelib/time'
|
|
27
|
+
require 'corelib/struct'
|
|
28
|
+
require 'corelib/io'
|
|
29
|
+
require 'corelib/main'
|
|
30
|
+
require 'corelib/variables'
|
|
31
|
+
require 'corelib/dir'
|
|
32
|
+
require 'corelib/file'
|
data/package.json
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
opal_filter "Array" do
|
|
2
|
+
fails "Array#clone copies singleton methods"
|
|
3
|
+
|
|
4
|
+
fails "Array#combination generates from a defensive copy, ignoring mutations"
|
|
5
|
+
fails "Array#combination yields a partition consisting of only singletons"
|
|
6
|
+
fails "Array#combination yields [] when length is 0"
|
|
7
|
+
fails "Array#combination yields a copy of self if the argument is the size of the receiver"
|
|
8
|
+
fails "Array#combination yields nothing if the argument is out of bounds"
|
|
9
|
+
fails "Array#combination yields the expected combinations"
|
|
10
|
+
fails "Array#combination yields nothing for out of bounds length and return self"
|
|
11
|
+
fails "Array#combination returns self when a block is given"
|
|
12
|
+
fails "Array#combination returns an enumerator when no block is provided"
|
|
13
|
+
|
|
14
|
+
fails "Array#<=> calls <=> left to right and return first non-0 result"
|
|
15
|
+
fails "Array#<=> returns -1 if the arrays have same length and a pair of corresponding elements returns -1 for <=>"
|
|
16
|
+
fails "Array#<=> returns +1 if the arrays have same length and a pair of corresponding elements returns +1 for <=>"
|
|
17
|
+
fails "Array#<=> tries to convert the passed argument to an Array using #to_ary"
|
|
18
|
+
fails "Array#<=> returns nil when the argument is not array-like"
|
|
19
|
+
|
|
20
|
+
fails "Array#delete may be given a block that is executed if no element matches object"
|
|
21
|
+
fails "Array#delete returns the last element in the array for which object is equal under #=="
|
|
22
|
+
|
|
23
|
+
fails "Array.[] can unpack 2 or more nested referenced array"
|
|
24
|
+
|
|
25
|
+
fails "Array#[]= sets elements in the range arguments when passed ranges"
|
|
26
|
+
|
|
27
|
+
fails "Array#flatten does not call flatten on elements"
|
|
28
|
+
fails "Array#flatten with a non-Array object in the Array ignores the return value of #to_ary if it is nil"
|
|
29
|
+
fails "Array#flatten with a non-Array object in the Array raises a TypeError if the return value of #to_ary is not an Array"
|
|
30
|
+
fails "Array#flatten raises a TypeError when the passed Object can't be converted to an Integer"
|
|
31
|
+
fails "Array#flatten tries to convert passed Objects to Integers using #to_int"
|
|
32
|
+
|
|
33
|
+
fails "Array#flatten! does not call flatten! on elements"
|
|
34
|
+
fails "Array#flatten! flattens any elements which responds to #to_ary, using the return value of said method"
|
|
35
|
+
fails "Array#flatten! raises a TypeError when the passed Object can't be converted to an Integer"
|
|
36
|
+
fails "Array#flatten! tries to convert passed Objects to Integers using #to_int"
|
|
37
|
+
fails "Array#flatten! should not check modification by size"
|
|
38
|
+
|
|
39
|
+
fails "Array#initialize with (size, object=nil) sets the array to the values returned by the block before break is executed"
|
|
40
|
+
fails "Array#initialize with (size, object=nil) returns the value passed to break"
|
|
41
|
+
fails "Array#initialize with (size, object=nil) uses the block value instead of using the default value"
|
|
42
|
+
fails "Array#initialize with (size, object=nil) yields the index of the element and sets the element to the value of the block"
|
|
43
|
+
fails "Array#initialize with (size, object=nil) raises a TypeError if the size argument is not an Integer type"
|
|
44
|
+
fails "Array#initialize with (size, object=nil) calls #to_int to convert the size argument to an Integer when object is not given"
|
|
45
|
+
fails "Array#initialize with (size, object=nil) calls #to_int to convert the size argument to an Integer when object is given"
|
|
46
|
+
fails "Array#initialize with (size, object=nil) raises an ArgumentError if size is too large"
|
|
47
|
+
fails "Array#initialize with (size, object=nil) sets the array to size and fills with the object"
|
|
48
|
+
fails "Array#initialize with (array) calls #to_ary to convert the value to an array"
|
|
49
|
+
fails "Array#initialize preserves the object's identity even when changing its value"
|
|
50
|
+
|
|
51
|
+
fails "Array#& determines equivalence between elements in the sense of eql?"
|
|
52
|
+
|
|
53
|
+
fails "Array#- removes an identical item even when its #eql? isn't reflexive"
|
|
54
|
+
fails "Array#- doesn't remove an item with the same hash but not #eql?"
|
|
55
|
+
fails "Array#- removes an item identified as equivalent via #hash and #eql?"
|
|
56
|
+
|
|
57
|
+
fails "Array#* raises a TypeError is the passed argument is nil"
|
|
58
|
+
fails "Array#* converts the passed argument to a String rather than an Integer"
|
|
59
|
+
fails "Array#* raises a TypeError if the argument can neither be converted to a string nor an integer"
|
|
60
|
+
fails "Array#* tires to convert the passed argument to an Integer using #to_int"
|
|
61
|
+
fails "Array#* tries to convert the passed argument to a String using #to_str"
|
|
62
|
+
fails "Array#* with a string uses the same separator with nested arrays"
|
|
63
|
+
fails "Array#* with a string returns a string formed by concatenating each element.to_str separated by separator"
|
|
64
|
+
|
|
65
|
+
fails "Array.new with (size, object=nil) raises an ArgumentError if size is too large"
|
|
66
|
+
fails "Array.new with (array) calls #to_ary to convert the value to an array"
|
|
67
|
+
fails "Array.new with (size, object=nil) calls #to_int to convert the size argument to an Integer when object is given"
|
|
68
|
+
fails "Array.new with (size, object=nil) calls #to_int to convert the size argument to an Integer when object is not given"
|
|
69
|
+
fails "Array.new with (size, object=nil) raises a TypeError if the size argument is not an Integer type"
|
|
70
|
+
|
|
71
|
+
fails "Array#permutation generates from a defensive copy, ignoring mutations"
|
|
72
|
+
fails "Array#permutation returns an Enumerator which works as expected even when the array was modified"
|
|
73
|
+
fails "Array#permutation truncates Float arguments"
|
|
74
|
+
fails "Array#permutation handles nested Arrays correctly"
|
|
75
|
+
fails "Array#permutation handles duplicate elements correctly"
|
|
76
|
+
fails "Array#permutation returns no permutations when the given length has no permutations"
|
|
77
|
+
fails "Array#permutation returns the empty permutation([]) when called on an empty Array"
|
|
78
|
+
fails "Array#permutation returns the empty permutation ([[]]) when the given length is 0"
|
|
79
|
+
fails "Array#permutation yields all permutations of given length to the block then returns self when called with block and argument"
|
|
80
|
+
fails "Array#permutation yields all permutations to the block then returns self when called with block but no arguments"
|
|
81
|
+
fails "Array#permutation returns an Enumerator of permutations of given length when called with an argument but no block"
|
|
82
|
+
fails "Array#permutation returns an Enumerator of all permutations when called without a block or arguments"
|
|
83
|
+
|
|
84
|
+
fails "Array#product when given an empty block returns self"
|
|
85
|
+
fails "Array#product when given a block will ignore unreasonable numbers of products and yield anyway"
|
|
86
|
+
fails "Array#product when given a block yields all combinations in turn"
|
|
87
|
+
fails "Array#product does not attempt to produce an unreasonable number of products"
|
|
88
|
+
fails "Array#product returns an empty array when the argument is an empty array"
|
|
89
|
+
fails "Array#product has no required argument"
|
|
90
|
+
fails "Array#product returns the expected result"
|
|
91
|
+
fails "Array#product returns converted arguments using :to_ary"
|
|
92
|
+
|
|
93
|
+
fails "Array#rassoc does not check the last element in each contained but speficically the second"
|
|
94
|
+
fails "Array#rassoc calls elem == obj on the second element of each contained array"
|
|
95
|
+
|
|
96
|
+
fails "Array#repeated_combination generates from a defensive copy, ignoring mutations"
|
|
97
|
+
fails "Array#repeated_combination accepts sizes larger than the original array"
|
|
98
|
+
fails "Array#repeated_combination yields a partition consisting of only singletons"
|
|
99
|
+
fails "Array#repeated_combination yields nothing when the array is empty and num is non zero"
|
|
100
|
+
fails "Array#repeated_combination yields [] when length is 0"
|
|
101
|
+
fails "Array#repeated_combination yields the expected repeated_combinations"
|
|
102
|
+
fails "Array#repeated_combination yields nothing for negative length and return self"
|
|
103
|
+
fails "Array#repeated_combination returns self when a block is given"
|
|
104
|
+
fails "Array#repeated_combination returns an enumerator when no block is provided"
|
|
105
|
+
|
|
106
|
+
fails "Array#repeated_permutation generates from a defensive copy, ignoring mutations"
|
|
107
|
+
fails "Array#repeated_permutation allows permutations larger than the number of elements"
|
|
108
|
+
fails "Array#repeated_permutation returns an Enumerator which works as expected even when the array was modified"
|
|
109
|
+
fails "Array#repeated_permutation truncates Float arguments"
|
|
110
|
+
fails "Array#repeated_permutation handles duplicate elements correctly"
|
|
111
|
+
fails "Array#repeated_permutation does not yield when called on an empty Array with a nonzero argument"
|
|
112
|
+
fails "Array#repeated_permutation yields the empty repeated_permutation ([[]]) when the given length is 0"
|
|
113
|
+
fails "Array#repeated_permutation yields all repeated_permutations to the block then returns self when called with block but no arguments"
|
|
114
|
+
fails "Array#repeated_permutation returns an Enumerator of all repeated permutations of given length when called without a block"
|
|
115
|
+
|
|
116
|
+
fails "Array#rindex rechecks the array size during iteration"
|
|
117
|
+
|
|
118
|
+
fails "Array#rotate! with an argument n raises a TypeError if not passed an integer-like argument"
|
|
119
|
+
fails "Array#rotate! with an argument n coerces the argument using to_int"
|
|
120
|
+
fails "Array#rotate! with an argument n moves the first (n % size) elements at the end and returns self"
|
|
121
|
+
fails "Array#rotate! when passed no argument moves the first element to the end and returns self"
|
|
122
|
+
fails "Array#rotate! raises a RuntimeError on a frozen array"
|
|
123
|
+
fails "Array#rotate! does nothing and returns self when the length is zero or one"
|
|
124
|
+
fails "Array#rotate with an argument n raises a TypeError if not passed an integer-like argument"
|
|
125
|
+
fails "Array#rotate with an argument n coerces the argument using to_int"
|
|
126
|
+
fails "Array#rotate with an argument n returns a copy of the array with the first (n % size) elements moved at the end"
|
|
127
|
+
fails "Array#rotate when passed no argument returns a copy of the array with the first element moved at the end"
|
|
128
|
+
fails "Array#rotate does not return subclass instance for Array subclasses"
|
|
129
|
+
fails "Array#rotate does not return self"
|
|
130
|
+
fails "Array#rotate does not mutate the receiver"
|
|
131
|
+
fails "Array#rotate returns a copy of the array when its length is one or zero"
|
|
132
|
+
|
|
133
|
+
fails "Array#sample calls #rand on the Object passed by the :random key in the arguments Hash"
|
|
134
|
+
fails "Array#sample calls #to_hash to convert the passed Object"
|
|
135
|
+
fails "Array#sample calls #to_int on the Object returned by #rand"
|
|
136
|
+
fails "Array#sample calls #to_int on the first argument and #to_hash on the second when passed Objects"
|
|
137
|
+
fails "Array#sample calls #to_int to convert the count when passed an Object"
|
|
138
|
+
fails "Array#sample does not return the same value if the Array has unique values"
|
|
139
|
+
fails "Array#sample ignores an Object passed for the RNG if it does not define #rand"
|
|
140
|
+
fails "Array#sample raises ArgumentError when passed a negative count"
|
|
141
|
+
fails "Array#sample raises a RangeError if the value is equal to the Array size"
|
|
142
|
+
fails "Array#sample raises a RangeError if the value is less than zero"
|
|
143
|
+
fails "Array#sample returns at most the number of elements in the Array"
|
|
144
|
+
fails "Array#sample when the object returned by #rand is not a Fixnum but responds to #to_int calls #to_int on the Object"
|
|
145
|
+
fails "Array#sample when the object returned by #rand is not a Fixnum but responds to #to_int raises a RangeError if the value is equal to the Array size"
|
|
146
|
+
fails "Array#sample when the object returned by #rand is not a Fixnum but responds to #to_int raises a RangeError if the value is less than zero"
|
|
147
|
+
fails "Array#sample with options calls #rand on the Object passed by the :random key in the arguments Hash"
|
|
148
|
+
fails "Array#sample with options calls #to_hash to convert the passed Object"
|
|
149
|
+
fails "Array#sample with options calls #to_int on the first argument and #to_hash on the second when passed Objects"
|
|
150
|
+
fails "Array#sample with options ignores an Object passed for the RNG if it does not define #rand"
|
|
151
|
+
fails "Array#sample with options when the object returned by #rand is a Fixnum raises a RangeError if the value is equal to the Array size"
|
|
152
|
+
fails "Array#sample with options when the object returned by #rand is a Fixnum raises a RangeError if the value is less than zero"
|
|
153
|
+
fails "Array#sample with options when the object returned by #rand is a Fixnum uses the fixnum as index"
|
|
154
|
+
|
|
155
|
+
fails "Array#select returns a new array of elements for which block is true"
|
|
156
|
+
|
|
157
|
+
fails "Array#shuffle attempts coercion via #to_hash"
|
|
158
|
+
fails "Array#shuffle is not destructive"
|
|
159
|
+
fails "Array#shuffle returns the same values, in a usually different order"
|
|
160
|
+
fails "Array#shuffle calls #rand on the Object passed by the :random key in the arguments Hash"
|
|
161
|
+
fails "Array#shuffle ignores an Object passed for the RNG if it does not define #rand"
|
|
162
|
+
fails "Array#shuffle accepts a Float for the value returned by #rand"
|
|
163
|
+
fails "Array#shuffle calls #to_int on the Object returned by #rand"
|
|
164
|
+
fails "Array#shuffle raises a RangeError if the value is less than zero"
|
|
165
|
+
fails "Array#shuffle raises a RangeError if the value is equal to one"
|
|
166
|
+
|
|
167
|
+
fails "Array#shuffle! returns the same values, in a usually different order"
|
|
168
|
+
|
|
169
|
+
fails "Array#slice! calls to_int on range arguments"
|
|
170
|
+
fails "Array#slice! calls to_int on start and length arguments"
|
|
171
|
+
fails "Array#slice! does not expand array with indices out of bounds"
|
|
172
|
+
fails "Array#slice! does not expand array with negative indices out of bounds"
|
|
173
|
+
fails "Array#slice! removes and return elements in range"
|
|
174
|
+
fails "Array#slice! removes and returns elements in end-exclusive ranges"
|
|
175
|
+
|
|
176
|
+
fails "Array#sort_by! makes some modification even if finished sorting when it would break in the given block"
|
|
177
|
+
fails "Array#sort_by! returns the specified value when it would break in the given block"
|
|
178
|
+
fails "Array#sort_by! raises a RuntimeError on an empty frozen array"
|
|
179
|
+
fails "Array#sort_by! raises a RuntimeError on a frozen array"
|
|
180
|
+
fails "Array#sort_by! completes when supplied a block that always returns the same result"
|
|
181
|
+
fails "Array#sort_by! returns an Enumerator if not given a block"
|
|
182
|
+
fails "Array#sort_by! sorts array in place by passing each element to the given block"
|
|
183
|
+
|
|
184
|
+
fails "Array#uniq compares elements based on the value returned from the block"
|
|
185
|
+
fails "Array#uniq compares elements with matching hash codes with #eql?"
|
|
186
|
+
fails "Array#uniq handles nil and false like any other values"
|
|
187
|
+
fails "Array#uniq uses eql? semantics"
|
|
188
|
+
fails "Array#uniq yields items in order"
|
|
189
|
+
|
|
190
|
+
fails "Array#uniq! compares elements based on the value returned from the block"
|
|
191
|
+
|
|
192
|
+
fails "Array#values_at returns an array of elements at the indexes when passed indexes"
|
|
193
|
+
fails "Array#values_at calls to_int on its indices"
|
|
194
|
+
fails "Array#values_at returns an array of elements in the ranges when passes ranges"
|
|
195
|
+
fails "Array#values_at calls to_int on arguments of ranges when passes ranges"
|
|
196
|
+
fails "Array#values_at does not return subclass instance on Array subclasses"
|
|
197
|
+
fails "Array#values_at when passed ranges returns an array of elements in the ranges"
|
|
198
|
+
fails "Array#values_at when passed ranges calls to_int on arguments of ranges"
|
|
199
|
+
fails "Array#values_at when passed a range fills with nil if the index is out of the range"
|
|
200
|
+
fails "Array#values_at when passed a range on an empty array fills with nils if the index is out of the range"
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
fails "Array#zip calls #to_ary to convert the argument to an Array"
|
|
204
|
+
fails "Array#zip uses #each to extract arguments' elements when #to_ary fails"
|
|
205
|
+
|
|
206
|
+
fails "Array#hash returns the same value if arrays are #eql?"
|
|
207
|
+
fails "Array#hash returns same hash code for arrays with the same content"
|
|
208
|
+
fails "Array#hash ignores array class differences"
|
|
209
|
+
fails "Array#hash calls to_int on result of calling hash on each element"
|
|
210
|
+
fails "Array#hash returns the same fixnum for arrays with the same content"
|
|
211
|
+
|
|
212
|
+
fails "Array#partition returns in the left array values for which the block evaluates to true"
|
|
213
|
+
fails "Array#partition returns two arrays"
|
|
214
|
+
fails "Array#partition does not return subclass instances on Array subclasses"
|
|
215
|
+
|
|
216
|
+
fails "Array#| acts as if using an intermediate hash to collect values"
|
|
217
|
+
|
|
218
|
+
# recursive arrays
|
|
219
|
+
fails "Array#join raises an ArgumentError when the Array is recursive"
|
|
220
|
+
fails "Array#uniq! properly handles recursive arrays"
|
|
221
|
+
fails "Array#| properly handles recursive arrays"
|
|
222
|
+
fails "Array#<=> properly handles recursive arrays"
|
|
223
|
+
fails "Array#eql? handles well recursive arrays"
|
|
224
|
+
fails "Array#== handles well recursive arrays"
|
|
225
|
+
fails "Array#flatten raises an ArgumentError on recursive arrays"
|
|
226
|
+
fails "Array#flatten! raises an ArgumentError on recursive arrays"
|
|
227
|
+
fails "Array#partition properly handles recursive arrays"
|
|
228
|
+
fails "Array#& properly handles recursive arrays"
|
|
229
|
+
fails "Array#values_at properly handles recursive arrays"
|
|
230
|
+
fails "Array#hash returns the same hash for equal recursive arrays through hashes"
|
|
231
|
+
fails "Array#hash returns the same hash for equal recursive arrays"
|
|
232
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
opal_filter "BasicObject" do
|
|
2
|
+
fails "BasicObject#instance_eval evaluates strings"
|
|
3
|
+
fails "BasicObject#singleton_method_added is called when a method is defined with alias_method in the singleton class"
|
|
4
|
+
fails "BasicObject#singleton_method_added is called when a method is defined with syntax alias in the singleton class"
|
|
5
|
+
fails "BasicObject instance metaclass contains methods defined for the BasicObject instance"
|
|
6
|
+
fails "BasicObject instance metaclass has BasicObject as superclass"
|
|
7
|
+
fails "BasicObject instance metaclass is an instance of Class"
|
|
8
|
+
fails "BasicObject metaclass contains methods for the BasicObject class"
|
|
9
|
+
fails "BasicObject metaclass has Class as superclass"
|
|
10
|
+
fails "BasicObject does not define built-in constants (according to defined?)"
|
|
11
|
+
fails "BasicObject does not define built-in constants (according to const_defined?)"
|
|
12
|
+
fails "BasicObject raises NameError when referencing built-in constants"
|
|
13
|
+
fails "BasicObject raises NoMethodError for nonexistent methods after #method_missing is removed"
|
|
14
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
opal_filter "Class" do
|
|
2
|
+
fails "Class#allocate returns a fully-formed instance of Module"
|
|
3
|
+
fails "Class#allocate raises TypeError for #superclass"
|
|
4
|
+
|
|
5
|
+
fails "Class#dup stores the new name if assigned to a constant"
|
|
6
|
+
fails "Class#dup sets the name from the class to nil if not assigned to a constant"
|
|
7
|
+
fails "Class#dup retains the correct ancestor chain for the singleton class"
|
|
8
|
+
fails "Class#dup retains an included module in the ancestor chain for the singleton class"
|
|
9
|
+
fails "Class#dup duplicates both the class and the singleton class"
|
|
10
|
+
|
|
11
|
+
fails "Class#initialize_copy raises a TypeError when called on already initialized classes"
|
|
12
|
+
fails "Class#initialize_copy raises a TypeError when called on BasicObject"
|
|
13
|
+
fails "Class#initialize raises a TypeError when called on already initialized classes"
|
|
14
|
+
fails "Class#initialize raises a TypeError when called on BasicObject"
|
|
15
|
+
fails "Class#initialize when given the Class raises a TypeError"
|
|
16
|
+
|
|
17
|
+
fails "Class.new raises a TypeError if passed a metaclass"
|
|
18
|
+
fails "Class#new passes the block to #initialize"
|
|
19
|
+
|
|
20
|
+
fails "Class#superclass for a singleton class of a class returns the singleton class of its superclass"
|
|
21
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
opal_filter "Enumerable" do
|
|
2
|
+
fails "Enumerable#cycle passed a number n as an argument raises an ArgumentError if more arguments are passed"
|
|
3
|
+
|
|
4
|
+
fails "Enumerable#grep can use $~ in the block when used with a Regexp"
|
|
5
|
+
|
|
6
|
+
fails "Enumerable#inject returns nil when fails(legacy rubycon)"
|
|
7
|
+
fails "Enumerable#inject without inject arguments(legacy rubycon)"
|
|
8
|
+
|
|
9
|
+
fails "Enumerable#reduce returns nil when fails(legacy rubycon)"
|
|
10
|
+
fails "Enumerable#reduce without inject arguments(legacy rubycon)"
|
|
11
|
+
|
|
12
|
+
fails "Enumerable#chunk does not yield the object passed to #chunk if it is nil"
|
|
13
|
+
fails "Enumerable#chunk yields an element and an object value-equal but not identical to the object passed to #chunk"
|
|
14
|
+
fails "Enumerable#chunk raises a RuntimeError if the block returns a Symbol starting with an underscore other than :_alone or :_separator"
|
|
15
|
+
fails "Enumerable#chunk does not return elements for which the block returns nil"
|
|
16
|
+
fails "Enumerable#chunk does not return elements for which the block returns :_separator"
|
|
17
|
+
fails "Enumerable#chunk returns elements for which the block returns :_alone in separate Arrays"
|
|
18
|
+
fails "Enumerable#chunk returns elements of the Enumerable in an Array of Arrays, [v, ary], where 'ary' contains the consecutive elements for which the block returned the value 'v'"
|
|
19
|
+
fails "Enumerable#chunk yields the current element and the current chunk to the block"
|
|
20
|
+
fails "Enumerable#chunk returns an Enumerator if given a block"
|
|
21
|
+
fails "Enumerable#chunk raises an ArgumentError if called without a block"
|
|
22
|
+
fails "Enumerable#chunk with [initial_state] yields an element and an object value-equal but not identical to the object passed to #chunk"
|
|
23
|
+
fails "Enumerable#chunk with [initial_state] does not yield the object passed to #chunk if it is nil"
|
|
24
|
+
|
|
25
|
+
fails "Enumerable#each_cons gathers whole arrays as elements when each yields multiple"
|
|
26
|
+
fails "Enumerable#each_cons returns an enumerator if no block"
|
|
27
|
+
fails "Enumerable#each_cons yields only as much as needed"
|
|
28
|
+
fails "Enumerable#each_cons works when n is >= full length"
|
|
29
|
+
fails "Enumerable#each_cons tries to convert n to an Integer using #to_int"
|
|
30
|
+
fails "Enumerable#each_cons raises an Argument Error if there is not a single parameter > 0"
|
|
31
|
+
fails "Enumerable#each_cons passes element groups to the block"
|
|
32
|
+
|
|
33
|
+
fails "Enumerable#each_entry passes extra arguments to #each"
|
|
34
|
+
fails "Enumerable#each_entry passes through the values yielded by #each_with_index"
|
|
35
|
+
fails "Enumerable#each_entry returns an enumerator if no block"
|
|
36
|
+
fails "Enumerable#each_entry yields multiple arguments as an array"
|
|
37
|
+
|
|
38
|
+
fails "Enumerable#minmax_by gathers whole arrays as elements when each yields multiple"
|
|
39
|
+
fails "Enumerable#minmax_by is able to return the maximum for enums that contain nils"
|
|
40
|
+
fails "Enumerable#minmax_by uses min/max.<=>(current) to determine order"
|
|
41
|
+
fails "Enumerable#minmax_by returns the object that appears first in #each in case of a tie"
|
|
42
|
+
fails "Enumerable#minmax_by returns the object for whom the value returned by block is the largest"
|
|
43
|
+
fails "Enumerable#minmax_by returns nil if #each yields no objects"
|
|
44
|
+
fails "Enumerable#minmax_by returns an enumerator if no block"
|
|
45
|
+
|
|
46
|
+
fails "Enumerable#minmax gathers whole arrays as elements when each yields multiple"
|
|
47
|
+
fails "Enumerable#minmax returns the minimum when using a block rule"
|
|
48
|
+
fails "Enumerable#minmax raises a NoMethodError for elements without #<=>"
|
|
49
|
+
fails "Enumerable#minmax raises an ArgumentError when elements are incomparable"
|
|
50
|
+
fails "Enumerable#minmax returns [nil, nil] for an empty Enumerable"
|
|
51
|
+
fails "Enumerable#minmax min should return the minimum element"
|
|
52
|
+
|
|
53
|
+
fails "Enumerable#reverse_each gathers whole arrays as elements when each yields multiple"
|
|
54
|
+
|
|
55
|
+
fails "Enumerable#sort gathers whole arrays as elements when each yields multiple"
|
|
56
|
+
fails "Enumerable#sort raises an error if objects can't be compared"
|
|
57
|
+
fails "Enumerable#sort compare values returned by block with 0"
|
|
58
|
+
fails "Enumerable#sort sorts enumerables that contain nils"
|
|
59
|
+
fails "Enumerable#sort raises a NoMethodError if elements do not define <=>"
|
|
60
|
+
fails "Enumerable#sort yields elements to the provided block"
|
|
61
|
+
fails "Enumerable#sort sorts by the natural order as defined by <=>"
|
|
62
|
+
|
|
63
|
+
fails "Enumerable#take_while calls the block with initial args when yielded with multiple arguments"
|
|
64
|
+
|
|
65
|
+
fails "Enumerable#zip passes each element of the result array to a block and return nil if a block is given"
|
|
66
|
+
fails "Enumerable#zip converts arguments to arrays using #to_ary"
|
|
67
|
+
fails "Enumerable#zip converts arguments to enums using #to_enum"
|
|
68
|
+
fails "Enumerable#zip gathers whole arrays as elements when each yields multiple"
|
|
69
|
+
end
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
opal_filter "Hash" do
|
|
2
|
+
fails "Hash.[] coerces a single argument which responds to #to_ary"
|
|
3
|
+
fails "Hash.[] ignores elements that are not arrays"
|
|
4
|
+
fails "Hash.[] calls to_hash"
|
|
5
|
+
fails "Hash.[] returns an instance of a subclass when passed an Array"
|
|
6
|
+
fails "Hash.[] returns instances of subclasses"
|
|
7
|
+
fails "Hash.[] returns an instance of the class it's called on"
|
|
8
|
+
fails "Hash.[] does not call #initialize on the subclass instance"
|
|
9
|
+
fails "Hash.[] passed an array treats elements that are 1 element arrays as keys with value nil"
|
|
10
|
+
fails "Hash.[] passed a single argument which responds to #to_hash coerces it and returns a copy"
|
|
11
|
+
fails "Hash.[] removes the default_proc"
|
|
12
|
+
|
|
13
|
+
fails "Hash#assoc only returns the first matching key-value pair for identity hashes"
|
|
14
|
+
|
|
15
|
+
fails "Hash#default_proc= uses :to_proc on its argument"
|
|
16
|
+
|
|
17
|
+
fails "Hash#each properly expands (or not) child class's 'each'-yielded args"
|
|
18
|
+
fails "Hash#each yields the key only to a block expecting |key,|"
|
|
19
|
+
|
|
20
|
+
fails "Hash#each_pair properly expands (or not) child class's 'each'-yielded args"
|
|
21
|
+
fails "Hash#each_pair yields the key only to a block expecting |key,|"
|
|
22
|
+
|
|
23
|
+
fails "Hash#== compares the values in self to values in other hash"
|
|
24
|
+
fails "Hash#== returns true iff other Hash has the same number of keys and each key-value pair matches"
|
|
25
|
+
fails "Hash#== compares keys with matching hash codes via eql?"
|
|
26
|
+
fails "Hash#== compares keys with eql? semantics"
|
|
27
|
+
fails "Hash#== computes equality for recursive hashes & arrays"
|
|
28
|
+
fails "Hash#== computes equality for complex recursive hashes"
|
|
29
|
+
fails "Hash#== does not compare keys with different hash codes via eql?"
|
|
30
|
+
fails "Hash#== first compares keys via hash"
|
|
31
|
+
|
|
32
|
+
fails "Hash#eql? compares the values in self to values in other hash"
|
|
33
|
+
fails "Hash#eql? returns true iff other Hash has the same number of keys and each key-value pair matches"
|
|
34
|
+
fails "Hash#eql? compares keys with matching hash codes via eql?"
|
|
35
|
+
fails "Hash#eql? compares keys with eql? semantics"
|
|
36
|
+
fails "Hash#eql? computes equality for recursive hashes & arrays"
|
|
37
|
+
fails "Hash#eql? computes equality for complex recursive hashes"
|
|
38
|
+
fails "Hash#eql? does not compare keys with different hash codes via eql?"
|
|
39
|
+
fails "Hash#eql? first compares keys via hash"
|
|
40
|
+
fails "Hash#eql? does not compare values when keys don't match"
|
|
41
|
+
|
|
42
|
+
fails "Hash#[] calls subclass implementations of default"
|
|
43
|
+
fails "Hash#[] does not create copies of the immediate default value"
|
|
44
|
+
fails "Hash#[] compares keys with eql? semantics"
|
|
45
|
+
fails "Hash#[] compares key via hash"
|
|
46
|
+
fails "Hash#[] does not compare keys with different #hash values via #eql?"
|
|
47
|
+
fails "Hash#[] compares keys with the same #hash value via #eql?"
|
|
48
|
+
fails "Hash#[] finds a value via an identical key even when its #eql? isn't reflexive"
|
|
49
|
+
|
|
50
|
+
fails "Hash#[]= stores unequal keys that hash to the same value"
|
|
51
|
+
fails "Hash#[]= associates the key with the value and return the value"
|
|
52
|
+
|
|
53
|
+
fails "Hash#fetch raises an ArgumentError when not passed one or two arguments"
|
|
54
|
+
|
|
55
|
+
fails "Hash#flatten recursively flattens Array values to the given depth"
|
|
56
|
+
fails "Hash#flatten raises a TypeError if given a non-Integer argument"
|
|
57
|
+
|
|
58
|
+
fails "Hash#has_key? compares keys with the same #hash value via #eql?"
|
|
59
|
+
fails "Hash#has_key? returns true if argument is a key"
|
|
60
|
+
|
|
61
|
+
fails "Hash#hash returns the same hash for recursive hashes through arrays"
|
|
62
|
+
fails "Hash#hash returns the same hash for recursive hashes"
|
|
63
|
+
fails "Hash#hash generates a hash for recursive hash structures"
|
|
64
|
+
fails "Hash#hash returns a value which doesn't depend on the hash order"
|
|
65
|
+
|
|
66
|
+
fails "Hash#include? compares keys with the same #hash value via #eql?"
|
|
67
|
+
fails "Hash#include? returns true if argument is a key"
|
|
68
|
+
|
|
69
|
+
fails "Hash#invert compares new keys with eql? semantics"
|
|
70
|
+
|
|
71
|
+
fails "Hash#initialize_copy does not transfer default values"
|
|
72
|
+
fails "Hash#initialize_copy calls to_hash on hash subclasses"
|
|
73
|
+
fails "Hash#initialize_copy tries to convert the passed argument to a hash using #to_hash"
|
|
74
|
+
fails "Hash#initialize_copy replaces the contents of self with other"
|
|
75
|
+
|
|
76
|
+
fails "Hash#inspect handles hashes with recursive values"
|
|
77
|
+
|
|
78
|
+
fails "Hash#key? compares keys with the same #hash value via #eql?"
|
|
79
|
+
fails "Hash#key? returns true if argument is a key"
|
|
80
|
+
|
|
81
|
+
fails "Hash#member? compares keys with the same #hash value via #eql?"
|
|
82
|
+
fails "Hash#member? returns true if argument is a key"
|
|
83
|
+
|
|
84
|
+
fails "Hash#merge returns subclass instance for subclasses"
|
|
85
|
+
|
|
86
|
+
fails "Hash.new raises an ArgumentError if more than one argument is passed"
|
|
87
|
+
fails "Hash.new raises an ArgumentError if passed both default argument and default block"
|
|
88
|
+
|
|
89
|
+
fails "Hash#rassoc uses #== to compare the argument to the values"
|
|
90
|
+
|
|
91
|
+
fails "Hash#rehash reorganizes the hash by recomputing all key hash codes"
|
|
92
|
+
|
|
93
|
+
fails "Hash#reject returns subclass instance for subclasses"
|
|
94
|
+
fails "Hash#reject processes entries with the same order as reject!"
|
|
95
|
+
fails "Hash#reject! removes keys from self for which the block yields true"
|
|
96
|
+
fails "Hash#reject! is equivalent to delete_if if changes are made"
|
|
97
|
+
fails "Hash#reject! returns nil if no changes were made"
|
|
98
|
+
fails "Hash#reject! processes entries with the same order as delete_if"
|
|
99
|
+
fails "Hash#reject! returns an Enumerator if called on a non-empty hash without a block"
|
|
100
|
+
fails "Hash#reject! returns an Enumerator if called on an empty hash without a block"
|
|
101
|
+
|
|
102
|
+
fails "Hash#replace tries to convert the passed argument to a hash using #to_hash"
|
|
103
|
+
fails "Hash#replace does not transfer default values"
|
|
104
|
+
|
|
105
|
+
fails "Hash#select returns a Hash of entries for which block is true"
|
|
106
|
+
|
|
107
|
+
fails "Hash#shift returns (computed) default for empty hashes"
|
|
108
|
+
|
|
109
|
+
fails "Hash#store stores unequal keys that hash to the same value"
|
|
110
|
+
fails "Hash#store associates the key with the value and return the value"
|
|
111
|
+
|
|
112
|
+
fails "Hash#sort converts self to a nested array of [key, value] arrays and sort with Array#sort"
|
|
113
|
+
fails "Hash#sort works when some of the keys are themselves arrays"
|
|
114
|
+
fails "Hash#sort uses block to sort array if passed a block"
|
|
115
|
+
|
|
116
|
+
fails "Hash#to_h returns self for Hash instances"
|
|
117
|
+
|
|
118
|
+
fails "Hash#to_s handles hashes with recursive values"
|
|
119
|
+
|
|
120
|
+
fails "Hash.try_convert does not rescue exceptions raised by #to_hash"
|
|
121
|
+
fails "Hash.try_convert sends #to_hash to the argument and raises TypeError if it's not a kind of Hash"
|
|
122
|
+
fails "Hash.try_convert sends #to_hash to the argument and returns the result if it's a kind of Hash"
|
|
123
|
+
fails "Hash.try_convert sends #to_hash to the argument and returns the result if it's a Hash"
|
|
124
|
+
fails "Hash.try_convert sends #to_hash to the argument and returns the result if it's nil"
|
|
125
|
+
fails "Hash.try_convert returns nil when the argument does not respond to #to_hash"
|
|
126
|
+
fails "Hash.try_convert returns the argument if it's a kind of Hash"
|
|
127
|
+
fails "Hash.try_convert returns the argument if it's a Hash"
|
|
128
|
+
end
|