Bug 730484 - [New Tab Page] don't iterate NodeList properties when creating cells; r=dietrich
authorTim Taubert <tim.taubert@gmx.de>
Sat, 25 Feb 2012 01:08:44 +0100
changeset 87718 c928dc7c9dff8ff573089a18ebd6c582bae789ff
parent 87717 911c4d5ae460b4f0a0f64ccba133a6e65c547991
child 87719 27322e24bd01e02cb9c1f83692b4219db7ad881d
push id22143
push userphilringnalda@gmail.com
push dateSun, 26 Feb 2012 23:12:35 +0000
treeherdermozilla-central@b98fc24ac54b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdietrich
bugs730484
milestone13.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 730484 - [New Tab Page] don't iterate NodeList properties when creating cells; r=dietrich
browser/base/content/newtab/grid.js
--- a/browser/base/content/newtab/grid.js
+++ b/browser/base/content/newtab/grid.js
@@ -18,18 +18,20 @@ let gGrid = {
    * The cached DOM fragment for sites.
    */
   _siteFragment: null,
 
   /**
    * All cells contained in the grid.
    */
   get cells() {
+    let cells = [];
     let children = this.node.querySelectorAll("li");
-    let cells = [new Cell(this, child) for each (child in children)];
+    for (let i = 0; i < children.length; i++)
+      cells.push(new Cell(this, children[i]));
 
     // Replace the getter with our cached value.
     Object.defineProperty(this, "cells", {value: cells, enumerable: true});
 
     return cells;
   },
 
   /**