Skip to content

Commit

Permalink
Add readonly to public static attributes, see #325
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed May 7, 2024
1 parent b23edcd commit 853f829
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion js/common-vsm/model/LauncherMechanism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class LauncherMechanism extends PhetioObject {
* at startup and exist for the lifetime of the simulation, it implements 'Reference type serialization', as described in the
* Serialization section of https://github.com/phetsims/phet-io/blob/main/doc/phet-io-instrumentation-technical-guide.md#serialization
*/
public static LauncherMechanismIO = new IOType<LauncherMechanism>( 'LauncherMechanismIO', {
public static readonly LauncherMechanismIO = new IOType<LauncherMechanism>( 'LauncherMechanismIO', {
valueType: LauncherMechanism,
documentation: 'Mechanism used to launch the projectile',
supertype: ReferenceIO( IOType.ObjectIO )
Expand Down
2 changes: 1 addition & 1 deletion js/common/model/Field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export default abstract class Field extends PhetioObject {
* In this simulation, the data and statistical measures are computed solely based on the landedProjectiles, so the
* serialization separates the projectiles into the airborne vs landed projectiles.
*/
public static FieldIO = new IOType<Field>( 'FieldIO', {
public static readonly FieldIO = new IOType<Field>( 'FieldIO', {
valueType: Field,
documentation: 'A field in the Projectile Data Lab. This contains the state for the projectiles, separated into airborne and landed projectiles.',
defaultDeserializationMethod: 'applyState',
Expand Down
2 changes: 1 addition & 1 deletion js/common/model/Projectile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default class Projectile {
* calls ProjectileIO.toStateObject to serialize the Projectile instances using value-based serialization (and vice-
* versa for fromStateObject).
*/
public static ProjectileIO = new IOType<Projectile, ProjectileStateObject>( 'ProjectileIO', {
public static readonly ProjectileIO = new IOType<Projectile, ProjectileStateObject>( 'ProjectileIO', {
valueType: Projectile,
stateSchema: {
screenIdentifier: StringUnionIO( ScreenIdentifierValues ),
Expand Down
2 changes: 1 addition & 1 deletion js/common/model/ProjectileType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class ProjectileType extends PhetioObject {
* at startup and exist for the lifetime of the simulation, it implements 'Reference type serialization', as described in the
* Serialization section of https://github.com/phetsims/phet-io/blob/main/doc/phet-io-instrumentation-technical-guide.md#serialization
*/
public static ProjectileTypeIO = new IOType<ProjectileType>( 'ProjectileTypeIO', {
public static readonly ProjectileTypeIO = new IOType<ProjectileType>( 'ProjectileTypeIO', {
valueType: ProjectileType,
documentation: 'The type of object being launched.',
supertype: ReferenceIO( IOType.ObjectIO )
Expand Down

0 comments on commit 853f829

Please sign in to comment.