зеркало из https://github.com/mozilla/gecko-dev.git
The code in RegExpImpl.findReplen did not take into account that a particular parenthesis pair can be null if it is not captured. The patch fixes that to send undefined to the replace function for that case.
This commit is contained in:
Родитель
828f431d53
Коммит
2aa340aba8
|
@ -483,7 +483,11 @@ class ReplaceData extends GlobData {
|
|||
args[0] = reImpl.lastMatch.toString();
|
||||
for (int i=0; i < parenCount; i++) {
|
||||
SubString sub = (SubString) parens.get(i);
|
||||
args[i+1] = sub.toString();
|
||||
if (sub != null) {
|
||||
args[i+1] = sub.toString();
|
||||
} else {
|
||||
args[i+1] = Undefined.instance;
|
||||
}
|
||||
}
|
||||
args[parenCount+1] = new Integer(reImpl.leftContext.length);
|
||||
args[parenCount+2] = str;
|
||||
|
|
Загрузка…
Ссылка в новой задаче