Skip to content

Commit

Permalink
Add workaround to avoid crash in Truffleruby (#8602)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimerave committed Aug 31, 2020
1 parent 2b7607c commit 6cab599
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -43,6 +43,7 @@
* [#8513](https://github.com/rubocop-hq/rubocop/pull/8513): Clarify the ruby warning mentioned in the `Lint/ShadowingOuterLocalVariable` documentation. ([@chocolateboy][])
* [#8517](https://github.com/rubocop-hq/rubocop/pull/8517): Make `Style/HashTransformKeys` and `Style/HashTransformValues` aware of `to_h` with block. ([@eugeneius][])
* [#8529](https://github.com/rubocop-hq/rubocop/pull/8529): Mark `Lint/FrozenStringLiteralComment` as `Safe`, but with unsafe auto-correction. ([@marcandre][])
* [#8602](https://github.com/rubocop-hq/rubocop/pull/8602): Fix usage of `to_enum(:scan, regexp)` to work on TruffleRuby. ([@jaimerave][])

## 0.89.1 (2020-08-10)

Expand Down Expand Up @@ -4819,3 +4820,4 @@
[@nguyenquangminh0711]: https://github.com/nguyenquangminh0711
[@chocolateboy]: https://github.com/chocolateboy
[@Lykos]: https://github.com/Lykos
[@jaimerave]: https://github.com/jaimerave
8 changes: 3 additions & 5 deletions lib/rubocop/cop/utils/format_string.rb
Expand Up @@ -111,11 +111,9 @@ def max_digit_dollar_num
private

def parse
@source.to_enum(:scan, SEQUENCE).map do
FormatSequence.new(
Regexp.last_match
)
end
matches = []
@source.scan(SEQUENCE) { matches << FormatSequence.new(Regexp.last_match) }
matches
end

def mixed_formats?
Expand Down

0 comments on commit 6cab599

Please sign in to comment.