Skip to content

Commit

Permalink
Bug 1396967 - Fix undeclared assignments in MozMill. r=tcsc
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: 7C5zFAHmRQQ

--HG--
extra : rebase_source : f6b0d5e1cac37ec1031176f291a13953f5af4e83
  • Loading branch information
Kit Cambridge committed Sep 5, 2017
1 parent 18a2475 commit 3136ed3
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ waitForEvents.prototype = {
for (var e in this.registry) {
assert.waitFor(function () {
return this.node.firedEvents[e] == true;
}, "waitForEvents.wait(): Event '" + ex + "' has been fired.", timeout, interval);
}, "waitForEvents.wait(): Event '" + e + "' has been fired.", timeout, interval);

this.node.removeEventListener(e, this.registry[e], true);
}
Expand Down Expand Up @@ -793,7 +793,7 @@ MozMillController.prototype.assertImageLoaded = function (el) {
// Workaround for Safari -- it only supports the
// complete attrib on script-created images
if (typeof comp == 'undefined') {
test = new Image();
let test = new Image();
// If the original image was successfully loaded,
// src for new one should be pulled from cache
test.src = img.src;
Expand Down Expand Up @@ -982,9 +982,9 @@ function browserAdditions (controller) {
timed_out = true;
}
finally {
state = 'URI=' + win.document.location.href +
let state = 'URI=' + win.document.location.href +
', readyState=' + win.document.readyState;
message = "controller.waitForPageLoad(" + state + ")";
let message = "controller.waitForPageLoad(" + state + ")";

if (timed_out) {
throw new errors.AssertionError(message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ var _byAttrib = function (parent, attributes) {

for (var i in nodes) {
var n = nodes[i];
requirementPass = 0;
requirementLength = 0;
let requirementPass = 0;
let requirementLength = 0;

for (var a in attributes) {
requirementLength++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ function getAddrbkController () {
}

function firePythonCallback (filename, method, args, kwargs) {
obj = {'filename': filename, 'method': method};
let obj = {'filename': filename, 'method': method};
obj['args'] = args || [];
obj['kwargs'] = kwargs || {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Assert.prototype = {
}
a = pSlice.call(a);
b = pSlice.call(b);
return _deepEqual(a, b);
return this._deepEqual(a, b);
}
try {
var ka = Object.keys(a),
Expand Down Expand Up @@ -396,7 +396,8 @@ Assert.prototype = {
// XXX Bug 634948
// Regex objects are transformed to strings when evaluated in a sandbox
// For now lets re-create the regex from its string representation
let pattern = flags = "";
let pattern = "";
let flags = "";
try {
let matches = aRegex.toString().match(/\/(.*)\/(.*)/);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ events.fail = function (obj) {
events.currentTest.__fails__.push(obj);
}

for (var time of timers) {
for (var timer of timers) {
timer.actions.push(
{"currentTest": events.currentModule.__file__ + "::" + events.currentTest.__name__,
"obj": obj,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function getEntity(aDTDs, aEntityId) {

// Build a string of external entities
var references = "";
for (i = 0; i < aDTDs.length; i++) {
for (let i = 0; i < aDTDs.length; i++) {
var id = 'dtd' + i;
references += '<!ENTITY % ' + id + ' SYSTEM "' + aDTDs[i] + '">%' + id + ';';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var EXPORTED_SYMBOLS = ['getLength', ];//'compare'];

var getLength = function (obj) {
var len = 0;
for (i in obj) {
for (let i in obj) {
len++;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
// and use it here. Until that's in the platform, though,
// we'll play it safe and parentify the filename unless
// we're absolutely certain things will be ok if we don't.
var filenameURI = ios.newURI(options.filename,
var filenameURI = ios.newURI(filename,
null,
baseURI);
if (filenameURI.scheme == 'chrome' &&
Expand Down

0 comments on commit 3136ed3

Please sign in to comment.