mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 11:15:34 +00:00
d30ebd31a8
We have found a problem in string.replace() when replacing a regular expression with a dollar sign. The following code works right when the replacement string does not contain "$": $ java -jar js.jar js> var re = new RegExp("%%%"); js> var price = "%%% 1.99"; js> price.replace(re, "USD"); USD 1.99 js> price.replace(re, "$"); Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException at org.mozilla.javascript.regexp.ReplaceData.interpretDollar(RegExpImpl.java:40 0) at org.mozilla.javascript.regexp.ReplaceData.findReplen(RegExpImpl.java:502) at org.mozilla.javascript.regexp.RegExpImpl.replace(RegExpImpl.java:116) at org.mozilla.javascript.NativeString.execMethod(NativeString.java:266) at org.mozilla.javascript.IdFunction.call(IdFunction.java:78) at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1222) at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1940) at org.mozilla.javascript.InterpretedScript.call(InterpretedScript.java:68) at org.mozilla.javascript.InterpretedScript.exec(InterpretedScript.java:59) at org.mozilla.javascript.Context.evaluateReader(Context.java:773) at org.mozilla.javascript.tools.shell.Main.evaluateReader(Main.java:312) at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:219) at org.mozilla.javascript.tools.shell.Main.exec(Main.java:106) at org.mozilla.javascript.tools.shell.Main.main(Main.java:68) |
||
---|---|---|
.. | ||
benchmarks | ||
jsd | ||
jsdj | ||
jsj | ||
macbuild | ||
ref | ||
rhino | ||
src | ||
tests | ||
.cvsignore | ||
landbranch.pl | ||
Makefile.in | ||
makefile.win |