Use const where possible
Summary: Use const where possible. This does not use const for all variables as that would require too much refactoring for one diff. It does however use const where currently possible as well as does some small refactoring to enable const usage in more locations. Striving for 100% const usage leads to code with is easier to reason about as a reference will always reference the same value. The compiler will also assist if you accidentally override a reference. Reviewed By: IanChilds Differential Revision: D3741999 fbshipit-source-id: 1ba7da5784c3047f2d4c03746890192f724aa65e
This commit is contained in:
committed by
Facebook Github Bot 6
parent
4bcefd8845
commit
ca72b2b796
@@ -89,7 +89,7 @@ function assertTestTree(node, nodeName, parentName) {
|
||||
|
||||
function setupTestTree(node, nodeName, parentName, index) {
|
||||
var lines = [
|
||||
'CSSNodeRef ' + nodeName + ' = CSSNodeNew();',
|
||||
'const CSSNodeRef ' + nodeName + ' = CSSNodeNew();',
|
||||
];
|
||||
|
||||
for (var style in node.style) {
|
||||
|
Reference in New Issue
Block a user