Skip to content

Commit

Permalink
Use validate instead of assertInstanceOf, see phetsims/axon#226
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Feb 26, 2019
1 parent 673be4d commit e5f6412
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/molarity/model/SoluteIO.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ define( function( require ) {
var molarity = require( 'MOLARITY/molarity' );
var ObjectIO = require( 'TANDEM/types/ObjectIO' );
var phetioInherit = require( 'TANDEM/phetioInherit' );
var validate = require( 'AXON/validate' );

// ifphetio
var assertInstanceOf = require( 'ifphetio!PHET_IO/assertInstanceOf' );
var phetioEngine = require( 'ifphetio!PHET_IO/phetioEngine' );

/**
Expand All @@ -24,18 +24,18 @@ define( function( require ) {
* @constructor
*/
function SoluteIO( solute, phetioID ) {
assert && assertInstanceOf( solute, phet.molarity.Solute );
ObjectIO.call( this, solute, phetioID );
}

phetioInherit( ObjectIO, 'SoluteIO', SoluteIO, {}, {
documentation: 'The solute for the sim',
validator: { isValidValue: v => v instanceof phet.molarity.Solute },

/**
* @param {Solute} solute
*/
toStateObject: function( solute ) {
assert && assertInstanceOf( solute, phet.molarity.Solute );
validate( solute, this.validator );
return solute.tandem.phetioID;
},

Expand Down

0 comments on commit e5f6412

Please sign in to comment.