Bug 816548 - Show 'hidden' properties menu item should say 'non-enumerable', r=past

This commit is contained in:
Victor Porof 2012-12-04 15:48:39 +02:00
Родитель fe349ddddf
Коммит e3b98b696f
8 изменённых файлов: 46 добавлений и 28 удалений

Просмотреть файл

@ -1041,7 +1041,7 @@ pref("devtools.debugger.ui.stackframes-width", 200);
pref("devtools.debugger.ui.variables-width", 300);
pref("devtools.debugger.ui.panes-visible-on-startup", false);
pref("devtools.debugger.ui.variables-sorting-enabled", true);
pref("devtools.debugger.ui.variables-non-enum-visible", true);
pref("devtools.debugger.ui.variables-only-enum-visible", false);
pref("devtools.debugger.ui.variables-searchbox-visible", false);
// Enable the Tilt inspector

Просмотреть файл

@ -1601,7 +1601,7 @@ Prefs.map("Int", "stackframesWidth", "devtools.debugger.ui.stackframes-width");
Prefs.map("Int", "variablesWidth", "devtools.debugger.ui.variables-width");
Prefs.map("Bool", "panesVisibleOnStartup", "devtools.debugger.ui.panes-visible-on-startup");
Prefs.map("Bool", "variablesSortingEnabled", "devtools.debugger.ui.variables-sorting-enabled");
Prefs.map("Bool", "variablesNonEnumVisible", "devtools.debugger.ui.variables-non-enum-visible");
Prefs.map("Bool", "variablesOnlyEnumVisible", "devtools.debugger.ui.variables-only-enum-visible");
Prefs.map("Bool", "variablesSearchboxVisible", "devtools.debugger.ui.variables-searchbox-visible");
Prefs.map("Char", "remoteHost", "devtools.debugger.remote-host");
Prefs.map("Int", "remotePort", "devtools.debugger.remote-port");

Просмотреть файл

