Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 /* Any copyright is dedicated to the Public Domain.
2 * http://creativecommons.org/publicdomain/zero/1.0/ */
4 // A for-of loop in Web Console code can loop over a content NodeList.
6 const TEST_URI = "http://example.com/browser/browser/devtools/webconsole/test/test-for-of.html";
8 function test() {
9 addTab(TEST_URI);
10 browser.addEventListener("load", function onLoad() {
11 browser.removeEventListener("load", onLoad, true);
12 openConsole(null, testForOf);
13 }, true);
14 }
16 function testForOf(hud) {
17 var jsterm = hud.jsterm;
18 jsterm.execute("{ [x.tagName for (x of document.body.childNodes) if (x.nodeType === 1)].join(' '); }",
19 (node) => {
20 ok(/H1 DIV H2 P/.test(node.textContent),
21 "for-of loop should find all top-level nodes");
22 finishTest();
23 });
24 }