Bug 1245649: Enable no-nested-ternary. r=mconley

This commit is contained in:
Dave Townsend
2016-02-03 21:17:16 -08:00
parent 90d6041298
commit 141eaedde7
29 changed files with 215 additions and 106 deletions

View File

@@ -426,9 +426,12 @@ var gGestureSupport = {
try { try {
// Determine what type of data to load based on default value's type // Determine what type of data to load based on default value's type
let type = typeof aDef; let type = typeof aDef;
let getFunc = "get" + (type == "boolean" ? "Bool" : let getFunc = "Char";
type == "number" ? "Int" : "Char") + "Pref"; if (type == "boolean")
return gPrefService[getFunc](branch + aPref); getFunc = "Bool";
else if (type == "number")
getFunc = "Int";
return gPrefService["get" + getFunc + "Pref"](branch + aPref);
} }
catch (e) { catch (e) {
return aDef; return aDef;

View File

@@ -277,9 +277,13 @@ ContentSearchUIController.prototype = {
if (this.suggestionAtIndex(this.selectedIndex)) { if (this.suggestionAtIndex(this.selectedIndex)) {
eventData.selection = { eventData.selection = {
index: this.selectedIndex, index: this.selectedIndex,
kind: aEvent instanceof MouseEvent ? "mouse" : kind: undefined,
aEvent instanceof KeyboardEvent ? "key" : undefined,
}; };
if (aEvent instanceof MouseEvent) {
eventData.selection.kind = "mouse";
} else if (aEvent instanceof KeyboardEvent) {
eventData.selection.kind = "key";
}
} }
this._sendMsg("Search", eventData); this._sendMsg("Search", eventData);

View File

@@ -300,7 +300,7 @@ function initPluginsRow() {
let entries = Array.from(permissionMap, item => ({ name: item[1], permission: item[0] })); let entries = Array.from(permissionMap, item => ({ name: item[1], permission: item[0] }));
entries.sort(function(a, b) { entries.sort(function(a, b) {
return a.name < b.name ? -1 : (a.name == b.name ? 0 : 1); return a.name.localeCompare(b.name);
}); });
let permissionEntries = entries.map(p => fillInPluginPermissionTemplate(p.name, p.permission)); let permissionEntries = entries.map(p => fillInPluginPermissionTemplate(p.name, p.permission));

View File

@@ -916,8 +916,12 @@ CustomizeMode.prototype = {
let removable = aPlace == "palette" || CustomizableUI.isWidgetRemovable(aNode); let removable = aPlace == "palette" || CustomizableUI.isWidgetRemovable(aNode);
wrapper.setAttribute("removable", removable); wrapper.setAttribute("removable", removable);
let contextMenuAttrName = aNode.getAttribute("context") ? "context" : let contextMenuAttrName = "";
aNode.getAttribute("contextmenu") ? "contextmenu" : ""; if (aNode.getAttribute("context")) {
contextMenuAttrName = "context";
} else if (aNode.getAttribute("contextmenu")) {
contextMenuAttrName = "contextmenu";
}
let currentContextMenu = aNode.getAttribute(contextMenuAttrName); let currentContextMenu = aNode.getAttribute(contextMenuAttrName);
let contextMenuForPlace = aPlace == "panel" ? let contextMenuForPlace = aPlace == "panel" ?
kPanelItemContextMenu : kPanelItemContextMenu :

View File

@@ -417,8 +417,12 @@
// Autoscroll the popup strip if we drag over the scroll buttons. // Autoscroll the popup strip if we drag over the scroll buttons.
let anonid = event.originalTarget.getAttribute('anonid'); let anonid = event.originalTarget.getAttribute('anonid');
let scrollDir = anonid == "scrollbutton-up" ? -1 : let scrollDir = 0;
anonid == "scrollbutton-down" ? 1 : 0; if (anonid == "scrollbutton-up") {
scrollDir = -1;
} else if (anonid == "scrollbutton-down") {
scrollDir = 1;
}
if (scrollDir != 0) { if (scrollDir != 0) {
this._scrollBox.scrollByIndex(scrollDir, false); this._scrollBox.scrollByIndex(scrollDir, false);
} }

View File

@@ -542,7 +542,7 @@ var pktApi = (function() {
usedTagsObjectArray.sort(function(usedTagA, usedTagB) { usedTagsObjectArray.sort(function(usedTagA, usedTagB) {
var a = usedTagA.timestamp; var a = usedTagA.timestamp;
var b = usedTagB.timestamp; var b = usedTagB.timestamp;
return a < b ? -1 : a > b ? 1 : 0; return a - b;
}); });
// Get all keys tags // Get all keys tags

View File

@@ -110,7 +110,7 @@
"no-negated-in-lhs": 2, "no-negated-in-lhs": 2,
// Nested ternary statements are confusing // Nested ternary statements are confusing
// "no-nested-ternary": 2, "no-nested-ternary": 2,
// Use {} instead of new Object() // Use {} instead of new Object()
// "no-new-object": 2, // "no-new-object": 2,

View File

@@ -1193,9 +1193,7 @@ TreeNode.compareAmounts = function(aA, aB) {
}; };
TreeNode.compareUnsafeNames = function(aA, aB) { TreeNode.compareUnsafeNames = function(aA, aB) {
return aA._unsafeName < aB._unsafeName ? -1 : return aA._unsafeName.localeCompare(aB._unsafeName);
aA._unsafeName > aB._unsafeName ? 1 :
0;
}; };

View File

@@ -1593,12 +1593,13 @@ module.exports = function (chai, _) {
} }
} }
var actuallyGot = '' var actuallyGot = '';
, expectedThrown = name !== null var expectedThrown = 'an error';
? name if (name !== null) {
: desiredError expectedThrown = name;
? '#{exp}' //_.inspect(desiredError) } else if (desiredError) {
: 'an error'; expectedThrown = '#{exp}'; //_.inspect(desiredError)
}
if (thrown) { if (thrown) {
actuallyGot = ' but #{act} was thrown' actuallyGot = ' but #{act} was thrown'

View File

@@ -415,7 +415,13 @@ var JsDiff = (function() {
var ret = [], change; var ret = [], change;
for ( var i = 0; i < changes.length; i++) { for ( var i = 0; i < changes.length; i++) {
change = changes[i]; change = changes[i];
ret.push([(change.added ? 1 : change.removed ? -1 : 0), change.value]); var order = 0;
if (change.added) {
order = 1;
} else if (change.removed) {
order = -1;
}
ret.push([order, change.value]);
} }
return ret; return ret;
} }
@@ -2097,12 +2103,13 @@ var color = exports.color = function(type, str) {
*/ */
exports.window = { exports.window = {
width: isatty width: 75
? process.stdout.getWindowSize
? process.stdout.getWindowSize(1)[0]
: tty.getWindowSize()[1]
: 75
}; };
if (isatty) {
exports.window.width = process.stdout.getWindowSize
? process.stdout.getWindowSize(1)[0]
: tty.getWindowSize()[1];
}
/** /**
* Expose some basic cursor interactions * Expose some basic cursor interactions
@@ -2240,11 +2247,13 @@ function Base(runner) {
stats.passes = stats.passes || 0; stats.passes = stats.passes || 0;
var medium = test.slow() / 2; var medium = test.slow() / 2;
test.speed = test.duration > test.slow() if (test.duration > test.slow()) {
? 'slow' test.speed = 'slow';
: test.duration > medium } else if (test.duration > medium) {
? 'medium' test.speed = 'medium';
: 'fast'; } else {
test.speed = 'fast';
}
stats.passes++; stats.passes++;
}); });

View File

@@ -581,11 +581,11 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
var wrapper = undefined; var wrapper = undefined;
for (var c = element.firstChild; c; c = c.nextSibling) { for (var c = element.firstChild; c; c = c.nextSibling) {
var type = c.nodeType; var type = c.nodeType;
wrapper = (type === 1) // Element Node if (type === 1) {
? (wrapper ? element : c) wrapper = wrapper ? element : c;
: (type === 3) // Text Node } else if (type === 3) {
? (notWs.test(c.nodeValue) ? element : wrapper) wrapper = notWs.test(c.nodeValue) ? element : wrapper;
: wrapper; }
} }
return wrapper === element ? undefined : wrapper; return wrapper === element ? undefined : wrapper;
} }
@@ -1411,9 +1411,11 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
// Look for a class like linenums or linenums:<n> where <n> is the // Look for a class like linenums or linenums:<n> where <n> is the
// 1-indexed number of the first line. // 1-indexed number of the first line.
var lineNums = cs.className.match(/\blinenums\b(?::(\d+))?/); var lineNums = cs.className.match(/\blinenums\b(?::(\d+))?/);
lineNums = lineNums if (lineNums) {
? lineNums[1] && lineNums[1].length ? +lineNums[1] : true lineNums = lineNums[1] && lineNums[1].length ? +lineNums[1] : true;
: false; } else {
lineNums = false;
}
if (lineNums) { numberLines(cs, lineNums); } if (lineNums) { numberLines(cs, lineNums); }
// do the pretty printing // do the pretty printing

View File

@@ -256,8 +256,11 @@ BookmarkImporter.prototype = {
} else { } else {
// Ensure tag folder gets processed last // Ensure tag folder gets processed last
nodes[0].children.sort(function sortRoots(aNode, bNode) { nodes[0].children.sort(function sortRoots(aNode, bNode) {
return (aNode.root && aNode.root == "tagsFolder") ? 1 : if (aNode.root && aNode.root == "tagsFolder")
(bNode.root && bNode.root == "tagsFolder") ? -1 : 0; return 1;
if (bNode.root && bNode.root == "tagsFolder")
return -1;
return 0;
}); });
let batch = { let batch = {

View File

@@ -977,8 +977,9 @@ function reorderChildren(parent, orderedChildrenGuids) {
let i = orderedChildrenGuids.indexOf(a.guid); let i = orderedChildrenGuids.indexOf(a.guid);
let j = orderedChildrenGuids.indexOf(b.guid); let j = orderedChildrenGuids.indexOf(b.guid);
// This works provided fetchBookmarksByParent returns sorted children. // This works provided fetchBookmarksByParent returns sorted children.
return (i == -1 && j == -1) ? 0 : if (i == -1 && j == -1)
(i != -1 && j != -1 && i < j) || (i != -1 && j == -1) ? -1 : 1; return 0;
return (i != -1 && j != -1 && i < j) || (i != -1 && j == -1) ? -1 : 1;
}); });
// Update the bookmarks position now. If any unknown guid have been // Update the bookmarks position now. If any unknown guid have been

View File

@@ -173,7 +173,7 @@ this.PlacesBackups = {
this._entries.sort((a, b) => { this._entries.sort((a, b) => {
let aDate = this.getDateForFile(a); let aDate = this.getDateForFile(a);
let bDate = this.getDateForFile(b); let bDate = this.getDateForFile(b);
return aDate < bDate ? 1 : aDate > bDate ? -1 : 0; return bDate - aDate;
}); });
return this._entries; return this._entries;
}, },
@@ -215,7 +215,7 @@ this.PlacesBackups = {
this._backupFiles.sort((a, b) => { this._backupFiles.sort((a, b) => {
let aDate = this.getDateForFile(a); let aDate = this.getDateForFile(a);
let bDate = this.getDateForFile(b); let bDate = this.getDateForFile(b);
return aDate < bDate ? 1 : aDate > bDate ? -1 : 0; return bDate - aDate;
}); });
return this._backupFiles; return this._backupFiles;

View File

@@ -1751,16 +1751,21 @@ Search.prototype = {
let typed = Prefs.autofillTyped || this.hasBehavior("typed"); let typed = Prefs.autofillTyped || this.hasBehavior("typed");
let bookmarked = this.hasBehavior("bookmark") && !this.hasBehavior("history"); let bookmarked = this.hasBehavior("bookmark") && !this.hasBehavior("history");
return [ let query = [];
bookmarked ? typed ? SQL_BOOKMARKED_TYPED_HOST_QUERY if (bookmarked) {
: SQL_BOOKMARKED_HOST_QUERY query.push(typed ? SQL_BOOKMARKED_TYPED_HOST_QUERY
: typed ? SQL_TYPED_HOST_QUERY : SQL_BOOKMARKED_HOST_QUERY);
: SQL_HOST_QUERY, } else {
{ query.push(typed ? SQL_TYPED_HOST_QUERY
: SQL_HOST_QUERY);
}
query.push({
query_type: QUERYTYPE_AUTOFILL_HOST, query_type: QUERYTYPE_AUTOFILL_HOST,
searchString: this._searchString.toLowerCase() searchString: this._searchString.toLowerCase()
} });
];
return query;
}, },
/** /**
@@ -1780,17 +1785,22 @@ Search.prototype = {
let typed = Prefs.autofillTyped || this.hasBehavior("typed"); let typed = Prefs.autofillTyped || this.hasBehavior("typed");
let bookmarked = this.hasBehavior("bookmark") && !this.hasBehavior("history"); let bookmarked = this.hasBehavior("bookmark") && !this.hasBehavior("history");
return [ let query = [];
bookmarked ? typed ? SQL_BOOKMARKED_TYPED_URL_QUERY if (bookmarked) {
: SQL_BOOKMARKED_URL_QUERY query.push(typed ? SQL_BOOKMARKED_TYPED_URL_QUERY
: typed ? SQL_TYPED_URL_QUERY : SQL_BOOKMARKED_URL_QUERY);
: SQL_URL_QUERY, } else {
{ query.push(typed ? SQL_TYPED_URL_QUERY
: SQL_URL_QUERY);
}
query.push({
query_type: QUERYTYPE_AUTOFILL_URL, query_type: QUERYTYPE_AUTOFILL_URL,
searchString: this._autofillUrlSearchString, searchString: this._autofillUrlSearchString,
revHost revHost
} });
];
return query;
}, },
/** /**

View File

@@ -534,9 +534,12 @@ function check_JSON_backup(aIsAutomaticBackup) {
*/ */
function frecencyForUrl(aURI) function frecencyForUrl(aURI)
{ {
let url = aURI instanceof Ci.nsIURI ? aURI.spec let url = aURI;
: aURI instanceof URL ? aURI.href if (aURI instanceof Ci.nsIURI) {
: aURI; url = aURI.spec;
} else if (aURI instanceof URL) {
url = aURI.href;
}
let stmt = DBConn().createStatement( let stmt = DBConn().createStatement(
"SELECT frecency FROM moz_places WHERE url = ?1" "SELECT frecency FROM moz_places WHERE url = ?1"
); );

View File

@@ -72,8 +72,12 @@ var Readability = function(uri, doc, options) {
return rv + '("' + e.textContent + '")'; return rv + '("' + e.textContent + '")';
} }
var classDesc = e.className && ("." + e.className.replace(/ /g, ".")); var classDesc = e.className && ("." + e.className.replace(/ /g, "."));
var elDesc = e.id ? "(#" + e.id + classDesc + ")" : var elDesc = "";
(classDesc ? "(" + classDesc + ")" : ""); if (e.id) {
elDesc = "(#" + e.id + classDesc + ")";
} else if (classDesc) {
elDesc = "(" + classDesc + ")";
}
return rv + elDesc; return rv + elDesc;
} }
this.log = function () { this.log = function () {
@@ -743,7 +747,7 @@ Readability.prototype = {
// - parent: 1 (no division) // - parent: 1 (no division)
// - grandparent: 2 // - grandparent: 2
// - great grandparent+: ancestor level * 3 // - great grandparent+: ancestor level * 3
var scoreDivider = level === 0 ? 1 : level === 1 ? 2 : level * 3; var scoreDivider = level < 2 ? level + 1 : level * 3;
ancestor.readability.contentScore += contentScore / scoreDivider; ancestor.readability.contentScore += contentScore / scoreDivider;
}); });
}); });

View File

@@ -481,8 +481,14 @@ function logTestInfo(aText, aCaller) {
let ms = now.getMilliseconds(); let ms = now.getMilliseconds();
let time = (hh < 10 ? "0" + hh : hh) + ":" + let time = (hh < 10 ? "0" + hh : hh) + ":" +
(mm < 10 ? "0" + mm : mm) + ":" + (mm < 10 ? "0" + mm : mm) + ":" +
(ss < 10 ? "0" + ss : ss) + ":" + (ss < 10 ? "0" + ss : ss) + ":";
(ms < 10 ? "00" + ms : ms < 100 ? "0" + ms : ms); if (ms < 10) {
time += "00";
}
else if (ms < 100) {
time += "0";
}
time += ms;
let msg = time + " | TEST-INFO | " + caller.filename + " | [" + caller.name + let msg = time + " | TEST-INFO | " + caller.filename + " | [" + caller.name +
" : " + caller.lineNumber + "] " + aText; " : " + caller.lineNumber + "] " + aText;
do_print(msg); do_print(msg);

View File

@@ -1241,7 +1241,10 @@ var Histogram = {
// - If it's 1 -> manually correct it to 0 (the 0..1 anomaly) // - If it's 1 -> manually correct it to 0 (the 0..1 anomaly)
// - For the rest, set the label as the bottom value instead of the upper. // - For the rest, set the label as the bottom value instead of the upper.
// --> so we'll end with the following (non dummy) labels: 0, 2, 4, 8, 16, ... // --> so we'll end with the following (non dummy) labels: 0, 2, 4, 8, 16, ...
return !aIsBHR ? k : k == 1 ? 0 : (k + 1) / 2; if (!aIsBHR) {
return k;
}
return k == 1 ? 0 : (k + 1) / 2;
} }
const labelledValues = Object.keys(aHgram.values) const labelledValues = Object.keys(aHgram.values)

View File

@@ -393,7 +393,11 @@ function testtag_tree_TreeSelection_UI(tree, testid, multiple)
// do this three times, one for each state of pageUpOrDownMovesSelection, // do this three times, one for each state of pageUpOrDownMovesSelection,
// and then once with the accel key pressed // and then once with the accel key pressed
for (let t = 0; t < 3; t++) { for (let t = 0; t < 3; t++) {
let testidmod = (t == 2) ? " with accel" : (t == 1) ? " rev" : ""; let testidmod = "";
if (t == 2)
testidmod = " with accel"
else if (t == 1)
testidmod = " rev";
var keymod = (t == 2) ? { accelKey: true } : { }; var keymod = (t == 2) ? { accelKey: true } : { };
var moveselection = tree.pageUpOrDownMovesSelection; var moveselection = tree.pageUpOrDownMovesSelection;
@@ -1164,10 +1168,20 @@ function testtag_tree_wheel(aTree)
function helper(aStart, aDelta, aIntDelta, aDeltaMode) function helper(aStart, aDelta, aIntDelta, aDeltaMode)
{ {
aTree.treeBoxObject.scrollToRow(aStart); aTree.treeBoxObject.scrollToRow(aStart);
var expected = !aIntDelta ? aStart : var expected;
aDeltaMode != WheelEvent.DOM_DELTA_PAGE ? aStart + aIntDelta : if (!aIntDelta) {
aIntDelta > 0 ? aStart + aTree.treeBoxObject.getPageLength() : expected = aStart;
aStart - aTree.treeBoxObject.getPageLength(); }
else if (aDeltaMode != WheelEvent.DOM_DELTA_PAGE) {
expected = aStart + aIntDelta;
}
else if (aIntDelta > 0) {
expected = aStart + aTree.treeBoxObject.getPageLength();
}
else {
expected = aStart - aTree.treeBoxObject.getPageLength();
}
if (expected < 0) { if (expected < 0) {
expected = 0; expected = 0;
} }

View File

@@ -63,8 +63,11 @@
var state = this.getAttribute("checkState"); var state = this.getAttribute("checkState");
if (state == "") if (state == "")
return this.checked ? 1 : 0; return this.checked ? 1 : 0;
else if (state == "0")
return state == "0" ? 0 : (state == "2" ? 2 : 1); return 0;
if (state == "2")
return 2;
return 1;
]]></getter> ]]></getter>
<setter><![CDATA[ <setter><![CDATA[
this.setAttribute("checkState", val); this.setAttribute("checkState", val);

View File

@@ -778,24 +778,29 @@
var yi = 2, mi = 4, di = 6; var yi = 2, mi = 4, di = 6;
function fieldForNumber(i) {
if (i == 2)
return "input-one";
if (i == 4)
return "input-two";
return "input-three";
}
for (var i = 1; i < numberFields.length; i++) { for (var i = 1; i < numberFields.length; i++) {
switch (Number(numberFields[i])) { switch (Number(numberFields[i])) {
case 2: case 2:
twoDigitYear = true; // fall through twoDigitYear = true; // fall through
case 2002: case 2002:
yi = i; yi = i;
yfield = (i == 2 ? "input-one" : yfield = fieldForNumber(i);
(i == 4 ? "input-two" : "input-three"));
break; break;
case 9, 10: case 9, 10:
mi = i; mi = i;
mfield = (i == 2 ? "input-one" : mfield = fieldForNumber(i);
(i == 4 ? "input-two" : "input-three"));
break; break;
case 4: case 4:
di = i; di = i;
dfield = (i == 2 ? "input-one" : dfield = fieldForNumber(i);
(i == 4 ? "input-two" : "input-three"));
break; break;
} }
} }

View File

@@ -465,10 +465,18 @@
// set fading // set fading
var fade = this.getAttribute("fade"); var fade = this.getAttribute("fade");
var fadeDelay = (fade == "fast") ? 1 : fade == "slow" ? 4000 : 0; var fadeDelay = 0;
if (fadeDelay) { if (fade == "fast") {
this._fadeTimer = setTimeout(() => this.hidePopup(true), fadeDelay, this); fadeDelay = 1;
} }
else if (fade == "slow") {
fadeDelay = 4000;
}
else {
return;
}
this._fadeTimer = setTimeout(() => this.hidePopup(true), fadeDelay, this);
]]> ]]>
</handler> </handler>
<handler event="popuphiding" phase="target"> <handler event="popuphiding" phase="target">

View File

@@ -443,7 +443,9 @@
Components.utils.reportError(e); Components.utils.reportError(e);
} }
} }
var val = rv !== undefined ? rv : (this.instantApply ? this.valueFromPreferences : this.value); var val = rv;
if (val === undefined)
val = this.instantApply ? this.valueFromPreferences : this.value;
// if the preference is marked for reset, show default value in UI // if the preference is marked for reset, show default value in UI
if (val === undefined) if (val === undefined)
val = this.defaultValue; val = this.defaultValue;

