Closed Bug 586355 Opened 14 years ago Closed 9 years ago

use NS_ASSERT

Categories

(Firefox Graveyard :: Panorama, defect, P4)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX
Future

People

(Reporter: iangilman, Unassigned)

References

Details

(Whiteboard: b5)

We're currently using our own assert in TabCandy. Dao has suggested we switch it to NS_ASSERT, which sounds good, but we should make sure it suits our needs. It can be found in: toolkit/content/debug.js To use it, you need: Components.utils.import("resource://gre/modules/debug.js"); The call order is the same, but the behavior is slightly different.
Depends on: 582023
Whiteboard: b4
Whiteboard: b4 → b5
Mass moving all Tab Candy bugs from Mozilla Labs to Firefox::Tab Candy. Filter the bugmail spam with "tabcandymassmove".
Product: Mozilla Labs → Firefox
Target Milestone: -- → ---
QA Contact: tabcandy → tabcandy
I agree this is something we should do. Ian, how does the behavior change when we move to NS_ASSERT? Will it then dump, or only print on debug, or what?
Priority: -- → P2
From debug.js: * This function provides a simple assertion function for JavaScript. * If the condition is true, this function will do nothing. If the * condition is false, then the message will be printed to the console * and an alert will appear showing a stack trace, so that the (alpha * or nightly) user can file a bug containing it. For future enhancements, * see bugs 330077 and 330078. I've gotten into using Utils.assertThrow, which sends a message to the console and also throws an exception. NS_ASSERT doesn't have anything like this.
Priority: P2 → P4
(In reply to comment #3) > I've gotten into using Utils.assertThrow, which sends a message to the console > and also throws an exception. NS_ASSERT doesn't have anything like this. Thanks. But we would be able to know what line it came from, right? Of course that's a tad easier if tabview.js didn't get collapsed, but I don't think it's the end of the world...? Particularly now that we have function names on everything which should show up in the trace.
Beyond that important difference are that NS_ASSERT a) /alerts/ the users, so it's ensured that users will notice this and can file a bug on it and b) doesn't affect release builds at all.
Target Milestone: --- → Future
Yes, Utils.assert and Utils.assertThrow both include full stack traces, so you know what line number it came from. Hopefully NS_ASSERT provides the same in the log, not just the alert, but I don't know. One possibility would be to replace Utils.assert with NS_ASSERT, but still keep Utils.assertThrow, with its added functionality, and have it call NS_ASSERT.
Panorama has been removed from Firefox 45, currently in Beta and scheduled for release on March 7th. As such, I'm closing all existing Panorama bugs. If you are still using Panorama, you will see a deprecation message in Firefox 44, and when 45 is released your tab group data will be migrated to bookmarks, with a folder for each group. There are also a few addons offering similar functionality. See https://support.mozilla.org/en-US/kb/tab-groups-removal for more info. We're removing Panorama because it has extremely low usage (about 0.01% of users), and has a large number of bugs and usability issues. The cost of fixing all those issues is far too high to justify, and so we'll instead be focusing our time and energy on improving other parts of Firefox.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.