@@ -26,6 +26,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2626
2727*/
2828
29+ // include this file BEFORE any OPT frontend files
30+
2931
3032// backend scripts to execute (Python 2 and 3 variants, if available)
3133// make two copies of ../web_exec.py and give them the following names,
@@ -73,7 +75,7 @@ function setCodeMirrorVal(dat) {
7375
7476
7577var myVisualizer = null ; // singleton ExecutionVisualizer instance
76- var myVisualizerState = null ; // contains the parameters necessary to generate myVisualizer
78+ var visualizedAppState = null ; // parameters necessary to generate myVisualizer
7779
7880
7981var rawInputLst = [ ] ; // a list of strings inputted by the user in response to raw_input or mouse_input events
@@ -189,7 +191,7 @@ function executePythonCode(pythonSourceCode,
189191 return ;
190192 }
191193
192- myVisualizerState = null ; // clear this before attempting to execute
194+ visualizedAppState = null ; // clear this before attempting to execute
193195
194196 $ . get ( backendScript ,
195197 { user_script : pythonSourceCode ,
@@ -249,11 +251,8 @@ function executePythonCode(pythonSourceCode,
249251
250252 // set some nasty global state that represents the current
251253 // code that's being visualized at the moment
252- myVisualizerState = { visualizedCode : pythonSourceCode ,
253- backendScript : backendScript ,
254- backendOptionsObj : backendOptionsObj ,
255- frontendOptionsObj : frontendOptionsObj } ;
256- // TODO: insert UUID
254+ visualizedAppState = getAppState ( ) ; // TODO: add UUID
255+ visualizedAppState . visualizedAppState = null ; // prevent chaining
257256
258257 handleSuccessFunc ( ) ;
259258 }
0 commit comments