on master help sign in
Debugger: better names.
commitcc6c0e3b2d2939e7a5a60a9b439142da29603b72 authorLaszlo Pandy <laszlo.pandy@prezi.com> dateTue 29 Oct 2013, 23:14 (13 years ago) parent64a2a26
1 file changed+14−14
runtime/Debugger.js+14−14
runtime/Debugger.js+14−14
@@ -12,7 +12,7 @@ Elm.debuggerInit = function(module) {
1212 };
1313};
1414
15−function debuggerInit(module, elm) {
15+function debuggerInit(module, runtime) {
1616
1717 var programPaused = false;
1818 var allNodes = null;
@@ -32,7 +32,7 @@ function debuggerInit(module, elm) {
3232 // ignore notify because we are stepping
3333 }
3434 else {
35− elm.notify(id, v, timestep);
35+ runtime.notify(id, v, timestep);
3636 recordEvent(id, v, timestep);
3737 }
3838 };
@@ -66,7 +66,7 @@ function debuggerInit(module, elm) {
6666 });
6767 }
6868
69− function gotoStep(index) {
69+ function stepTo(index) {
7070 if (!programPaused) {
7171 programPaused = true;
7272 resetProgram();
@@ -84,7 +84,7 @@ function debuggerInit(module, elm) {
8484 assert(index >= eventCounter, "index must be bad");
8585 while (eventCounter < index) {
8686 var nextEvent = recordedEvents[eventCounter];
87− elm.notify(nextEvent.id, nextEvent.value, nextEvent.timestep);
87+ runtime.notify(nextEvent.id, nextEvent.value, nextEvent.timestep);
8888
8989 eventCounter += 1;
9090 }
@@ -104,7 +104,7 @@ function debuggerInit(module, elm) {
104104 function doPlayback(eventList) {
105105 var x = eventList.shift();
106106 var time = x[2];
107− elm.notify(x[0], x[1], x[2]);
107+ runtime.notify(x[0], x[1], x[2]);
108108
109109 if (eventList.length > 0) {
110110 var delta = eventList[0][2] - time;
@@ -117,17 +117,17 @@ function debuggerInit(module, elm) {
117117 graphicsFoldp.recv(Date.now(), true, moduleRetValue.main.id);
118118 }
119119
120− var wrappedElm = {
120+ var wrappedRuntime = {
121121 notify: wrapNotify,
122122 runDelayed: wrapRunDelayed,
123− node: elm.node,
124− display: elm.display,
125− id: elm.id,
126− addListener: elm.addListener,
127− inputs: elm.inputs
123+ node: runtime.node,
124+ display: runtime.display,
125+ id: runtime.id,
126+ addListener: runtime.addListener,
127+ inputs: runtime.inputs
128128 };
129129
130− var moduleRetValue = module.make(wrappedElm);
130+ var moduleRetValue = module.make(wrappedRuntime);
131131
132132 var elmDebugger = {
133133 moduleRetValue: moduleRetValue,
@@ -136,10 +136,10 @@ function debuggerInit(module, elm) {
136136 reset: resetProgram,
137137 restart: restartProgram,
138138 getMaxSteps: getMaxSteps,
139− stepTo: gotoStep
139+ stepTo: stepTo
140140 };
141141
142− allNodes = flattenNodes(wrappedElm.inputs);
142+ allNodes = flattenNodes(wrappedRuntime.inputs);
143143 initialProgramState.nodeValues = saveNodeValues(allNodes);
144144 initialProgramState.asyncTimers = asyncTimers.slice();
145145