Commits

Rune Halvorsen  committed 987dc06

Use console logger service directly, not through console view

  • Participants
  • Parent commits 79b6fbd

Comments (0)

Files changed (2)

File src/console-logger/console.js

       this._msgs.push(entry);
     }
 
-    window.messages.post('console-message', entry);
     this._updateviews();
   };
 

File src/ecma-debugger/view-commandline.js

 cls = window.cls || (window.cls = {});
 
 /**
-  * @constructor 
+  * @constructor
   * @extends ViewBase
   */
 
     var match_cur = 0;
     var local_frame_index = 0;
     var _shift_key = false;
-   
-    
-    const 
+
+
+    const
     SCRIPT = "(function(path){var a = '', b= ''; for (a in path){b += a + '_,_';}; return b;})(%s)",
     KEY = 0,
     DEPTH = 3;
 
   var onConsoleMessage = function(msg)
   {
-    if( settings['command_line'].get('show-ecma-errors') && msg['source'] == 'ecmascript')
+  opera.postError(msg.join(", "))
+    const DESCRIPTION = 2,
+          CONTEXT = 4,
+          SOURCE = 5;
+    if( settings['command_line'].get('show-ecma-errors') && msg[SOURCE] == 'ecmascript')
     {
       cons_out_render_return_val
       (
         console_output_data[console_output_data.length] =
         {
           type: "return-value",
-          value: msg['context'] + '\n' + msg['description']
+          value: msg[CONTEXT] + '\n' + msg[DESCRIPTION]
         }
       );
       if(__container)
   }
 
   messages.addListener('frame-selected', onFrameSelected);
-  messages.addListener('console-message', onConsoleMessage);
   messages.addListener('active-tab', checkToolbarVisibility);
-
+  window.services['console-logger'].add_listener("consolemessage", onConsoleMessage); 
   this.init(id, name, container_class, html, default_handler);
-
 }
 
 cls.CommandLineView.create_ui_widgets = function()
   this.templateOptionList = function(select_obj)
   {
     // TODO this is a relict of protocol 3, needs cleanup
-    
+
     var active_window_id = runtimes.getActiveWindowId();
 
     if( active_window_id )
       }
       return templates.runtimes(_runtimes, 'runtime');
     }
-    
+
   }
 
   this.checkChange = function(target_ele)
 
   this.init(id, class_name);
 }
-
-
-