View File

@@ -1237,7 +1237,10 @@
<property name="ordinal"> <property name="ordinal">
<getter><![CDATA[ <getter><![CDATA[
var val = this.getAttribute("ordinal"); var val = this.getAttribute("ordinal");
return "" + (val == "" ? 1 : (val == "0" ? 0 : parseInt(val))); if (val == "")
return "1";
return "" + (val == "0" ? 0 : parseInt(val));
]]></getter> ]]></getter>
<setter><![CDATA[ <setter><![CDATA[
this.setAttribute("ordinal", val); this.setAttribute("ordinal", val);

View File

@@ -262,10 +262,18 @@ Rect.prototype = {
/** Ensure this rectangle is inside the other, if possible. Preserves w, h. */ /** Ensure this rectangle is inside the other, if possible. Preserves w, h. */
translateInside: function translateInside(other) { translateInside: function translateInside(other) {
let offsetX = (this.left <= other.left ? other.left - this.left : let offsetX = 0;
(this.right > other.right ? other.right - this.right : 0)); if (this.left <= other.left)
let offsetY = (this.top <= other.top ? other.top - this.top : offsetX = other.left - this.left;
(this.bottom > other.bottom ? other.bottom - this.bottom : 0)); else if (this.right > other.right)
offsetX = other.right - this.right;
let offsetY = 0;
if (this.top <= other.top)
offsetY = other.top - this.top;
else if (this.bottom > other.bottom)
offsetY = other.bottom - this.bottom;
return this.translate(offsetX, offsetY); return this.translate(offsetX, offsetY);
}, },

View File

@@ -80,9 +80,11 @@ this.XPathGenerator = {
* @returns a properly quoted string to insert into an XPath query * @returns a properly quoted string to insert into an XPath query
*/ */
quoteArgument: function sss_xph_quoteArgument(aArg) { quoteArgument: function sss_xph_quoteArgument(aArg) {
return !/'/.test(aArg) ? "'" + aArg + "'" : if (!/'/.test(aArg))
!/"/.test(aArg) ? '"' + aArg + '"' : return "'" + aArg + "'";
"concat('" + aArg.replace(/'+/g, "',\"$&\",'") + "')"; if (!/"/.test(aArg))
return '"' + aArg + '"';
return "concat('" + aArg.replace(/'+/g, "',\"$&\",'") + "')";
}, },
/** /**

View File

@@ -320,9 +320,13 @@ function parseRDFManifest(aId, aUpdateKey, aRequest, aManifestData) {
let extensionRes = gRDF.GetResource(PREFIX_EXTENSION + aId); let extensionRes = gRDF.GetResource(PREFIX_EXTENSION + aId);
let themeRes = gRDF.GetResource(PREFIX_THEME + aId); let themeRes = gRDF.GetResource(PREFIX_THEME + aId);
let itemRes = gRDF.GetResource(PREFIX_ITEM + aId); let itemRes = gRDF.GetResource(PREFIX_ITEM + aId);
let addonRes = ds.ArcLabelsOut(extensionRes).hasMoreElements() ? extensionRes let addonRes;
: ds.ArcLabelsOut(themeRes).hasMoreElements() ? themeRes if (ds.ArcLabelsOut(extensionRes).hasMoreElements())
: itemRes; addonRes = extensionRes;
else if (ds.ArcLabelsOut(themeRes).hasMoreElements())
addonRes = themeRes;
else
addonRes = itemRes;
// If we have an update key then the update manifest must be signed // If we have an update key then the update manifest must be signed
if (aUpdateKey) { if (aUpdateKey) {

View File

@@ -609,8 +609,13 @@ function logTestInfo(aText, aCaller) {
let ms = now.getMilliseconds(); let ms = now.getMilliseconds();
let time = (hh < 10 ? "0" + hh : hh) + ":" + let time = (hh < 10 ? "0" + hh : hh) + ":" +
(mm < 10 ? "0" + mm : mm) + ":" + (mm < 10 ? "0" + mm : mm) + ":" +
(ss < 10 ? "0" + ss : ss) + ":" + (ss < 10 ? "0" + ss : ss) + ":";
(ms < 10 ? "00" + ms : ms < 100 ? "0" + ms : ms); if (ms < 10) {
time += "00";
} else if (ms < 100) {
time += "0";
}
time += ms;
let msg = time + " | TEST-INFO | " + caller.filename + " | [" + caller.name + let msg = time + " | TEST-INFO | " + caller.filename + " | [" + caller.name +
" : " + caller.lineNumber + "] " + aText; " : " + caller.lineNumber + "] " + aText;
LOG_FUNCTION(msg); LOG_FUNCTION(msg);