opal 1.0.3 → 1.1.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +13 -12
- data/.gitattributes +1 -1
- data/.github/FUNDING.yml +1 -0
- data/.github/workflows/build.yml +90 -0
- data/.jshintrc +1 -1
- data/.overcommit.yml +35 -0
- data/.rubocop.yml +44 -7
- data/{.rubocop_todo.yml → .rubocop/todo.yml} +4 -5
- data/CHANGELOG.md +152 -1
- data/Gemfile +2 -3
- data/HACKING.md +2 -9
- data/LICENSE +1 -1
- data/README.md +21 -18
- data/UNRELEASED.md +4 -2
- data/benchmark-ips/bm_array_pop_1.rb +8 -0
- data/benchmark-ips/bm_array_shift.rb +7 -0
- data/benchmark-ips/bm_js_symbols_vs_strings.rb +7 -2
- data/benchmark-ips/class_shovel_vs_singleton_class.rb +16 -0
- data/bin/build-browser-source-map-support +4 -0
- data/bin/format-filters +54 -0
- data/bin/git-submodule-fast-install +49 -0
- data/bin/remove-filters +39 -0
- data/bin/setup +4 -0
- data/bin/yarn +11 -0
- data/docs/releasing.md +18 -0
- data/docs/roda-sprockets.md +86 -0
- data/docs/sinatra.md +5 -12
- data/examples/rack/Gemfile +1 -0
- data/examples/rack/app/application.rb +3 -0
- data/examples/rack/config.ru +5 -4
- data/exe/opal-repl +2 -83
- data/lib/opal/ast/builder.rb +1 -1
- data/lib/opal/builder.rb +2 -10
- data/lib/opal/builder_processors.rb +1 -1
- data/lib/opal/cli.rb +4 -1
- data/lib/opal/cli_options.rb +11 -3
- data/lib/opal/cli_runners.rb +27 -37
- data/lib/opal/cli_runners/applescript.rb +5 -44
- data/lib/opal/cli_runners/chrome.js +7 -35
- data/lib/opal/cli_runners/chrome.rb +75 -17
- data/lib/opal/cli_runners/compiler.rb +17 -0
- data/lib/opal/cli_runners/nashorn.rb +9 -43
- data/lib/opal/cli_runners/nodejs.rb +18 -47
- data/lib/opal/cli_runners/server.rb +18 -6
- data/lib/opal/cli_runners/source-map-support-browser.js +6449 -0
- data/lib/opal/cli_runners/source-map-support-node.js +3704 -0
- data/lib/opal/cli_runners/source-map-support.js +639 -0
- data/lib/opal/cli_runners/system_runner.rb +45 -0
- data/lib/opal/compiler.rb +57 -29
- data/lib/opal/config.rb +0 -5
- data/lib/opal/erb.rb +1 -1
- data/lib/opal/magic_comments.rb +34 -0
- data/lib/opal/nodes/args/arity_check.rb +2 -1
- data/lib/opal/nodes/base.rb +1 -1
- data/lib/opal/nodes/call.rb +1 -4
- data/lib/opal/nodes/def.rb +2 -0
- data/lib/opal/nodes/iter.rb +1 -1
- data/lib/opal/nodes/literal.rb +19 -14
- data/lib/opal/nodes/logic.rb +5 -80
- data/lib/opal/nodes/masgn.rb +2 -0
- data/lib/opal/nodes/rescue.rb +1 -1
- data/lib/opal/nodes/super.rb +24 -10
- data/lib/opal/nodes/top.rb +5 -4
- data/lib/opal/parser/with_c_lexer.rb +2 -1
- data/lib/opal/parser/with_ruby_lexer.rb +1 -1
- data/lib/opal/path_reader.rb +2 -2
- data/lib/opal/paths.rb +8 -5
- data/lib/opal/repl.rb +103 -0
- data/lib/opal/rewriter.rb +4 -0
- data/lib/opal/rewriters/for_rewriter.rb +1 -1
- data/lib/opal/rewriters/js_reserved_words.rb +7 -7
- data/lib/opal/rewriters/numblocks.rb +31 -0
- data/lib/opal/rewriters/returnable_logic.rb +33 -0
- data/lib/opal/util.rb +11 -48
- data/lib/opal/version.rb +1 -1
- data/opal.gemspec +26 -26
- data/opal/corelib/array.rb +160 -118
- data/opal/corelib/array/pack.rb +5 -3
- data/opal/corelib/basic_object.rb +4 -4
- data/opal/corelib/class.rb +2 -1
- data/opal/corelib/comparable.rb +49 -31
- data/opal/corelib/constants.rb +5 -5
- data/opal/corelib/enumerable.rb +108 -46
- data/opal/corelib/enumerator.rb +27 -12
- data/opal/corelib/file.rb +3 -1
- data/opal/corelib/hash.rb +6 -1
- data/opal/corelib/helpers.rb +8 -28
- data/opal/corelib/io.rb +12 -7
- data/opal/corelib/kernel.rb +45 -14
- data/opal/corelib/kernel/format.rb +3 -1
- data/opal/corelib/math.rb +8 -6
- data/opal/corelib/method.rb +8 -0
- data/opal/corelib/module.rb +17 -2
- data/opal/corelib/number.rb +3 -12
- data/opal/corelib/proc.rb +16 -0
- data/opal/corelib/random/mersenne_twister.rb +147 -0
- data/opal/corelib/range.rb +3 -13
- data/opal/corelib/regexp.rb +10 -6
- data/opal/corelib/runtime.js +208 -81
- data/opal/corelib/string.rb +55 -49
- data/opal/corelib/string/encoding.rb +109 -32
- data/opal/corelib/string/unpack.rb +2 -17
- data/opal/corelib/struct.rb +14 -1
- data/opal/corelib/time.rb +4 -0
- data/opal/opal.rb +1 -1
- data/opal/opal/mini.rb +1 -1
- data/package.json +16 -0
- data/spec/README.md +10 -0
- data/spec/filters/bugs/array.rb +76 -0
- data/spec/filters/bugs/base64.rb +10 -0
- data/spec/filters/bugs/basicobject.rb +12 -0
- data/spec/filters/bugs/bigdecimal.rb +248 -0
- data/spec/filters/bugs/class.rb +12 -0
- data/spec/filters/bugs/complex.rb +7 -0
- data/spec/filters/bugs/date.rb +104 -0
- data/spec/filters/bugs/encoding.rb +259 -0
- data/spec/filters/bugs/enumerable.rb +26 -0
- data/spec/filters/bugs/enumerator.rb +48 -0
- data/spec/filters/bugs/exception.rb +120 -0
- data/spec/filters/bugs/file.rb +48 -0
- data/spec/filters/bugs/float.rb +74 -0
- data/spec/filters/bugs/hash.rb +60 -0
- data/spec/filters/bugs/integer.rb +78 -0
- data/spec/filters/bugs/io.rb +9 -0
- data/spec/filters/bugs/kernel.rb +401 -0
- data/spec/filters/bugs/language.rb +451 -0
- data/spec/filters/bugs/marshal.rb +50 -0
- data/spec/filters/bugs/math.rb +4 -0
- data/spec/filters/bugs/method.rb +79 -0
- data/spec/filters/bugs/module.rb +281 -0
- data/spec/filters/bugs/nilclass.rb +4 -0
- data/spec/filters/bugs/numeric.rb +27 -0
- data/spec/filters/bugs/openstruct.rb +8 -0
- data/spec/filters/bugs/pack_unpack.rb +138 -0
- data/spec/filters/bugs/pathname.rb +9 -0
- data/spec/filters/bugs/proc.rb +80 -0
- data/spec/filters/bugs/random.rb +20 -0
- data/spec/filters/bugs/range.rb +139 -0
- data/spec/filters/bugs/rational.rb +12 -0
- data/spec/filters/bugs/regexp.rb +91 -0
- data/spec/filters/bugs/set.rb +51 -0
- data/spec/filters/bugs/singleton.rb +7 -0
- data/spec/filters/bugs/string.rb +341 -0
- data/spec/filters/bugs/stringscanner.rb +78 -0
- data/spec/filters/bugs/struct.rb +26 -0
- data/spec/filters/bugs/symbol.rb +7 -0
- data/spec/filters/bugs/time.rb +109 -0
- data/spec/filters/bugs/unboundmethod.rb +33 -0
- data/spec/filters/bugs/warnings.rb +30 -0
- data/spec/filters/unsupported/array.rb +168 -0
- data/spec/filters/unsupported/basicobject.rb +15 -0
- data/spec/filters/unsupported/bignum.rb +55 -0
- data/spec/filters/unsupported/class.rb +5 -0
- data/spec/filters/unsupported/delegator.rb +6 -0
- data/spec/filters/unsupported/enumerable.rb +12 -0
- data/spec/filters/unsupported/enumerator.rb +14 -0
- data/spec/filters/unsupported/file.rb +4 -0
- data/spec/filters/unsupported/fixnum.rb +15 -0
- data/spec/filters/unsupported/float.rb +47 -0
- data/spec/filters/unsupported/freeze.rb +259 -0
- data/spec/filters/unsupported/hash.rb +44 -0
- data/spec/filters/unsupported/integer.rb +101 -0
- data/spec/filters/unsupported/kernel.rb +35 -0
- data/spec/filters/unsupported/language.rb +25 -0
- data/spec/filters/unsupported/marshal.rb +44 -0
- data/spec/filters/unsupported/matchdata.rb +63 -0
- data/spec/filters/unsupported/math.rb +4 -0
- data/spec/filters/unsupported/pathname.rb +4 -0
- data/spec/filters/unsupported/privacy.rb +287 -0
- data/spec/filters/unsupported/proc.rb +4 -0
- data/spec/filters/unsupported/random.rb +5 -0
- data/spec/filters/unsupported/range.rb +8 -0
- data/spec/filters/unsupported/regexp.rb +70 -0
- data/spec/filters/unsupported/set.rb +5 -0
- data/spec/filters/unsupported/singleton.rb +7 -0
- data/spec/filters/unsupported/string.rb +687 -0
- data/spec/filters/unsupported/struct.rb +7 -0
- data/spec/filters/unsupported/symbol.rb +21 -0
- data/spec/filters/unsupported/taint.rb +162 -0
- data/spec/filters/unsupported/thread.rb +10 -0
- data/spec/filters/unsupported/time.rb +204 -0
- data/spec/filters/unsupported/usage_of_files.rb +262 -0
- data/spec/lib/builder_processors_spec.rb +44 -0
- data/spec/lib/builder_spec.rb +133 -0
- data/spec/lib/cli_runners/server_spec.rb +25 -0
- data/spec/lib/cli_runners_spec.rb +16 -0
- data/spec/lib/cli_spec.rb +256 -0
- data/spec/lib/compiler_spec.rb +693 -0
- data/spec/lib/config_spec.rb +112 -0
- data/spec/lib/dependency_resolver_spec.rb +43 -0
- data/spec/lib/deprecations_spec.rb +17 -0
- data/spec/lib/fixtures/complex_sprockets.js.rb.erb +4 -0
- data/spec/lib/fixtures/file_with_directives.js +2 -0
- data/spec/lib/fixtures/jst_file.js.jst +1 -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_file.js +1 -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/source_location_test.rb +7 -0
- data/spec/lib/fixtures/source_map.rb +1 -0
- data/spec/lib/fixtures/source_map/subfolder/other_file.rb +1 -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/path_reader_spec.rb +47 -0
- data/spec/lib/paths_spec.rb +18 -0
- data/spec/lib/repl_spec.rb +28 -0
- data/spec/lib/rewriters/base_spec.rb +68 -0
- data/spec/lib/rewriters/binary_operator_assignment_spec.rb +153 -0
- data/spec/lib/rewriters/block_to_iter_spec.rb +28 -0
- data/spec/lib/rewriters/dot_js_syntax_spec.rb +108 -0
- data/spec/lib/rewriters/explicit_writer_return_spec.rb +186 -0
- data/spec/lib/rewriters/for_rewriter_spec.rb +92 -0
- data/spec/lib/rewriters/hashes/key_duplicates_rewriter_spec.rb +47 -0
- data/spec/lib/rewriters/js_reserved_words_spec.rb +119 -0
- data/spec/lib/rewriters/logical_operator_assignment_spec.rb +202 -0
- data/spec/lib/rewriters/opal_engine_check_spec.rb +84 -0
- data/spec/lib/rewriters/returnable_logic_spec.rb +52 -0
- data/spec/lib/rewriters/rubyspec/filters_rewriter_spec.rb +59 -0
- data/spec/lib/simple_server_spec.rb +56 -0
- data/spec/lib/source_map/file_spec.rb +67 -0
- data/spec/lib/source_map/index_spec.rb +80 -0
- data/spec/lib/spec_helper.rb +105 -0
- data/spec/mspec-opal/formatters.rb +197 -0
- data/spec/mspec-opal/runner.rb +172 -0
- data/spec/opal/compiler/irb_spec.rb +44 -0
- data/spec/opal/compiler/unicode_spec.rb +10 -0
- data/spec/opal/core/array/dup_spec.rb +23 -0
- data/spec/opal/core/array/intersection_spec.rb +38 -0
- data/spec/opal/core/array/minus_spec.rb +38 -0
- data/spec/opal/core/array/union_spec.rb +38 -0
- data/spec/opal/core/array/uniq_spec.rb +49 -0
- data/spec/opal/core/class/inherited_spec.rb +18 -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_spec.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/enumerator/with_index_spec.rb +6 -0
- data/spec/opal/core/exception_spec.rb +8 -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/fixtures/require_tree_files/nested/nested 1.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/nested/nested 2.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/other/other 1.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/file 1.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/file 2.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/file 3.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_with_dot/index.rb +3 -0
- data/spec/opal/core/hash/internals_spec.rb +339 -0
- data/spec/opal/core/helpers_spec.rb +14 -0
- data/spec/opal/core/iterable_props_spec.rb +53 -0
- data/spec/opal/core/kernel/at_exit_spec.rb +70 -0
- data/spec/opal/core/kernel/freeze_spec.rb +15 -0
- data/spec/opal/core/kernel/instance_variables_spec.rb +110 -0
- data/spec/opal/core/kernel/methods_spec.rb +25 -0
- data/spec/opal/core/kernel/public_methods_spec.rb +25 -0
- data/spec/opal/core/kernel/require_tree_spec.rb +18 -0
- data/spec/opal/core/kernel/respond_to_spec.rb +15 -0
- data/spec/opal/core/language/DATA/characters_support_spec.rb +9 -0
- data/spec/opal/core/language/DATA/empty___END___spec.rb +7 -0
- data/spec/opal/core/language/DATA/multiple___END___spec.rb +10 -0
- data/spec/opal/core/language/arguments/mlhs_arg_spec.rb +18 -0
- data/spec/opal/core/language/keyword_arguments_spec.rb +9 -0
- data/spec/opal/core/language/numblocks_spec.rb +16 -0
- data/spec/opal/core/language/safe_navigator_spec.rb +7 -0
- data/spec/opal/core/language/while_spec.rb +31 -0
- data/spec/opal/core/language_spec.rb +29 -0
- data/spec/opal/core/marshal/dump_spec.rb +81 -0
- data/spec/opal/core/marshal/load_spec.rb +13 -0
- data/spec/opal/core/module_spec.rb +27 -0
- data/spec/opal/core/object_id_spec.rb +56 -0
- data/spec/opal/core/regexp/interpolation_spec.rb +40 -0
- data/spec/opal/core/regexp/match_spec.rb +78 -0
- data/spec/opal/core/runtime/bridged_classes_spec.rb +123 -0
- data/spec/opal/core/runtime/constants_spec.rb +16 -0
- data/spec/opal/core/runtime/eval_spec.rb +5 -0
- data/spec/opal/core/runtime/exit_spec.rb +29 -0
- data/spec/opal/core/runtime/is_a_spec.rb +48 -0
- data/spec/opal/core/runtime/loaded_spec.rb +20 -0
- data/spec/opal/core/runtime/main_methods_spec.rb +39 -0
- data/spec/opal/core/runtime/method_missing_spec.rb +68 -0
- data/spec/opal/core/runtime/rescue_spec.rb +37 -0
- data/spec/opal/core/runtime/string_spec.rb +25 -0
- data/spec/opal/core/runtime/truthy_spec.rb +61 -0
- data/spec/opal/core/runtime_spec.rb +58 -0
- data/spec/opal/core/string/each_byte_spec.rb +19 -0
- data/spec/opal/core/string/gsub_spec.rb +35 -0
- data/spec/opal/core/string/to_sym_spec.rb +9 -0
- data/spec/opal/core/string_spec.rb +28 -0
- data/spec/opal/core/struct/dup_spec.rb +11 -0
- data/spec/opal/core/time_spec.rb +68 -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/js_spec.rb +72 -0
- data/spec/opal/stdlib/json/ext_spec.rb +55 -0
- data/spec/opal/stdlib/json/parse_spec.rb +37 -0
- data/spec/opal/stdlib/logger/logger_spec.rb +308 -0
- data/spec/opal/stdlib/native/alias_native_spec.rb +27 -0
- data/spec/opal/stdlib/native/array_spec.rb +11 -0
- data/spec/opal/stdlib/native/date_spec.rb +12 -0
- data/spec/opal/stdlib/native/deprecated_include_spec.rb +8 -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/hash_spec.rb +67 -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_alias_spec.rb +26 -0
- data/spec/opal/stdlib/native/native_class_spec.rb +18 -0
- data/spec/opal/stdlib/native/native_module_spec.rb +13 -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 +92 -0
- data/spec/opal/stdlib/native/struct_spec.rb +12 -0
- data/spec/opal/stdlib/pp_spec.rb +5 -0
- data/spec/opal/stdlib/promise/always_spec.rb +49 -0
- data/spec/opal/stdlib/promise/error_spec.rb +15 -0
- data/spec/opal/stdlib/promise/rescue_spec.rb +53 -0
- data/spec/opal/stdlib/promise/then_spec.rb +79 -0
- data/spec/opal/stdlib/promise/trace_spec.rb +51 -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/source_map_spec.rb +8 -0
- data/spec/opal/stdlib/strscan/scan_spec.rb +11 -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/ruby_specs +183 -0
- data/spec/spec_helper.rb +31 -0
- data/spec/support/guard_platform.rb +4 -0
- data/spec/support/match_helpers.rb +57 -0
- data/spec/support/mspec_rspec_adapter.rb +33 -0
- data/spec/support/rewriters_helper.rb +54 -0
- data/spec/support/source_map_helper.rb +190 -0
- data/stdlib/base64.rb +2 -2
- data/stdlib/bigdecimal.rb +15 -3
- data/stdlib/bigdecimal/bignumber.js.rb +1 -1
- data/stdlib/bigdecimal/util.rb +148 -0
- data/stdlib/delegate.rb +8 -0
- data/stdlib/nodejs/fileutils.rb +1 -1
- data/stdlib/nodejs/kernel.rb +0 -13
- data/stdlib/nodejs/stacktrace.rb +4 -179
- data/stdlib/ostruct.rb +5 -0
- data/stdlib/pp.rb +586 -19
- data/stdlib/prettyprint.rb +556 -0
- data/stdlib/rbconfig/sizeof.rb +2 -0
- data/stdlib/securerandom.rb +32 -0
- data/stdlib/set.rb +36 -0
- data/stdlib/strscan.rb +15 -0
- data/tasks/benchmarking.rake +1 -1
- data/tasks/linting.rake +3 -5
- data/tasks/releasing.rake +2 -5
- data/tasks/testing.rake +16 -11
- data/tasks/testing/mspec_special_calls.rb +1 -19
- data/test/nodejs/fixtures/cat.png +0 -0
- data/test/nodejs/fixtures/hello.rb +1 -0
- data/test/nodejs/fixtures/iso88591.txt +1 -0
- data/test/nodejs/fixtures/utf8.txt +1 -0
- data/test/nodejs/fixtures/win1258.txt +1 -0
- data/test/nodejs/test_dir.rb +39 -0
- data/test/nodejs/test_env.rb +62 -0
- data/test/nodejs/test_error.rb +29 -0
- data/test/nodejs/test_file.rb +206 -0
- data/test/nodejs/test_file_encoding.rb +20 -0
- data/test/nodejs/test_io.rb +18 -0
- data/test/nodejs/test_opal_builder.rb +12 -0
- data/test/nodejs/test_pathname.rb +16 -0
- data/test/opal/cat.png +0 -0
- data/test/opal/http_server.rb +52 -0
- data/test/opal/test_base64.rb +115 -0
- data/test/opal/test_keyword.rb +590 -0
- data/test/opal/test_matrix.rb +661 -0
- data/test/opal/test_openuri.rb +53 -0
- data/test/opal/unsupported_and_bugs.rb +39 -0
- data/yarn.lock +1355 -0
- metadata +905 -40
- data/.travis.yml +0 -109
- data/appveyor.yml +0 -35
- data/lib/opal/nodes/runtime_helpers.rb +0 -51
- data/opal/corelib/random/MersenneTwister.js +0 -137
- data/opal/corelib/random/mersenne_twister.js.rb +0 -13
- data/stdlib/bigdecimal/kernel.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1258e4fe63a4d35db8c8472acd68f434d597fff7be3e32c936be00dffbc83407
|
4
|
+
data.tar.gz: e7f697b42cd2e1c849f349e107e26740a8922ca409cdbfe94a7bba7bd7a06c6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a842bac817402616b1cb4e62e3d33d87c9a76011ac336b88efa3f28359a006a3f16139962cc7f2e4269389ae0a8a09a3902a9d53c36c1e347c28674454758976
|
7
|
+
data.tar.gz: e40165a56cb60445deee1525f51b12d629876b486b88a1f6f30e009aa127df769a6425fcbcaa1023654eeebb1b82cf50d2b3eece0476625775c431ed0957d700
|
data/.codeclimate.yml
CHANGED
@@ -38,15 +38,16 @@ plugins:
|
|
38
38
|
channel: rubocop-0-53
|
39
39
|
|
40
40
|
exclude_patterns:
|
41
|
-
- "benchmark/*"
|
42
|
-
- "build/*"
|
43
|
-
- "coverage/*"
|
44
|
-
- "docs/*"
|
45
|
-
- "examples/*"
|
46
|
-
- "tasks/*"
|
47
|
-
- "spec/*"
|
48
|
-
- "test/*"
|
49
|
-
- "vendored-minitest/*"
|
50
|
-
- "**/node_modules/*"
|
51
|
-
- stdlib/nodejs/js-yaml-3-6-1.js
|
52
|
-
- lib/opal/source_map/vlq.rb
|
41
|
+
- "benchmark/*"
|
42
|
+
- "build/*"
|
43
|
+
- "coverage/*"
|
44
|
+
- "docs/*"
|
45
|
+
- "examples/*"
|
46
|
+
- "tasks/*"
|
47
|
+
- "spec/*"
|
48
|
+
- "test/*"
|
49
|
+
- "vendored-minitest/*"
|
50
|
+
- "**/node_modules/*"
|
51
|
+
- stdlib/nodejs/js-yaml-3-6-1.js
|
52
|
+
- lib/opal/source_map/vlq.rb
|
53
|
+
- lib/opal/cli_runners/source-map-support*.js
|
data/.gitattributes
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
UNRELEASED.md merge=union
|
data/.github/FUNDING.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
open_collective: opal
|
@@ -0,0 +1,90 @@
|
|
1
|
+
name: build
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
- "*-stable"
|
8
|
+
- "*/ci-check"
|
9
|
+
pull_request:
|
10
|
+
branches:
|
11
|
+
- master
|
12
|
+
|
13
|
+
jobs:
|
14
|
+
rake:
|
15
|
+
name: ${{ matrix.combo.name || matrix.combo.ruby }}
|
16
|
+
strategy:
|
17
|
+
fail-fast: false
|
18
|
+
matrix:
|
19
|
+
combo:
|
20
|
+
- name: mspec-nodejs
|
21
|
+
ruby: 3.0
|
22
|
+
command: bin/rake mspec_nodejs
|
23
|
+
- name: mspec-chrome
|
24
|
+
ruby: 3.0
|
25
|
+
command: bin/rake mspec_chrome
|
26
|
+
- name: minitest
|
27
|
+
ruby: 3.0
|
28
|
+
command: bin/rake minitest
|
29
|
+
- name: current-ruby
|
30
|
+
ruby: 3.0
|
31
|
+
- name: previous-ruby
|
32
|
+
ruby: 2.7
|
33
|
+
- name: older-ruby
|
34
|
+
ruby: 2.6
|
35
|
+
- name: near-eol-ruby
|
36
|
+
ruby: 2.5
|
37
|
+
- name: smoke-test
|
38
|
+
ruby: 3.0
|
39
|
+
command: bin/rake smoke_test
|
40
|
+
- name: windows
|
41
|
+
# These two fail because of broken stacktraces on windows: minitest_node_nodejs mspec_nodejs
|
42
|
+
command: bundle exec rake rspec minitest_nodejs
|
43
|
+
ruby: 3.0
|
44
|
+
os: windows-latest
|
45
|
+
- name: lint
|
46
|
+
command: bin/rake lint
|
47
|
+
ruby: 3.0
|
48
|
+
- name: timezone
|
49
|
+
ruby: 3.0
|
50
|
+
|
51
|
+
# Currently failing:
|
52
|
+
# - ruby: truffleruby
|
53
|
+
# - ruby: jruby
|
54
|
+
# - ruby: ruby-head
|
55
|
+
|
56
|
+
runs-on: ${{ matrix.combo.os || 'ubuntu-latest' }}
|
57
|
+
steps:
|
58
|
+
- uses: actions/checkout@v2
|
59
|
+
- uses: ruby/setup-ruby@v1
|
60
|
+
with:
|
61
|
+
ruby-version: ${{ matrix.combo.ruby }}
|
62
|
+
# NOTE: Bundler 2.2.0 fails to install libv8
|
63
|
+
# https://github.com/rubyjs/libv8/issues/310
|
64
|
+
bundler: "2.1.4"
|
65
|
+
bundler-cache: false
|
66
|
+
- run: ruby bin/git-submodule-fast-install
|
67
|
+
- run: bundle lock
|
68
|
+
- uses: actions/cache@v2
|
69
|
+
with:
|
70
|
+
path: ./vendor/bundle
|
71
|
+
key: ${{ runner.os }}-${{ matrix.combo.ruby }}-gems-${{ github.ref }}-${{ hashFiles('**/Gemfile.lock') }}
|
72
|
+
restore-keys: |
|
73
|
+
${{ runner.os }}-${{ matrix.combo.ruby }}-gems-${{ github.ref }}
|
74
|
+
${{ runner.os }}-${{ matrix.combo.ruby }}-gems-master
|
75
|
+
${{ runner.os }}-${{ matrix.combo.ruby }}-gems-
|
76
|
+
- uses: actions/cache@v2
|
77
|
+
with:
|
78
|
+
path: ./node_modules
|
79
|
+
key: ${{ runner.os }}-npm-${{ github.ref }}-${{ hashFiles('**/yarn.lock') }}
|
80
|
+
restore-keys: |
|
81
|
+
${{ runner.os }}-npm-${{ github.ref }}
|
82
|
+
${{ runner.os }}-npm-master
|
83
|
+
${{ runner.os }}-npm-
|
84
|
+
- run: yarn install
|
85
|
+
- name: bundle install
|
86
|
+
run: |
|
87
|
+
bundle config path $PWD/vendor/bundle
|
88
|
+
bundle install --jobs 4 --retry 3
|
89
|
+
bundle clean
|
90
|
+
- run: ${{ matrix.combo.command || 'bin/rake rspec' }}
|
data/.jshintrc
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
"undef" : true, // Prohibit the use of explicitly undeclared variables
|
11
11
|
"unused" : true, // Warn when you define and never use your variables
|
12
12
|
|
13
|
-
"predef" : ["Opal", "JSON", "Java", "OpalNode", "jsyaml"],
|
13
|
+
"predef" : ["Opal", "JSON", "Java", "OpalNode", "jsyaml", "globalThis"],
|
14
14
|
|
15
15
|
"browser": true,
|
16
16
|
"node": true,
|
data/.overcommit.yml
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Use this file to configure the Overcommit hooks you wish to use. This will
|
2
|
+
# extend the default configuration defined in:
|
3
|
+
# https://github.com/sds/overcommit/blob/master/config/default.yml
|
4
|
+
#
|
5
|
+
# At the topmost level of this YAML file is a key representing type of hook
|
6
|
+
# being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
|
7
|
+
# customize each hook, such as whether to only run it on certain files (via
|
8
|
+
# `include`), whether to only display output if it fails (via `quiet`), etc.
|
9
|
+
#
|
10
|
+
# For a complete list of hooks, see:
|
11
|
+
# https://github.com/sds/overcommit/tree/master/lib/overcommit/hook
|
12
|
+
#
|
13
|
+
# For a complete list of options that you can use to customize hooks, see:
|
14
|
+
# https://github.com/sds/overcommit#configuration
|
15
|
+
#
|
16
|
+
# Uncomment the following lines to make the configuration take effect.
|
17
|
+
|
18
|
+
gemfile: Gemfile
|
19
|
+
|
20
|
+
PreCommit:
|
21
|
+
RuboCop:
|
22
|
+
enabled: true
|
23
|
+
on_warn: fail # Treat all warnings as failures
|
24
|
+
|
25
|
+
TrailingWhitespace:
|
26
|
+
enabled: true
|
27
|
+
# exclude:
|
28
|
+
# - '**/db/structure.sql' # Ignore trailing whitespace in generated files
|
29
|
+
|
30
|
+
#PostCheckout:
|
31
|
+
# ALL: # Special hook name that customizes all hooks of this type
|
32
|
+
# quiet: true # Change all post-checkout hooks to only display output on failure
|
33
|
+
#
|
34
|
+
# IndexTags:
|
35
|
+
# enabled: true # Generate a tags file with `ctags` each time HEAD changes
|
data/.rubocop.yml
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
require: rubocop-performance
|
2
|
+
inherit_from: .rubocop/todo.yml
|
2
3
|
|
3
4
|
AllCops:
|
4
5
|
TargetRubyVersion: 2.5
|
@@ -49,6 +50,8 @@ AllCops:
|
|
49
50
|
- 'stdlib/e2mmap.rb'
|
50
51
|
- 'stdlib/matrix.rb'
|
51
52
|
- 'stdlib/matrix/*.rb'
|
53
|
+
- 'stdlib/pp.rb'
|
54
|
+
- 'stdlib/prettyprint.rb'
|
52
55
|
|
53
56
|
inherit_mode:
|
54
57
|
merge:
|
@@ -69,6 +72,10 @@ Layout/CommentIndentation:
|
|
69
72
|
- 'lib/opal/rewriters/binary_operator_assignment.rb'
|
70
73
|
- 'lib/opal/rewriters/logical_operator_assignment.rb'
|
71
74
|
|
75
|
+
# We need to support older rubies
|
76
|
+
Layout/IndentHeredoc:
|
77
|
+
Enabled: false
|
78
|
+
|
72
79
|
Style/FrozenStringLiteralComment:
|
73
80
|
Exclude:
|
74
81
|
- 'opal/**/*.rb'
|
@@ -116,6 +123,10 @@ Lint/LiteralAsCondition:
|
|
116
123
|
- 'opal/**/*.rb'
|
117
124
|
- 'stdlib/**/*.rb'
|
118
125
|
|
126
|
+
# Allow the use of if/unless inside blocks
|
127
|
+
Style/Next:
|
128
|
+
Enabled: false
|
129
|
+
|
119
130
|
Lint/RescueException:
|
120
131
|
Exclude:
|
121
132
|
# That's what MRI does
|
@@ -243,12 +254,18 @@ Style/InverseMethods:
|
|
243
254
|
- 'opal/corelib/basic_object.rb'
|
244
255
|
- 'opal/corelib/kernel.rb'
|
245
256
|
|
246
|
-
Style/
|
247
|
-
# Base Opal classes simply can't call super for #method_missing
|
257
|
+
Style/MethodMissingSuper:
|
258
|
+
# Base Opal classes simply can't or shouldn't call super for #method_missing
|
248
259
|
Exclude:
|
249
260
|
- 'opal/corelib/basic_object.rb'
|
250
261
|
- 'opal/corelib/kernel.rb'
|
251
262
|
- 'opal/corelib/string/inheritance.rb'
|
263
|
+
- 'stdlib/native.rb'
|
264
|
+
- 'stdlib/delegate.rb'
|
265
|
+
- 'stdlib/ostruct.rb'
|
266
|
+
|
267
|
+
Style/MissingRespondToMissing:
|
268
|
+
Enabled: true
|
252
269
|
|
253
270
|
Style/NumericPredicate:
|
254
271
|
Enabled: false
|
@@ -257,6 +274,8 @@ Style/ParallelAssignment:
|
|
257
274
|
Enabled: false
|
258
275
|
|
259
276
|
Style/PercentLiteralDelimiters:
|
277
|
+
PreferredDelimiters:
|
278
|
+
default: '{}'
|
260
279
|
Exclude:
|
261
280
|
# Opal has a convention of %x{}
|
262
281
|
- 'opal/**/*.rb'
|
@@ -326,10 +345,6 @@ Style/RegexpLiteral:
|
|
326
345
|
# Rubocop doesn't check for backslashes, so this rule is disabled.
|
327
346
|
Enabled: false
|
328
347
|
|
329
|
-
Style/PercentLiteralDelimiters:
|
330
|
-
PreferredDelimiters:
|
331
|
-
default: '{}'
|
332
|
-
|
333
348
|
Naming/FileName:
|
334
349
|
Exclude:
|
335
350
|
- 'stdlib/opal-builder.rb'
|
@@ -396,3 +411,25 @@ Style/ConditionalAssignment:
|
|
396
411
|
Naming/MemoizedInstanceVariableName:
|
397
412
|
Exclude:
|
398
413
|
- lib/opal/parser/patch.rb # it's a monkey-patch on the parser gem
|
414
|
+
|
415
|
+
Style/AccessModifierDeclarations:
|
416
|
+
Enabled: false
|
417
|
+
|
418
|
+
Style/MultipleComparison:
|
419
|
+
Enabled: false
|
420
|
+
|
421
|
+
Layout/EmptyLineAfterGuardClause:
|
422
|
+
Enabled: false
|
423
|
+
|
424
|
+
Layout/AlignHash:
|
425
|
+
Enabled: false
|
426
|
+
|
427
|
+
# No way to set multiple preferred names
|
428
|
+
Naming/RescuedExceptionsVariableName:
|
429
|
+
Enabled: false
|
430
|
+
|
431
|
+
Style/Semicolon:
|
432
|
+
AllowAsExpressionSeparator: true
|
433
|
+
|
434
|
+
Layout/EmptyLinesAroundExceptionHandlingKeywords:
|
435
|
+
Enabled: false
|
@@ -33,12 +33,11 @@ Style/MutableConstant:
|
|
33
33
|
- 'lib/opal/nodes/call.rb'
|
34
34
|
- 'lib/opal/util.rb'
|
35
35
|
|
36
|
-
|
36
|
+
Lint/HandleExceptions:
|
37
37
|
Exclude:
|
38
|
-
- 'stdlib/native.rb'
|
39
|
-
- 'stdlib/delegate.rb'
|
40
38
|
- 'stdlib/ostruct.rb'
|
41
39
|
|
42
|
-
Lint/
|
40
|
+
Lint/ToJSON:
|
43
41
|
Exclude:
|
44
|
-
- '
|
42
|
+
- 'lib/opal/source_map/map.rb'
|
43
|
+
- 'stdlib/json.rb'
|
data/CHANGELOG.md
CHANGED
@@ -15,10 +15,161 @@ Changes are grouped as follows:
|
|
15
15
|
|
16
16
|
|
17
17
|
|
18
|
-
## [Unreleased](https://github.com/opal/opal/compare/v1.0
|
18
|
+
## [Unreleased](https://github.com/opal/opal/compare/v1.1.0...HEAD) - unreleased
|
19
19
|
|
20
20
|
|
21
|
+
### Added
|
22
|
+
### Fixed
|
23
|
+
### Changed
|
24
|
+
### Deprecated
|
25
|
+
### Removed
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
## [1.1.0](https://github.com/opal/opal/compare/v1.0.5...v1.1.0) - 2021-02-19
|
31
|
+
|
32
|
+
|
33
|
+
### Added
|
34
|
+
|
35
|
+
- Basic support for `uplevel:` keyword argument in `Kernel#warn` ([#2006](https://github.com/opal/opal/pull/2006))
|
36
|
+
- Added a `#respond_to_missing?` implementation for `BasicObject`, `Delegator`, `OpenStruct`, that's meant for future support in the Opal runtime, which currently ignores it ([#2007](https://github.com/opal/opal/pull/2007))
|
37
|
+
- `Opal::Compiler#magic_comments` that allows to access magic-comments format and converts it to a hash ([#2038](https://github.com/opal/opal/pull/2038))
|
38
|
+
- Use magic-comments to declare helpers required by the file ([#2038](https://github.com/opal/opal/pull/2038))
|
39
|
+
- `Opal.$$` is now a shortcut for `Opal.const_get_relative` ([#2038](https://github.com/opal/opal/pull/2038))
|
40
|
+
- `Opal.$$$` is now a shortcut for `Opal.const_get_qualified` ([#2038](https://github.com/opal/opal/pull/2038))
|
41
|
+
- Added support for `globalThis` as the generic global object accessor ([#2047](https://github.com/opal/opal/pull/2047))
|
42
|
+
- `Opal::Compiler#magic_comments` that allows to access magic-comments format and converts it to a hash
|
43
|
+
- Use magic-comments to declare helpers required by the file
|
44
|
+
- `Opal.$$` is now a shortcut for `Opal.const_get_relative`
|
45
|
+
- `Opal.$$$` is now a shortcut for `Opal.const_get_qualified`
|
46
|
+
- Source-map support for Node.js in the default runner ([#2045](https://github.com/opal/opal/pull/2045))
|
47
|
+
- SecureRandom#hex(n) ([#2050](https://github.com/opal/opal/pull/2050))
|
48
|
+
- Added a generic implementation of Kernel#caller and #warn(uplevel:) that works with sourcemaps in Node.js and Chrome ([#2065](https://github.com/opal/opal/pull/2065))
|
49
|
+
- Added support for numblocks `-> { _1 + _2 }.call(3, 4) # => 7` ([#2149](https://github.com/opal/opal/pull/2149))
|
50
|
+
- Support `<internal:…>` and `<js:…>` in stacktraces, like MRI we now distinguish internal lines from lib/app lines ([#2154](https://github.com/opal/opal/pull/2154))
|
51
|
+
- `Array#difference`, `Array#intersection`, `Array#union` as aliases respectively to `Array#{-,&,|}` ([#2151](https://github.com/opal/opal/pull/2151))
|
52
|
+
- Aliases `filter{,!}` to `select{,!}` throughout the corelib classes ([#2151](https://github.com/opal/opal/pull/2151))
|
53
|
+
- `Enumerable#filter_map`, `Enumerable#tally` ([#2151](https://github.com/opal/opal/pull/2151))
|
54
|
+
- Alias `Kernel#then` for `Kernel#yield_self` ([#2151](https://github.com/opal/opal/pull/2151))
|
55
|
+
- Method chaining: `{Proc,Method}#{<<,>>}` ([#2151](https://github.com/opal/opal/pull/2151))
|
56
|
+
- Added Integer#to_d ([#2006](https://github.com/opal/opal/pull/2006))
|
57
|
+
- Added a compiler option `use_strict` which can also be set by the `use_strict` magic comment ([#1959](https://github.com/opal/opal/pull/1959))
|
58
|
+
- Add `--rbrequire (-q)` option to `opal` command line executable ([#2120](https://github.com/opal/opal/pull/2120))
|
59
|
+
|
60
|
+
### Fixed
|
61
|
+
|
62
|
+
- Array#delete_if ([#2069](https://github.com/opal/opal/pull/2069))
|
63
|
+
- Array#keep_if ([#2069](https://github.com/opal/opal/pull/2069))
|
64
|
+
- Array#reject! ([#2069](https://github.com/opal/opal/pull/2069))
|
65
|
+
- Array#select! ([#2069](https://github.com/opal/opal/pull/2069))
|
66
|
+
- Struct#dup ([#1995](https://github.com/opal/opal/pull/1995))
|
67
|
+
- Integer#gcdlcm ([#1972](https://github.com/opal/opal/pull/1972))
|
68
|
+
- Enumerable#to_h ([#1979](https://github.com/opal/opal/pull/1979))
|
69
|
+
- Enumerator#size ([#1980](https://github.com/opal/opal/pull/1980))
|
70
|
+
- Enumerable#min ([#1982](https://github.com/opal/opal/pull/1982))
|
71
|
+
- Enumerable#min_by ([#1985](https://github.com/opal/opal/pull/1985))
|
72
|
+
- Enumerable#max_by ([#1985](https://github.com/opal/opal/pull/1985))
|
73
|
+
- Set#intersect? ([#1988](https://github.com/opal/opal/pull/1988))
|
74
|
+
- Set#disjoint? ([#1988](https://github.com/opal/opal/pull/1988))
|
75
|
+
- Set#keep_if ([#1987](https://github.com/opal/opal/pull/1987))
|
76
|
+
- Set#select! ([#1987](https://github.com/opal/opal/pull/1987))
|
77
|
+
- Set#reject! ([#1987](https://github.com/opal/opal/pull/1987))
|
78
|
+
- String#unicode_normalize ([#2175](https://github.com/opal/opal/pull/2175))
|
79
|
+
- Module#alias_method ([#1983](https://github.com/opal/opal/pull/1983))
|
80
|
+
- Enumerable#minmax_by ([#1981](https://github.com/opal/opal/pull/1981))
|
81
|
+
- Enumerator#each_with_index ([#1990](https://github.com/opal/opal/pull/1990))
|
82
|
+
- Range#== ([#1992](https://github.com/opal/opal/pull/1992))
|
83
|
+
- Range#each ([#1991](https://github.com/opal/opal/pull/1991))
|
84
|
+
- Enumerable#zip ([#1986](https://github.com/opal/opal/pull/1986))
|
85
|
+
- String#getbyte ([#2141](https://github.com/opal/opal/pull/2141))
|
86
|
+
- Struct#dup not copying `$$data` ([#1995](https://github.com/opal/opal/pull/1995))
|
87
|
+
- Fixed usage of semicolon in single-line backticks ([#2004](https://github.com/opal/opal/pull/2004))
|
88
|
+
- Module#attr with multiple arguments ([#2003](https://github.com/opal/opal/pull/2003))
|
89
|
+
- `PathReader` used to try to read missing files instead of respecting the `missing_require_severity` configuration value ([#2044](https://github.com/opal/opal/pull/2044))
|
90
|
+
- Removed some unused variables from the runtime ([#2052](https://github.com/opal/opal/pull/2052))
|
91
|
+
- Fixed a typo in the runtime ([#2054](https://github.com/opal/opal/pull/2054))
|
92
|
+
- Fix Regexp interpolation, previously interpolating with other regexps was broken ([#2062](https://github.com/opal/opal/pull/2062))
|
93
|
+
- Set match on StringScanner#skip and StringScanner#scan_until ([#2061](https://github.com/opal/opal/pull/2061))
|
94
|
+
- Fix ruby 2.7 warnings ([#2071](https://github.com/opal/opal/pull/2071))
|
95
|
+
- Improve the --help descriptions ([#2146](https://github.com/opal/opal/pull/2146))
|
96
|
+
- Remove BasicObject#class ([#2166](https://github.com/opal/opal/pull/2166))
|
97
|
+
- Time#strftime %j leading zeros ([#2161](https://github.com/opal/opal/pull/2161))
|
98
|
+
- Fix `call { true or next }` producing invalid code ([#2160](https://github.com/opal/opal/pull/2160))
|
99
|
+
- `define_method` can now be called on the main object ([#2029](https://github.com/opal/opal/pull/2029))
|
100
|
+
- Fix nested for-loops ([#2033](https://github.com/opal/opal/pull/2033))
|
101
|
+
- Fix Number#round for Integers ([#2030](https://github.com/opal/opal/pull/2030))
|
102
|
+
- Fix parsing Unicode characters from Opal ([#2073](https://github.com/opal/opal/pull/2073))
|
103
|
+
- Integer#===: improve Integer recognition ([#2089](https://github.com/opal/opal/pull/2089))
|
104
|
+
- Regexp: ensure ignoreCase is never undefined ([#2098](https://github.com/opal/opal/pull/2098))
|
105
|
+
- Hash#delete: ensure String keys are converted to values ([#2106](https://github.com/opal/opal/pull/2106))
|
106
|
+
- Array#shift: improve performance on v8 >7.1 ([#2115](https://github.com/opal/opal/pull/2115))
|
107
|
+
- Array#pop(1): improve performance ([#2130](https://github.com/opal/opal/pull/2130))
|
108
|
+
- Object#pretty_inspect ([#2139](https://github.com/opal/opal/pull/2139))
|
109
|
+
- Fix conversion from UTF-8 to bytes ([#2138](https://github.com/opal/opal/pull/2138))
|
110
|
+
- Restore compatibility with Chrome 38, used by Cordova and many mobile browsers ([#2109](https://github.com/opal/opal/pull/2109))
|
111
|
+
|
112
|
+
### Changed
|
113
|
+
|
114
|
+
- Updated outdated parser version ([#2013](https://github.com/opal/opal/pull/2013))
|
115
|
+
- Nashorn has been deprecated but GraalVM still supports it ([#1997](https://github.com/opal/opal/pull/1997))
|
116
|
+
- "opal/mini" now includes "opal/io" ([#2002](https://github.com/opal/opal/pull/2002))
|
117
|
+
- Regexps assigned to constants are now frozen ([#2007](https://github.com/opal/opal/pull/2007))
|
118
|
+
- `Opal.$$` changed from being the constant cache of Object to being a shortcut for `Opal.const_get_relative` ([#2038](https://github.com/opal/opal/pull/2038))
|
119
|
+
- Moved REPL implementation from bin/ to its own lib/ file as `opal/repl.rb` ([#2048](https://github.com/opal/opal/pull/2048))
|
120
|
+
- `Encoding.default_external` is now initialized with `__ENCODING__` ([#2072](https://github.com/opal/opal/pull/2072))
|
121
|
+
- Keep the MersenneTwister implementation private ([#2108](https://github.com/opal/opal/pull/2108))
|
122
|
+
- Change parser to 3.0 ([#2148](https://github.com/opal/opal/pull/2148))
|
123
|
+
- Fix forwarding a rescued error to a global var: `rescue => $gvar` ([#2154](https://github.com/opal/opal/pull/2154))
|
124
|
+
- Now using Parser v3.0 and targeting Ruby 3.0 ([#2156](https://github.com/opal/opal/pull/2156))
|
125
|
+
- `Comparable#clamp` to support a Range argument ([#2151](https://github.com/opal/opal/pull/2151))
|
126
|
+
- `#to_h` method to support a block (shortform for `.map(&block).to_h`) ([#2151](https://github.com/opal/opal/pull/2151))
|
127
|
+
- BigDecimal is now a subclass of Numeric ([#2006](https://github.com/opal/opal/pull/2006))
|
128
|
+
- PP to be rebased on upstream Ruby version ([#2083](https://github.com/opal/opal/pull/2083))
|
129
|
+
- String to report UTF-8 encoding by default, as MRI does ([#2117](https://github.com/opal/opal/pull/2117))
|
130
|
+
- Don't output "Failed to load WithCLexer, using pure Ruby lexer" warning unless in $DEBUG mode ([#2174](https://github.com/opal/opal/pull/2174))
|
131
|
+
|
132
|
+
### Deprecated
|
133
|
+
|
134
|
+
- Requiring nodejs/stacktrace has been deprecated, source-maps are already
|
135
|
+
supported by the default Node.js runner or by requiring https://github.com/evanw/node-source-map-support
|
136
|
+
before loading code compiled by Opal ([#2045](https://github.com/opal/opal/pull/2045))
|
137
|
+
|
138
|
+
### Removed
|
139
|
+
|
140
|
+
- Removed special compilation for the `Opal.truthy?` and `Opal.falsy?` helpers ([#2076](https://github.com/opal/opal/pull/2076))
|
141
|
+
- Removed the deprecated `tainting` compiler config option ([#2072](https://github.com/opal/opal/pull/2072))
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
## [1.0.5](https://github.com/opal/opal/compare/v1.0.4...v1.0.5) - 2020-12-23
|
147
|
+
|
148
|
+
|
149
|
+
### Fixed
|
150
|
+
|
151
|
+
- [Backported] Add --rbrequire (-q) option to opal cmdline tool ([#2120](https://github.com/opal/opal/pull/2120))
|
152
|
+
- Improve the --help descriptions ([#2146](https://github.com/opal/opal/pull/2146))
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
## [1.0.4](https://github.com/opal/opal/compare/v1.0.3...v1.0.4) - 2020-12-13
|
158
|
+
|
159
|
+
|
160
|
+
### Fixed
|
161
|
+
|
162
|
+
- [Backported] Using the `--map` / `-P` CLI option was only working in conjunction with other options ([#1974](https://github.com/opal/opal/pull/1974))
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
## [1.0.3](https://github.com/opal/opal/compare/v1.0.2...v1.0.3) - 2020-02-01
|
168
|
+
|
169
|
+
|
170
|
+
### Fixed
|
21
171
|
|
172
|
+
- Fixed compiling code with Unicode chars from Opal with opal-parser ([#2074](https://github.com/opal/opal/pull/2074))
|
22
173
|
|
23
174
|
|
24
175
|
|