Remove var in Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js (#22126)

Summary:
Replaces the keywords var with let or const in Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js

- [x] Check npm run flow
- [x] Check npm run flow-check-ios
- [x] Check npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js] - remove var
Pull Request resolved: https://github.com/facebook/react-native/pull/22126

Differential Revision: D12929758

Pulled By: TheSavior

fbshipit-source-id: bee9dfb463d197458cb218f39274af5a4d16ce1f
This commit is contained in:
nabettu 2018-11-05 16:13:01 -08:00 committed by Facebook Github Bot
parent ac9e09d079
commit 0a39cda39a
1 changed files with 4 additions and 4 deletions

View File

@ -41,8 +41,8 @@ function deepFreezeAndThrowOnMutationInDev<T: Object>(object: T): T {
const keys = Object.keys(object);
const hasOwnProperty = Object.prototype.hasOwnProperty;
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
if (hasOwnProperty.call(object, key)) {
Object.defineProperty(object, key, {
get: identity.bind(null, object[key]),
@ -56,8 +56,8 @@ function deepFreezeAndThrowOnMutationInDev<T: Object>(object: T): T {
Object.freeze(object);
Object.seal(object);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
if (hasOwnProperty.call(object, key)) {
deepFreezeAndThrowOnMutationInDev(object[key]);
}