opal 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +4 -4
  3. data/.github/ISSUE_TEMPLATE/bug-report.md +47 -0
  4. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  5. data/.github/workflows/build.yml +11 -5
  6. data/.gitignore +1 -0
  7. data/.jshintrc +1 -1
  8. data/.rubocop.yml +2 -1
  9. data/CHANGELOG.md +95 -1
  10. data/Gemfile +0 -4
  11. data/HACKING.md +1 -1
  12. data/README.md +19 -15
  13. data/UNRELEASED.md +37 -96
  14. data/benchmark-ips/bm_array_unshift.rb +7 -0
  15. data/bin/build-browser-source-map-support +2 -3
  16. data/bin/opal-mspec +2 -0
  17. data/docs/compiler.md +1 -1
  18. data/examples/rack/Gemfile +0 -1
  19. data/examples/rack/Gemfile.lock +0 -4
  20. data/lib/opal/cli.rb +1 -0
  21. data/lib/opal/cli_options.rb +4 -0
  22. data/lib/opal/cli_runners/nodejs.rb +5 -1
  23. data/lib/opal/cli_runners/source-map-support-browser.js +8 -2
  24. data/lib/opal/cli_runners/source-map-support-node.js +3706 -0
  25. data/lib/opal/cli_runners/source-map-support.js +3 -1
  26. data/lib/opal/compiler.rb +2 -2
  27. data/lib/opal/nodes/args/arity_check.rb +1 -0
  28. data/lib/opal/nodes/args/parameters.rb +6 -0
  29. data/lib/opal/nodes/class.rb +1 -13
  30. data/lib/opal/nodes/literal.rb +14 -7
  31. data/lib/opal/nodes/module.rb +13 -9
  32. data/lib/opal/nodes/variables.rb +13 -4
  33. data/lib/opal/nodes/while.rb +54 -17
  34. data/lib/opal/parser.rb +1 -5
  35. data/lib/opal/parser/patch.rb +44 -0
  36. data/lib/opal/repl.rb +7 -0
  37. data/lib/opal/rewriter.rb +4 -0
  38. data/lib/opal/rewriters/arguments.rb +4 -1
  39. data/lib/opal/rewriters/forward_args.rb +54 -0
  40. data/lib/opal/rewriters/logical_operator_assignment.rb +5 -2
  41. data/lib/opal/rewriters/opal_engine_check.rb +5 -7
  42. data/lib/opal/rewriters/pattern_matching.rb +287 -0
  43. data/lib/opal/version.rb +1 -1
  44. data/opal/corelib/array.rb +42 -20
  45. data/opal/corelib/array/pack.rb +6 -1
  46. data/opal/corelib/complex.rb +2 -0
  47. data/opal/corelib/constants.rb +3 -3
  48. data/opal/corelib/hash.rb +45 -38
  49. data/opal/corelib/module.rb +2 -7
  50. data/opal/corelib/number.rb +2 -180
  51. data/opal/corelib/numeric.rb +156 -0
  52. data/opal/corelib/object_space.rb +102 -0
  53. data/opal/corelib/pattern_matching.rb +159 -0
  54. data/opal/corelib/random.rb +31 -66
  55. data/opal/corelib/random/formatter.rb +122 -0
  56. data/opal/corelib/range.rb +50 -19
  57. data/opal/corelib/runtime.js +82 -21
  58. data/opal/corelib/string.rb +86 -52
  59. data/opal/corelib/string/encoding.rb +140 -25
  60. data/opal/corelib/string/unpack.rb +26 -40
  61. data/opal/opal.rb +1 -0
  62. data/opal/opal/full.rb +2 -0
  63. data/package.json +1 -1
  64. data/spec/filters/bugs/array.rb +0 -23
  65. data/spec/filters/bugs/basicobject.rb +3 -0
  66. data/spec/filters/bugs/encoding.rb +0 -2
  67. data/spec/filters/bugs/exception.rb +1 -0
  68. data/spec/filters/bugs/float.rb +0 -2
  69. data/spec/filters/bugs/hash.rb +3 -13
  70. data/spec/filters/bugs/integer.rb +0 -2
  71. data/spec/filters/bugs/kernel.rb +16 -3
  72. data/spec/filters/bugs/language.rb +27 -90
  73. data/spec/filters/bugs/marshal.rb +1 -3
  74. data/spec/filters/bugs/module.rb +16 -1
  75. data/spec/filters/bugs/numeric.rb +4 -12
  76. data/spec/filters/bugs/objectspace.rb +67 -0
  77. data/spec/filters/bugs/pack_unpack.rb +0 -9
  78. data/spec/filters/bugs/pathname.rb +1 -0
  79. data/spec/filters/bugs/proc.rb +8 -0
  80. data/spec/filters/bugs/random.rb +3 -6
  81. data/spec/filters/bugs/range.rb +83 -113
  82. data/spec/filters/bugs/set.rb +2 -0
  83. data/spec/filters/bugs/string.rb +32 -70
  84. data/spec/filters/bugs/struct.rb +2 -10
  85. data/spec/filters/bugs/time.rb +8 -2
  86. data/spec/filters/unsupported/float.rb +3 -0
  87. data/spec/filters/unsupported/freeze.rb +1 -0
  88. data/spec/filters/unsupported/integer.rb +3 -0
  89. data/spec/filters/unsupported/refinements.rb +8 -0
  90. data/spec/filters/unsupported/string.rb +100 -95
  91. data/spec/filters/unsupported/time.rb +4 -0
  92. data/spec/lib/compiler_spec.rb +16 -0
  93. data/spec/lib/rewriters/forward_args_spec.rb +61 -0
  94. data/spec/lib/rewriters/logical_operator_assignment_spec.rb +1 -1
  95. data/spec/lib/rewriters/numblocks_spec.rb +44 -0
  96. data/spec/lib/rewriters/opal_engine_check_spec.rb +49 -4
  97. data/spec/opal/core/language/forward_args_spec.rb +53 -0
  98. data/spec/opal/core/language/infinite_range_spec.rb +13 -0
  99. data/spec/opal/core/language/memoization_spec.rb +16 -0
  100. data/spec/opal/core/language/pattern_matching_spec.rb +124 -0
  101. data/spec/opal/core/module_spec.rb +38 -2
  102. data/spec/opal/core/number/to_i_spec.rb +28 -0
  103. data/spec/opal/core/runtime/bridged_classes_spec.rb +16 -0
  104. data/spec/opal/core/runtime/constants_spec.rb +20 -1
  105. data/spec/opal/core/string/subclassing_spec.rb +16 -0
  106. data/spec/opal/core/string/unpack_spec.rb +22 -0
  107. data/spec/opal/core/string_spec.rb +4 -4
  108. data/spec/ruby_specs +4 -1
  109. data/stdlib/json.rb +3 -1
  110. data/stdlib/promise/v1.rb +1 -0
  111. data/stdlib/promise/v2.rb +386 -0
  112. data/stdlib/securerandom.rb +55 -35
  113. data/tasks/releasing.rake +1 -1
  114. data/tasks/testing.rake +6 -4
  115. data/test/nodejs/test_string.rb +25 -0
  116. data/test/opal/promisev2/test_always.rb +63 -0
  117. data/test/opal/promisev2/test_error.rb +16 -0
  118. data/test/opal/promisev2/test_rescue.rb +59 -0
  119. data/test/opal/promisev2/test_then.rb +90 -0
  120. data/test/opal/promisev2/test_trace.rb +52 -0
  121. data/test/opal/promisev2/test_value.rb +16 -0
  122. data/test/opal/promisev2/test_when.rb +35 -0
  123. data/vendored-minitest/minitest/assertions.rb +2 -0
  124. metadata +47 -8
  125. data/lib/opal/parser/with_c_lexer.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ebf169fc98d390d965c39386668f569467dc11db3eff5f2571db172f9f632b02
