summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-symbol-ext
diff options
context:
space:
mode:
authorKOBAYASHI Shuji <[email protected]>2019-11-16 19:47:31 +0900
committerKOBAYASHI Shuji <[email protected]>2019-11-16 19:47:31 +0900
commita367373fe3e9fd405bb11b0eafb7b74865d884ad (patch)
tree7219d083433a70609aec871de1a0f247d2c4e448 /mrbgems/mruby-symbol-ext
parentc9f156ef0c3f6992fa55798a6cbe46e4c94fc23b (diff)
downloadmruby-a367373fe3e9fd405bb11b0eafb7b74865d884ad.tar.gz
mruby-a367373fe3e9fd405bb11b0eafb7b74865d884ad.zip
Revert "Implement Ruby2.7's frozen strings from `Symbol#to_s`"
This feature was reverted from Ruby 2.7.
Diffstat (limited to 'mrbgems/mruby-symbol-ext')
-rw-r--r--mrbgems/mruby-symbol-ext/mrblib/symbol.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/mrbgems/mruby-symbol-ext/mrblib/symbol.rb b/mrbgems/mruby-symbol-ext/mrblib/symbol.rb
index 4b4cf83fe..99fa275d5 100644
--- a/mrbgems/mruby-symbol-ext/mrblib/symbol.rb
+++ b/mrbgems/mruby-symbol-ext/mrblib/symbol.rb
@@ -10,7 +10,7 @@ class Symbol
# Same as <code>sym.to_s.capitalize.intern</code>.
def capitalize
- self.to_s.capitalize.to_sym
+ (self.to_s.capitalize! || self).to_sym
end
##
@@ -20,7 +20,7 @@ class Symbol
# Same as <code>sym.to_s.downcase.intern</code>.
def downcase
- self.to_s.downcase.to_sym
+ (self.to_s.downcase! || self).to_sym
end
##
@@ -30,7 +30,7 @@ class Symbol
# Same as <code>sym.to_s.upcase.intern</code>.
def upcase
- self.to_s.upcase.to_sym
+ (self.to_s.upcase! || self).to_sym
end
##
@@ -41,7 +41,7 @@ class Symbol
def casecmp(other)
return nil unless other.kind_of?(Symbol)
- lhs = self.to_s.upcase
+ lhs = self.to_s; lhs.upcase!
rhs = other.to_s.upcase
lhs <=> rhs
end