Skip to content

Commit 75ba673

Browse files
committed
Fix enumeration issue in ENV.{select, filter} when no block is given
1 parent 6c34ed2 commit 75ba673

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
@@ -55,6 +55,7 @@ Bug fixes:
5555
* Made `Kernel#caller_locations` accept a range argument, and return `nil` when appropriate.
5656
* Made `rb_respond_to` work with primitives (#1869, @chrisseaton).
5757
* Fixed issue with missing backtrace for `rescue $ERROR_INFO` (#1660).
58+
* Fixed enumeration issue in `ENV.{select, filter}`.
5859

5960
Compatibility:
6061

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)