tfpt review "/shelveset:StringGsubEach;REDMOND\dremy"
Comment  :
  Changes to for string.gsub and string.each (and each_line) to run clean.  The 
most significant change is to track version in MutableString.  This version is 
bumped on any mutation and functions that iterate (each, each_line, gsub) check 
the version before and after to assure there has been no version change during 
the iteration.  After these changes all gsub, each, and each_line specs run 
clean (no excludes).  Note that although the specs run clean the each behavior 
does not match MRI.  The spec test contains a new line in the iterating string 
("hello\nworld") and MRI does throw a runtime exception if this string is 
iterated.  However if there is no new line in the string MRI does not throw an 
exception if the underlying string is mutated.  This seems inconsistent but 
worth noting.

  String#gsub with pattern and block sets $~ for access from the block
  String#gsub with pattern and block restores $~ after leaving the block
  String#gsub with pattern and block sets $~ to MatchData of last match and nil 
when there's none for access from outside
  String#gsub with pattern and block raises a RuntimeError if the string is 
modified while substituting
  String#each raises a RuntimeError if the string is modified while substituting
  String#each_line raises a RuntimeError if the string is modified while 
substituting



Attachment: StringGsubEach.diff
Description: StringGsubEach.diff

_______________________________________________
Ironruby-core mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to