Bug 1217072 - Remove for-each from addon-sdk/. r=mossop

This commit is contained in:
Tooru Fujisawa 2015-10-18 23:32:06 +09:00
parent 9d6972cbad
commit 9bef79efc8
4 changed files with 7 additions and 7 deletions

View File

@ -290,7 +290,7 @@ exports["test PWPB Single DOM Selection"] = function(assert, done) {
"selection.html with single DOM Selection works.");
let selectionCount = 0;
for each (let sel in selection) {
for (let sel of selection) {
selectionCount++;
assert.equal(sel.text, "foo",
@ -326,7 +326,7 @@ exports["test PWPB Textarea Selection"] = function(assert, done) {
"selection.html with Textarea Selection works.");
let selectionCount = 0;
for each (let sel in selection) {
for (let sel of selection) {
selectionCount++;
assert.equal(sel.text, "noodles",
@ -365,7 +365,7 @@ exports["test PWPB Set HTML in Multiple DOM Selection"] = function(assert, done)
"selection.html with DOM Selection works.");
let selectionCount = 0;
for each (let sel in selection) {
for (let sel of selection) {
assert.equal(sel.text, expectedText[selectionCount],
"iterable selection.text with multiple DOM Selection works.");
@ -403,7 +403,7 @@ exports["test PWPB Set Text in Textarea Selection"] = function(assert, done) {
"selection.html with Textarea Selection works.");
let selectionCount = 0;
for each (let sel in selection) {
for (let sel of selection) {
selectionCount++;
assert.equal(sel.text, text,

View File

@ -212,7 +212,7 @@ exports.testWindowIteratorPrivateDefault = function(assert, done) {
// there should only be one window open here, if not give us the
// the urls
if (browserWindows.length > 1) {
for each (let tab in tabs) {
for (let tab of tabs) {
assert.fail("TAB URL: " + tab.url);
}
}

View File

@ -35,7 +35,7 @@ function testPageMod(assert, done, testURL, pageModOptions,
testCallback, timeout) {
let loader = createLoader();
let { PageMod } = loader.require("sdk/page-mod");
let pageMods = [new PageMod(opts) for each (opts in pageModOptions)];
let pageMods = pageModOptions.map(opts => new PageMod(opts));
let newTab = openNewTab(testURL);
let b = getBrowserForTab(newTab);

View File

@ -15,7 +15,7 @@ const { defer } = require("sdk/lang/functional");
function tabExistenceInTabs(assert, found, tab, tabs) {
let tabFound = false;
for each (let t in tabs) {
for (let t of tabs) {
assert.notEqual(t.title, undefined, 'tab title is not undefined');
assert.notEqual(t.url, undefined, 'tab url is not undefined');
assert.notEqual(t.index, undefined, 'tab index is not undefined');