This has now landed in Bug 1431050 - remaining consumers were either
migrated to console.assert or changed to throw an exception.
You can continue to use console.assert instead of NS_ASSERT in JS. If you
find a case where console logging from chrome code doesn't do what you
expect please let me know.
On Mon, Feb 26, 2018 at 10:24 AM, Marco Bonardo <mbona...@mozilla.com>
> On Mon, Feb 26, 2018 at 7:02 PM, Brian Grinstead <bgrinst...@mozilla.com>
> > 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