Skip to content

Commit

Permalink
Specify isMetallic before super call, see #531
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Jan 14, 2020
1 parent 79592f6 commit 0b2d969
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/model/Resistor.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@ define( require => {
// validate resistor type
validate( resistorType, { valueType: Resistor.ResistorType } );

// @public (read-only)
assert && assert( !options.hasOwnProperty( 'isMetallic' ), 'isMetallic is given by the resistorType' );
options.isMetallic = resistorType.isMetallic;

super( startVertex, endVertex, options.resistorLength, tandem, options );

// @public (read-only) {Resistor.ResistorType} indicates one of ResistorType values
this.resistorType = resistorType;

assert && assert( typeof this.resistorType.isMetallic === 'boolean' );

// @public (read-only) // TODO: is this correct? Is it necessary?
options.isMetallic = this.resistorType.isMetallic;

// @public {Property.<number>} the resistance in ohms
this.resistanceProperty = new NumberProperty( resistorType.defaultResistance, {
tandem: tandem.createTandem( 'resistanceProperty' ),
Expand Down

0 comments on commit 0b2d969

Please sign in to comment.