Bug 1346797 - Fix calendar eslint issues - Fix mozilla/avoid-removeChild issues. r=MakeMyDay
MozReview-Commit-ID: KghdaOwvfVg
--- a/calendar/lightning/modules/ltnInvitationUtils.jsm
+++ b/calendar/lightning/modules/ltnInvitationUtils.jsm
@@ -292,17 +292,17 @@ ltn.invitation = {
* @param {Node} aToNode text node to change
* @param {String} aType use 'newline' for the same, 'added' or 'removed' for decoration
* @param {String} aText [optional]
* @param {Boolean} aClear [optional] for consecutive changes on the same node, set to false
*/
function _content2Child(aToNode, aType, aText = "", aClear = true) {
let nodeDoc = aToNode.ownerDocument;
if (aClear && aToNode.hasChildNodes()) {
- aToNode.removeChild(aToNode.firstChild);
+ aToNode.firstChild.remove();
}
let n = nodeDoc.createElement(aType.toLowerCase() == "newline" ? "br" : "span");
switch (aType) {
case "added":
case "modified":
case "removed":
n.className = aType;
if (Preferences.get("calendar.view.useSystemColors", false)) {