2
0
Эх сурвалжийг харах

bind lexical this for this.update (#28357)

ycw 1 жил өмнө
parent
commit
86a4d25640

+ 2 - 4
editor/js/libs/ui.three.js

@@ -549,9 +549,7 @@ class UIPoints extends UISpan {
 		this.lastPointIdx = 0;
 		this.onChangeCallback = null;
 
-		// TODO Remove this bind() stuff
-
-		this.update = function () {
+		this.update = () => { // bind lexical this
 
 			if ( this.onChangeCallback !== null ) {
 
@@ -559,7 +557,7 @@ class UIPoints extends UISpan {
 
 			}
 
-		}.bind( this );
+		};
 
 	}