Bug 1167957 - Remove spidermonkey specific JS from debugger

This commit is contained in:
Patrick Brosset 2015-05-25 09:17:26 +02:00
Родитель 20b1bf8936
Коммит e2db77577a
50 изменённых файлов: 143 добавлений и 96 удалений

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -8,7 +8,7 @@ const ADDON_URL = EXAMPLE_URL + "addon3.xpi";
let gClient; let gClient;
function test() { function test() {
Task.spawn(function () { Task.spawn(function*() {
let addon = yield addAddon(ADDON_URL); let addon = yield addAddon(ADDON_URL);
let addonDebugger = yield initAddonDebugger(ADDON_URL); let addonDebugger = yield initAddonDebugger(ADDON_URL);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -107,7 +107,7 @@ WatchExpressionsView.prototype = Heritage.extend(WidgetMethods, {
*/ */
switchExpression: function(aVar, aExpression) { switchExpression: function(aVar, aExpression) {
let expressionItem = 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. // Remove the watch expression if it's going to be empty or a duplicate.
if (!aExpression || this.getAllStrings().indexOf(aExpression) != -1) { if (!aExpression || this.getAllStrings().indexOf(aExpression) != -1) {
@ -133,7 +133,7 @@ WatchExpressionsView.prototype = Heritage.extend(WidgetMethods, {
*/ */
deleteExpression: function(aVar) { deleteExpression: function(aVar) {
let expressionItem = 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. // Remove the watch expression.
this.remove(expressionItem); this.remove(expressionItem);