From 0b2d969b9f15b2775de9ac19afa55f8492877bac Mon Sep 17 00:00:00 2001 From: samreid Date: Tue, 14 Jan 2020 16:00:04 -0700 Subject: [PATCH] Specify isMetallic before super call, see https://github.com/phetsims/circuit-construction-kit-common/issues/531 --- js/model/Resistor.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/model/Resistor.js b/js/model/Resistor.js index eb2f0395..6968d1b2 100644 --- a/js/model/Resistor.js +++ b/js/model/Resistor.js @@ -46,6 +46,10 @@ 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 @@ -53,9 +57,6 @@ define( require => { assert && assert( typeof this.resistorType.isMetallic === 'boolean' ); - // @public (read-only) // TODO: is this correct? Is it necessary? - options.isMetallic = this.resistorType.isMetallic; - // @public {Property.} the resistance in ohms this.resistanceProperty = new NumberProperty( resistorType.defaultResistance, { tandem: tandem.createTandem( 'resistanceProperty' ),