зеркало из https://github.com/mozilla/gecko-dev.git
Checking in for jesse. Replacing some eval() calls in chrome js with calls to parseInt() and new RegExp(). b=83314, r=mstoltz, sr=brendan.
This commit is contained in:
Родитель
96f6859891
Коммит
f2299aa85e
|
@ -551,7 +551,7 @@ nsHelperAppDialog.prototype = {
|
|||
// replaceInsert: Replace given insert with replacement text and return the result.
|
||||
replaceInsert: function( text, insertNo, replacementText ) {
|
||||
var result = text;
|
||||
var regExp = eval( "/#"+insertNo+"/" );
|
||||
var regExp = new RegExp("#"+insertNo);
|
||||
result = result.replace( regExp, replacementText );
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -284,7 +284,7 @@ function initializeTermFromId(id)
|
|||
// id is of the form searchAttr<n>
|
||||
// strlen("searchAttr") == 10
|
||||
// turn searchAttr<n> -> <n>
|
||||
var index = eval(id.slice(10));
|
||||
var index = parseInt(id.slice(10));
|
||||
initializeTermFromIndex(index)
|
||||
}
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ function loadDialog()
|
|||
|
||||
function replaceInsert( text, index, value ) {
|
||||
var result = text;
|
||||
var regExp = eval( "/#"+index+"/" );
|
||||
var regExp = new RegExp( "#"+index );
|
||||
result = result.replace( regExp, value );
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ var progressListener = {
|
|||
// Get current time.
|
||||
var now = ( new Date() ).getTime();
|
||||
// If interval hasn't elapsed, ignore it.
|
||||
if ( now - lastUpdate < interval && aMaxTotalProgress != "-1" && eval(aCurTotalProgress) < eval(aMaxTotalProgress) )
|
||||
if ( now - lastUpdate < interval && aMaxTotalProgress != "-1" && parseInt(aCurTotalProgress) < parseInt(aMaxTotalProgress) )
|
||||
return;
|
||||
|
||||
// Update this time.
|
||||
|
@ -306,7 +306,7 @@ function loadDialog()
|
|||
|
||||
function replaceInsert( text, index, value ) {
|
||||
var result = text;
|
||||
var regExp = eval( "/#"+index+"/" );
|
||||
var regExp = new RegExp( "#"+index );
|
||||
result = result.replace( regExp, value );
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ function getString( stringId ) {
|
|||
|
||||
function replaceInsert( text, index, value ) {
|
||||
var result = text;
|
||||
var regExp = eval( "/#"+index+"/" );
|
||||
var regExp = new RegExp( "#"+index );
|
||||
result = result.replace( regExp, value );
|
||||
return result;
|
||||
}
|
||||
|
@ -194,7 +194,7 @@ function onProgress( bytes, max ) {
|
|||
&&
|
||||
max != "-1"
|
||||
&&
|
||||
eval(bytes) < eval(max) ) {
|
||||
parseInt(bytes) < parseInt(max) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче