@@ -32,10 +32,10 @@ export default function clone (parent, {
32
32
} = { } ) {
33
33
// maintain two arrays for circular references, where corresponding parents
34
34
// and children have the same index
35
- var allParents = [ ]
36
- var allChildren = [ ]
35
+ let allParents = [ ]
36
+ let allChildren = [ ]
37
37
38
- var useBuffer = typeof Buffer !== 'undefined' && typeof Buffer . isBuffer === 'function'
38
+ let useBuffer = typeof Buffer !== 'undefined' && typeof Buffer . isBuffer === 'function'
39
39
40
40
const isBuffer = typeof window !== 'undefined' ? browserIsBuffer : Buffer . isBuffer
41
41
@@ -46,8 +46,8 @@ export default function clone (parent, {
46
46
47
47
if ( depth === 0 ) { return parent }
48
48
49
- var child
50
- var proto
49
+ let child
50
+ let proto
51
51
if ( typeof parent !== 'object' ) {
52
52
return parent
53
53
}
@@ -95,7 +95,7 @@ export default function clone (parent, {
95
95
}
96
96
97
97
if ( circular ) {
98
- var index = allParents . indexOf ( parent )
98
+ let index = allParents . indexOf ( parent )
99
99
100
100
if ( index !== - 1 ) {
101
101
return allChildren [ index ]
@@ -106,20 +106,20 @@ export default function clone (parent, {
106
106
107
107
if ( _instanceof ( parent , NativeMap ) ) {
108
108
parent . forEach ( function ( value , key ) {
109
- var keyChild = _clone ( key , depth - 1 )
110
- var valueChild = _clone ( value , depth - 1 )
109
+ let keyChild = _clone ( key , depth - 1 )
110
+ let valueChild = _clone ( value , depth - 1 )
111
111
child . set ( keyChild , valueChild )
112
112
} )
113
113
}
114
114
if ( _instanceof ( parent , NativeSet ) ) {
115
115
parent . forEach ( function ( value ) {
116
- var entryChild = _clone ( value , depth - 1 )
116
+ let entryChild = _clone ( value , depth - 1 )
117
117
child . add ( entryChild )
118
118
} )
119
119
}
120
120
121
- for ( var i in parent ) {
122
- var attrs = Object . getOwnPropertyDescriptor ( parent , i )
121
+ for ( let i in parent ) {
122
+ let attrs = Object . getOwnPropertyDescriptor ( parent , i )
123
123
if ( attrs ) {
124
124
if ( attrs . hasOwnProperty ( 'get' ) && attrs . get . name === 'computedGetter' ) {
125
125
Object . defineProperty ( child , i , attrs )
@@ -131,12 +131,12 @@ export default function clone (parent, {
131
131
}
132
132
133
133
if ( Object . getOwnPropertySymbols ) {
134
- var symbols = Object . getOwnPropertySymbols ( parent )
134
+ let symbols = Object . getOwnPropertySymbols ( parent )
135
135
for ( let i = 0 ; i < symbols . length ; i ++ ) {
136
136
// Don't need to worry about cloning a symbol because it is a primitive,
137
137
// like a number or string.
138
- var symbol = symbols [ i ]
139
- var descriptor = Object . getOwnPropertyDescriptor ( parent , symbol )
138
+ let symbol = symbols [ i ]
139
+ let descriptor = Object . getOwnPropertyDescriptor ( parent , symbol )
140
140
if ( descriptor && ! descriptor . enumerable && ! includeNonEnumerable ) {
141
141
continue
142
142
}
@@ -146,7 +146,7 @@ export default function clone (parent, {
146
146
}
147
147
148
148
if ( includeNonEnumerable ) {
149
- var allPropertyNames = Object . getOwnPropertyNames ( parent )
149
+ let allPropertyNames = Object . getOwnPropertyNames ( parent )
150
150
for ( let i = 0 ; i < allPropertyNames . length ; i ++ ) {
151
151
const propertyName = allPropertyNames [ i ]
152
152
let descriptor = Object . getOwnPropertyDescriptor ( parent , propertyName )
@@ -187,7 +187,7 @@ function __isRegExp (o) {
187
187
clone . __isRegExp = __isRegExp
188
188
189
189
function __getRegExpFlags ( re ) {
190
- var flags = ''
190
+ let flags = ''
191
191
if ( re . global ) flags += 'g'
192
192
if ( re . ignoreCase ) flags += 'i'
193
193
if ( re . multiline ) flags += 'm'
0 commit comments