Bug 1514760 - Debugger variables cannot be expanded when re-paused. r=nchevobbe
authorJason Laster <jlaster@mozilla.com>
Mon, 17 Dec 2018 09:53:35 -0500
changeset 451044 0f6c4e398f4753724a17e6bd809b033da2d171e5
parent 451043 d68a1c8025fb7e14047e5b0ba07ebe776c089da7
child 451045 b0d5f304e740f0dcd1516d78270f5d731cf4a054
push id35225
push usercbrindusan@mozilla.com
push dateTue, 18 Dec 2018 09:51:20 +0000
treeherdermozilla-central@d62e952be812 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe
bugs1514760
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1514760 - Debugger variables cannot be expanded when re-paused. r=nchevobbe Tags: Bug #: 1514760 Differential Revision: https://phabricator.services.mozilla.com/D14747
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,23 @@ 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) {