浏览代码

Move onUploadCallback from constructor to prototype scope (#21770)

Kai Salmen 4 年之前
父节点
当前提交
43b59f942c
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      src/core/BufferAttribute.js
  2. 2 2
      src/core/InterleavedBuffer.js

+ 2 - 2
src/core/BufferAttribute.js

@@ -29,10 +29,10 @@ class BufferAttribute {
 
 		this.version = 0;
 
-		this.onUploadCallback = function () {};
-
 	}
 
+	onUploadCallback() {}
+
 	set needsUpdate( value ) {
 
 		if ( value === true ) this.version ++;

+ 2 - 2
src/core/InterleavedBuffer.js

@@ -16,10 +16,10 @@ class InterleavedBuffer {
 
 		this.uuid = MathUtils.generateUUID();
 
-		this.onUploadCallback = function () {};
-
 	}
 
+	onUploadCallback() {}
+
 	set needsUpdate( value ) {
 
 		if ( value === true ) this.version ++;