зеркало из https://github.com/mozilla/pjs.git
"for (i in myArray)" produces unintentional side effects if a test modifies Array.prototype or Object.prototype. Use for (i=0; __; i++) instead.
This commit is contained in:
Родитель
25d8b4b4be
Коммит
38c1d1eb9c
|
@ -40,8 +40,8 @@ function reportFailure (msg)
|
||||||
var funcName = currentFunc();
|
var funcName = currentFunc();
|
||||||
var prefix = (funcName) ? "[reported from " + funcName + "] ": "";
|
var prefix = (funcName) ? "[reported from " + funcName + "] ": "";
|
||||||
|
|
||||||
for (l in lines)
|
for (var i=0; i<lines.length; i++)
|
||||||
print (FAILED + prefix + lines[l]);
|
print (FAILED + prefix + lines[i]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,8 +53,8 @@ function printStatus (msg)
|
||||||
var lines = msg.split ("\n");
|
var lines = msg.split ("\n");
|
||||||
var l;
|
var l;
|
||||||
|
|
||||||
for (l in lines)
|
for (var i=0; i<lines.length; i++)
|
||||||
print (STATUS + lines[l]);
|
print (STATUS + lines[i]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@ function reportFailure (msg)
|
||||||
var funcName = currentFunc();
|
var funcName = currentFunc();
|
||||||
var prefix = (funcName) ? "[reported from " + funcName + "] ": "";
|
var prefix = (funcName) ? "[reported from " + funcName + "] ": "";
|
||||||
|
|
||||||
for (l in lines)
|
for (var i=0; i<lines.length; i++)
|
||||||
print (FAILED + prefix + lines[l]);
|
print (FAILED + prefix + lines[i]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,8 +53,8 @@ function printStatus (msg)
|
||||||
var lines = msg.split ("\n");
|
var lines = msg.split ("\n");
|
||||||
var l;
|
var l;
|
||||||
|
|
||||||
for (l in lines)
|
for (var i=0; i<lines.length; i++)
|
||||||
print (STATUS + lines[l]);
|
print (STATUS + lines[i]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче