Joist is the main framework for PhET Interactive Simulations. Joist creates and displays the simulation content, home screen, navigation bar, About dialog, enables switching between tabs, and other framework-related features.
MIT License
8
stars
6
forks
source link
JoistButton calls `super` followed immediately by `mutate`? #824
super();
// We want to mutate eagerly, but must do so after initializing Voicing properties
this.mutate( options );
Is it really necessary to call super without options, immediately followed by mutate?
If so... It should be documented, because it's really confusing, and really odd. (No, I don't understand the existing comment, and it's not sufficient.) And I would definitely reconsider whatever design decision caused this to be necessary.
This is vestigial, and the hackary is no longer needed since updating our mixins to Typescript. The options can be passed directly to super. Let me know if you see any other cases like this!
In JoistButton.ts:
Is it really necessary to call
super
without options, immediately followed bymutate
?If so... It should be documented, because it's really confusing, and really odd. (No, I don't understand the existing comment, and it's not sufficient.) And I would definitely reconsider whatever design decision caused this to be necessary.