Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ENV.freeze since 2.7.0 #2135

Merged
merged 1 commit into from Mar 10, 2020
Merged

Add ENV.freeze since 2.7.0 #2135

merged 1 commit into from Mar 10, 2020

Conversation

@znz
Copy link
Member

znz commented Feb 6, 2020

ruby/ruby@f53d7e4

 %  RBENV_VERSION=2.7.0 ruby -e 'p ENV.instance_eval{@a=1};ENV.freeze rescue p($!);p ENV.instance_eval{@b=2}'
 1
 #<TypeError: cannot freeze ENV>
 2
 %  RBENV_VERSION=2.6.5 ruby -e 'p ENV.instance_eval{@a=1};ENV.freeze rescue p($!);p ENV.instance_eval{@b=2}'
 1
 Traceback (most recent call last):
 	2: from -e:1:in `<main>'
 	1: from -e:1:in `instance_eval'
 -e:1:in `block in <main>': can't modify frozen #<Class:#<Object:0x00007fa095088508>> (FrozenError)
ruby/ruby@f53d7e4

```
 %  RBENV_VERSION=2.7.0 ruby -e 'p ENV.instance_eval{@A=1};ENV.freeze rescue p($!);p ENV.instance_eval{@b=2}'
 1
 #<TypeError: cannot freeze ENV>
 2
 %  RBENV_VERSION=2.6.5 ruby -e 'p ENV.instance_eval{@A=1};ENV.freeze rescue p($!);p ENV.instance_eval{@b=2}'
 1
 Traceback (most recent call last):
 	2: from -e:1:in `<main>'
 	1: from -e:1:in `instance_eval'
 -e:1:in `block in <main>': can't modify frozen #<Class:#<Object:0x00007fa095088508>> (FrozenError)
```
@znz znz added the Ruby2.7.0 label Feb 6, 2020
@hanachin hanachin merged commit 33875b5 into rurema:master Mar 10, 2020
8 checks passed
8 checks passed
rake
Details
misspell
Details
Pages changed 3 new files uploaded
Details
Redirect rules No redirect rules processed
Details
Header rules 1 header rule processed
Details
Mixed content No mixed content detected
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.