# HG changeset patch # User Ian Neal # Date 1633794698 -3600 # Parent 11b2381af19be7b90d89e251afe00cb1c2ad4461 Bug 1727989 - Fix JS strict warnings in unescapeTagValue. r=frg a=frg diff --git a/suite/extensions/irc/js/lib/irc.js b/suite/extensions/irc/js/lib/irc.js --- a/suite/extensions/irc/js/lib/irc.js +++ b/suite/extensions/irc/js/lib/irc.js @@ -733,30 +733,30 @@ function serv_decodetagdata(str) dict["\\"] = "\\"; dict["r"] = "\r"; dict["n"] = "\n"; // Function for unescaping key values. function unescapeTagValue(data) { var rv = ""; - for (var i = 0; i < data.length; i++) + for (let j = 0; j < data.length; j++) { - var ci = data[i]; - var co = dict[data[i+1]]; - if (ci == "\\" && i < str.length - 1) + let currentItem = data[j]; + if (currentItem == "\\" && j < data.length - 1) { - if (co) - rv += co; + let nextItem = data[j + 1]; + if (nextItem in dict) + rv += dict[nextItem]; else - rv += data[i+1]; - i++ + rv += nextItem; + j++ } - else if (ci != "\\") - rv += ci; + else if (currentItem != "\\") + rv += currentItem; } return rv; } var obj = Object(); var tags = str.split(";");