Bug 819049: JS debugging protocol: use 'name', 'displayName', and 'userDisplayName' properties on function grips. r=past
authorJim Blandy <jimb@mozilla.com>
Fri, 14 Dec 2012 10:26:47 -0800 (2012-12-14)
changeset 116092 3686e1e8845fc2e089ee40852649018bdf264312
parent 116091 909ffcf23f838bd1842add5fe9e01fab4a56602e
child 116093 62d11f7658cce8e6c77da5f7702e7d913b61b8f4
push id24043
push userryanvm@gmail.com
push dateSat, 15 Dec 2012 21:18:16 +0000 (2012-12-15)
treeherdermozilla-central@c8a1314aa449 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs819049
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 819049: JS debugging protocol: use 'name', 'displayName', and 'userDisplayName' properties on function grips. r=past
browser/devtools/debugger/debugger-controller.js
browser/devtools/debugger/debugger-panes.js
toolkit/devtools/debugger/tests/unit/test_frameactor-01.js
toolkit/devtools/debugger/tests/unit/test_frameactor-04.js
--- a/browser/devtools/debugger/debugger-controller.js
+++ b/browser/devtools/debugger/debugger-controller.js
@@ -922,17 +922,19 @@ StackFrames.prototype = {
 
     let label = L10N.getFormatStr("scopeLabel", [name]);
     switch (aEnv.type) {
       case "with":
       case "object":
         label += " [" + aEnv.object.class + "]";
         break;
       case "function":
-        label += " [" + aEnv.functionName + "]";
+        let f = aEnv.function;
+        label += " [" + (f.name || f.userDisplayName || f.displayName ||
+                         "(anonymous)") + "]";
         break;
     }
     return label;
   },
 
   /**
    * Adds the specified stack frame to the list.
    *
--- a/browser/devtools/debugger/debugger-panes.js
+++ b/browser/devtools/debugger/debugger-panes.js
@@ -133,17 +133,18 @@ let StackFrameUtils = {
    * Create a textual representation for the specified stack frame
    * to display in the stack frame container.
    *
    * @param object aFrame
    *        The stack frame to label.
    */
   getFrameTitle: function SFU_getFrameTitle(aFrame) {
     if (aFrame.type == "call") {
-      return aFrame.calleeName || "(anonymous)";
+      let c = aFrame.callee;
+      return (c.name || c.userDisplayName || c.displayName || "(anonymous)");
     }
     return "(" + aFrame.type + ")";
   }
 };
 
 /**
  * Functions handling the breakpoints UI.
  */
--- a/toolkit/devtools/debugger/tests/unit/test_frameactor-01.js
+++ b/toolkit/devtools/debugger/tests/unit/test_frameactor-01.js
@@ -23,17 +23,17 @@ function run_test()
   do_test_pending();
 }
 
 function test_pause_frame()
 {
   gThreadClient.addOneTimeListener("paused", function(aEvent, aPacket) {
     do_check_true(!!aPacket.frame);
     do_check_true(!!aPacket.frame.actor);
-    do_check_eq(aPacket.frame.calleeName, "stopMe");
+    do_check_eq(aPacket.frame.callee.name, "stopMe");
     gThreadClient.resume(function() {
       finishClient(gClient);
     });
   });
 
   gDebuggee.eval("(" + function() {
     function stopMe() {
       debugger;
--- a/toolkit/devtools/debugger/tests/unit/test_frameactor-04.js
+++ b/toolkit/devtools/debugger/tests/unit/test_frameactor-04.js
@@ -20,25 +20,25 @@ function run_test()
       test_pause_frame();
     });
   });
   do_test_pending();
 }
 
 var gFrames = [
   // Function calls...
-  { type: "call", calleeName: "depth3" },
-  { type: "call", calleeName: "depth2" },
-  { type: "call", calleeName: "depth1" },
+  { type: "call", callee: { name: "depth3" } },
+  { type: "call", callee: { name: "depth2" } },
+  { type: "call", callee: { name: "depth1" } },
 
   // Anonymous function call in our eval...
-  { type: "call", calleeName: undefined },
+  { type: "call", callee: { name: undefined } },
 
   // The eval itself.
-  { type: "eval", calleeName: undefined },
+  { type: "eval", callee: { name: undefined } },
 ];
 
 var gSliceTests = [
   { start: 0, count: undefined, resetActors: true },
   { start: 0, count: 1 },
   { start: 2, count: 2 },
   { start: 1, count: 15 },
   { start: 15, count: undefined },