[2.1.0] local variables leak into global scope upon re-save

If you have problems installing or running Algodoo, have found a bug or need in-game help - this is it!

[2.1.0] local variables leak into global scope upon re-save

Postby ukuru.gejacoya » Sun Feb 09, 2014 1:10 pm

hello!
I report this bug in my sincere hope that there's someone to take care of it in future versions of Algodoo.

[summary] when you add _localVariables to an object, they all end up showing in the global scope when the scene gets overwritten.

here are the steps to replicate it:

1. file > new scene
2. check for _foo variable in global scope: _foo -> undefined
3. create a box
4. right click it > script menu > _foo="bar" //the _foo is added
5. recheck the global scope: console > _foo -> undefined
6. enter onSpawn into the box property window: (e)=>{scene.my.box = entity} //or (e)=>{scene.my.box = e.this}
7. save the scene
8. reload the saved one
9. console > _foo -> undefined //OK
10. overwrite the scene
11. reload the scene
12. console > _foo -> bar // quite unexpected
13. new scene
14. console > _foo -> bar // still there
15. restart Algodoo
16. console > _foo -> bar // alive and kicking!
ukuru.gejacoya
 
Posts: 10
Joined: Sun Jun 23, 2013 2:55 pm

Return to Help / Bug reports

Who is online

Users browsing this forum: No registered users and 16 guests