4
- data.tar.gz: 7d4d4e0de908d931ca39ac6d05d5fcbc1f1f1c1585e0cad22549ad31129f4064
3
+ metadata.gz: f13610ebfa130a3b3379a2d23f3fc077de87e4fd69c33248a87bdf23e144686a
4
+ data.tar.gz: 275fa37ed3f201f2c716bcf8f05cc5fcd5ff42dec5aaae1b4753c126a629d5c1
5
5
  SHA512:
6
- metadata.gz: 6c80d8bcb148c8c8563b88c0e482f77937e4f4e8cc2144a5f9f83ea1e4b914a3e3bf7888b591d9721a20e050a64e08ddb099af7c5b4cb939d8c2f8472a662c9d
7
- data.tar.gz: e04acce5335dd3ffe2bafdd40425ad788ff50316240d7863c7b8256b97f69a48a7f18cdcb9d9c1ddf0b738e366d5290b510ed6978735661a8f59f3e9003d3148
6
+ metadata.gz: b5a9d1f1494542fd5d1669bb16548b5a335777398a3d84945dbabb8477cedd79f1fd1fc251f663e9f22a518a9a7c3d361f83fb14c860bc3cb36b79c7cd6c40b8
7
+ data.tar.gz: 90f237673bc19937ee643fbe5562cd348476f975a90348c95138785457a6da342b4df98a48d14b223a938e9c91ac603fde0d2c5cbe18982ec1bcc3c1e6d4c375
data/.codeclimate.yml CHANGED
@@ -9,13 +9,13 @@ checks:
9
9
  threshold: 10
10
10
  file-lines:
11
11
  config:
12
- threshold: 250
12
+ threshold: 1000
13
13
  method-complexity:
14
14
  config:
15
15
  threshold: 5
16
16
  method-count:
17
17
  config:
18
- threshold: 20
18
+ threshold: 100
19
19
  method-lines:
20
20
  config:
21
21
  threshold: 30
@@ -39,6 +39,7 @@ plugins:
39
39
 
40
40
  exclude_patterns:
41
41
  - "benchmark/*"
42
+ - "benchmark-ips/*"
42
43
  - "build/*"
43
44
  - "coverage/*"
44
45
  - "docs/*"
@@ -50,5 +51,4 @@ exclude_patterns:
50
51
  - "**/node_modules/*"
51
52
  - stdlib/nodejs/js-yaml-3-6-1.js
52
53
  - lib/opal/source_map/vlq.rb
53
- - lib/opal/cli_runners/source-map-support.js
54
- - lib/opal/cli_runners/source-map-support-browser.js
54
+ - lib/opal/cli_runners/source-map-support*.js
@@ -0,0 +1,47 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: 'Bug: '
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ <!-- A clear and concise description of what the bug is.
12
+ Please clarify if it's a missing feature. -->
13
+
14
+ Opal version: …
15
+
16
+
17
+ **To Reproduce**
18
+
19
+ <!--
20
+ Steps to reproduce the behavior.
21
+
22
+ You can contrasting it to Ruby's behavior:
23
+
24
+ ```
25
+ $ opal -v -e "puts 123"
26
+ 123
27
+ ```
28
+
29
+ ```
30
+ $ruby -v -e "puts 123"
31
+ ```
32
+
33
+ or show an error in the compiled code:
34
+
35
+ ```
36
+ $ opal -v -e "puts 123" -cEO
37
+
38
+ /* Generated by Opal 1.1.1 */
39
+ (function(Opal) {
40
+ var self = Opal.top, $nesting = [], nil = Opal.nil, $$$ = Opal.$$$, $$ = Opal.$$;
41
+
42
+ Opal.add_stubs(['$puts']);
43
+ return self.$puts(123)
44
+ })(Opal);
45
+
46
+ ```
47
+ -->
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: 'Feature: '
5
+ labels: feature
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -6,9 +6,7 @@ on:
6
6
  - master
7
7
  - "*-stable"
8
8
  - "*/ci-check"
9
- pull_request:
10
- branches:
11
- - master
9
+ pull_request: {}
12
10
 
13
11
  jobs:
14
12
  rake:
@@ -26,14 +24,18 @@ jobs:
26
24
  - name: minitest
27
25
  ruby: 3.0
28
26
  command: bin/rake minitest
27
+ - name: minitest-strict-mode
28
+ ruby: 3.0
29
+ command: bin/rake minitest
30
+ strict: 'true'
29
31
  - name: current-ruby
30
32
  ruby: 3.0
31
33
  - name: previous-ruby
32
34
  ruby: 2.7
33
35
  - name: older-ruby
34
36
  ruby: 2.6
35
- - name: near-eol-ruby
36
- ruby: 2.5
37
+ # - name: near-eol-ruby
38
+ # ruby: 2.6
37
39
  - name: smoke-test
