on master help sign in
Fix bug when main is not a signal
0294fdaEvan Czaplicki
runtime/Debugger.js+6
@@ -121,6 +121,12 @@ function debugModule(module, runtime) {
121
121
122 var assignedPropTracker = Object.create(wrappedRuntime);
122 var assignedPropTracker = Object.create(wrappedRuntime);
123 var moduleInstance = module.make(assignedPropTracker);
123 var moduleInstance = module.make(assignedPropTracker);
124+
125+ // make sure the signal graph is actually a signal & extract the visual model
126+ if ( !('recv' in moduleInstance.main) ) {
127+ moduleInstance.main = Elm.Signal.make(runtime).constant(moduleInstance.main);
128+ }
129+
124 // The main module stores imported modules onto the runtime.
130 // The main module stores imported modules onto the runtime.
125 // To ensure only one instance of each module is created,
131 // To ensure only one instance of each module is created,
126 // we assign them back on the original runtime object.
132 // we assign them back on the original runtime object.