Bug 1258154 - Open functions in variables view if they were returned from console evaluation. r=jlongster
authorBrian Grinstead <bgrinstead@mozilla.com>
Wed, 30 Mar 2016 18:30:05 -0700
changeset 291325 85199a7b852fe6729f5708f56a31e6a368ddc009
parent 291324 b932cef38db8ae5957d2b49a4f47f067938a09a0
child 291326 712a70746d183ee33e00bc06efd48de25b7332a7
push id74545
push userkwierso@gmail.com
push dateFri, 01 Apr 2016 23:05:42 +0000
treeherdermozilla-inbound@c410d4e20586 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlongster
bugs1258154
milestone48.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 1258154 - Open functions in variables view if they were returned from console evaluation. r=jlongster MozReview-Commit-ID: Cv9srKvAWdg
devtools/client/webconsole/console-output.js
devtools/client/webconsole/test/browser_console_variables_view.js
--- a/devtools/client/webconsole/console-output.js
+++ b/devtools/client/webconsole/console-output.js
@@ -2774,17 +2774,17 @@ Widgets.ObjectRenderers.add({
       shown++;
     }
 
     this._text(")");
   },
 
   _onClick: function () {
     let location = this.objectActor.location;
-    if (location) {
+    if (location && IGNORED_SOURCE_URLS.indexOf(location.url) === -1) {
       this.output.openLocationInDebugger(location);
     }
     else {
       this.openObjectInVariablesView();
     }
   }
 }); // Widgets.ObjectRenderers.byClass.Function
 
--- a/devtools/client/webconsole/test/browser_console_variables_view.js
+++ b/devtools/client/webconsole/test/browser_console_variables_view.js
@@ -16,16 +16,37 @@ var hud;
 
 add_task(function* () {
   yield loadTab(TEST_URI);
 
   hud = yield openConsole();
 
   gWebConsole = hud;
   gJSTerm = hud.jsterm;
+
+  let msg = yield gJSTerm.execute("(function foo(){})");
+
+  ok(msg, "output message found");
+  ok(msg.textContent.includes("function foo()"),
+                              "message text check");
+
+  executeSoon(() => {
+    EventUtils.synthesizeMouse(msg.querySelector("a"), 2, 2, {}, hud.iframeWindow);
+  });
+
+  let varView = yield hud.jsterm.once("variablesview-fetched");
+  ok(varView, "object inspector opened on click");
+
+  yield findVariableViewProperties(varView, [{
+    name: "name",
+    value: "foo",
+  }], { webconsole: hud });
+});
+
+add_task(function* () {
   let msg = yield gJSTerm.execute("fooObj");
 
   ok(msg, "output message found");
   ok(msg.textContent.includes('{ testProp: "testValue" }'),
                               "message text check");
 
   let anchor = msg.querySelector("a");
   ok(anchor, "object link found");