Closed Bug 1439677 Opened 2 years ago Closed 2 years ago

Make `console.assert` print the stack to stdout

Categories

(DevTools :: Console, defect, P3)

defect

Tracking

(firefox60 fixed)

RESOLVED FIXED
Firefox 60
Tracking Status
firefox60 --- fixed

People

(Reporter: bgrins, Assigned: baku)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

STR: Run this in any script (i.e. browser.js)

var c = console.createInstance();
function a() {
  c.assert(false, "b");
}
a();

Expected - some kind of stack trace like:
  b  browser.js:10:3
  a chrome://browser/content/browser.js:10:3
  <anonymous> chrome://browser/content/browser.js:12:1
  <anonymous> chrome://browser/content/browser.xul:82:3

Actual - no stack trace in stdout:
  console.assert: "b"
Priority: -- → P3
Blocks: 1439689
Attached patch console2.patchSplinter Review
Assignee: nobody → amarchesini
Attachment #8952791 - Flags: review?(bgrinstead)
Comment on attachment 8952791 [details] [diff] [review]
console2.patch

Review of attachment 8952791 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks!
Attachment #8952791 - Flags: review?(bgrinstead) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ca3d342c3b15
Console.assert() should print the stack to stdout, r=bgrins
https://hg.mozilla.org/mozilla-central/rev/ca3d342c3b15
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 60
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.