waterbearlang / waterbear

Visual block syntax for programming languages
http://waterbearlang.com/
358 stars 88 forks source link

1174 double get variable #1212

Closed dethe closed 9 years ago

dethe commented 9 years ago

OK, finally tracked it down for sure.

I thought errors in the new Date blocks were a clue, but that was just a problem I missed in the code review: we were mutating the arguments, so they were getting changed over and over. I fixed that to clone the arguments instead and date blocks work fine now.

Then I dug some more into the per-frame runtime. I had put some code in last time I worked on this to ensure there was only one handler registered at a time, and to delete that handler when we restarted the script. I put in a quick test to make sure this was working, and that test failed. So I tracked it down to one place where I had forgotten to update the variable holding the current frame runner. Fixed that spot, ran the test and all was well. Could hit play any number of times and the waterbear wouldn't speed up. The Simple Bounce is always going the same speed now too.

ghost commented 9 years ago

Ahh yes I did mean to check about creating a new date object. Thanks for catching that. All these changes look good to me.