Bug 1231509 - Using more than just an expression in XBL fields confuses the eslint xbl preprocessor. r=mossop

MozReview-Commit-ID: 4lMiSP0ery4

--HG--
extra : rebase_source : 299bbdc5e93b92d80e438482aa28b22d427ce71b
This commit is contained in:
Philipp Kewisch 2016-09-19 11:31:38 +02:00
Родитель a35ec87644
Коммит 7298b61dc6
4 изменённых файлов: 107 добавлений и 52 удалений

Просмотреть файл

@ -1858,13 +1858,19 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
<field name="progresstext" readonly="true">
document.getElementById("addon-progress-notification-progresstext");
</field>
<field name="DownloadUtils" readonly="true">
{
let utils = {};
Components.utils.import("resource://gre/modules/DownloadUtils.jsm", utils);
utils.DownloadUtils;
}
</field>
<property name="DownloadUtils" readonly="true">
<getter><![CDATA[
let module = {};
Components.utils.import("resource://gre/modules/DownloadUtils.jsm", module);
Object.defineProperty(this, "DownloadUtils", {
configurable: true,
enumerable: true,
writable: true,
value: module.DownloadUtils
});
return module.DownloadUtils;
]]></getter>
</property>
<method name="destroy">
<body><![CDATA[

Просмотреть файл

@ -69,14 +69,13 @@
<!-- =================== nsIAutoCompleteInput =================== -->
<field name="popup"><![CDATA[
// Wrap in a block so that the let statements don't
// create properties on 'this' (bug 635252).
{
<property name="popup" readonly="true">
<getter><![CDATA[
let popup = null;
let popupId = this.getAttribute("autocompletepopup");
if (popupId)
if (popupId) {
popup = document.getElementById(popupId);
}
if (!popup) {
popup = document.createElement("panel");
popup.setAttribute("type", "autocomplete");
@ -86,9 +85,17 @@
popupset.appendChild(popup);
}
popup.mInput = this;
popup;
}
]]></field>
// Avoid having to recalculate the popup property each time
Object.defineProperty(this, "popup", {
configurable: true,
enumerable: true,
writable: true,
value: popup
});
return popup;
]]></getter>
</property>
<property name="controller" onget="return this.mController;" readonly="true"/>
@ -149,13 +156,19 @@
parseInt(this.getAttribute("shrinkdelay")) || 0
</field>
<field name="PrivateBrowsingUtils" readonly="true">
{
let utils = {};
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm", utils);
utils.PrivateBrowsingUtils
}
</field>
<property name="PrivateBrowsingUtils" readonly="true">
<getter><![CDATA[
let module = {};
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm", module);
Object.defineProperty(this, "PrivateBrowsingUtils", {
configurable: true,
enumerable: true,
writable: true,
value: module.PrivateBrowsingUtils
});
return module.PrivateBrowsingUtils;
]]></getter>
</property>
<property name="inPrivateContext" readonly="true"
onget="return this.PrivateBrowsingUtils.isWindowPrivate(window);"/>

Просмотреть файл

@ -1263,11 +1263,19 @@
</body>
</method>
<field name="DeferredTask" readonly="true">
let targetObj = {};
Components.utils.import("resource://gre/modules/DeferredTask.jsm", targetObj);
targetObj.DeferredTask;
</field>
<property name="DeferredTask" readonly="true">
<getter><![CDATA[
let module = {};
Components.utils.import("resource://gre/modules/DeferredTask.jsm", module);
Object.defineProperty(this, "DeferredTask", {
configurable: true,
enumerable: true,
writable: true,
value: module.DeferredTask
});
return module.DeferredTask;
]]></getter>
</property>
<method name="_deferredValueUpdate">
<parameter name="aElement"/>
<body>

Просмотреть файл

@ -349,15 +349,26 @@
</setter>
</property>
<field name="tabbox" readonly="true"><![CDATA[
var parent = this.parentNode;
while (parent) {
if (parent.localName == "tabbox")
break;
parent = parent.parentNode;
}
parent;
]]></field>
<property name="tabbox" readonly="true">
<getter><![CDATA[
let parent = this.parentNode;
while (parent) {
if (parent.localName == "tabbox") {
break;
}
parent = parent.parentNode;
}
// Avoid having to recalculate the tabbox property each time
Object.defineProperty(this, "tabbox", {
configurable: true,
enumerable: true,
writable: true,
value: parent
});
return parent;
]]></getter>
</property>
<!-- _tabbox is deprecated, it exists only for backwards compatibility. -->
<field name="_tabbox" readonly="true"><![CDATA[
@ -633,15 +644,26 @@
</method>
<!-- public -->
<field name="tabbox" readonly="true"><![CDATA[
var parent = this.parentNode;
while (parent) {
if (parent.localName == "tabbox")
break;
parent = parent.parentNode;
}
parent;
]]></field>
<property name="tabbox" readonly="true">
<getter><![CDATA[
let parent = this.parentNode;
while (parent) {
if (parent.localName == "tabbox") {
break;
}
parent = parent.parentNode;
}
// Avoid having to recalculate the tabbox property each time
Object.defineProperty(this, "tabbox", {
configurable: true,
enumerable: true,
writable: true,
value: parent
});
return parent;
]]></getter>
</property>
<field name="_selectedPanel">this.childNodes.item(this.selectedIndex)</field>
@ -770,13 +792,19 @@
<field name="arrowKeysShouldWrap" readonly="true">
/Mac/.test(navigator.platform)
</field>
<field name="TelemetryStopwatch" readonly="true">
{
let tmp = {};
Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", tmp);
tmp.TelemetryStopwatch;
}
</field>
<property name="TelemetryStopwatch" readonly="true">
<getter><![CDATA[
let module = {};
Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", module);
Object.defineProperty(this, "TelemetryStopwatch", {
configurable: true,
enumerable: true,
writable: true,
value: module.TelemetryStopwatch
});
return module.TelemetryStopwatch;
]]></getter>
</property>
</implementation>
<handlers>