Explorar o código

bind lexical this for this.update (#28357)

ycw hai 1 ano
pai
achega
86a4d25640
Modificáronse 1 ficheiros con 2 adicións e 4 borrados
  1. 2 4
      editor/js/libs/ui.three.js

+ 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 );
+		};
 
 	}