phetsims / proportion-playground

"Proportion Playground" is an educational simulation in HTML5, by PhET Interactive Simulations at the University of Colorado Boulder.
GNU General Public License v3.0
2 stars 4 forks source link

use config with required params #104

Closed zepumph closed 5 years ago

zepumph commented 5 years ago

The phet-io team stumbled across usages of required params in optional options objects. We didn't know how to proceed. Over to you to remark required params as optional, or to fix usages. We also thought that assertions should be used for any required config keys to make sure they were provided.

issues seen in SceneNode and BilliardsTableControl.

Like:


    assert && assert( config.sceneIcon );
    assert && assert( config.leftControl );
    assert && assert( config.rightControl );
    assert && assert( config.leftSwitchControl );
    assert && assert( config.rightSwitchControl );
jonathanolson commented 5 years ago

Fixed up in this case. I think the general decision was to only update options to config where required when we run across them, instead of examining all cases. Is that correct?

zepumph commented 5 years ago

Yeah that sounds appropriate. I wasn't aware that there were older usages of requred params in options. That makes more sense.