[MacRuby/MacRuby] 998999: fix the MatchData#[] behavior if passed a negative...
27 Aug
2012
27 Aug
'12
9:24 a.m.
Branch: refs/heads/master Home: https://github.com/MacRuby/MacRuby Commit: 998999953decfd1162cef517fa87498e99897c21 https://github.com/MacRuby/MacRuby/commit/998999953decfd1162cef517fa87498e99... Author: Watson <watson1978@gmail.com> Date: 2012-08-27 (Mon, 27 Aug 2012) Changed paths: M re.c Log Message: ----------- fix the MatchData#[] behavior if passed a negative Fixnum object as index In below case, MatchData#[] always returns a nil: index < 0 && (matched count) + index >= 0 Sample code: ``` str = 'foo bar baz' m = str.match(/\w+/) p m[-1] #=> expect "foo", but nil ``` This fix above behavior.
4821
Age (days ago)
4821
Last active (days ago)
0 comments
1 participants
participants (1)
-
GitHub