-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an error when parsing non UTF-8 frozen string
This PR fixes the following `FrozenError` when parsing non UTF-8 frozen string: ```console $ cat example.rb # encoding: ascii-8bit # frozen_string_literal: true require 'rubocop-ast' RuboCop::AST::ProcessedSource.new('true', 3.2) ``` ```console $ ruby example.rb /Users/koic/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rubocop-ast-1.28.0/lib/rubocop/ast/processed_source.rb:30: in `force_encoding': can't modify frozen String: "true" (FrozenError) from /Users/koic/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/rubocop-ast-1.28.0/lib/rubocop/ast/processed_source.rb:30: in `initialize' from example.rb:6:in `new' from example.rb:6:in `<main>' ```
- Loading branch information
Showing
3 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* [#262](https://github.com/rubocop/rubocop-ast/pull/262): Fix an error when parsing non UTF-8 frozen string. ([@koic][]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters