On Thursday, September 22, 2016 at 2:58:46 PM UTC+10, Daniel Holbert wrote: > On 09/21/2016 08:41 PM, Samael Wang wrote: > > The NS_ASSERTION document [1] says "Don't use NS_ASSERTION", which could be > > a bit confusing that now some of the similar named macros may be deprecated > > but some are new and encouraged. > > I think that document's advice is too severe. > > roc made a compelling case for *preferring* non-fatal assertions (i.e. > NS_ASSERTION) in many scenarios, particularly when failure is not > catastrophic. See his blog post here for more details: > http://robert.ocallahan.org/2011/12/case-for-non-fatal-assertions.html > > I found (and still find) his argument there quite compelling. I think > it's important that debug builds are able to proceed past (inevitable) > unexpected-but-not-horrible conditions -- while at the same time, > perhaps shouting about those unexpected conditions noisily so that > people can report them if they care to do so (and so that test suites fail). > > Personally, I use *both* MOZ_ASSERT and NS_ASSERTION, in different > scenarios, depending on how catastrophic it would be if the asserted > condition doesn't hold, and depending on how sure I am that the > condition does-currently & must-always-in-the-future hold true. > [...] > ~Daniel
Sitting on the shoulders of giants, an idea, in the unlikely case it's not been thought of yet: How about an assertion that files a crash report (or something lighter like a telemetry blip) but does not actually crash? g. _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform