Bug 1465089 - Do not highlight the debugger on interrupts. r=nchevobbe draft
authorJason Laster <jason.laster.11@gmail.com>
Tue, 29 May 2018 10:29:02 -0400
changeset 800938 5d1017a9c5781651330dedaf20ff03228d5cfac0
parent 800025 94d7f0e1c4d0390450028972cfeb65e0550b9892
push id111524
push userbmo:jlaster@mozilla.com
push dateTue, 29 May 2018 14:29:56 +0000
reviewersnchevobbe
bugs1465089
milestone62.0a1
Bug 1465089 - Do not highlight the debugger on interrupts. r=nchevobbe
devtools/client/framework/attach-thread.js
--- a/devtools/client/framework/attach-thread.js
+++ b/devtools/client/framework/attach-thread.js
@@ -8,23 +8,25 @@ const Services = require("Services");
 const defer = require("devtools/shared/defer");
 
 const {LocalizationHelper} = require("devtools/shared/l10n");
 const L10N = new LocalizationHelper("devtools/client/locales/toolbox.properties");
 
 function handleThreadState(toolbox, event, packet) {
   // Suppress interrupted events by default because the thread is
   // paused/resumed a lot for various actions.
-  if (event !== "paused" || packet.why.type !== "interrupted") {
-    // TODO: Bug 1225492, we continue emitting events on the target
-    // like we used to, but we should emit these only on the
-    // threadClient now.
-    toolbox.target.emit("thread-" + event);
+  if (event === "paused" && packet.why.type === "interrupted") {
+    return;
   }
 
+  // TODO: Bug 1225492, we continue emitting events on the target
+  // like we used to, but we should emit these only on the
+  // threadClient now.
+  toolbox.target.emit("thread-" + event);
+
   if (event === "paused") {
     toolbox.highlightTool("jsdebugger");
 
     if (packet.why.type === "debuggerStatement" ||
        packet.why.type === "breakpoint" ||
        packet.why.type === "exception") {
       toolbox.raise();
       toolbox.selectTool("jsdebugger", packet.why.type);