Bug 1514760 - Debugger variables cannot be expanded when re-paused. r=nchevobbe, a=RyanVM
authorJason Laster <jlaster@mozilla.com>
Wed, 19 Dec 2018 07:11:00 -0500
changeset 509104 c35977a3c5a3d1c6eb3ac66582143d7e9ef07665
parent 509103 6003743fd8fd999ec1334b180efd04784a47a050
child 509105 2f5faf2206df5e8fed5b12e4079c5dfe446b1987
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe, RyanVM
bugs1514760
milestone65.0
Bug 1514760 - Debugger variables cannot be expanded when re-paused. r=nchevobbe, a=RyanVM
devtools/client/debugger/new/test/mochitest/browser_dbg-expressions.js
devtools/client/debugger/new/test/mochitest/browser_dbg-scopes.js
devtools/client/shared/components/reps/reps.js
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-expressions.js
@@ -83,16 +83,16 @@ add_task(async function() {
   await deleteExpression(dbg, "foo");
   await deleteExpression(dbg, "location");
   is(findAllElements(dbg, "expressionNodes").length, 0);
 
   // Test expanding properties when the debuggee is active
   await resume(dbg);
   await addExpression(dbg, "location");
 
-  is(findAllElements(dbg, "expressionNodes").length, 34);
+  is(findAllElements(dbg, "expressionNodes").length, 1);
 
   await toggleExpressionNode(dbg, 1);
-  is(findAllElements(dbg, "expressionNodes").length, 1);
+  is(findAllElements(dbg, "expressionNodes").length, 34);
 
   await deleteExpression(dbg, "location");
   is(findAllElements(dbg, "expressionNodes").length, 0);
 });
--- a/devtools/client/debugger/new/test/mochitest/browser_dbg-scopes.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-scopes.js
@@ -22,10 +22,10 @@ add_task(async function() {
   is(getLabel(dbg, 1), "secondCall");
   is(getLabel(dbg, 2), "<this>");
   is(getLabel(dbg, 4), "foo()");
   await toggleScopeNode(dbg, 4);
   is(getLabel(dbg, 5), "arguments");
 
   await stepOver(dbg);
   is(getLabel(dbg, 4), "foo()");
-  is(getLabel(dbg, 11), "Window");
+  is(getLabel(dbg, 5), "Window");
 });
--- a/devtools/client/shared/components/reps/reps.js
+++ b/devtools/client/shared/components/reps/reps.js
@@ -2516,16 +2516,22 @@ function reducer(state = initialState(),
     return cloneState({
       actors: data.actor ? new Set(state.actors || []).add(data.result.from) : state.actors,
       evaluations: new Map(state.evaluations).set(data.node.path, {
         getterValue: data.result && data.result.value && (data.result.value.return || data.result.value.throw)
       })
     });
   }
 
+  // NOTE: we clear the state on resume because otherwise the scopes pane 
+  // would be out of date. Bug 1514760 
+  if (type === "RESUME" || type == "NAVIGATE") {
+    return initialState();
+  }
+
   return state;
 }
 
 function getObjectInspectorState(state) {
   return state.objectInspector;
 }
 
 function getExpandedPaths(state) {