@ -184,7 +184,7 @@ function OptionsView() {
dumpn("OptionsView was instantiated");
this._togglePauseOnExceptions = this._togglePauseOnExceptions.bind(this);
this._toggleShowPanesOnStartup = this._toggleShowPanesOnStartup.bind(this);
this._toggleShowVariablesNonEnum = this._toggleShowVariablesNonEnum.bind(this);
this._toggleShowVariablesOnlyEnum = this._toggleShowVariablesOnlyEnum.bind(this);
this._toggleShowVariablesFilterBox = this._toggleShowVariablesFilterBox.bind(this);
}
@ -197,12 +197,12 @@ OptionsView.prototype = {
this._button = document.getElementById("debugger-options");
this._pauseOnExceptionsItem = document.getElementById("pause-on-exceptions");
this._showPanesOnStartupItem = document.getElementById("show-panes-on-startup");
this._showVariablesNonEnumItem = document.getElementById("show-vars-nonenum");
this._showVariablesOnlyEnumItem = document.getElementById("show-vars-only-enum");
this._showVariablesFilterBoxItem = document.getElementById("show-vars-filter-box");
this._pauseOnExceptionsItem.setAttribute("checked", "false");
this._showPanesOnStartupItem.setAttribute("checked", Prefs.panesVisibleOnStartup);
this._showVariablesNonEnumItem.setAttribute("checked", Prefs.variablesNonEnumVisible);
this._showVariablesOnlyEnumItem.setAttribute("checked", Prefs.variablesOnlyEnumVisible);
this._showVariablesFilterBoxItem.setAttribute("checked", Prefs.variablesSearchboxVisible);
},
@ -247,9 +247,9 @@ OptionsView.prototype = {
/**
* Listener handling the 'show non-enumerables' menuitem command.
*/
_toggleShowVariablesNonEnum: function DVO__toggleShowVariablesNonEnum() {
DebuggerView.Variables.nonEnumVisible = Prefs.variablesNonEnumVisible =
this._showVariablesNonEnumItem.getAttribute("checked") == "true";
_toggleShowVariablesOnlyEnum: function DVO__toggleShowVariablesOnlyEnum() {
DebuggerView.Variables.onlyEnumVisible = Prefs.variablesOnlyEnumVisible =
this._showVariablesOnlyEnumItem.getAttribute("checked") == "true";
},
/**
@ -263,7 +263,7 @@ OptionsView.prototype = {
_button: null,
_pauseOnExceptionsItem: null,
_showPanesOnStartupItem: null,
_showVariablesNonEnumItem: null,
_showVariablesOnlyEnumItem: null,
_showVariablesFilterBoxItem: null
};

Просмотреть файл

@ -48,7 +48,7 @@ let DebuggerView = {
this.Variables = new VariablesView(document.getElementById("variables"));
this.Variables.searchPlaceholder = L10N.getStr("emptyVariablesFilterText");
this.Variables.emptyText = L10N.getStr("emptyVariablesText");
this.Variables.nonEnumVisible = Prefs.variablesNonEnumVisible;
this.Variables.onlyEnumVisible = Prefs.variablesOnlyEnumVisible;
this.Variables.searchEnabled = Prefs.variablesSearchboxVisible;
this.Variables.eval = DebuggerController.StackFrames.evaluate;
this.Variables.lazyEmpty = true;

Просмотреть файл

@ -55,8 +55,8 @@
oncommand="DebuggerView.Options._togglePauseOnExceptions()"/>
<command id="toggleShowPanesOnStartup"
oncommand="DebuggerView.Options._toggleShowPanesOnStartup()"/>
<command id="toggleShowNonEnum"
oncommand="DebuggerView.Options._toggleShowVariablesNonEnum()"/>
<command id="toggleShowOnlyEnum"
oncommand="DebuggerView.Options._toggleShowVariablesOnlyEnum()"/>
<command id="toggleShowVariablesFilterBox"
oncommand="DebuggerView.Options._toggleShowVariablesFilterBox()"/>
</commandset>
@ -137,11 +137,11 @@
label="&debuggerUI.showPanesOnInit;"
accesskey="&debuggerUI.showPanesOnInit.key;"
command="toggleShowPanesOnStartup"/>
<menuitem id="show-vars-nonenum"
<menuitem id="show-vars-only-enum"
type="checkbox"
label="&debuggerUI.showNonEnums;"
accesskey="&debuggerUI.showNonEnums.key;"
command="toggleShowNonEnum"/>
label="&debuggerUI.showOnlyEnum;"
accesskey="&debuggerUI.showOnlyEnum.key;"
command="toggleShowOnlyEnum"/>
<menuitem id="show-vars-filter-box"
type="checkbox"
label="&debuggerUI.showVarsFilter;"

Просмотреть файл

@ -57,8 +57,8 @@ function testNonEnumProperties() {
"There should be just one property in the .nonenum container.");
// Uncheck 'show hidden properties'.
gDebugger.DebuggerView.Options._showVariablesNonEnumItem.setAttribute("checked", "false");
gDebugger.DebuggerView.Options._toggleShowVariablesNonEnum();
gDebugger.DebuggerView.Options._showVariablesOnlyEnumItem.setAttribute("checked", "true");
gDebugger.DebuggerView.Options._toggleShowVariablesOnlyEnum();
executeSoon(function() {
ok(details.hasAttribute("open"),
@ -68,8 +68,8 @@ function testNonEnumProperties() {
".nonenum container should become hidden.");
// Check 'show hidden properties'.
gDebugger.DebuggerView.Options._showVariablesNonEnumItem.setAttribute("checked", "true");
gDebugger.DebuggerView.Options._toggleShowVariablesNonEnum();
gDebugger.DebuggerView.Options._showVariablesOnlyEnumItem.setAttribute("checked", "false");
gDebugger.DebuggerView.Options._toggleShowVariablesOnlyEnum();
executeSoon(function() {
ok(details.hasAttribute("open"),
@ -89,8 +89,8 @@ function testNonEnumProperties() {
".nonenum container should be hidden.");
// Uncheck 'show hidden properties'.
gDebugger.DebuggerView.Options._showVariablesNonEnumItem.setAttribute("checked", "false");
gDebugger.DebuggerView.Options._toggleShowVariablesNonEnum();
gDebugger.DebuggerView.Options._showVariablesOnlyEnumItem.setAttribute("checked", "true");
gDebugger.DebuggerView.Options._toggleShowVariablesOnlyEnum();
executeSoon(function() {
ok(!details.hasAttribute("open"),
@ -100,8 +100,8 @@ function testNonEnumProperties() {
".nonenum container should stay hidden.");
// Check 'show hidden properties'.
gDebugger.DebuggerView.Options._showVariablesNonEnumItem.setAttribute("checked", "true");
gDebugger.DebuggerView.Options._toggleShowVariablesNonEnum();
gDebugger.DebuggerView.Options._showVariablesOnlyEnumItem.setAttribute("checked", "false");
gDebugger.DebuggerView.Options._toggleShowVariablesOnlyEnum();
executeSoon(function() {
gDebugger.DebuggerController.activeThread.resume(function() {

Просмотреть файл

@ -139,6 +139,7 @@ VariablesView.prototype = {
/**
* Specifies if enumerable properties and variables should be displayed.
* These variables and properties are visible by default.
* @param boolean aFlag
*/
set enumVisible(aFlag) {
@ -151,6 +152,7 @@ VariablesView.prototype = {
/**
* Specifies if non-enumerable properties and variables should be displayed.
* These variables and properties are visible by default.
* @param boolean aFlag
*/
set nonEnumVisible(aFlag) {
@ -161,6 +163,21 @@ VariablesView.prototype = {
}
},
/**
* Specifies if only enumerable properties and variables should be displayed.
* Both types of these variables and properties are visible by default.
* @param boolean aFlag
*/
set onlyEnumVisible(aFlag) {
if (aFlag) {
this.enumVisible = true;
this.nonEnumVisible = false;
} else {
this.enumVisible = true;
this.nonEnumVisible = true;
}
},
/**
* Enables variable and property searching in this view.
*/

Просмотреть файл

@ -58,11 +58,12 @@
<!ENTITY debuggerUI.showVarsFilter "Show variables filter box">
<!ENTITY debuggerUI.showVarsFilter.key "V">
<!-- LOCALIZATION NOTE (debuggerUI.showNonEnums): This is the label for the
<!-- LOCALIZATION NOTE (debuggerUI.showOnlyEnum): This is the label for the
- checkbox that toggles visibility of hidden (non-enumerable) variables and
- properties in stack views. -->
<!ENTITY debuggerUI.showNonEnums "Show hidden properties">
<!ENTITY debuggerUI.showNonEnums.key "P">
- properties in stack views. The "enumerable" flag is a state of a property
- defined in JavaScript. When in doubt, leave untranslated. -->
<!ENTITY debuggerUI.showOnlyEnum "Show only enumerable properties">
<!ENTITY debuggerUI.showOnlyEnum.key "P">
<!-- LOCALIZATION NOTE (debuggerUI.searchPanelTitle): This is the text that
- appears in the filter panel popup as a description. -->