@@ -14,7 +14,7 @@ function History( editor ) {
1414
1515 // signals
1616
17- var scope = this ;
17+ const scope = this ;
1818
1919 this . editor . signals . startPlayer . add ( function ( ) {
2020
@@ -34,10 +34,10 @@ History.prototype = {
3434
3535 execute : function ( cmd , optionalName ) {
3636
37- var lastCmd = this . undos [ this . undos . length - 1 ] ;
38- var timeDifference = new Date ( ) . getTime ( ) - this . lastCmdTime . getTime ( ) ;
37+ const lastCmd = this . undos [ this . undos . length - 1 ] ;
38+ const timeDifference = new Date ( ) . getTime ( ) - this . lastCmdTime . getTime ( ) ;
3939
40- var isUpdatableCmd = lastCmd &&
40+ const isUpdatableCmd = lastCmd &&
4141 lastCmd . updatable &&
4242 cmd . updatable &&
4343 lastCmd . object === cmd . object &&
@@ -94,7 +94,7 @@ History.prototype = {
9494
9595 }
9696
97- var cmd = undefined ;
97+ let cmd = undefined ;
9898
9999 if ( this . undos . length > 0 ) {
100100
@@ -129,7 +129,7 @@ History.prototype = {
129129
130130 }
131131
132- var cmd = undefined ;
132+ let cmd = undefined ;
133133
134134 if ( this . redos . length > 0 ) {
135135
@@ -157,7 +157,7 @@ History.prototype = {
157157
158158 toJSON : function ( ) {
159159
160- var history = { } ;
160+ const history = { } ;
161161 history . undos = [ ] ;
162162 history . redos = [ ] ;
163163
@@ -169,7 +169,7 @@ History.prototype = {
169169
170170 // Append Undos to History
171171
172- for ( var i = 0 ; i < this . undos . length ; i ++ ) {
172+ for ( let i = 0 ; i < this . undos . length ; i ++ ) {
173173
174174 if ( this . undos [ i ] . hasOwnProperty ( 'json' ) ) {
175175
@@ -181,7 +181,7 @@ History.prototype = {
181181
182182 // Append Redos to History
183183
184- for ( var i = 0 ; i < this . redos . length ; i ++ ) {
184+ for ( let i = 0 ; i < this . redos . length ; i ++ ) {
185185
186186 if ( this . redos [ i ] . hasOwnProperty ( 'json' ) ) {
187187
@@ -199,10 +199,10 @@ History.prototype = {
199199
200200 if ( json === undefined ) return ;
201201
202- for ( var i = 0 ; i < json . undos . length ; i ++ ) {
202+ for ( let i = 0 ; i < json . undos . length ; i ++ ) {
203203
204- var cmdJSON = json . undos [ i ] ;
205- var cmd = new Commands [ cmdJSON . type ] ( this . editor ) ; // creates a new object of type "json.type"
204+ const cmdJSON = json . undos [ i ] ;
205+ const cmd = new Commands [ cmdJSON . type ] ( this . editor ) ; // creates a new object of type "json.type"
206206 cmd . json = cmdJSON ;
207207 cmd . id = cmdJSON . id ;
208208 cmd . name = cmdJSON . name ;
@@ -211,10 +211,10 @@ History.prototype = {
211211
212212 }
213213
214- for ( var i = 0 ; i < json . redos . length ; i ++ ) {
214+ for ( let i = 0 ; i < json . redos . length ; i ++ ) {
215215
216- var cmdJSON = json . redos [ i ] ;
217- var cmd = new Commands [ cmdJSON . type ] ( this . editor ) ; // creates a new object of type "json.type"
216+ const cmdJSON = json . redos [ i ] ;
217+ const cmd = new Commands [ cmdJSON . type ] ( this . editor ) ; // creates a new object of type "json.type"
218218 cmd . json = cmdJSON ;
219219 cmd . id = cmdJSON . id ;
220220 cmd . name = cmdJSON . name ;
@@ -250,7 +250,7 @@ History.prototype = {
250250 this . editor . signals . sceneGraphChanged . active = false ;
251251 this . editor . signals . historyChanged . active = false ;
252252
253- var cmd = this . undos . length > 0 ? this . undos [ this . undos . length - 1 ] : undefined ; // next cmd to pop
253+ let cmd = this . undos . length > 0 ? this . undos [ this . undos . length - 1 ] : undefined ; // next cmd to pop
254254
255255 if ( cmd === undefined || id > cmd . id ) {
256256
@@ -297,7 +297,7 @@ History.prototype = {
297297 this . editor . signals . sceneGraphChanged . active = false ;
298298 this . editor . signals . historyChanged . active = false ;
299299
300- var cmd = this . redo ( ) ;
300+ let cmd = this . redo ( ) ;
301301 while ( cmd !== undefined ) {
302302
303303 if ( ! cmd . hasOwnProperty ( 'json' ) ) {
0 commit comments