Browse Source

Fix Material accessors

Tristan VALCKE 8 years ago
parent
commit
d4ee29216c
1 changed files with 12 additions and 9 deletions
  1. 12 9
      src/materials/Material.js

+ 12 - 9
src/materials/Material.js

@@ -63,24 +63,27 @@ function Material() {
 
 
 }
 }
 
 
-Object.assign( Material.prototype, EventDispatcher.prototype, {
-
-	constructor: Material,
-
-	isMaterial: true,
+Object.defineProperty( Material.prototype, "needsUpdate", {
 
 
-	get needsUpdate() {
+	get: function() {
 
 
 		return this._needsUpdate;
 		return this._needsUpdate;
 
 
 	},
 	},
-
-	set needsUpdate( value ) {
+	set: function(value) {
 
 
 		if ( value === true ) this.update();
 		if ( value === true ) this.update();
 		this._needsUpdate = value;
 		this._needsUpdate = value;
 
 
-	},
+	}
+
+});
+
+Object.assign( Material.prototype, EventDispatcher.prototype, {
+
+	constructor: Material,
+
+	isMaterial: true,
 
 
 	setValues: function ( values ) {
 	setValues: function ( values ) {