-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Assertion failed: Impossible set state (electric potential line) #130
Comments
Proposed fix in preceding commits, @phet-steele can you verify on phettest? Would you like a new dev version? |
@samreid with this one, I'd like a new dev version and will probably update the QA task with the new version. |
New dev version is here: http://www.colorado.edu/physics/phet/dev/html/charges-and-fields/1.1.0-phetiodev.3/wrappers/index/ |
Looks fixed in the above dev version. |
@chrisklus and I stumbled across some code that looks potentially (pun semi-intended) problematic that was committed to resolve this issue. |
In the commit, I rewrote the function using ES6 default parameters and I added checks for the parameter types. This pattern works in this case because the tandem is only supplied if the position is also supplied (options are not fully orthogonal). But let me know if this is too obscure and I can rewrite it using our idiomatic options pattern. Also note: before I made any changes, I observed #161, which makes it difficult to test this code fully. |
It definitely does look a little odd to me, especially since there are function invocations for setting the default parameters, and I've never done this before. However, this apparently is valid in JavaScript, and the sim runs and creates electric potential lines just fine. Also, the asserts would catch any inappropriate parameters, so it seems okay to me. The only additional item I would suggest is to explicitly document that the tandem is optional but is never included if the vector position vector is not (and fix the comment to adhere to the line length convention). Otherwise, I think others will find this confusing the way that @chrisklus and I did. |
@samreid - feel free to close once suggested comment is added, no need to assign back to us. |
Thanks, I updated the comments accordingly, closing. |
Kills the wrapper. Seen on macOS 10.12.6 Chrome. For phetsims/qa/issues/37.
The text was updated successfully, but these errors were encountered: