phetsims / axon

Axon provides powerful and concise models for interactive simulations, based on observable Properties and related patterns.
MIT License
11 stars 8 forks source link

TinyStaticProperty isSettable === true #351

Closed pixelzoom closed 3 years ago

pixelzoom commented 3 years ago

TinyStaticProperty:

  set( value ) {
    throw new Error( 'Cannot set a TinyStaticProperty value' );
  }
> const p = new phet.axon.TinyStaticProperty( 0, () => {} );
undefined
> p.isSettable()
true
> p.value = 1
TinyStaticProperty.js:51 Uncaught Error: Cannot set a TinyStaticProperty value
    at TinyStaticProperty.set (TinyStaticProperty.js:51)
    at TinyStaticProperty.set value [as value] (TinyProperty.js:83)
    at <anonymous>:1:9

So shouldn't TinyStaticProperty override isSettable to return false?

zepumph commented 3 years ago

Sounds good to me! @jonathanolson to review.

jonathanolson commented 3 years ago

Looks great to me, closing!