Browse Source

Merge pull request #19978 from ianpurvis/uniform-es6-class

Uniform: convert to es6 class
Mr.doob 5 years ago
parent
commit
1bcfbfd883
1 changed files with 14 additions and 10 deletions
  1. 14 10
      src/core/Uniform.js

+ 14 - 10
src/core/Uniform.js

@@ -1,20 +1,24 @@
-function Uniform( value ) {
+class Uniform {
 
-	if ( typeof value === 'string' ) {
+	constructor( value ) {
 
-		console.warn( 'THREE.Uniform: Type parameter is no longer needed.' );
-		value = arguments[ 1 ];
+		if ( typeof value === 'string' ) {
 
-	}
+			console.warn( 'THREE.Uniform: Type parameter is no longer needed.' );
+			value = arguments[ 1 ];
 
-	this.value = value;
+		}
 
-}
+		this.value = value;
+
+	}
 
-Uniform.prototype.clone = function () {
+	clone() {
 
-	return new Uniform( this.value.clone === undefined ? this.value : this.value.clone() );
+		return new Uniform( this.value.clone === undefined ? this.value : this.value.clone() );
 
-};
+	}
+
+}
 
 export { Uniform };