Skip to content

Commit

Permalink
Fix String#chomp to work in IE6..8
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Feb 2, 2014
1 parent b80fcc5 commit 8462178
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opal/corelib/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def chomp(separator = $/)
return self.replace(/(\r?\n)+$/, '');
}
else if (self.length > separator.length) {
var tail = self.substr(-1 * separator.length);
var tail = self.substr(self.length - separator.length, separator.length);
if (tail === separator) {
return self.substr(0, self.length - separator.length);
Expand Down

0 comments on commit 8462178

Please sign in to comment.