From 368518eff13c1f606db6c995763263a885af20f8 Mon Sep 17 00:00:00 2001 From: ggtmtmgg Date: Sun, 4 Nov 2018 10:57:21 -0800 Subject: [PATCH] Remove var in Libraries/Utilities/MatrixMath.js (#22111) Summary: Replaces the keywords var with let in Libraries/Utilities/MatrixMath.js - [x] Check npm run flow - [x] Check npm run flow-check-ios - [x] Check npm run flow-check-android [GENERAL] [ENHANCEMENT] [Libraries/Utilities/MatrixMath.js] - remove `var` Pull Request resolved: https://github.com/facebook/react-native/pull/22111 Differential Revision: D12919285 Pulled By: TheSavior fbshipit-source-id: dca65d2da311b5c50ab6ce7338af1cc941fb7a33 --- Libraries/Utilities/MatrixMath.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Libraries/Utilities/MatrixMath.js b/Libraries/Utilities/MatrixMath.js index 453bcf739..e5b75fb2d 100755 --- a/Libraries/Utilities/MatrixMath.js +++ b/Libraries/Utilities/MatrixMath.js @@ -577,7 +577,7 @@ const MatrixMath = { ); // output values - var perspective = []; + let perspective = []; const quaternion = []; const scale = []; const skew = []; @@ -590,7 +590,7 @@ const MatrixMath = { } const matrix = []; const perspectiveMatrix = []; - for (var i = 0; i < 4; i++) { + for (let i = 0; i < 4; i++) { matrix.push([]); for (let j = 0; j < 4; j++) { const value = transformMatrix[i * 4 + j] / transformMatrix[15]; @@ -622,7 +622,7 @@ const MatrixMath = { const transposedInversePerspectiveMatrix = MatrixMath.transpose( inversePerspectiveMatrix, ); - var perspective = MatrixMath.multiplyVectorByMatrix( + perspective = MatrixMath.multiplyVectorByMatrix( rightHandSide, transposedInversePerspectiveMatrix, ); @@ -633,14 +633,14 @@ const MatrixMath = { } // translation is simple - for (var i = 0; i < 3; i++) { + for (let i = 0; i < 3; i++) { translation[i] = matrix[3][i]; } // Now get scale and shear. // 'row' is a 3 element array of 3 component vectors const row = []; - for (i = 0; i < 3; i++) { + for (let i = 0; i < 3; i++) { row[i] = [matrix[i][0], matrix[i][1], matrix[i][2]]; } @@ -678,7 +678,7 @@ const MatrixMath = { // is -1, then negate the matrix and the scaling factors. const pdum3 = MatrixMath.v3Cross(row[1], row[2]); if (MatrixMath.v3Dot(row[0], pdum3) < 0) { - for (i = 0; i < 3; i++) { + for (let i = 0; i < 3; i++) { scale[i] *= -1; row[i][0] *= -1; row[i][1] *= -1;