Skip to content

Commit

Permalink
add Range.defaultValue getter that throws error, #78
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Malley <cmalley@pixelzoom.com>
  • Loading branch information
pixelzoom committed Oct 4, 2018
1 parent 7b63a08 commit 7a9fe1d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/Range.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ define( function( require ) {
*/
equals: function( object ) {
return ( object instanceof Range ) && ( this._min === object.min ) && ( this._max === object.max );
},

/**
* In https://github.com/phetsims/dot/issues/57, defaultValue was moved to RangeWithValue.
* This ES5 getter catches programming errors where defaultValue is still used with Range.
*/
get defaultValue() {
throw new Error( 'defaultValue is undefined, did you mean to use RangeWithValue?' );
}
};

Expand Down

0 comments on commit 7a9fe1d

Please sign in to comment.