Bug 897050 - Prefer displayName instead of name; r=fitzgen

This commit is contained in:
Jonathan Fuentes 2013-09-12 09:54:56 -07:00
parent fa026a5be1
commit aa2357bcd8
3 changed files with 5 additions and 3 deletions

View File

@ -668,7 +668,7 @@ let StackFrameUtils = {
getFrameTitle: function(aFrame) {
if (aFrame.type == "call") {
let c = aFrame.callee;
return (c.name || c.userDisplayName || c.displayName || "(anonymous)");
return (c.userDisplayName || c.displayName || c.name || "(anonymous)");
}
return "(" + aFrame.type + ")";
},
@ -702,7 +702,7 @@ let StackFrameUtils = {
case "function":
let f = aEnv.function;
label += " [" +
(f.name || f.userDisplayName || f.displayName || "(anonymous)") +
(f.userDisplayName || f.displayName || f.name || "(anonymous)") +
"]";
break;
}

View File

@ -2549,7 +2549,8 @@ ObjectActor.prototype = {
if (this.obj.class === "Function") {
if (this.obj.name) {
g.name = this.obj.name;
} else if (this.obj.displayName) {
}
if (this.obj.displayName) {
g.displayName = this.obj.displayName;
}

View File

@ -30,6 +30,7 @@ function test_named_function()
do_check_eq(args[0].class, "Function");
do_check_eq(args[0].name, "stopMe");
do_check_eq(args[0].displayName, "stopMe");
let objClient = gThreadClient.pauseGrip(args[0]);
objClient.getParameterNames(function(aResponse) {