From 3e7ad2de28cef2578e313b8d133475e1a82d9e28 Mon Sep 17 00:00:00 2001 From: Tooru Fujisawa Date: Wed, 23 Sep 2015 18:39:17 +0900 Subject: [PATCH] Bug 1207494 - Part 15: Remove use of expression closure from dom/xul/. r=bz --HG-- extra : commitid : A8CJK5lluib extra : rebase_source : 54401f225233de1bed1ce0a52dc9c97b7f9d231b --- .../tests/chrome/templates_shared.js | 2 +- .../tests/chrome/test_tmpl_errors.xul | 54 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/dom/xul/templates/tests/chrome/templates_shared.js b/dom/xul/templates/tests/chrome/templates_shared.js index a73e602424d0..1b96cbb8656f 100644 --- a/dom/xul/templates/tests/chrome/templates_shared.js +++ b/dom/xul/templates/tests/chrome/templates_shared.js @@ -440,7 +440,7 @@ function compareConsoleMessages() var consoleService = Components.classes["@mozilla.org/consoleservice;1"]. getService(Components.interfaces.nsIConsoleService); var messages = consoleService.getMessageArray() || []; - messages = messages.map(function (m) m.message); + messages = messages.map(m => m.message); // Copy to avoid modifying expectedConsoleMessages var expect = expectedConsoleMessages.concat(); for (var m = 0; m < messages.length; m++) { diff --git a/dom/xul/templates/tests/chrome/test_tmpl_errors.xul b/dom/xul/templates/tests/chrome/test_tmpl_errors.xul index e6852210fbdc..f3b58502dba2 100644 --- a/dom/xul/templates/tests/chrome/test_tmpl_errors.xul +++ b/dom/xul/templates/tests/chrome/test_tmpl_errors.xul @@ -33,37 +33,37 @@ var tests = [ // used in invalid location { - pre: function(template) template.insertBefore(document.createElement("queryset"), template.lastChild), + pre: template => template.insertBefore(document.createElement("queryset"), template.lastChild), error: "Error parsing template: unexpected element", - post: function(queryset) queryset.parentNode.removeChild(queryset) + post: queryset => queryset.parentNode.removeChild(queryset) }, // no member variable found { - pre: function(template) $("action").firstChild.removeAttribute("uri"), + pre: template => $("action").firstChild.removeAttribute("uri"), error: "Error parsing template: no member variable found. Action body should have an element with uri attribute", - post: function() $("action").firstChild.setAttribute("uri", "?child") + post: () => $("action").firstChild.setAttribute("uri", "?child") }, // bad binding subject { - pre: function(template) $("binding").removeAttribute("subject"), + pre: template => $("binding").removeAttribute("subject"), error: "Error parsing template: requires a variable for its subject attribute", - post: function() $("binding").setAttribute("subject", "?child"), + post: () => $("binding").setAttribute("subject", "?child"), }, // bad binding predicate { - pre: function(template) $("binding").removeAttribute("predicate"), + pre: template => $("binding").removeAttribute("predicate"), error: "Error parsing template: element is missing a predicate attribute", - post: function() $("binding").setAttribute("predicate", "http://www.some-fictitious-zoo.com/rdf#name"), + post: () => $("binding").setAttribute("predicate", "http://www.some-fictitious-zoo.com/rdf#name"), }, // bad binding object { - pre: function(template) $("binding").setAttribute("object", "blah"), + pre: template => $("binding").setAttribute("object", "blah"), error: "Error parsing template: requires a variable for its object attribute", - post: function() $("binding").setAttribute("object", "?name"), + post: () => $("binding").setAttribute("object", "?name"), }, // where condition missing a subject @@ -120,65 +120,65 @@ var tests = [ // bad member container { - pre: function(template) $("member").setAttribute("container", "blah"), + pre: template => $("member").setAttribute("container", "blah"), error: "Error parsing template: requires a variable for its container attribute", - post: function() $("member").setAttribute("container", "?uri"), + post: () => $("member").setAttribute("container", "?uri"), }, // bad member child { - pre: function(template) $("member").setAttribute("child", "blah"), + pre: template => $("member").setAttribute("child", "blah"), error: "Error parsing template: requires a variable for its child attribute", - post: function() $("member").setAttribute("child", "?child"), + post: () => $("member").setAttribute("child", "?child"), }, // bad triple subject { - pre: function(template) $("triple").removeAttribute("subject"), + pre: template => $("triple").removeAttribute("subject"), error: "Error parsing template: requires a variable for its subject attribute", - post: function() $("triple").setAttribute("subject", "?child"), + post: () => $("triple").setAttribute("subject", "?child"), }, // missing triple predicate { - pre: function(template) $("triple").removeAttribute("predicate"), + pre: template => $("triple").removeAttribute("predicate"), error: "Error parsing template: should have a non-variable value as a predicate", - post: function() $("triple").setAttribute("predicate", "http://www.some-fictitious-zoo.com/rdf#name"), + post: () => $("triple").setAttribute("predicate", "http://www.some-fictitious-zoo.com/rdf#name"), }, // bad triple predicate { - pre: function(template) $("triple").setAttribute("predicate", "?predicate"), + pre: template => $("triple").setAttribute("predicate", "?predicate"), error: "Error parsing template: should have a non-variable value as a predicate", - post: function() $("triple").setAttribute("predicate", "http://www.some-fictitious-zoo.com/rdf#name"), + post: () => $("triple").setAttribute("predicate", "http://www.some-fictitious-zoo.com/rdf#name"), }, // bad triple object { - pre: function(template) $("triple").removeAttribute("object"), + pre: template => $("triple").removeAttribute("object"), error: "Error parsing template: requires a variable for its object attribute", - post: function() $("triple").setAttribute("object", "?name"), + post: () => $("triple").setAttribute("object", "?name"), }, // content not first element in query { pre: function(template) { var content = $("content"); content.parentNode.appendChild(content); return content; }, error: "Error parsing template: expected to be first", - post: function(content) content.parentNode.insertBefore(content, content.parentNode.firstChild), + post: content => content.parentNode.insertBefore(content, content.parentNode.firstChild), }, // member container variable not bound { - pre: function(template) $("member").removeAttribute("container"), + pre: template => $("member").removeAttribute("container"), error: "Error parsing template: neither container or child variables of has a value", - post: function() $("member").setAttribute("container", "?uri"), + post: () => $("member").setAttribute("container", "?uri"), }, // neither triple subject or object variable are bound { - pre: function(template) $("triple").setAttribute("subject", "?blah"), + pre: template => $("triple").setAttribute("subject", "?blah"), error: "Error parsing template: neither subject or object variables of has a value", - post: function() $("triple").setAttribute("subject", "?child"), + post: () => $("triple").setAttribute("subject", "?child"), }, // neither triple subject or object variable are bound