38
40
  ruby: 3.0
39
41
  command: bin/rake smoke_test
@@ -87,4 +89,8 @@ jobs:
87
89
  bundle config path $PWD/vendor/bundle
88
90
  bundle install --jobs 4 --retry 3
89
91
  bundle clean
92
+ - name: set environment variables
93
+ if: ${{ matrix.combo.strict == 'true' }}
94
+ run: |
95
+ echo "USE_STRICT=true" >> $GITHUB_ENV
90
96
  - run: ${{ matrix.combo.command || 'bin/rake rspec' }}
data/.gitignore CHANGED
@@ -3,6 +3,7 @@
3
3
  .yardoc
4
4
  .bundle
5
5
  Gemfile.lock
6
+ Gemfile.local
6
7
  build/
7
8
  /.github_access_token
8
9
  /cdn
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", "globalThis"],
13
+ "predef" : ["Opal", "JSON", "Java", "OpalNode", "jsyaml", "globalThis", "FinalizationRegistry", "WeakMap"],
14
14
 
15
15
  "browser": true,
16
16
  "node": true,
data/.rubocop.yml CHANGED
@@ -107,8 +107,9 @@ Layout/SpaceAroundOperators:
107
107
 
108
108
  Lint/BooleanSymbol:
109
109
  Exclude:
110
- # There are AST nodes with types :true and :false
110
+ # There are AST nodes and rewriters with types :true and :false
111
111
  - 'lib/opal/nodes/**/*.rb'
112
+ - 'lib/opal/rewriters/**/*.rb'
112
113
 
113
114
  Lint/InheritException:
114
115
  Exclude:
data/CHANGELOG.md CHANGED
@@ -15,7 +15,70 @@ Changes are grouped as follows:
15
15
 
16
16
 
17
17
 
