Bug 1306622 - New console frontend: Fix stacktrace expandable closure. r=me
authorLin Clark <lclark@mozilla.com>
Sun, 02 Oct 2016 15:16:49 -0700
changeset 359155 d94f92d3dc02d8c3094ef55621393f56de56a204
parent 359154 c4704a0ce400f59397ad3101402f9ad5ece1fdfb
child 359156 cf5c96ed4ae6d6d6968a5e1bf4f97a2bb070500a
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-beta@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1306622
milestone52.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 1306622 - New console frontend: Fix stacktrace expandable closure. r=me MozReview-Commit-ID: DugEHmQvbXd
devtools/client/webconsole/new-console-output/components/message.js
--- a/devtools/client/webconsole/new-console-output/components/message.js
+++ b/devtools/client/webconsole/new-console-output/components/message.js
@@ -64,24 +64,21 @@ function Message(props) {
 
   const icon = MessageIcon({level});
 
   // Figure out if there is an expandable part to the message.
   let attachment = null;
   if (props.attachment) {
     attachment = props.attachment;
   } else if (stacktrace) {
-    if (open) {
-      attachment = dom.div({ className: "stacktrace devtools-monospace" },
-        StackTrace({
-          stacktrace: stacktrace,
-          onViewSourceInDebugger: onViewSourceInDebugger
-        })
-      );
-    }
+    const child = open ? StackTrace({
+      stacktrace: stacktrace,
+      onViewSourceInDebugger: onViewSourceInDebugger
+    }) : null;
+    attachment = dom.div({ className: "stacktrace devtools-monospace" }, child);
   }
 
   // If there is an expandable part, make it collapsible.
   let collapse = null;
   if (attachment) {
     collapse = CollapseButton({
       open,
       onClick: function () {