Migrate core/field_image.js to ES6 const/let

This commit is contained in:
kozbial
2021-07-21 15:23:23 -07:00
committed by Monica Kozbial
parent 569a86901e
commit 60c03cef4f

View File

@@ -44,8 +44,8 @@ Blockly.FieldImage = function(src, width, height,
throw Error('Src value of an image field is required');
}
src = Blockly.utils.replaceMessageReferences(src);
var imageHeight = Number(Blockly.utils.replaceMessageReferences(height));
var imageWidth = Number(Blockly.utils.replaceMessageReferences(width));
const imageHeight = Number(Blockly.utils.replaceMessageReferences(height));
const imageWidth = Number(Blockly.utils.replaceMessageReferences(width));
if (isNaN(imageHeight) || isNaN(imageWidth)) {
throw Error('Height and width values of an image field must cast to' +
' numbers.');