From 72c91e9d81eeb1d9adbaff76d920c8dbc2ee3119 Mon Sep 17 00:00:00 2001 From: Andrew Konchin Date: Sun, 17 Oct 2021 02:17:13 +0300 Subject: [PATCH] Remove TRUE, FALSE, and NIL constants --- CHANGELOG.md | 1 + spec/tags/language/predefined_tags.txt | 3 --- src/main/ruby/truffleruby/core/false.rb | 3 --- src/main/ruby/truffleruby/core/nil.rb | 3 --- src/main/ruby/truffleruby/core/true.rb | 3 --- 5 files changed, 1 insertion(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3abbd17d041d..48c45c9e2d61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ Compatibility: * `Module#attr_*` methods now return an array of method names (#2498, @gogainda). * Fixed `Socket#(local|remote)_address` to retrieve family and type from the file descriptor (#2444, @larskanis). * Add `Thread.ignore_deadlock` accessor (#2453). +* Remove `TRUE`, `FALSE`, and `NIL` constants like CRuby 3.0 (#2505, @andrykonchin). Performance: diff --git a/spec/tags/language/predefined_tags.txt b/spec/tags/language/predefined_tags.txt index b8d674b10ede..9f2878d6c2b9 100644 --- a/spec/tags/language/predefined_tags.txt +++ b/spec/tags/language/predefined_tags.txt @@ -6,6 +6,3 @@ slow:The predefined global constant ARGV contains Strings encoded in locale Enco slow:Global variable $0 is the path given as the main script and the same as __FILE__ slow:Global variable $? is thread-local slow:Global variable $0 actually sets the program name -fails:The predefined global constants TRUE is no longer defined -fails:The predefined global constants FALSE is no longer defined -fails:The predefined global constants NIL is no longer defined diff --git a/src/main/ruby/truffleruby/core/false.rb b/src/main/ruby/truffleruby/core/false.rb index 260f17ef3e88..47a0f8529e6d 100644 --- a/src/main/ruby/truffleruby/core/false.rb +++ b/src/main/ruby/truffleruby/core/false.rb @@ -48,6 +48,3 @@ def self.__allocate__ raise TypeError, "allocator undefined for #{self}" end end - -FALSE = false -Object.deprecate_constant :FALSE diff --git a/src/main/ruby/truffleruby/core/nil.rb b/src/main/ruby/truffleruby/core/nil.rb index 1f40a8b555fb..e2b515cbfb51 100644 --- a/src/main/ruby/truffleruby/core/nil.rb +++ b/src/main/ruby/truffleruby/core/nil.rb @@ -87,6 +87,3 @@ def self.__allocate__ raise TypeError, "allocator undefined for #{self}" end end - -NIL = nil -Object.deprecate_constant :NIL diff --git a/src/main/ruby/truffleruby/core/true.rb b/src/main/ruby/truffleruby/core/true.rb index ed7841b10188..8a6e35fb5926 100644 --- a/src/main/ruby/truffleruby/core/true.rb +++ b/src/main/ruby/truffleruby/core/true.rb @@ -48,6 +48,3 @@ def self.__allocate__ raise TypeError, "allocator undefined for #{self}" end end - -TRUE = true -Object.deprecate_constant :TRUE