on master help sign in
Debugger: fix initialization by using main node instead of graphics node (their values are the same).
f20fa4eLaszlo Pandy
runtime/Debugger.js+3−5
@@ -7,9 +7,7 @@ Elm.debuggerAttach = function(module) {
7 return {
7 return {
8 make: function(runtime) {
8 make: function(runtime) {
9 var wrappedModule = debugModule(module, runtime);
9 var wrappedModule = debugModule(module, runtime);
10− Elm.debuggerInit = function() {
11− Elm.Debugger = debuggerInit(wrappedModule, runtime);
10+ Elm.Debugger = debuggerInit(wrappedModule, runtime);
12− };
13 return wrappedModule.moduleInstance;
11 return wrappedModule.moduleInstance;
14 }
12 }
15 };
13 };
@@ -98,10 +96,9 @@ function debugModule(module, runtime) {
98
96
99function debuggerInit(debugModule, runtime) {
97function debuggerInit(debugModule, runtime) {
100 var Signal = Elm.Signal.make(runtime);
98 var Signal = Elm.Signal.make(runtime);
101− var graphicsNode = debugModule.moduleInstance.main.kids[0];
102
99
103 var tracePath = tracePathInit(runtime);
100 var tracePath = tracePathInit(runtime);
104− var tracePathNode = A2(Signal.lift, tracePath.graphicsUpdate, graphicsNode);
101+ var tracePathNode = A2(Signal.lift, tracePath.graphicsUpdate, debugModule.moduleInstance.main);
105 runtime.node.parentNode.appendChild(tracePath.canvas);
102 runtime.node.parentNode.appendChild(tracePath.canvas);
106
103
107 function resetProgram() {
104 function resetProgram() {
@@ -160,6 +157,7 @@ function debuggerInit(debugModule, runtime) {
160 }
157 }
161
158
162 function redrawGraphics() {
159 function redrawGraphics() {
160+ var graphicsNode = debugModule.moduleInstance.main.kids[0];
163 graphicsNode.recv(Date.now(), true, debugModule.moduleInstance.main.id);
161 graphicsNode.recv(Date.now(), true, debugModule.moduleInstance.main.id);
164 }
162 }
165
163