Maybe the comment is a bit unclear, here's why I intended to do:

The debugger shouldn't be affected by the mode, to achieve this, I'm simply setting "dosend" to false when the current view is a child of the debugger. (If the view is not a child of the debugger, "dosend" is set to its default value, that means true.) The loop is only entered when "dosend" is true, so it won't be entered for any child of the debugger. After the loop I need to set "dosend" to true if the current view is a debugger-child to ensure the event is sent.

The same effect be achieved by this code:
var dosend = true;
if (! isDebugView) {
  for (...) {
    // iterate over modal views
  }
}
if (dosend) {
  // send event
}

But that code would add additional noise to non-debug builds, because of the extra if-clause.


On 6/1/2010 6:27 PM, P T Withington wrote:
I don't follow your logic here.  The comment says you won't enter the loop for 
the debugger, but it seems to fall through to that loop anyway?  Is it missing 
an `else` ?

Isn't the idea that if you are over the debug console you ignore the mode 
altogether and just send the mouse event, otherwise you only send the event if 
the mode permits it?

On 2010-05-30, at 20:33, André Bargull wrote:

Change 20100531-bargull-TKS by barg...@bargull02 on 2010-05-31 01:21:49
in /home/anba/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: null pointer exception in lz.ModeManager for debug apps

Bugs Fixed: LPP-9053 (npe in lz.ModeManager.handleMouseEvent() in debug mode)

Technical Reviewer: hqm

Details:
There was a missing test in an if-condition which led to a null pointer 
exception. While fixing this, I've restructured the code a bit:
The test whether a view is a child of the debugger window can be done before 
entering the loop. If the view is a child of the debugger, simply don't enter 
the loop, but still send the mouse event. Otherwise just proceed like before.


Tests:
see bugreport

Files:
M WEB-INF/lps/lfc/services/LzModeManager.lzs

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20100531-bargull-TKS.tar



Reply via email to