Bug 1228975 - Remove Array generics usage from Places code. r=mak

This commit is contained in:
simplyblue 2015-12-01 15:40:30 +05:30
parent d52411379d
commit 4c11bd80b7
7 changed files with 11 additions and 11 deletions

View File

@ -940,9 +940,9 @@ before(exports, (name, assert, done) => resetPlaces(done));
after(exports, (name, assert, done) => resetPlaces(done));
function saveP () {
return promisedEmitter(save.apply(null, Array.slice(arguments)));
return promisedEmitter(save.apply(null, Array.prototype.slice.call(arguments)));
}
function searchP () {
return promisedEmitter(search.apply(null, Array.slice(arguments)));
return promisedEmitter(search.apply(null, Array.prototype.slice.call(arguments)));
}

View File

@ -316,7 +316,7 @@ after(exports, (name, assert, done) => setTimeout(() => resetPlaces(done), 1));
before(exports, (name, assert, done) => resetPlaces(done));
function saveP () {
return promisedEmitter(save.apply(null, Array.slice(arguments)));
return promisedEmitter(save.apply(null, Array.prototype.slice.call(arguments)));
}
function makeCompleted (done, countTo) {

View File

@ -237,7 +237,7 @@ function toBeWithin (range) {
}
function searchP () {
return promisedEmitter(search.apply(null, Array.slice(arguments)));
return promisedEmitter(search.apply(null, Array.prototype.slice.call(arguments)));
}
before(exports, (name, assert, done) => resetPlaces(done));

View File

@ -633,7 +633,7 @@ PlacesViewBase.prototype = {
if (!parentElt._built)
return;
let index = Array.indexOf(parentElt.childNodes, parentElt._startMarker) +
let index = Array.prototype.indexOf.call(parentElt.childNodes, parentElt._startMarker) +
aIndex + 1;
this._insertNewItemToPopup(aPlacesNode, parentElt,
parentElt.childNodes[index]);
@ -663,7 +663,7 @@ PlacesViewBase.prototype = {
if (parentElt._built) {
// Move the node.
parentElt.removeChild(elt);
let index = Array.indexOf(parentElt.childNodes, parentElt._startMarker) +
let index = Array.prototype.indexOf.call(parentElt.childNodes, parentElt._startMarker) +
aNewIndex + 1;
parentElt.insertBefore(elt, parentElt.childNodes[index]);
}
@ -1411,7 +1411,7 @@ PlacesToolbar.prototype = {
if (elt._placesNode && elt != this._rootElt &&
elt.localName != "menupopup") {
let eltRect = elt.getBoundingClientRect();
let eltIndex = Array.indexOf(this._rootElt.childNodes, elt);
let eltIndex = Array.prototype.indexOf.call(this._rootElt.childNodes, elt);
if (PlacesUtils.nodeIsFolder(elt._placesNode) &&
!PlacesUIUtils.isContentsReadOnly(elt._placesNode)) {
// This is a folder.

View File

@ -279,7 +279,7 @@ PlacesTreeView.prototype = {
return 0;
// Inserting the new elements into the rows array in one shot (by
// Array.concat) is faster than resizing the array (by splice) on each loop
// Array.prototype.concat) is faster than resizing the array (by splice) on each loop
// iteration.
let cc = aContainer.childCount;
let newElements = new Array(cc);

View File

@ -42,7 +42,7 @@
is(children.length, aAvailableTags.length,
"Found expected number of tags in the tags selector");
Array.forEach(children, function (aChild) {
Array.prototype.forEach.call(children, function (aChild) {
let tag = aChild.getAttribute("label");
ok(true, "Found tag '" + tag + "' in the selector");
ok(aAvailableTags.includes(tag), "Found expected tag");

View File

@ -2578,7 +2578,7 @@ TransactionItemCache.prototype = {
return this._annotations || null;
},
set tags(v) {
this._tags = (v && Array.isArray(v) ? Array.slice(v) : null);
this._tags = (v && Array.isArray(v) ? Array.prototype.slice.call(v) : null);
},
get tags() {
return this._tags || null;
@ -2598,7 +2598,7 @@ function BaseTransaction()
BaseTransaction.prototype = {
name: null,
set childTransactions(v) {
this._childTransactions = (Array.isArray(v) ? Array.slice(v) : null);
this._childTransactions = (Array.isArray(v) ? Array.prototype.slice.call(v) : null);
},
get childTransactions() {
return this._childTransactions || null;