Bug 1048000 - Expect undefined for non-matching regex groups. r=bnicholson

This commit is contained in:
Wes Johnston 2014-08-13 14:53:34 -07:00
parent 2622559577
commit 821554a3e1

View File

@ -573,9 +573,9 @@ let PromptUtils = {
if (!aLabel)
return "";
if (/ *\(\&([^&])\)(:)?$/.test(aLabel)) {
if (/ *\(\&([^&])\)(:?)$/.test(aLabel)) {
aLabel = RegExp.leftContext + RegExp.$2;
} else if (/^(.*[^&])?\&(([^&]).*$)/.test(aLabel)) {
} else if (/^([^&]*)\&(([^&]).*$)/.test(aLabel)) {
aLabel = RegExp.$1 + RegExp.$2;
}