18
- ## [Unreleased](https://github.com/opal/opal/compare/v1.0.5...HEAD) - unreleased
18
+ ## [1.2.0](https://github.com/opal/opal/compare/v1.1.1...1.2.0) - 2021-07-28
19
+
20
+
21
+ ### Added
22
+
23
+ - Support for multiple arguments in Hash#{merge, merge!, update} ([#2187](https://github.com/opal/opal/pull/2187))
24
+ - Support for Ruby 3.0 forward arguments: `def a(...) puts(...) end` ([#2153](https://github.com/opal/opal/pull/2153))
25
+ - Support for beginless and endless ranges: `(1..)`, `(..1)` ([#2150](https://github.com/opal/opal/pull/2150))
26
+ - Preliminary support for `**nil` argument - see #2240 to note limitations ([#2152](https://github.com/opal/opal/pull/2152))
27
+ - Support for `Random::Formatters` which add methods `#{hex,base64,urlsafe_base64,uuid,random_float,random_number,alphanumeric}` to `Random` and `SecureRandom` ([#2218](https://github.com/opal/opal/pull/2218))
28
+ - Basic support for ObjectSpace finalizers and ObjectSpace::WeakMap ([#2247](https://github.com/opal/opal/pull/2247))
29
+ - A more robust support for encodings (especially binary strings) ([#2235](https://github.com/opal/opal/pull/2235))
30
+ - Support for `"\x80"` syntax in String literals ([#2235](https://github.com/opal/opal/pull/2235))
31
+ - Added `String#+@`, `String#-@` ([#2235](https://github.com/opal/opal/pull/2235))
32
+ - Support for `begin <CODE> end while <CONDITION>` ([#2255](https://github.com/opal/opal/pull/2255))
33
+
34
+ ### Fixed
35
+
36
+ - Encoding lookup was working only with uppercase names, not giving any errors for wrong ones (#2181, #2183, #2190)
37
+ - Fix `Number#to_i` with huge number ([#2191](https://github.com/opal/opal/pull/2191))
38
+ - Add regexp support to `String#start_with` ([#2198](https://github.com/opal/opal/pull/2198))
39
+ - `String#bytes` now works in strict mode ([#2194](https://github.com/opal/opal/pull/2194))
40
+ - Fix nested module inclusion ([#2053](https://github.com/opal/opal/pull/2053))
41
+ - SecureRandom is now cryptographically secure on most platforms (#2218, #2170)
42
+ - Fix performance regression for `Array#unshift` on v8 > 7.1 ([#2116](https://github.com/opal/opal/pull/2116))
43
+ - String subclasses now call `#initialize` with multiple arguments correctly (with a limitation caused by the String immutability issue, that a source string must be the first argument and `#initialize` can't change its value) (#2238, #2185)
44
+ - Number#step is moved to Numeric ([#2100](https://github.com/opal/opal/pull/2100))
45
+ - Fix class Class < superclass for invalid superclasses ([#2123](https://github.com/opal/opal/pull/2123))
46
+ - Fix `String#unpack("U*")` on binary strings with latin1 high characters, fix performance regression on that call (#2235, #2189, #2129, #2099, #2094, #2000, #2128)
47
+ - Fix `String#to_json` output on some edge cases ([#2235](https://github.com/opal/opal/pull/2235))
48
+ - Rework class variables to support inheritance correctly ([#2251](https://github.com/opal/opal/pull/2251))
49
+ - ISO-8859-1 and US-ASCII encodings are now separated as in MRI ([#2235](https://github.com/opal/opal/pull/2235))
50
+ - `String#b` no longer modifies object strings in-place ([#2235](https://github.com/opal/opal/pull/2235))
51
+
52
+ ### Changed
53
+
54
+ - `String#unpack`, `Array#pack`, `String#chars`, `String#length`, `Number#chr`, and (only partially) `String#+` are now encoding aware ([#2235](https://github.com/opal/opal/pull/2235))
55
+ - `String#inspect` now uses `\x` for binary stirngs ([#2235](https://github.com/opal/opal/pull/2235))
56
+ - `if RUBY_ENGINE == "opal"` and friends are now outputing less JS code (#2159, #1965)
57
+ - `Array`: `to_a`, `slice`/`[]`, `uniq`, `*`, `difference`/`-`, `intersection`/`&`, `union`/`|`, flatten now return Array, not a subclass, as Ruby 3.0 does ([#2237](https://github.com/opal/opal/pull/2237))
58
+ - `Array`: `difference`, `intersection`, `union` now accept multiple arguments ([#2237](https://github.com/opal/opal/pull/2237))
59
+
60
+ ### Deprecated
61
+
62
+ - Stopped testing Opal on Ruby 2.5 since it reached EOL.
63
+
64
+ ### Removed
65
+
66
+ - Removed support for the outdated `c_lexer`, it was optional and didn't work for the last few releases of parser ([#2235](https://github.com/opal/opal/pull/2235))
67
+
68
+
69
+
70
+
71
+ ## [1.1.1](https://github.com/opal/opal/compare/v1.1.0...v1.1.1) - 2021-02-23
72
+
73
+
74
+ ### Fixed
75
+
76
+ - The default runner (nodejs) wasn't starting to a bad require in the improved stack-traces ([#2182](https://github.com/opal/opal/pull/2182))
77
+
78
+
79
+
80
+
81
+ ## [1.1.0](https://github.com/opal/opal/compare/v1.0.5...v1.1.0) - 2021-02-19
19
82
 
20
83
 
21
84
  ### Added
@@ -36,6 +99,14 @@ Changes are grouped as follows:
36
99
  - 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))
37
100
  - Added support for numblocks `-> { _1 + _2 }.call(3, 4) # => 7` ([#2149](https://github.com/opal/opal/pull/2149))
38
101
  - 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))
102
+ - `Array#difference`, `Array#intersection`, `Array#union` as aliases respectively to `Array#{-,&,|}` ([#2151](https://github.com/opal/opal/pull/2151))
103
+ - Aliases `filter{,!}` to `select{,!}` throughout the corelib classes ([#2151](https://github.com/opal/opal/pull/2151))
104
+ - `Enumerable#filter_map`, `Enumerable#tally` ([#2151](https://github.com/opal/opal/pull/2151))
105
+ - Alias `Kernel#then` for `Kernel#yield_self` ([#2151](https://github.com/opal/opal/pull/2151))
106
+ - Method chaining: `{Proc,Method}#{<<,>>}` ([#2151](https://github.com/opal/opal/pull/2151))
107
+ - Added Integer#to_d ([#2006](https://github.com/opal/opal/pull/2006))
108
+ - 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))
109
+ - Add `--rbrequire (-q)` option to `opal` command line executable ([#2120](https://github.com/opal/opal/pull/2120))
39
110
 
40
111
  ### Fixed
41
112
 
@@ -55,6 +126,7 @@ Changes are grouped as follows:
55
126
  - Set#keep_if ([#1987](https://github.com/opal/opal/pull/1987))
56
127
  - Set#select! ([#1987](https://github.com/opal/opal/pull/1987))
57
128
  - Set#reject! ([#1987](https://github.com/opal/opal/pull/1987))
129
+ - String#unicode_normalize ([#2175](https://github.com/opal/opal/pull/2175))
58
130
  - Module#alias_method ([#1983](https://github.com/opal/opal/pull/1983))
59
131
  - Enumerable#minmax_by ([#1981](https://github.com/opal/opal/pull/1981))
60
132
  - Enumerator#each_with_index ([#1990](https://github.com/opal/opal/pull/1990))
@@ -72,6 +144,21 @@ Changes are grouped as follows:
72
144
  - Set match on StringScanner#skip and StringScanner#scan_until ([#2061](https://github.com/opal/opal/pull/2061))
73
145
  - Fix ruby 2.7 warnings ([#2071](https://github.com/opal/opal/pull/2071))
74
146
  - Improve the --help descriptions ([#2146](https://github.com/opal/opal/pull/2146))
147
+ - Remove BasicObject#class ([#2166](https://github.com/opal/opal/pull/2166))
148
+ - Time#strftime %j leading zeros ([#2161](https://github.com/opal/opal/pull/2161))
149
+ - Fix `call { true or next }` producing invalid code ([#2160](https://github.com/opal/opal/pull/2160))
150
+ - `define_method` can now be called on the main object ([#2029](https://github.com/opal/opal/pull/2029))
151
+ - Fix nested for-loops ([#2033](https://github.com/opal/opal/pull/2033))
152
+ - Fix Number#round for Integers ([#2030](https://github.com/opal/opal/pull/2030))
153
+ - Fix parsing Unicode characters from Opal ([#2073](https://github.com/opal/opal/pull/2073))
154
+ - Integer#===: improve Integer recognition ([#2089](https://github.com/opal/opal/pull/2089))
155
+ - Regexp: ensure ignoreCase is never undefined ([#2098](https://github.com/opal/opal/pull/2098))
156
+ - Hash#delete: ensure String keys are converted to values ([#2106](https://github.com/opal/opal/pull/2106))
157
+ - Array#shift: improve performance on v8 >7.1 ([#2115](https://github.com/opal/opal/pull/2115))
158
+ - Array#pop(1): improve performance ([#2130](https://github.com/opal/opal/pull/2130))
159
+ - Object#pretty_inspect ([#2139](https://github.com/opal/opal/pull/2139))
160
+ - Fix conversion from UTF-8 to bytes ([#2138](https://github.com/opal/opal/pull/2138))
161
+ - Restore compatibility with Chrome 38, used by Cordova and many mobile browsers ([#2109](https://github.com/opal/opal/pull/2109))
75
162
 
76
163
  ### Changed
77
164
 
@@ -86,6 +173,12 @@ Changes are grouped as follows:
86
173
  - Change parser to 3.0 ([#2148](https://github.com/opal/opal/pull/2148))
87
174
  - Fix forwarding a rescued error to a global var: `rescue => $gvar` ([#2154](https://github.com/opal/opal/pull/2154))
88
175
  - Now using Parser v3.0 and targeting Ruby 3.0 ([#2156](https://github.com/opal/opal/pull/2156))
176
+ - `Comparable#clamp` to support a Range argument ([#2151](https://github.com/opal/opal/pull/2151))
177
+ - `#to_h` method to support a block (shortform for `.map(&block).to_h`) ([#2151](https://github.com/opal/opal/pull/2151))
178
+ - BigDecimal is now a subclass of Numeric ([#2006](https://github.com/opal/opal/pull/2006))
179
+ - PP to be rebased on upstream Ruby version ([#2083](https://github.com/opal/opal/pull/2083))
180
+ - String to report UTF-8 encoding by default, as MRI does ([#2117](https://github.com/opal/opal/pull/2117))
181
+ - Don't output "Failed to load WithCLexer, using pure Ruby lexer" warning unless in $DEBUG mode ([#2174](https://github.com/opal/opal/pull/2174))
89
182
 
90
183
  ### Deprecated
91
184
 
@@ -96,6 +189,7 @@ Changes are grouped as follows:
96
189
  ### Removed
97
190
 
98
191
  - Removed special compilation for the `Opal.truthy?` and `Opal.falsy?` helpers ([#2076](https://github.com/opal/opal/pull/2076))
192
+ - Removed the deprecated `tainting` compiler config option ([#2072](https://github.com/opal/opal/pull/2072))
99
193
 
100
194
 
101
195
 
data/Gemfile CHANGED
@@ -48,7 +48,3 @@ end unless ENV['CI']
48
48
  group :doc do
49
49
  gem 'redcarpet' unless RUBY_ENGINE == 'truffleruby'
50
50
  end unless ENV['CI']
51
-
52
- platforms :ruby, :mswin, :mswin64, :mingw, :x64_mingw do
53
- #gem 'c_lexer', '~> 2.6' unless RUBY_ENGINE == 'truffleruby'
54
- end
data/HACKING.md CHANGED
@@ -33,7 +33,7 @@ Before making changes to Opal source, you need to understand a little about how
33
33
 
34
34
  Navigating to `spec/ruby/core` directory, you see that it contains multiple sub-directories, usually named after the Ruby class or module. Drilling further down into `spec/ruby/core/string` you see all the spec files for the various `String` behaviors under test, usually named by a method name followed by `_spec.rb`. Opening `spec/ruby/core/string/sub_spec.rb` you finally see the code that checks the correctness of Opal's implementation of the `String#sub` method's behavior.
35
35
 
36
- When you execute `$ bundle exec rake`, the code in this file is executed, along with all the other specs in the entire test suite. It's a good idea to run the entire test suite when you feel you reached a certain milestone in the course of making your changes (exactly what that means is up to you), and definitely do `$ bundle exec rake` before commiting your changes to make sure they have not introduced regressions or other unintended side effects.
36
+ When you execute `$ bundle exec rake`, the code in this file is executed, along with all the other specs in the entire test suite. It's a good idea to run the entire test suite when you feel you reached a certain milestone in the course of making your changes (exactly what that means is up to you), and definitely do `$ bundle exec rake` before committing your changes to make sure they have not introduced regressions or other unintended side effects.
37
37
 
38
38
  But you will want to run tests as often as possible, after every small change, and running the entire test suite will slow you down. You need to be able to execute a single spec that is concerned with the feature you are currently working on. To accomplish this, just add `PATTERN` to your spec invocation command, like this:
39
39
 
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  align="center" title="Opal logo by Elia Schito" width="105" height="105" />
4
4
  <br/>
5
5
  Opal <br/>
6
- <img src="https://img.shields.io/badge/Opal-Ruby%20💛%20JavaScript-yellow.svg?logo=ruby&style=social&logoColor=777"/>
6
+ <img src="https://img.shields.io/badge/Opal-Ruby%20💛%20JavaScript-yellow.svg?logo=ruby&style=social&logoColor=777" alt="Opal-Ruby 💛 JavaScript"/>
7
7
  </h1>
8
8
 
9
9
  <p align="center">
@@ -16,19 +16,19 @@
16
16
  <a href="https://stackoverflow.com/questions/ask?tags=opalrb"><img src="https://img.shields.io/badge/stackoverflow-%23opalrb-orange.svg?style=flat" alt="Stack Overflow" title="" /></a>
17
17
  <a href="#backers"><img src="https://opencollective.com/opal/backers/badge.svg" alt="Backers on Open Collective" title="" /></a>
18
18
  <a href="#sponsors"><img src="https://opencollective.com/opal/sponsors/badge.svg" alt="Sponsors on Open Collective" title="" /></a>
19
- <a href="https://gitter.im/opal/opal?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge"><img src="https://badges.gitter.im/Join%20Chat.svg" alt="Gitter" title="" /></a>
19
+ <a href="https://slack.opalrb.com/"><img src="https://img.shields.io/badge/slack-join%20chat-46BC99?logo=slack&style=flat" alt="Slack" title="Join Chat" /></a>
20
20
  <a href="https://opalrb.com/docs"><img src="https://img.shields.io/badge/docs-updated-blue.svg" alt="Documentation" title="" /></a>
21
21
 
22
22
  <br>
23
23
  <strong>Code:</strong><br>
24
24
  <a href="https://badge.fury.io/rb/opal"><img src="https://img.shields.io/gem/v/opal.svg?style=flat" alt="Gem Version" title="" /></a>
25
- <a href="https://github.com/opal/opal/actions?query=workflow%3Abuild"><img alt="Build Status" src="https://github.com/opal/opal/workflows/build/badge.svg" /></a>
25
+ <a href="https://github.com/opal/opal/actions?query=workflow%3Abuild"><img src="https://github.com/opal/opal/workflows/build/badge.svg" alt="Build Status" /></a>
26
26
  <a href="https://codeclimate.com/github/opal/opal"><img src="https://img.shields.io/codeclimate/maintainability-percentage/opal/opal.svg" alt="Code Climate" title="" /></a>
27
27
  <a href="https://coveralls.io/github/opal/opal?branch=master"><img src="https://coveralls.io/repos/opal/opal/badge.svg?branch=master&amp;service=github" alt="Coverage Status" title="" /></a>
28
28
 
29
29
  <br>
30
30
  <strong>Sponsors:</strong>
31
- <br/><a href="https://nebulab.it?utm_source=github&utm_medium=badge"><img src="https://img.shields.io/static/v1?label=Nebulab&message=Open+Source+Fridays&color=%235dbefd&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMQSURBVHgBrZZNTxNRFIbfczsgIMQiLBCRFDaGhUr9A9iiIa5EEneIwE/AlRsNv8KlIKwFl35RTUBX8rFBdiVKAgqmXSCY0M71nJl+zJTOdKh9k6Yzc8/cZ86555x7CQE0mji5hSyGlQoNaOgIPwrnhtIArWszu4EQFudjdR8rzUV+gw8/ZMZB9IwvIwimJJGafhmjWZwFOJ7QkYzWCwTdj+qUDJGKz8Rou3RAlT4YS+hHWW2u/QdM1MNzrI6+zwyXDrg8FANStIDaSXOIJ5whLgAljOIZiglRK6U4vDfz4S2ElGGJWsEaQkCTUbhtNbV+lb+xgFY2Bs9ET0h/GzBxlfAkqnCUKY5xKfVLbsi1/R126lcF6WgCYp2ES42EBp6tvQFY+alLTUlrUxizJEVNWiVwBkVagGg7oe+CDclLYOfrgMdfTBz8PfWa1lkzbsDEsH/5FyF9YUK0zQ1xwpoZtsm9pwxMRLyA9wyi0A2Jcjl1NNqeeEFEimxYPkmWd014ikIDnDTeBb53DOweaRxnvWGyhnmYfPZWGt487sNi6lsK67/lZ1oZGOtUaD3nhtU7etXXfe0VzrzCBgLKCR68rNDX6oaJlvd0xXnklbSfgSTL/QghXF8EP980cVKyVL/Ys9UDVFJa8Tdt+1lYmcmJM3Vd4UEvWeslRf32h9ubrVRl77gBrCto85OfUU+LXTMGx+JuN2Hoin3/Zkfjj6ObBAknV+KG4jpc9BqXMEpiCMz6Z9ZQ12kvJZxb6co4Zr1W83esY8F2OYsIe+eEyfTiVXczCl7uM2wliHfMEJaRc3Wa++mLUotrF4EW7h6f94Dvh6aVFM60Fy8Xkya+BfBOjh5yUWhqY0vmKi9q1GnVxZ7sHKIWSs7FQ71yUagkRTTCfymnVY1gsgHHC5z8hbUjaz0Fr8ZanXhX0pPOw5SrV8wNGjNscMrTKpXKaj05f9twVYHnMZGPHEuwTwEBNi+3NGiNt6GRcsfEIAfhp2cAV3cQLtXoOz7q8+ZJRLx3kmxn4dy7aas1SrfiBpKraV/9A+PSJLDAXLUvAAAAAElFTkSuQmCC"></a>
31
+ <br/><a href="https://nebulab.it?utm_source=github&utm_medium=badge"><img src="https://img.shields.io/static/v1?label=Nebulab&message=Open+Source+Fridays&color=%235dbefd&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAMQSURBVHgBrZZNTxNRFIbfczsgIMQiLBCRFDaGhUr9A9iiIa5EEneIwE/AlRsNv8KlIKwFl35RTUBX8rFBdiVKAgqmXSCY0M71nJl+zJTOdKh9k6Yzc8/cZ86555x7CQE0mji5hSyGlQoNaOgIPwrnhtIArWszu4EQFudjdR8rzUV+gw8/ZMZB9IwvIwimJJGafhmjWZwFOJ7QkYzWCwTdj+qUDJGKz8Rou3RAlT4YS+hHWW2u/QdM1MNzrI6+zwyXDrg8FANStIDaSXOIJ5whLgAljOIZiglRK6U4vDfz4S2ElGGJWsEaQkCTUbhtNbV+lb+xgFY2Bs9ET0h/GzBxlfAkqnCUKY5xKfVLbsi1/R126lcF6WgCYp2ES42EBp6tvQFY+alLTUlrUxizJEVNWiVwBkVagGg7oe+CDclLYOfrgMdfTBz8PfWa1lkzbsDEsH/5FyF9YUK0zQ1xwpoZtsm9pwxMRLyA9wyi0A2Jcjl1NNqeeEFEimxYPkmWd014ikIDnDTeBb53DOweaRxnvWGyhnmYfPZWGt487sNi6lsK67/lZ1oZGOtUaD3nhtU7etXXfe0VzrzCBgLKCR68rNDX6oaJlvd0xXnklbSfgSTL/QghXF8EP980cVKyVL/Ys9UDVFJa8Tdt+1lYmcmJM3Vd4UEvWeslRf32h9ubrVRl77gBrCto85OfUU+LXTMGx+JuN2Hoin3/Zkfjj6ObBAknV+KG4jpc9BqXMEpiCMz6Z9ZQ12kvJZxb6co4Zr1W83esY8F2OYsIe+eEyfTiVXczCl7uM2wliHfMEJaRc3Wa++mLUotrF4EW7h6f94Dvh6aVFM60Fy8Xkya+BfBOjh5yUWhqY0vmKi9q1GnVxZ7sHKIWSs7FQ71yUagkRTTCfymnVY1gsgHHC5z8hbUjaz0Fr8ZanXhX0pPOw5SrV8wNGjNscMrTKpXKaj05f9twVYHnMZGPHEuwTwEBNi+3NGiNt6GRcsfEIAfhp2cAV3cQLtXoOz7q8+ZJRLx3kmxn4dy7aas1SrfiBpKraV/9A+PSJLDAXLUvAAAAAElFTkSuQmCC" alt="Nebulab: Open Source Fridays" /></a>
32
32
  </p>
33
33
 
34
34
  ## Usage
@@ -216,21 +216,16 @@ then we support Opera 12.1x, 19.x and 20.x but not Opera 15.x through 18.x.
216
216
 
217
217
  This project exists thanks to all the people who contribute. [![contributors](https://opencollective.com/opal/contributors.svg?width=890&button=false")](https://github.com/opal/opal/graphs/contributors)
218
218
 
219
+ ## Versioning
220
+
221
+ Opal will broadly follow semver as a version policy, trying to bump the major version when introducing breaking changes.
222
+ Being a language implementation we're also aware that there's a fine line between what can be considered breaking and what is expected to be "safe" or just "additive". Moving forward we'll attempt to better clarify what interfaces are meant to be public and what should be considered private.
219
223
 
220
224
  ## Backers
221
225
 
222
226
  Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/opal#backer)]
223
227
 
224
- <a href="https://opencollective.com/opal#backers" target="_blank"><img src="https://opencollective.com/opal/backers.svg?width=890"></a>
225
-
226
-
227
- ## Sponsors
228
-
229
- ### Donations
230
-
231
- Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/opal#sponsor)]
232
-
233
- <a href="https://opencollective.com/opal/sponsor/0/website" target="_blank"><img src="https://opencollective.com/opal/sponsor/0/avatar.svg"></a>
228
+ <a href="https://opencollective.com/opal#backers" target="_blank"><img src="https://opencollective.com/opal/backers.svg?width=890" alt="Become a Backer Button" /></a>
234
229
  <a href="https://opencollective.com/opal/sponsor/1/website" target="_blank"><img src="https://opencollective.com/opal/sponsor/1/avatar.svg"></a>
235
230
  <a href="https://opencollective.com/opal/sponsor/2/website" target="_blank"><img src="https://opencollective.com/opal/sponsor/2/avatar.svg"></a>
236
231
  <a href="https://opencollective.com/opal/sponsor/3/website" target="_blank"><img src="https://opencollective.com/opal/sponsor/3/avatar.svg"></a>
@@ -241,9 +236,18 @@ Support this project by becoming a sponsor. Your logo will show up here with a l
241
236
  <a href="https://opencollective.com/opal/sponsor/8/website" target="_blank"><img src="https://opencollective.com/opal/sponsor/8/avatar.svg"></a>
242
237
  <a href="https://opencollective.com/opal/sponsor/9/website" target="_blank"><img src="https://opencollective.com/opal/sponsor/9/avatar.svg"></a>
243
238
 
239
+
240
+ ## Sponsors
241
+
242
+ ### Donations
243
+
244
+ Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/opal#sponsor)]
245
+
246
+ <a href="https://opencollective.com/opal/sponsor/0/website" target="_blank"><img src="https://opencollective.com/opal/sponsor/0/avatar.svg" alt="Become a Sponsor Button"></a>
247
+
244
248
  ### Sponsored Contributions
245
249
 
246
- <a href="https://nebulab.it/?utm_source=github&utm_medium=sponsors" target="_blank"><img src="https://nebulab.it/assets/images/logo-586625a4.svg"></a>
250
+ <a href="https://nebulab.it/?utm_source=github&utm_medium=sponsors" target="_blank"><img src="https://nebulab.com/assets/img/logo-nebulab_black.svg" alt="Nebulab Logo"></a>
247
251
 
248
252
 
249
253
  ## License
data/UNRELEASED.md CHANGED
@@ -1,109 +1,50 @@
1
- ### Added
2
1
 
3
- - Basic support for `uplevel:` keyword argument in `Kernel#warn` (#2006)
4
- - 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)
5
- - `Opal::Compiler#magic_comments` that allows to access magic-comments format and converts it to a hash (#2038)
6
- - Use magic-comments to declare helpers required by the file (#2038)
7
- - `Opal.$$` is now a shortcut for `Opal.const_get_relative` (#2038)
8
- - `Opal.$$$` is now a shortcut for `Opal.const_get_qualified` (#2038)
9
- - Added support for `globalThis` as the generic global object accessor (#2047)
10
- - `Opal::Compiler#magic_comments` that allows to access magic-comments format and converts it to a hash
11
- - Use magic-comments to declare helpers required by the file
12
- - `Opal.$$` is now a shortcut for `Opal.const_get_relative`
13
- - `Opal.$$$` is now a shortcut for `Opal.const_get_qualified`
14
- - Source-map support for Node.js in the default runner (#2045)
15
- - SecureRandom#hex(n) (#2050)
16
- - Added a generic implementation of Kernel#caller and #warn(uplevel:) that works with sourcemaps in Node.js and Chrome (#2065)
17
- - Added support for numblocks `-> { _1 + _2 }.call(3, 4) # => 7` (#2149)
18
- - Support `<internal:…>` and `<js:…>` in stacktraces, like MRI we now distinguish internal lines from lib/app lines (#2154)
19
- - `Array#difference`, `Array#intersection`, `Array#union` as aliases respectively to `Array#{-,&,|}` (#2151)
20
- - Aliases `filter{,!}` to `select{,!}` throughout the corelib classes (#2151)
21
- - `Enumerable#filter_map`, `Enumerable#tally` (#2151)
22
- - Alias `Kernel#then` for `Kernel#yield_self` (#2151)
23
- - Method chaining: `{Proc,Method}#{<<,>>}` (#2151)
24
- - Added Integer#to_d (#2006)
25
- - Added a compiler option `use_strict` which can also be set by the `use_strict` magic comment (#1959)
26
- - Add `--rbrequire (-q)` option to `opal` command line executable (#2120)
2
+ - Support for multiple arguments in Hash#{merge, merge!, update} (#2187)
3
+ - Support for Ruby 3.0 forward arguments: `def a(...) puts(...) end` (#2153)
4
+ - Support for beginless and endless ranges: `(1..)`, `(..1)` (#2150)
5
+ - Preliminary support for `**nil` argument - see #2240 to note limitations (#2152)
6
+ - Support for `Random::Formatters` which add methods `#{hex,base64,urlsafe_base64,uuid,random_float,random_number,alphanumeric}` to `Random` and `SecureRandom` (#2218)
7
+ - Basic support for ObjectSpace finalizers and ObjectSpace::WeakMap (#2247)
8
+ - A more robust support for encodings (especially binary strings) (#2235)
9
+ - Support for `"\x80"` syntax in String literals (#2235)
10
+ - Added `String#+@`, `String#-@` (#2235)
11
+ - Support for `begin <CODE> end while <CONDITION>` (#2255)
12
+ - Added Hash#except and `Hash#except!` (#2243)
13
+ - Parser 3.0: Implement pattern matching (as part of this `{Array,Hash,Struct}#{deconstruct,deconstruct_keys} methods were added)` (#2243)
14
+ - [experimental] Reimplement Promise to make it bridged with JS native Promise, this new implementation can be used by requiring `promise/v2` (#2220)
15
+
27
16
 
28
17
  ### Fixed
29
18
 
30
- - Array#delete_if (#2069)
31
- - Array#keep_if (#2069)
32
- - Array#reject! (#2069)
33
- - Array#select! (#2069)
34
- - Struct#dup (#1995)
35
- - Integer#gcdlcm (#1972)
36
- - Enumerable#to_h (#1979)
37
- - Enumerator#size (#1980)
38
- - Enumerable#min (#1982)
39
- - Enumerable#min_by (#1985)
40
- - Enumerable#max_by (#1985)
41
- - Set#intersect? (#1988)
42
- - Set#disjoint? (#1988)
43
- - Set#keep_if (#1987)
44
- - Set#select! (#1987)
45
- - Set#reject! (#1987)
46
- - String#unicode_normalize (#2175)
47
- - Module#alias_method (#1983)
48
- - Enumerable#minmax_by (#1981)
49
- - Enumerator#each_with_index (#1990)
50
- - Range#== (#1992)
51
- - Range#each (#1991)
52
- - Enumerable#zip (#1986)
53
- - String#getbyte (#2141)
54
- - Struct#dup not copying `$$data` (#1995)
55
- - Fixed usage of semicolon in single-line backticks (#2004)
56
- - Module#attr with multiple arguments (#2003)
57
- - `PathReader` used to try to read missing files instead of respecting the `missing_require_severity` configuration value (#2044)
58
- - Removed some unused variables from the runtime (#2052)
59
- - Fixed a typo in the runtime (#2054)
60
- - Fix Regexp interpolation, previously interpolating with other regexps was broken (#2062)
61
- - Set match on StringScanner#skip and StringScanner#scan_until (#2061)
62
- - Fix ruby 2.7 warnings (#2071)
63
- - Improve the --help descriptions (#2146)
64
- - Remove BasicObject#class (#2166)
65
- - Time#strftime %j leading zeros (#2161)
66
- - Fix `call { true or next }` producing invalid code (#2160)
67
- - `define_method` can now be called on the main object (#2029)
68
- - Fix nested for-loops (#2033)
69
- - Fix Number#round for Integers (#2030)
70
- - Fix parsing Unicode characters from Opal (#2073)
71
- - Integer#===: improve Integer recognition (#2089)
72
- - Regexp: ensure ignoreCase is never undefined (#2098)
73
- - Hash#delete: ensure String keys are converted to values (#2106)
74
- - Array#shift: improve performance on v8 >7.1 (#2115)
75
- - Array#pop(1): improve performance (#2130)
76
- - Object#pretty_inspect (#2139)
77
- - Fix conversion from UTF-8 to bytes (#2138)
78
- - Restore compatibility with Chrome 38, used by Cordova and many mobile browsers (#2109)
19
+ - Encoding lookup was working only with uppercase names, not giving any errors for wrong ones (#2181, #2183, #2190)
20
+ - Fix `Number#to_i` with huge number (#2191)
21
+ - Add regexp support to `String#start_with` (#2198)
22
+ - `String#bytes` now works in strict mode (#2194)
23
+ - Fix nested module inclusion (#2053)
24
+ - SecureRandom is now cryptographically secure on most platforms (#2218, #2170)
25
+ - Fix performance regression for `Array#unshift` on v8 > 7.1 (#2116)
26
+ - String subclasses now call `#initialize` with multiple arguments correctly (with a limitation caused by the String immutability issue, that a source string must be the first argument and `#initialize` can't change its value) (#2238, #2185)
27
+ - Number#step is moved to Numeric (#2100)
28
+ - Fix class Class < superclass for invalid superclasses (#2123)
29
+ - Fix `String#unpack("U*")` on binary strings with latin1 high characters, fix performance regression on that call (#2235, #2189, #2129, #2099, #2094, #2000, #2128)
30
+ - Fix `String#to_json` output on some edge cases (#2235)
31
+ - Rework class variables to support inheritance correctly (#2251)
32
+ - ISO-8859-1 and US-ASCII encodings are now separated as in MRI (#2235)
33
+ - `String#b` no longer modifies object strings in-place (#2235)
34
+ - Parser::Builder::Default.check_lvar_name patch (#2195)
79
35
 
80
36
  ### Changed
81
37
 
82
- - Updated outdated parser version (#2013)
83
- - Nashorn has been deprecated but GraalVM still supports it (#1997)
84
- - "opal/mini" now includes "opal/io" (#2002)
85
- - Regexps assigned to constants are now frozen (#2007)
86
- - `Opal.$$` changed from being the constant cache of Object to being a shortcut for `Opal.const_get_relative` (#2038)
87
- - Moved REPL implementation from bin/ to its own lib/ file as `opal/repl.rb` (#2048)
88
- - `Encoding.default_external` is now initialized with `__ENCODING__` (#2072)
89
- - Keep the MersenneTwister implementation private (#2108)
90
- - Change parser to 3.0 (#2148)
91
- - Fix forwarding a rescued error to a global var: `rescue => $gvar` (#2154)
92
- - Now using Parser v3.0 and targeting Ruby 3.0 (#2156)
93
- - `Comparable#clamp` to support a Range argument (#2151)
94
- - `#to_h` method to support a block (shortform for `.map(&block).to_h`) (#2151)
95
- - BigDecimal is now a subclass of Numeric (#2006)
96
- - PP to be rebased on upstream Ruby version (#2083)
97
- - String to report UTF-8 encoding by default, as MRI does (#2117)
98
- - Don't output "Failed to load WithCLexer, using pure Ruby lexer" warning unless in $DEBUG mode (#2174)
38
+ - `String#unpack`, `Array#pack`, `String#chars`, `String#length`, `Number#chr`, and (only partially) `String#+` are now encoding aware (#2235)
39
+ - `String#inspect` now uses `\x` for binary stirngs (#2235)
40
+ - `if RUBY_ENGINE == "opal"` and friends are now outputing less JS code (#2159, #1965)
41
+ - `Array`: `to_a`, `slice`/`[]`, `uniq`, `*`, `difference`/`-`, `intersection`/`&`, `union`/`|`, flatten now return Array, not a subclass, as Ruby 3.0 does (#2237)
42
+ - `Array`: `difference`, `intersection`, `union` now accept multiple arguments (#2237)
99
43
 
100
44
  ### Deprecated
101
45
 
102
- - Requiring nodejs/stacktrace has been deprecated, source-maps are already
103
- supported by the default Node.js runner or by requiring https://github.com/evanw/node-source-map-support
104
- before loading code compiled by Opal (#2045)
46
+ - Stopped testing Opal on Ruby 2.5 since it reached EOL.
105
47
 
106
48
  ### Removed
107
49
 
108
- - Removed special compilation for the `Opal.truthy?` and `Opal.falsy?` helpers (#2076)
109
- - Removed the deprecated `tainting` compiler config option (#2072)
50
+ - Removed support for the outdated `c_lexer`, it was optional and didn't work for the last few releases of parser (#2235)