Open dneise opened 7 years ago
Okay, so now all scripts apart from Main.js should have no side effects anymore, and they should only define some functions.
All scripts which had side effects, I moved into Main.js which was possible, none of the side-effect scripts was included more than once.
I would luve, if somebody could review this. The current commit is: https://github.com/fact-project/FACT_js_scripts/tree/bc7f17996b4a515cf3dfca6a633c751d793cd37c
java script has no include as we know, but Thomas has create an
include()
function in our js interpreter. js code in executed at include time, so stuff can happen oninclude("my_new_function.js");
if "my_new_fuction.js" does not only implement a function but also calls it right away ... this is extremely hard to understand.If in addition this function alters some global state, chaos is unavoidable.
Let's try to rewrite all scripts apart from Main.js such that they only implement functions and not call them. (Let's later also try to make sure these functions do not alter global state (too much)).
this is a list of files, we need to check: