Skip to content

Commit

Permalink
tandemNameSuffix, phetsims/tandem#310
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Feb 28, 2024
1 parent c180ffc commit 95be825
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions js/ReadOnlyProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ export default class ReadOnlyProperty<T> extends PhetioObject implements TReadOn
protected hasDeferredValue: boolean;

protected readonly valueValidator: Validator<T>;
public static readonly TANDEM_NAME_SUFFIX: string = 'Property';

/**
* This is protected to indicate to clients that subclasses should be used instead.
Expand All @@ -135,6 +134,7 @@ export default class ReadOnlyProperty<T> extends PhetioObject implements TReadOn
hasListenerOrderDependencies: false,

// phet-io
tandemNameSuffix: [ 'Property', DYNAMIC_ARCHETYPE_NAME ], // DYNAMIC_ARCHETYPE_NAME means that this Property is an archetype.
phetioOuterType: ReadOnlyProperty.PropertyIO,
phetioValueType: IOType.ObjectIO
}, providedOptions );
Expand Down Expand Up @@ -180,12 +180,6 @@ export default class ReadOnlyProperty<T> extends PhetioObject implements TReadOn
'PhET-iO Properties must specify a phetioValueType: ' + this.phetioID );
}

assert && assert( !this.isPhetioInstrumented() ||
options.tandem.name.endsWith( ReadOnlyProperty.TANDEM_NAME_SUFFIX ) ||
options.tandem.name === 'property' ||
options.tandem.name === DYNAMIC_ARCHETYPE_NAME, // It is ok to have dynamic element Properties (which would mean they are archetypes
`Property tandem.name must end with Property: ${options.tandem?.phetioID}` );

this.validValues = options.validValues;

this.tinyProperty = new TinyProperty( value, null, options.hasListenerOrderDependencies );
Expand Down

0 comments on commit 95be825

Please sign in to comment.