adjust sub-class extend EventDispatcher, not copy EventDispatcher’s prototype
@@ -27,7 +27,9 @@ function AnimationMixer( root ) {
}
-Object.assign( AnimationMixer.prototype, EventDispatcher.prototype, {
+AnimationMixer.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
+
+ constructor: AnimationMixer,
_bindAction: function ( action, prototypeAction ) {
@@ -40,7 +40,9 @@ function BufferGeometry() {
-Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {
+BufferGeometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
+ constructor: BufferGeometry,
isBufferGeometry: true,
@@ -58,7 +58,9 @@ function Geometry() {
-Object.assign( Geometry.prototype, EventDispatcher.prototype, {
+Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
+ constructor: Geometry,
isGeometry: true,
@@ -98,7 +98,9 @@ function Object3D() {
Object3D.DefaultUp = new Vector3( 0, 1, 0 );
Object3D.DefaultMatrixAutoUpdate = true;
-Object.assign( Object3D.prototype, EventDispatcher.prototype, {
+Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
+ constructor: Object3D,
isObject3D: true,
@@ -67,7 +67,9 @@ function Material() {
-Object.assign( Material.prototype, EventDispatcher.prototype, {
+Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
+ constructor: Material,
isMaterial: true,
@@ -39,7 +39,9 @@ function WebGLRenderTarget( width, height, options ) {
-Object.assign( WebGLRenderTarget.prototype, EventDispatcher.prototype, {
+WebGLRenderTarget.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
+ constructor: WebGLRenderTarget,
isWebGLRenderTarget: true,
@@ -74,7 +74,7 @@ Object.defineProperty( Texture.prototype, "needsUpdate", {
} );
-Object.assign( Texture.prototype, EventDispatcher.prototype, {
+Texture.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
constructor: Texture,