浏览代码

bind lexical this for this.update (#28357)

ycw 1 年之前
父节点
当前提交
86a4d25640
共有 1 个文件被更改,包括 2 次插入4 次删除
  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 );
+		};
 
 	}