Skip to content

Commit

Permalink
Use Number.isInteger instead of DOT/Utils.isInteger, see phetsims/dot…
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jan 6, 2021
1 parent 97f2ec9 commit d074ec0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions js/view/describers/MassDescriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* @author Michael Barlow (PhET Interactive Simulations)
*/

import Utils from '../../../../dot/js/Utils.js';
import inverseSquareLawCommonStrings from '../../../../inverse-square-law-common/js/inverseSquareLawCommonStrings.js';
import ISLCDescriber from '../../../../inverse-square-law-common/js/view/describers/ISLCDescriber.js';
import ISLCObjectEnum from '../../../../inverse-square-law-common/js/view/ISLCObjectEnum.js';
Expand Down Expand Up @@ -236,7 +235,7 @@ class MassDescriber extends ISLCDescriber {
*/
getMassSize( massValue ) {
const massIndex = getMassSizeIndex( massValue, SIZE_STRINGS.length );
assert && assert( Utils.isInteger( massIndex ) && massIndex < SIZE_STRINGS.length, 'wrong index for size strings' );
assert && assert( Number.isInteger( massIndex ) && massIndex < SIZE_STRINGS.length, 'wrong index for size strings' );
return SIZE_STRINGS[ massIndex ];
}

Expand Down Expand Up @@ -313,7 +312,7 @@ class MassDescriber extends ISLCDescriber {

let directionPhrase = isGrowing ? massGetsBiggerString : massGetsSmallerString;

// specific density related verbage
// specific density related verbage
if ( this.constantRadiusProperty.get() ) {
directionPhrase = isGrowing ? densityIncreasesString : densityDecreasesString;
}
Expand Down Expand Up @@ -370,7 +369,7 @@ class MassDescriber extends ISLCDescriber {
*/
const getRelativeSizeFromIndex = ( index, capitalized ) => {
const array = capitalized ? RELATIVE_SIZE_CAPITALIZED_STRINGS : RELATIVE_SIZE_STRINGS;
assert && assert( Utils.isInteger( index ) && index < array.length );
assert && assert( Number.isInteger( index ) && index < array.length );
return array[ index ];
};

Expand All @@ -381,7 +380,7 @@ const getRelativeSizeFromIndex = ( index, capitalized ) => {
*/
const getRelativeDensityFromIndex = ( index, capitalized ) => {
const array = capitalized ? RELATIVE_DENSITY_CAPITALIZED_STRINGS : RELATIVE_DENSITY_STRINGS;
assert && assert( Utils.isInteger( index ) && index < array.length );
assert && assert( Number.isInteger( index ) && index < array.length );
return array[ index ];
};

Expand Down

0 comments on commit d074ec0

Please sign in to comment.