Skip to content

Commit

Permalink
[Truffle] String#scrub accepts an explicit nil.
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Jan 10, 2017
1 parent d28f883 commit 404cb90
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions truffle/src/main/ruby/core/string.rb
Expand Up @@ -1199,10 +1199,7 @@ def match(pattern, pos=0)
result
end

def scrub(replace=undefined, &block)
if undefined.equal?(replace)
replace = nil
end
def scrub(replace = nil, &block)
val = scrub_internal(replace, &block)
return val unless val.nil?
self.dup
Expand Down

0 comments on commit 404cb90

Please sign in to comment.