Skip to content

Commit

Permalink
use isDisposable: false instead of overridden dispose methods, phet…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Jul 10, 2023
1 parent 56be7ed commit dea3b04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
12 changes: 2 additions & 10 deletions js/common/view/ElapsedTimeNumberDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,12 @@ class ElapsedTimeNumberDisplay extends NumberDisplay {
size: CollisionLabConstants.DISPLAY_FONT.size
} )
},
decimalPlaces: CollisionLabConstants.DISPLAY_DECIMAL_PLACES

decimalPlaces: CollisionLabConstants.DISPLAY_DECIMAL_PLACES,
isDisposable: false
}, options );

super( elapsedTimeProperty, options.displayRange, options );
}

/**
* @public
* @override
*/
dispose() {
assert && assert( false, 'ElapsedTimeNumberDisplay is not intended to be disposed' );
}
}

collisionLab.register( 'ElapsedTimeNumberDisplay', ElapsedTimeNumberDisplay );
Expand Down
12 changes: 2 additions & 10 deletions js/common/view/KineticEnergyNumberDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,12 @@ class KineticEnergyNumberDisplay extends PlayAreaNumberDisplay {
textOptions: {
font: CollisionLabConstants.DISPLAY_FONT
},
maxWidth: 300 // constrain width for i18n, determined empirically.

maxWidth: 300, // constrain width for i18n, determined empirically.
isDisposable: false
}, options );

super( totalKineticEnergyProperty, options );
}

/**
* @public
* @override
*/
dispose() {
assert && assert( false, 'KineticEnergyNumberDisplay is not intended to be disposed' );
}
}

collisionLab.register( 'KineticEnergyNumberDisplay', KineticEnergyNumberDisplay );
Expand Down

0 comments on commit dea3b04

Please sign in to comment.