Bug 1167957 - Remove spidermonkey specific JS from debugger

This commit is contained in:
Patrick Brosset 2015-05-25 09:17:26 +02:00
parent a7a1d85013
commit 7ac9b6c749
50 changed files with 143 additions and 96 deletions

View File

@ -516,9 +516,12 @@ exports.items.push({
return args.invert ? !value : value;
}
const toBlackBox = [s.attachment.source
for (s of dbg._view.Sources.items)
if (shouldBlackBox(s.attachment.source))];
const toBlackBox = [];
for (let {attachment: {source}} of dbg._view.Sources.items) {
if (shouldBlackBox(source)) {
toBlackBox.push(source);
}
}
// If we aren't black boxing any sources, bail out now.

View File

@ -456,7 +456,9 @@ function ThreadState() {
}
ThreadState.prototype = {
get activeThread() DebuggerController.activeThread,
get activeThread() {
return DebuggerController.activeThread;
},
/**
* Connect to the current thread client.
@ -542,7 +544,10 @@ function StackFrames() {
}
StackFrames.prototype = {
get activeThread() DebuggerController.activeThread,
get activeThread() {
return DebuggerController.activeThread;
},
currentFrameDepth: -1,
_currentFrameDescription: FRAME_TYPE.NORMAL,
_syncedWatchExpressions: null,
@ -1114,8 +1119,14 @@ function SourceScripts() {
}
SourceScripts.prototype = {
get activeThread() DebuggerController.activeThread,
get debuggerClient() DebuggerController.client,
get activeThread() {
return DebuggerController.activeThread;
},
get debuggerClient() {
return DebuggerController.client;
},
_cache: new Map(),
/**
@ -2443,23 +2454,33 @@ DebuggerController.HitCounts = new HitCounts();
*/
Object.defineProperties(window, {
"gTarget": {
get: function() DebuggerController._target,
get: function() {
return DebuggerController._target;
},
configurable: true
},
"gHostType": {
get: function() DebuggerView._hostType,
get: function() {
return DebuggerView._hostType;
},
configurable: true
},
"gClient": {
get: function() DebuggerController.client,
get: function() {
return DebuggerController.client;
},
configurable: true
},
"gThreadClient": {
get: function() DebuggerController.activeThread,
get: function() {
return DebuggerController.activeThread;
},
configurable: true
},
"gCallStackPageSize": {
get: function() CALL_STACK_PAGE_SIZE,
get: function() {
return CALL_STACK_PAGE_SIZE;
},
configurable: true
}
});

View File

@ -515,15 +515,17 @@ let DebuggerView = {
* Gets the visibility state of the instruments pane.
* @return boolean
*/
get instrumentsPaneHidden()
this._instrumentsPane.hasAttribute("pane-collapsed"),
get instrumentsPaneHidden() {
return this._instrumentsPane.hasAttribute("pane-collapsed");
},
/**
* Gets the currently selected tab in the instruments pane.
* @return string
*/
get instrumentsPaneTab()
this._instrumentsPane.selectedTab.id,
get instrumentsPaneTab() {
return this._instrumentsPane.selectedTab.id;
},
/**
* Sets the instruments pane hidden or visible.
@ -754,9 +756,10 @@ ResultsPanelContainer.prototype = Heritage.extend(WidgetMethods, {
* Gets this container's visibility state.
* @return boolean
*/
get hidden()
this._panel.state == "closed" ||
this._panel.state == "hiding",
get hidden() {
return this._panel.state == "closed" ||
this._panel.state == "hiding";
},
/**
* Removes all items from this container and hides it.

View File

@ -68,7 +68,9 @@ DebuggerPanel.prototype = {
// DevToolPanel API
get target() this._toolbox.target,
get target() {
return this._toolbox.target;
},
destroy: function() {
// Make sure this panel is not already destroyed.

View File

@ -18,7 +18,7 @@ function getCachedMessages(webConsole) {
}
function test() {
Task.spawn(function () {
Task.spawn(function*() {
let addon = yield addAddon(ADDON_URL);
let addonDebugger = yield initAddonDebugger(ADDON_URL);

View File

@ -6,7 +6,7 @@
const ADDON_URL = EXAMPLE_URL + "addon5.xpi";
function test() {
Task.spawn(function () {
Task.spawn(function*() {
let addon = yield addAddon(ADDON_URL);
let tab1 = yield addTab("chrome://browser_dbg_addon5/content/test.xul");

View File

@ -6,7 +6,7 @@
const ADDON_URL = EXAMPLE_URL + "addon4.xpi";
function test() {
Task.spawn(function () {
Task.spawn(function*() {
let addon = yield addAddon(ADDON_URL);
let tab1 = yield addTab("chrome://browser_dbg_addon4/content/test.xul");

View File

@ -14,7 +14,7 @@ let PREFS = [
"devtools.netmonitor.enabled"
];
function test() {
Task.spawn(function () {
Task.spawn(function*() {
let addon = yield addAddon(ADDON_URL);
let addonDebugger = yield initAddonDebugger(ADDON_URL);

View File

@ -1,14 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Ensure that the sources listed when debugging an addon are either from the
// Ensure that the sources listed when debugging an addon are either from the
// addon itself, or the SDK, with proper groups and labels.
const ADDON_URL = EXAMPLE_URL + "addon3.xpi";
let gClient;
function test() {
Task.spawn(function () {
Task.spawn(function*() {
let addon = yield addAddon(ADDON_URL);
let addonDebugger = yield initAddonDebugger(ADDON_URL);

View File

@ -47,7 +47,7 @@ function test() {
}
function checkNavigationWhileFocused() {
return Task.spawn(function() {
return Task.spawn(function*() {
yield promise.all([
waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_SCOPES),
waitForSourceAndCaret(gPanel, "-01.js", 5),

View File

@ -27,7 +27,7 @@ function test() {
is(gView.instrumentsPaneTab, "variables-tab",
"The variables tab should be selected by default.");
Task.spawn(function() {
Task.spawn(function*() {
yield waitForSourceShown(aPanel, ".html");
is(gEvents.itemCount, 0, "There should be no events before reloading.");

View File

@ -14,7 +14,7 @@ function test() {
let gView = gDebugger.DebuggerView;
let gEvents = gView.EventListeners;
Task.spawn(function() {
Task.spawn(function*() {
yield waitForSourceShown(aPanel, ".html");
yield testFetchOnFocus();
yield testFetchOnReloadWhenFocused();
@ -23,7 +23,7 @@ function test() {
});
function testFetchOnFocus() {
return Task.spawn(function() {
return Task.spawn(function*() {
let fetched = waitForDebuggerEvents(aPanel, gDebugger.EVENTS.EVENT_LISTENERS_FETCHED);
gView.toggleInstrumentsPane({ visible: true, animated: false }, 1);
@ -42,7 +42,7 @@ function test() {
}
function testFetchOnReloadWhenFocused() {
return Task.spawn(function() {
return Task.spawn(function*() {
let fetched = waitForDebuggerEvents(aPanel, gDebugger.EVENTS.EVENT_LISTENERS_FETCHED);
let reloading = once(gDebugger.gTarget, "will-navigate");
@ -73,7 +73,7 @@ function test() {
}
function testFetchOnReloadWhenNotFocused() {
return Task.spawn(function() {
return Task.spawn(function*() {
gDebugger.on(gDebugger.EVENTS.EVENT_LISTENERS_FETCHED, () => {
ok(false, "Shouldn't have fetched any event listeners.");
});

View File

@ -13,7 +13,7 @@ function test() {
let gView = gDebugger.DebuggerView;
let gEvents = gView.EventListeners;
Task.spawn(function() {
Task.spawn(function*() {
yield waitForSourceShown(aPanel, ".html");
let fetched = waitForDebuggerEvents(aPanel, gDebugger.EVENTS.EVENT_LISTENERS_FETCHED);

View File

@ -16,7 +16,7 @@ function test() {
let gEvents = gView.EventListeners;
let gBreakpoints = gController.Breakpoints;
Task.spawn(function() {
Task.spawn(function*() {
yield waitForSourceShown(aPanel, ".html");
let fetched = waitForDebuggerEvents(aPanel, gDebugger.EVENTS.EVENT_LISTENERS_FETCHED);

View File

@ -17,7 +17,7 @@ function test() {
let gEvents = gView.EventListeners;
let gBreakpoints = gController.Breakpoints;
Task.spawn(function() {
Task.spawn(function*() {
yield waitForSourceShown(aPanel, ".html");
let fetched = waitForDebuggerEvents(aPanel, gDebugger.EVENTS.EVENT_LISTENERS_FETCHED);

View File

@ -16,7 +16,7 @@ function test() {
let gEvents = gView.EventListeners;
let gBreakpoints = gController.Breakpoints;
Task.spawn(function() {
Task.spawn(function*() {
yield waitForSourceShown(aPanel, ".html");
let fetched = waitForDebuggerEvents(aPanel, gDebugger.EVENTS.EVENT_LISTENERS_FETCHED);

View File

@ -14,7 +14,7 @@ function test() {
let gView = gDebugger.DebuggerView;
let gEvents = gView.EventListeners;
Task.spawn(function() {
Task.spawn(function*() {
yield waitForSourceShown(aPanel, ".html");
yield callInTab(gTab, "addBodyClickEventListener");

View File

@ -16,7 +16,7 @@ function test() {
let gSources = gDebugger.DebuggerView.Sources;
let gBreakpoints = gDebugger.DebuggerController.Breakpoints;
let gBreakpointLocation;
Task.spawn(function() {
Task.spawn(function*() {
yield waitForSourceShown(aPanel, "-01.js");
gBreakpointLocation = { actor: getSourceActor(gSources, EXAMPLE_URL + "code_script-switching-01.js"),
line: 5 };
@ -41,7 +41,7 @@ function test() {
});
function verifyView({ disabled, visible }) {
return Task.spawn(function() {
return Task.spawn(function*() {
// It takes a tick for the checkbox in the SideMenuWidget and the
// gutter in the editor to get updated.
yield waitForTick();
@ -65,7 +65,7 @@ function test() {
// before causing the debuggee to pause, to allow functions to yield first.
function testWhenBreakpointEnabledAndFirstSourceShown() {
return Task.spawn(function() {
return Task.spawn(function*() {
yield ensureSourceIs(aPanel, "-01.js");
yield verifyView({ disabled: false, visible: true });
@ -82,7 +82,7 @@ function test() {
}
function testWhenBreakpointEnabledAndSecondSourceShown() {
return Task.spawn(function() {
return Task.spawn(function*() {
yield ensureSourceIs(aPanel, "-02.js", true);
yield verifyView({ disabled: false, visible: false });
@ -97,7 +97,7 @@ function test() {
}
function testWhenBreakpointDisabledAndSecondSourceShown() {
return Task.spawn(function() {
return Task.spawn(function*() {
yield ensureSourceIs(aPanel, "-02.js", true);
yield verifyView({ disabled: true, visible: false });

View File

@ -16,7 +16,7 @@ function test() {
return Task.spawn(spawnTest).then(finish, helpers.handleError);
}
function spawnTest() {
function* spawnTest() {
let options = yield helpers.openTab(TEST_URL);
yield helpers.openToolbar(options);

View File

@ -18,7 +18,7 @@ function test() {
};
helpers.addTabWithToolbar(TAB_URL, aOptions => {
return Task.spawn(function() {
return Task.spawn(function*() {
yield helpers.audit(aOptions, [{
setup: 'break',
check: {

View File

@ -8,7 +8,7 @@
const TEST_URI = EXAMPLE_URL + "doc_cmd-dbg.html";
function test() {
return Task.spawn(function() {
return Task.spawn(function*() {
let options = yield helpers.openTab(TEST_URI);
yield helpers.openToolbar(options);

View File

@ -8,7 +8,7 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let frames = win.DebuggerController.StackFrames;

View File

@ -8,7 +8,7 @@
const TAB_URL = EXAMPLE_URL + "doc_script-switching-01.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let frames = win.DebuggerController.StackFrames;

View File

@ -15,7 +15,7 @@ function test() {
let gSources = gDebugger.DebuggerView.Sources;
let gControllerSources = gDebugger.DebuggerController.SourceScripts;
Task.spawn(function() {
Task.spawn(function*() {
yield waitForSourceShown(aPanel, JS_URL);
is(gSources.itemCount, 1,

View File

@ -9,7 +9,7 @@
let gDefaultHostType = Services.prefs.getCharPref("devtools.toolbox.host");
function test() {
Task.spawn(function() {
Task.spawn(function*() {
yield testHosts(["bottom", "side", "window"], ["horizontal", "vertical", "horizontal"]);
yield testHosts(["side", "bottom", "side"], ["vertical", "horizontal", "vertical"]);
yield testHosts(["bottom", "side", "bottom"], ["horizontal", "vertical", "horizontal"]);
@ -25,7 +25,7 @@ function testHosts(aHostTypes, aLayoutTypes) {
Services.prefs.setCharPref("devtools.toolbox.host", firstHost);
return Task.spawn(function() {
return Task.spawn(function*() {
let [tab, debuggee, panel] = yield initDebugger("about:blank");
yield testHost(tab, panel, firstHost, firstLayout);
yield switchAndTestHost(tab, panel, secondHost, secondLayout);
@ -38,7 +38,7 @@ function switchAndTestHost(aTab, aPanel, aHostType, aLayoutType) {
let gToolbox = aPanel._toolbox;
let gDebugger = aPanel.panelWin;
return Task.spawn(function() {
return Task.spawn(function*() {
let layoutChanged = once(gDebugger, gDebugger.EVENTS.LAYOUT_CHANGED);
let hostChanged = gToolbox.switchHost(aHostType);

View File

@ -74,8 +74,8 @@ function testTabA() {
is(tabActors.size, 2, "gTabA opened: two tabs in list");
ok(tabActors.has(gFirstActor), "gTabA opened: initial tab present");
info("actors: " + [a.url for (a of tabActors)]);
gActorA = [a for (a of tabActors) if (a !== gFirstActor)][0];
info("actors: " + [...tabActors].map(a => a.url));
gActorA = [...tabActors].filter(a => a !== gFirstActor)[0];
ok(gActorA.url.match(/^data:text\/html;/), "gTabA opened: new tab URL");
is(gActorA.title, "JS Debugger BrowserTabList test page", "gTabA opened: new tab title");
});
@ -118,8 +118,8 @@ function testTabClosed() {
is(tabActors.size, 2, "gTabA closed: two tabs in list");
ok(tabActors.has(gFirstActor), "gTabA closed: initial tab present");
info("actors: " + [a.url for (a of tabActors)]);
gActorA = [a for (a of tabActors) if (a !== gFirstActor)][0];
info("actors: " + [...tabActors].map(a => a.url));
gActorA = [...tabActors].filter(a => a!== gFirstActor)[0];
ok(gActorA.url.match(/^data:text\/html;/), "gTabA closed: new tab URL");
is(gActorA.title, "JS Debugger BrowserTabList test page", "gTabA closed: new tab title");
});
@ -162,8 +162,8 @@ function testNewWindow() {
is(tabActors.size, 3, "gTabC closed: three tabs in list");
ok(tabActors.has(gFirstActor), "gTabC closed: initial tab present");
info("actors: " + [a.url for (a of tabActors)]);
gActorA = [a for (a of tabActors) if (a !== gFirstActor)][0];
info("actors: " + [...tabActors].map(a => a.url));
gActorA = [...tabActors].filter(a => a !== gFirstActor)[0];
ok(gActorA.url.match(/^data:text\/html;/), "gTabC closed: new tab URL");
is(gActorA.title, "JS Debugger BrowserTabList test page", "gTabC closed: new tab title");
});
@ -191,8 +191,8 @@ function testWindowClosed() {
is(tabActors.size, 2, "gNewWindow closed: two tabs in list");
ok(tabActors.has(gFirstActor), "gNewWindow closed: initial tab present");
info("actors: " + [a.url for (a of tabActors)]);
gActorA = [a for (a of tabActors) if (a !== gFirstActor)][0];
info("actors: " + [...tabActors].map(a => a.url));
gActorA = [...tabActors].filter(a => a !== gFirstActor)[0];
ok(gActorA.url.match(/^data:text\/html;/), "gNewWindow closed: new tab URL");
is(gActorA.title, "JS Debugger BrowserTabList test page", "gNewWindow closed: new tab title");
});

View File

@ -19,7 +19,7 @@ function test() {
gSources = gDebugger.DebuggerView.Sources;
gControllerSources = gDebugger.DebuggerController.SourceScripts;
Task.spawn(function() {
Task.spawn(function*() {
yield waitForSourceShown(gPanel, TAB_URL);
// From this point onward, the source editor's text should never change.

View File

@ -35,7 +35,7 @@ function test() {
};
}(gClient.request));
Task.spawn(function() {
Task.spawn(function*() {
yield waitForSourceShown(gPanel, JS_URL);
// From this point onward, the source editor's text should never change.

View File

@ -29,7 +29,7 @@ function test() {
}
function performTest() {
return Task.spawn(function() {
return Task.spawn(function*() {
yield selectBottomFrame();
testBottomFrame(4);

View File

@ -62,7 +62,7 @@ function performTest() {
gVariablesView.rawObject = test;
gVariablesView.scrollPageSize = 5;
return Task.spawn(function() {
return Task.spawn(function*() {
yield waitForTick();
// Part 0: Test generic focus methods on the variables view.

View File

@ -9,7 +9,7 @@
const TAB_URL = EXAMPLE_URL + "doc_scope-variable-2.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let events = win.EVENTS;

View File

@ -8,7 +8,7 @@
const TAB_URL = EXAMPLE_URL + "doc_scope-variable-2.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let events = win.EVENTS;

View File

@ -9,7 +9,7 @@
const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let bubble = win.DebuggerView.VariableBubble;

View File

@ -9,7 +9,7 @@
const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let bubble = win.DebuggerView.VariableBubble;

View File

@ -8,7 +8,7 @@
const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let bubble = win.DebuggerView.VariableBubble;

View File

@ -8,7 +8,7 @@
const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let bubble = win.DebuggerView.VariableBubble;

View File

@ -9,7 +9,7 @@
const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let bubble = win.DebuggerView.VariableBubble;

View File

@ -10,7 +10,7 @@ const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
function test() {
requestLongerTimeout(2);
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let bubble = win.DebuggerView.VariableBubble;

View File

@ -9,7 +9,7 @@
const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let bubble = win.DebuggerView.VariableBubble;

View File

@ -8,7 +8,7 @@
const TAB_URL = EXAMPLE_URL + "doc_scope-variable.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let events = win.EVENTS;

View File

@ -8,7 +8,7 @@
const TAB_URL = EXAMPLE_URL + "doc_scope-variable-3.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let bubble = win.DebuggerView.VariableBubble;

View File

@ -10,7 +10,7 @@
const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let events = win.EVENTS;

View File

@ -8,7 +8,7 @@
const TAB_URL = EXAMPLE_URL + "doc_watch-expression-button.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let events = win.EVENTS;

View File

@ -9,7 +9,7 @@
const TAB_URL = EXAMPLE_URL + "doc_watch-expression-button.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let events = win.EVENTS;

View File

@ -9,7 +9,7 @@
const TAB_URL = EXAMPLE_URL + "doc_domnode-variables.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let bubble = win.DebuggerView.VariableBubble;

View File

@ -8,7 +8,7 @@
const TAB_URL = EXAMPLE_URL + "doc_frame-parameters.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let bubble = win.DebuggerView.VariableBubble;

View File

@ -9,7 +9,7 @@
const TAB_URL = EXAMPLE_URL + "doc_recursion-stack.html";
function test() {
Task.spawn(function() {
Task.spawn(function*() {
let [tab,, panel] = yield initDebugger(TAB_URL);
let win = panel.panelWin;
let events = win.EVENTS;

View File

@ -170,13 +170,17 @@ FilterView.prototype = {
* Returns the current search operator.
* @return string
*/
get searchOperator() this.searchData[0],
get searchOperator() {
return this.searchData[0];
},
/**
* Returns the current search arguments.
* @return array
*/
get searchArguments() this.searchData[1],
get searchArguments() {
return this.searchData[1];
},
/**
* Clears the text from the searchbox and any changed views.

View File

@ -50,9 +50,10 @@ GlobalSearchView.prototype = Heritage.extend(WidgetMethods, {
* Gets the visibility state of the global search container.
* @return boolean
*/
get hidden()
this.widget.getAttribute("hidden") == "true" ||
this._splitter.getAttribute("hidden") == "true",
get hidden() {
return this.widget.getAttribute("hidden") == "true" ||
this._splitter.getAttribute("hidden") == "true";
},
/**
* Hides and removes all items from this search container.
@ -366,7 +367,9 @@ GlobalResults.prototype = {
/**
* Gets the number of source results in this store.
*/
get matchCount() this._store.length
get matchCount() {
return this._store.length;
}
};
/**
@ -400,7 +403,9 @@ SourceResults.prototype = {
/**
* Gets the number of line results in this store.
*/
get matchCount() this._store.length,
get matchCount() {
return this._store.length;
},
/**
* Expands the element, showing all the added details.
@ -429,21 +434,26 @@ SourceResults.prototype = {
* Gets this element's expanded state.
* @return boolean
*/
get expanded()
this._resultsContainer.getAttribute("hidden") != "true" &&
this._arrow.hasAttribute("open"),
get expanded() {
return this._resultsContainer.getAttribute("hidden") != "true" &&
this._arrow.hasAttribute("open");
},
/**
* Sets this element's expanded state.
* @param boolean aFlag
*/
set expanded(aFlag) this[aFlag ? "expand" : "collapse"](),
set expanded(aFlag) {
this[aFlag ? "expand" : "collapse"]();
},
/**
* Gets the element associated with this item.
* @return nsIDOMNode
*/
get target() this._target,
get target() {
return this._target;
},
/**
* Customization function for creating this item's UI.
@ -547,13 +557,17 @@ LineResults.prototype = {
/**
* Gets the number of word results in this store.
*/
get matchCount() this._matchCount,
get matchCount() {
return this._matchCount;
},
/**
* Gets the element associated with this item.
* @return nsIDOMNode
*/
get target() this._target,
get target() {
return this._target;
},
/**
* Customization function for creating this item's UI.

View File

@ -107,7 +107,7 @@ WatchExpressionsView.prototype = Heritage.extend(WidgetMethods, {
*/
switchExpression: function(aVar, aExpression) {
let expressionItem =
[i for (i of this) if (i.attachment.currentExpression == aVar.name)][0];
[...this].filter(i => i.attachment.currentExpression == aVar.name)[0];
// Remove the watch expression if it's going to be empty or a duplicate.
if (!aExpression || this.getAllStrings().indexOf(aExpression) != -1) {
@ -133,7 +133,7 @@ WatchExpressionsView.prototype = Heritage.extend(WidgetMethods, {
*/
deleteExpression: function(aVar) {
let expressionItem =
[i for (i of this) if (i.attachment.currentExpression == aVar.name)][0];
[...this].filter(i => i.attachment.currentExpression == aVar.name)[0];
// Remove the watch expression.
this.remove(expressionItem);