Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Truffle] String#scrub accepts an explicit nil.
Browse files Browse the repository at this point in the history
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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 404cb90

Please sign in to comment.