on master help sign in
Fix bug when main is not a signal
commit0294fda5405fd18fc9dca2359ff70f05f8124af5 authorEvan Czaplicki <info@elm-lang.org> dateMon 7 Apr 2014, 13:13 (13 years ago) parent0cc63b4
1 file changed+6
runtime/Debugger.js+6
runtime/Debugger.js+6
@@ -121,6 +121,12 @@ function debugModule(module, runtime) {
121121
122122 var assignedPropTracker = Object.create(wrappedRuntime);
123123 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+
124130 // The main module stores imported modules onto the runtime.
125131 // To ensure only one instance of each module is created,
126132 // we assign them back on the original runtime object.