phetsims / rutherford-scattering

"Rutherford Scattering" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 3 forks source link

CT: ModelViewTransform2.createRectangleInvertedYMapping is not a constructor #165

Closed pixelzoom closed 4 years ago

pixelzoom commented 4 years ago
rutherford-scattering : accessibility-fuzz : require.js : load
Query: brand=phet&ea&fuzz&a11y&memoryLimit=1000
Uncaught TypeError: ModelViewTransform2.createRectangleInvertedYMapping is not a constructor
TypeError: ModelViewTransform2.createRectangleInvertedYMapping is not a constructor
    at RutherfordAtomScreenView.RSBaseScreenView [as constructor] (https://bayes.colorado.edu/continuous-testing/snapshot-1575155813248/rutherford-scattering/js/common/view/RSBaseScreenView.js?bust=1575158927184:130:32)
    at new RutherfordAtomScreenView (https://bayes.colorado.edu/continuous-testing/snapshot-1575155813248/rutherford-scattering/js/rutherfordatom/view/RutherfordAtomScreenView.js?bust=1575158927184:59:22)
    at RutherfordAtomScreen.createView (https://bayes.colorado.edu/continuous-testing/snapshot-1575155813248/rutherford-scattering/js/rutherfordatom/RutherfordAtomScreen.js?bust=1575158927184:45:34)
    at RutherfordAtomScreen.initializeView (https://bayes.colorado.edu/continuous-testing/snapshot-1575155813248/joist/js/Screen.js?bust=1575158927184:261:25)
    at Array.<anonymous> (https://bayes.colorado.edu/continuous-testing/snapshot-1575155813248/joist/js/Sim.js?bust=1575158927184:840:18)
    at https://bayes.colorado.edu/continuous-testing/snapshot-1575155813248/joist/js/Sim.js?bust=1575158927184:848:27
id: Bayes Chrome
Approximately 11/30/2019, 4:16:53 PM


This has been a problem in RSBaseScreenView since the 2nd commit on 3/8/16. No idea how this was every working, or why it wasn't flagged as a problem before. Here's the culprit code. createRectangleInvertedYMapping is a static method, not a constructor, so new is just plain wrong.

    const modelViewTransform = new ModelViewTransform2.createRectangleInvertedYMapping( model.bounds, spaceNodeBounds );
samreid commented 4 years ago

Corrected in https://github.com/phetsims/rutherford-scattering/commit/3641c1f22b44e9e4d62f4b200de692b3025e5e77, closing.

jessegreenberg commented 4 years ago

Thanks for fixing!