Closed zepumph closed 6 years ago
@jessegreenberg is this in the rc going out right now? Or is this from axon shas later than that?
Thanks @zepumph, I reproduced with master but it is not showing up in the release branches.
I took a look at recent changes to forces-and-motion-basics and axon and didn't see anything obvious that would have introduced this.
We are hitting this after trying to set Cart.xProperty, which has valid range
range: new Range( -403, 403 )
in NetForceModel, it looks like the xProperty is set before the check for 'end-of-game' is made, then if the new value is beyond the game limits we stop the game and reset the cart. Maybe we could change this so that the xProperty value is only set if it is within limits.
That doesn't explain why it is only appearing now though.
Ahh, it makes sense to me! It is a NumberProperty, we just added validation to ranges in NumberProperty.
Hmm, even though the assertion we are hitting is in Property.js? I thought that check was older.
I see, it looks like isValidValue
is passed in through NumberProperty
, just an option in Property
.
Ill proceed with looking into
Maybe we could change this so that the xProperty value is only set if it is within limits.
Will involve flipping logic in MotionModel.step
.
Yes but in NumberProperty
we are updating the isValidValue
option to be passed into Property:
if ( options.range ) {
// Add a validation function that includes the range check.
options.isValidValue = function( value ) {
return isValidForValueType( value, options.valueType ) && ( value >= options.range.min ) && ( value <= options.range.max );
};
}
This is new.
I see, thanks!
Should be fixed in master with the above commit.
Steps to reproduce: