The JS String object's replace method supports more than group replacements ($n). See https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String/replace for other constructs.
The submitted patch adds test cases for all three.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Adds test cases for $&, $` and $' replacements
Now fixed in SVN. Thanks for the test cases.