|
@@ -4,18 +4,39 @@
|
|
|
|
|
|
THREE.EventDispatcher = function () {};
|
|
|
|
|
|
-THREE.EventDispatcher.prototype = {
|
|
|
+//
|
|
|
+// [Deprecation]
|
|
|
+//
|
|
|
+
|
|
|
+THREE.EventDispatcher.prototype = Object.assign( Object.create( {
|
|
|
|
|
|
constructor: THREE.EventDispatcher,
|
|
|
|
|
|
apply: function ( object ) {
|
|
|
|
|
|
+ console.warn( "THREE.EventDispatcher: .apply is deprecated, " +
|
|
|
+ "just inherit or Object.assign the prototype to mix-in." );
|
|
|
+
|
|
|
object.addEventListener = THREE.EventDispatcher.prototype.addEventListener;
|
|
|
object.hasEventListener = THREE.EventDispatcher.prototype.hasEventListener;
|
|
|
object.removeEventListener = THREE.EventDispatcher.prototype.removeEventListener;
|
|
|
object.dispatchEvent = THREE.EventDispatcher.prototype.dispatchEvent;
|
|
|
|
|
|
- },
|
|
|
+ }
|
|
|
+
|
|
|
+ // Notes:
|
|
|
+ // - The prototype chain ensures that Object.assign will not copy the
|
|
|
+ // properties within this block.
|
|
|
+ // - When .constructor is not explicitly set, it is not copied either,
|
|
|
+ // so use the disabled code below so doesn't need to be clobbered.
|
|
|
+
|
|
|
+} ), {
|
|
|
+
|
|
|
+//
|
|
|
+// [/Deprecation]
|
|
|
+//
|
|
|
+
|
|
|
+//Object.assign( THREE.EventDispatcher.prototype, {
|
|
|
|
|
|
addEventListener: function ( type, listener ) {
|
|
|
|
|
@@ -104,4 +125,4 @@ THREE.EventDispatcher.prototype = {
|
|
|
|
|
|
}
|
|
|
|
|
|
-};
|
|
|
+} );
|