Explorar el Código

Fix for https://github.com/mrdoob/three.js/issues/19293

- Replace calls to Array.prototype.fill and Array.prototype.copyWithin with for loops to set individual values
Christine Morten hace 5 años
padre
commit
ae86013872
Se han modificado 1 ficheros con 11 adiciones y 2 borrados
  1. 11 2
      src/animation/PropertyMixer.js

+ 11 - 2
src/animation/PropertyMixer.js

@@ -231,8 +231,13 @@ Object.assign( PropertyMixer.prototype, {
 	_setAdditiveIdentityNumeric: function () {
 	_setAdditiveIdentityNumeric: function () {
 
 
 		var startIndex = this._addIndex * this.valueSize;
 		var startIndex = this._addIndex * this.valueSize;
+		var endIndex = startIndex + this.valueSize;
 
 
-		this.buffer.fill( 0, startIndex, startIndex + this.valueSize );
+		for ( var i = startIndex; i < endIndex; i ++ ) {
+
+			this.buffer[ i ] = 0;
+
+		}
 
 
 	},
 	},
 
 
@@ -248,7 +253,11 @@ Object.assign( PropertyMixer.prototype, {
 		var startIndex = this._origIndex * this.valueSize;
 		var startIndex = this._origIndex * this.valueSize;
 		var targetIndex = this._addIndex * this.valueSize;
 		var targetIndex = this._addIndex * this.valueSize;
 
 
-		this.buffer.copyWithin( targetIndex, startIndex, this.valueSize );
+		for ( var i = 0; i < this.valueSize; i ++ ) {
+
+			this.buffer[ targetIndex + i ] = this.buffer[ startIndex + i ];
+
+		}
 
 
 	},
 	},