Backed out changeset 7dd13d06f132 (bug 862849) for breaking webconsole tests

This commit is contained in:
Wes Kocher 2013-11-06 15:13:53 -08:00
parent 3ab8921ba4
commit 5e64c6d1a6
8 changed files with 54 additions and 48 deletions

View File

@ -37,8 +37,8 @@ function getAllBreakpoints(dbg) {
let sources = dbg._view.Sources; let sources = dbg._view.Sources;
let { trimUrlLength: trim } = dbg.panelWin.SourceUtils; let { trimUrlLength: trim } = dbg.panelWin.SourceUtils;
for (let source of sources) { for (let source in sources) {
for (let { attachment: breakpoint } of source) { for (let { attachment: breakpoint } in source) {
breakpoints.push({ breakpoints.push({
url: source.value, url: source.value,
label: source.label + ":" + breakpoint.line, label: source.label + ":" + breakpoint.line,

View File

@ -231,8 +231,8 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
* The corresponding breakpoints if found, an empty array otherwise. * The corresponding breakpoints if found, an empty array otherwise.
*/ */
getOtherBreakpoints: function(aLocation = {}, aStore = []) { getOtherBreakpoints: function(aLocation = {}, aStore = []) {
for (let source of this) { for (let source in this) {
for (let breakpointItem of source) { for (let breakpointItem in source) {
let { url, line } = breakpointItem.attachment; let { url, line } = breakpointItem.attachment;
if (url != aLocation.url || line != aLocation.line) { if (url != aLocation.url || line != aLocation.line) {
aStore.push(breakpointItem); aStore.push(breakpointItem);
@ -1340,7 +1340,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]; [i for (i in this) if (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) {
@ -1366,7 +1366,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]; [i for (i in this) if (i.attachment.currentExpression == aVar.name)][0];
// Remove the watch expression. // Remove the watch expression.
this.remove(expressionItem); this.remove(expressionItem);
@ -1998,7 +1998,7 @@ GlobalSearchView.prototype = Heritage.extend(WidgetMethods, {
_createGlobalResultsUI: function(aGlobalResults) { _createGlobalResultsUI: function(aGlobalResults) {
let i = 0; let i = 0;
for (let sourceResults of aGlobalResults) { for (let sourceResults in aGlobalResults) {
if (i++ == 0) { if (i++ == 0) {
this._createSourceResultsUI(sourceResults); this._createSourceResultsUI(sourceResults);
} else { } else {
@ -2123,7 +2123,7 @@ GlobalSearchView.prototype = Heritage.extend(WidgetMethods, {
/** /**
* An object containing all source results, grouped by source location. * An object containing all source results, grouped by source location.
* Iterable via "for (let [location, sourceResults] of globalResults) { }". * Iterable via "for (let [location, sourceResults] in globalResults) { }".
*/ */
function GlobalResults() { function GlobalResults() {
this._store = []; this._store = [];
@ -2150,7 +2150,7 @@ GlobalResults.prototype = {
/** /**
* An object containing all the matched lines for a specific source. * An object containing all the matched lines for a specific source.
* Iterable via "for (let [lineNumber, lineResults] of sourceResults) { }". * Iterable via "for (let [lineNumber, lineResults] in sourceResults) { }".
* *
* @param string aUrl * @param string aUrl
* The target source url. * The target source url.
@ -2291,7 +2291,7 @@ SourceResults.prototype = {
/** /**
* An object containing all the matches for a specific line. * An object containing all the matches for a specific line.
* Iterable via "for (let chunk of lineResults) { }". * Iterable via "for (let chunk in lineResults) { }".
* *
* @param number aLine * @param number aLine
* The target line in the source. * The target line in the source.
@ -2436,10 +2436,12 @@ LineResults.prototype = {
/** /**
* A generator-iterator over the global, source or line results. * A generator-iterator over the global, source or line results.
*/ */
GlobalResults.prototype["@@iterator"] = GlobalResults.prototype.__iterator__ =
SourceResults.prototype["@@iterator"] = SourceResults.prototype.__iterator__ =
LineResults.prototype["@@iterator"] = function*() { LineResults.prototype.__iterator__ = function() {
yield* this._store; for (let item of this._store) {
yield item;
}
}; };
/** /**

View File

@ -615,7 +615,7 @@ StackFramesView.prototype = Heritage.extend(WidgetMethods, {
// Update the context menu to show the currently selected stackframe item // Update the context menu to show the currently selected stackframe item
// as a checked entry. // as a checked entry.
for (let otherItem of this) { for (let otherItem in this) {
if (otherItem != stackframeItem) { if (otherItem != stackframeItem) {
otherItem.attachment.popup.menuitem.removeAttribute("checked"); otherItem.attachment.popup.menuitem.removeAttribute("checked");
} else { } else {

View File

@ -107,8 +107,8 @@ function test() {
} }
function initialChecks() { function initialChecks() {
for (let source of gSources) { for (let source in gSources) {
for (let breakpoint of source) { for (let breakpoint in source) {
ok(gBreakpoints._getAdded(breakpoint.attachment), ok(gBreakpoints._getAdded(breakpoint.attachment),
"All breakpoint items should have corresponding promises (1)."); "All breakpoint items should have corresponding promises (1).");
ok(!gBreakpoints._getRemoving(breakpoint.attachment), ok(!gBreakpoints._getRemoving(breakpoint.attachment),
@ -223,8 +223,8 @@ function test() {
is(!!selectedBreakpoint.attachment.disabled, false, is(!!selectedBreakpoint.attachment.disabled, false,
"The targetted breakpoint should not have been disabled (" + aIndex + ")."); "The targetted breakpoint should not have been disabled (" + aIndex + ").");
for (let source of gSources) { for (let source in gSources) {
for (let otherBreakpoint of source) { for (let otherBreakpoint in source) {
if (otherBreakpoint != selectedBreakpoint) { if (otherBreakpoint != selectedBreakpoint) {
ok(!gBreakpoints._getAdded(otherBreakpoint.attachment), ok(!gBreakpoints._getAdded(otherBreakpoint.attachment),
"There should be no breakpoint client for a disabled breakpoint (9)."); "There should be no breakpoint client for a disabled breakpoint (9).");
@ -235,8 +235,8 @@ function test() {
} }
waitForDebuggerEvents(gPanel, gDebugger.EVENTS.BREAKPOINT_ADDED, 4).then(() => { waitForDebuggerEvents(gPanel, gDebugger.EVENTS.BREAKPOINT_ADDED, 4).then(() => {
for (let source of gSources) { for (let source in gSources) {
for (let someBreakpoint of source) { for (let someBreakpoint in source) {
ok(gBreakpoints._getAdded(someBreakpoint.attachment), ok(gBreakpoints._getAdded(someBreakpoint.attachment),
"There should be a breakpoint client for all enabled breakpoints (11)."); "There should be a breakpoint client for all enabled breakpoints (11).");
is(someBreakpoint.attachment.disabled, false, is(someBreakpoint.attachment.disabled, false,
@ -245,8 +245,8 @@ function test() {
} }
waitForDebuggerEvents(gPanel, gDebugger.EVENTS.BREAKPOINT_REMOVED, 5).then(() => { waitForDebuggerEvents(gPanel, gDebugger.EVENTS.BREAKPOINT_REMOVED, 5).then(() => {
for (let source of gSources) { for (let source in gSources) {
for (let someBreakpoint of source) { for (let someBreakpoint in source) {
ok(!gBreakpoints._getAdded(someBreakpoint.attachment), ok(!gBreakpoints._getAdded(someBreakpoint.attachment),
"There should be no breakpoint client for a disabled breakpoint (13)."); "There should be no breakpoint client for a disabled breakpoint (13).");
is(someBreakpoint.attachment.disabled, true, is(someBreakpoint.attachment.disabled, true,
@ -255,8 +255,8 @@ function test() {
} }
waitForDebuggerEvents(gPanel, gDebugger.EVENTS.BREAKPOINT_ADDED, 5).then(() => { waitForDebuggerEvents(gPanel, gDebugger.EVENTS.BREAKPOINT_ADDED, 5).then(() => {
for (let source of gSources) { for (let source in gSources) {
for (let someBreakpoint of source) { for (let someBreakpoint in source) {
ok(gBreakpoints._getAdded(someBreakpoint.attachment), ok(gBreakpoints._getAdded(someBreakpoint.attachment),
"There should be a breakpoint client for all enabled breakpoints (15)."); "There should be a breakpoint client for all enabled breakpoints (15).");
is(someBreakpoint.attachment.disabled, false, is(someBreakpoint.attachment.disabled, false,
@ -293,8 +293,8 @@ function test() {
ok(!gSources._selectedBreakpointItem, ok(!gSources._selectedBreakpointItem,
"There should be no breakpoint available after removing all breakpoints."); "There should be no breakpoint available after removing all breakpoints.");
for (let source of gSources) { for (let source in gSources) {
for (let otherBreakpoint of source) { for (let otherBreakpoint in source) {
ok(false, "It's a trap!"); ok(false, "It's a trap!");
} }
} }

View File

@ -1008,7 +1008,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
// Apply CSS transforms to each waterfall in this container totalTime // Apply CSS transforms to each waterfall in this container totalTime
// accurately translate and resize as needed. // accurately translate and resize as needed.
for (let { target, attachment } of this) { for (let { target, attachment } in this) {
let timingsNode = $(".requests-menu-timings", target); let timingsNode = $(".requests-menu-timings", target);
let startCapNode = $(".requests-menu-timings-cap.start", target); let startCapNode = $(".requests-menu-timings-cap.start", target);
let endCapNode = $(".requests-menu-timings-cap.end", target); let endCapNode = $(".requests-menu-timings-cap.end", target);
@ -1144,7 +1144,7 @@ RequestsMenuView.prototype = Heritage.extend(WidgetMethods, {
* Reapplies the current waterfall background on all request items. * Reapplies the current waterfall background on all request items.
*/ */
_flushWaterfallBackgrounds: function() { _flushWaterfallBackgrounds: function() {
for (let { target } of this) { for (let { target } in this) {
let waterfallNode = $(".requests-menu-waterfall", target); let waterfallNode = $(".requests-menu-waterfall", target);
waterfallNode.style.backgroundImage = this._cachedWaterfallBackground; waterfallNode.style.backgroundImage = this._cachedWaterfallBackground;
} }

View File

@ -28,9 +28,9 @@ function runTests()
let found = false; let found = false;
outer: for (let scope of sidebar.variablesView) { outer: for (let scope in sidebar.variablesView) {
for (let [, obj] of scope) { for (let [, obj] in scope) {
for (let [, prop] of obj) { for (let [, prop] in obj) {
if (prop.name == "a" && prop.value == "foobarBug636725") { if (prop.name == "a" && prop.value == "foobarBug636725") {
found = true; found = true;
break outer; break outer;

View File

@ -55,7 +55,7 @@ const STR = Services.strings.createBundle(DBG_STRINGS_URI);
/** /**
* A tree view for inspecting scopes, objects and properties. * A tree view for inspecting scopes, objects and properties.
* Iterable via "for (let [id, scope] of instance) { }". * Iterable via "for (let [id, scope] in instance) { }".
* Requires the devtools common.css and debugger.css skin stylesheets. * Requires the devtools common.css and debugger.css skin stylesheets.
* *
* To allow replacing variable or property values in this view, provide an * To allow replacing variable or property values in this view, provide an
@ -1126,7 +1126,7 @@ VariablesView.getterOrSetterDeleteCallback = function(aItem) {
/** /**
* A Scope is an object holding Variable instances. * A Scope is an object holding Variable instances.
* Iterable via "for (let [name, variable] of instance) { }". * Iterable via "for (let [name, variable] in instance) { }".
* *
* @param VariablesView aView * @param VariablesView aView
* The view to contain this scope. * The view to contain this scope.
@ -2077,7 +2077,7 @@ DevToolsUtils.defineLazyPrototypeGetter(Scope.prototype, "_batchItems", Array);
/** /**
* A Variable is a Scope holding Property instances. * A Variable is a Scope holding Property instances.
* Iterable via "for (let [name, property] of instance) { }". * Iterable via "for (let [name, property] in instance) { }".
* *
* @param Scope aScope * @param Scope aScope
* The scope to contain this variable. * The scope to contain this variable.
@ -2867,7 +2867,7 @@ Variable.prototype = Heritage.extend(Scope.prototype, {
/** /**
* A Property is a Variable holding additional child Property instances. * A Property is a Variable holding additional child Property instances.
* Iterable via "for (let [name, property] of instance) { }". * Iterable via "for (let [name, property] in instance) { }".
* *
* @param Variable aVar * @param Variable aVar
* The variable to contain this property. * The variable to contain this property.
@ -2928,11 +2928,13 @@ Property.prototype = Heritage.extend(Variable.prototype, {
/** /**
* A generator-iterator over the VariablesView, Scopes, Variables and Properties. * A generator-iterator over the VariablesView, Scopes, Variables and Properties.
*/ */
VariablesView.prototype["@@iterator"] = VariablesView.prototype.__iterator__ =
Scope.prototype["@@iterator"] = Scope.prototype.__iterator__ =
Variable.prototype["@@iterator"] = Variable.prototype.__iterator__ =
Property.prototype["@@iterator"] = function*() { Property.prototype.__iterator__ = function() {
yield* this._store; for (let item of this._store) {
yield item;
}
}; };
/** /**

View File

@ -405,7 +405,7 @@ ViewHelpers.Prefs.prototype = {
/** /**
* A generic Item is used to describe children present in a Widget. * A generic Item is used to describe children present in a Widget.
* The label, value and description properties are necessarily strings. * The label, value and description properties are necessarily strings.
* Iterable via "for (let childItem of parentItem) { }". * Iterable via "for (let childItem in parentItem) { }".
* *
* @param object aOwnerView * @param object aOwnerView
* The owner view creating this item. * The owner view creating this item.
@ -513,7 +513,7 @@ Item.prototype = {
if (aItem.finalize) { if (aItem.finalize) {
aItem.finalize(aItem); aItem.finalize(aItem);
} }
for (let childItem of aItem) { for (let childItem in aItem) {
aItem.remove(childItem); aItem.remove(childItem);
} }
@ -557,7 +557,7 @@ Item.prototype = {
/** /**
* Some generic Widget methods handling Item instances. * Some generic Widget methods handling Item instances.
* Iterable via "for (let childItem of wrappedView) { }". * Iterable via "for (let childItem in wrappedView) { }".
* *
* Usage: * Usage:
* function MyView() { * function MyView() {
@ -1529,7 +1529,7 @@ this.WidgetMethods = {
if (aItem.finalize) { if (aItem.finalize) {
aItem.finalize(aItem); aItem.finalize(aItem);
} }
for (let childItem of aItem) { for (let childItem in aItem) {
aItem.remove(childItem); aItem.remove(childItem);
} }
@ -1654,7 +1654,9 @@ this.WidgetMethods = {
/** /**
* A generator-iterator over all the items in this container. * A generator-iterator over all the items in this container.
*/ */
Item.prototype["@@iterator"] = Item.prototype.__iterator__ =
WidgetMethods["@@iterator"] = function*() { WidgetMethods.__iterator__ = function() {
yield* this._itemsByElement.values(); for (let [, item] of this._itemsByElement) {
yield item;
}
}; };