Skip to content

Commit

Permalink
Converted isNaN to isFinite, see #317
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Aug 23, 2017
1 parent 6d8cafc commit 4492b82
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions js/model/Charge.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ define( function( require ) {
* @public
*/
setLocation: function( circuitElement, distance ) {
//REVIEW: Are infinite distances allowed? isFinite() may be preferred over isNaN (but it's mostly a preference)
assert && assert( !isNaN( distance ), 'Distance was NaN' );
assert && assert( !isFinite( distance ), 'Distance was not finite' ); // also guards against NaN
assert && assert( circuitElement.containsScalarLocation( distance ), 'no location in branch' );
this.circuitElement = circuitElement;
this.distanceProperty.set( distance );
Expand Down

0 comments on commit 4492b82

Please sign in to comment.