forked from 0ad/0ad
Clean an out-of-scope variable usage. Patch by Stan.
This was SVN commit r18520.
This commit is contained in:
parent
1459fe0f8e
commit
82f1987114
@ -5,13 +5,14 @@
|
||||
*/
|
||||
function clone(o)
|
||||
{
|
||||
let r;
|
||||
if (o instanceof Array)
|
||||
var r = [];
|
||||
r = [];
|
||||
else if (o instanceof Object)
|
||||
var r = {};
|
||||
r = {};
|
||||
else // native data type
|
||||
return o;
|
||||
for (var key in o)
|
||||
for (let key in o)
|
||||
r[key] = clone(o[key]);
|
||||
return r;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user