From 3c99d4d133c1b4341615779d52ff925df470e08a Mon Sep 17 00:00:00 2001 From: Victor Porof Date: Mon, 21 Jan 2013 23:59:30 +0200 Subject: [PATCH] Bug 830702 - Variables View needs a way to clear hierarchies, to avoid highlighting variable or property changes, r=past --- .../debugger/test/browser_dbg_propertyview-data.js | 6 ++++++ browser/devtools/shared/VariablesView.jsm | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/browser/devtools/debugger/test/browser_dbg_propertyview-data.js b/browser/devtools/debugger/test/browser_dbg_propertyview-data.js index e663f2472e3..71e2e60b62a 100644 --- a/browser/devtools/debugger/test/browser_dbg_propertyview-data.js +++ b/browser/devtools/debugger/test/browser_dbg_propertyview-data.js @@ -70,6 +70,12 @@ function testVariablesView() testThirdLevelContents(); testIntegrity(arr, obj); + gVariablesView.clearHierarchy(); + is (gVariablesView._prevHierarchy.size, 0, + "The previous hierarchy should have been cleared."); + is (gVariablesView._currHierarchy.size, 0, + "The current hierarchy should have been cleared."); + closeDebuggerAndFinish(); } diff --git a/browser/devtools/shared/VariablesView.jsm b/browser/devtools/shared/VariablesView.jsm index 3e1550724f4..bd343d6f981 100644 --- a/browser/devtools/shared/VariablesView.jsm +++ b/browser/devtools/shared/VariablesView.jsm @@ -1880,6 +1880,15 @@ Property.prototype.__iterator__ = function VV_iterator() { } }; +/** + * Forget everything recorded about added scopes, variables or properties. + * @see VariablesView.createHierarchy + */ +VariablesView.prototype.clearHierarchy = function VV_clearHierarchy() { + this._prevHierarchy = new Map(); + this._currHierarchy = new Map(); +}; + /** * Start recording a hierarchy of any added scopes, variables or properties. * @see VariablesView.commitHierarchy