Skip to content

Commit

Permalink
remove redundant assert, #222
Browse files Browse the repository at this point in the history
zepumph committed Apr 18, 2019
1 parent 03f3a0c commit db06752
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/Action.js
Original file line number Diff line number Diff line change
@@ -101,23 +101,23 @@ define( require => {
// Iterate through each validator and make sure that it won't validate options on validating value. This is
// mainly done for performance
options.validators.forEach( validator => {
assert && assert(
assert(
validator.validateOptionsOnValidateValue !== true,
'Action sets its own validateOptionsOnValidateValue for each argument type'
);
validator.validateOptionsOnValidateValue = false;

// Changing the validator options after construction indicates a logic error, except that many EmitterIOs
// are shared between instances. Don't assume we "own" the validator if it came from the TypeIO.
assert && !phetioTypeSupplied && Object.freeze( validator );
!phetioTypeSupplied && Object.freeze( validator );

// validate the options passed in to validate each Action argument
assert && ValidatorDef.validateValidator( validator );
ValidatorDef.validateValidator( validator );
} );

// Changing after construction indicates a logic error, except that many EmitterIOs are shared between instances.
// Don't assume we "own" the validator if it came from the TypeIO.
assert && !phetioTypeSupplied && Object.freeze( options.validators );
!phetioTypeSupplied && Object.freeze( options.validators );
}

// @protected - can be supplied by subclasses after super constructor call completes

0 comments on commit db06752

Please sign in to comment.