Skip to content

Commit

Permalink
Call emit from emit1, emit2, emit3, see #211
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 8, 2019
1 parent 441cdcc commit 880b311
Showing 1 changed file with 6 additions and 55 deletions.
61 changes: 6 additions & 55 deletions js/Emitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,23 +238,8 @@ define( require => {
* @deprecated - please use emit()
*/
emit1( arg0 ) {
this.isPhetioInstrumented() && this.phetioStartEvent( 'emitted', {
args: [ this.phetioType.parameterTypes[ 0 ].toStateObject( arg0 ) ]
} );

if ( this.listeners.length > 0 ) {
this.activeListenersStack.push( this.listeners );
const lastEntry = this.activeListenersStack.length - 1;

for ( let i = 0; i < this.activeListenersStack[ lastEntry ].length; i++ ) {
this.activeListenersStack[ lastEntry ][ i ]( arg0 );
}

this.activeListenersStack.pop();
}
this.isPhetioInstrumented() && this.phetioEndEvent();

this.after && this.after( arg0 );
this.validate = null;
this.emit( arg0 );
}

/**
Expand All @@ -265,24 +250,8 @@ define( require => {
* @deprecated - please use emit()
*/
emit2( arg0, arg1 ) {
this.isPhetioInstrumented() && this.phetioStartEvent( 'emitted', {
args: [
this.phetioType.parameterTypes[ 0 ].toStateObject( arg0 ),
this.phetioType.parameterTypes[ 1 ].toStateObject( arg1 )
]
} );

if ( this.listeners.length > 0 ) {
this.activeListenersStack.push( this.listeners );
const lastEntry = this.activeListenersStack.length - 1;

for ( let i = 0; i < this.activeListenersStack[ lastEntry ].length; i++ ) {
this.activeListenersStack[ lastEntry ][ i ]( arg0, arg1 );
}
this.activeListenersStack.pop();
}
this.isPhetioInstrumented() && this.phetioEndEvent();
this.after && this.after( arg0, arg1 );
this.validate = null;
this.emit( arg0, arg1 );
}

/**
Expand All @@ -294,26 +263,8 @@ define( require => {
* @deprecated - please use emit()
*/
emit3( arg0, arg1, arg2 ) {
this.isPhetioInstrumented() && this.phetioStartEvent( 'emitted', {
args: [
this.phetioType.parameterTypes[ 0 ].toStateObject( arg0 ),
this.phetioType.parameterTypes[ 1 ].toStateObject( arg1 ),
this.phetioType.parameterTypes[ 2 ].toStateObject( arg2 )
]
} );

if ( this.listeners.length > 0 ) {
this.activeListenersStack.push( this.listeners );
const lastEntry = this.activeListenersStack.length - 1;

for ( let i = 0; i < this.activeListenersStack[ lastEntry ].length; i++ ) {
this.activeListenersStack[ lastEntry ][ i ]( arg0, arg1, arg2 );
}

this.activeListenersStack.pop();
}
this.isPhetioInstrumented() && this.phetioEndEvent();
this.after && this.after( arg0, arg1, arg2 );
this.validate = null;
this.emit( arg0, arg1, arg2 );
}

/**
Expand Down

0 comments on commit 880b311

Please sign in to comment.