On Mon, Feb 26, 2018 at 7:02 PM, Brian Grinstead <bgrinst...@mozilla.com> wrote:
> console.assert doesn't throw an exception, and neither does NS_ASSERT. So I 
> don’t think replacing consumers with exceptions is correct if we want to keep 
> the current behavior. But I guess the intent for places code in bug 1431050 
> is to change the behavior and make those assertions throw?

By looking at the patch, some consumers used it wrongly expecting it
to interrupt the code (that likely threw a few lines later). While
other code threw an exception explicitly after NS_ASSERT.
Thus the common need seems to be "print a stack somewhere and throw".
For that we can just wrap console.assert into a local util that
throws, it's not a problem.
Afaik, the only other advantage of NS_ASSERT was to make the assertion
very visible to Nightly users, so they could report a bug. But that
also had downsides.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to