Skip to content

Commit a23836a

Browse files
committed
[GR-20430] Fix enumeration issue in ENV.{select, filter} when no block is given.
PullRequest: truffleruby/1239
2 parents 7f29768 + 75ba673 commit a23836a

File tree

4 files changed

+2
-3
lines changed

4 files changed

+2
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Bug fixes:
5858
* Fixed `Struct#hash` for `keyword_init: true` `Struct`.
5959
* Fixed `String#{upcase!,downcase!,swapcase!}(:ascii)` for non-ASCII-compatible encodings like UTF-16.
6060
* Fixed `String#capitalize!` for strings that weren't full ASCII.
61+
* Fixed enumeration issue in `ENV.{select, filter}`.
6162

6263
Compatibility:
6364

spec/tags/core/env/filter_tags.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

spec/tags/core/env/select_tags.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/main/ruby/truffleruby/core/env.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def replace(other)
240240
end
241241

242242
def select(&blk)
243-
return to_enum { size } unless block_given?
243+
return to_enum(:select) { size } unless block_given?
244244
to_hash.select(&blk)
245245
end
246246
alias_method :filter, :select

0 commit comments

Comments
 (0)