Skip to content

Commit

Permalink
add required tandem assertion, #192
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph authored and pixelzoom committed Jul 27, 2020
1 parent b8f61d4 commit 42ee096
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/PhetioObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,12 @@ inherit( Object, PhetioObject, {
initializePhetioObject: function( baseOptions, config ) {
assert && assert( config, 'initializePhetioObject must be called with config' );

// The presence of `tandem` indicates if this PhetioObject can be intiialized. If not yet initialized, perhaps
// Make sure that required tandems are supplied
if ( Tandem.VALIDATION && config.tandem && config.tandem.required ) {
assert && assert( config.tandem.supplied, 'required tandems must be supplied' );
}

// The presence of `tandem` indicates if this PhetioObject can be initialized. If not yet initialized, perhaps
// it will be initialized later on, as in Node.mutate().
if ( !( config.tandem && config.tandem.supplied ) ) {
assert && !config.tandem && assert( !specifiesNonTandemPhetioObjectKey( config ), 'only specify metadata when providing a Tandem' );
Expand Down

0 comments on commit 42ee096

Please sign in to comment.