tl;dr We are thinking about replacing Cu.reportError with console.error,
are there any cases which wouldn't be covered?
I noticed that there are some instances in our code where we have
incorrectly tried to use Cu.reportError in the same way as
console.error. We have tried to use the second argument as an additional
string/standard object rather than the stack object that Cu.reportError
is expecting.
This made me wonder about the differences between the two functions, and
if we could move to the more standard console.error. There is a 10 year
old bug <https://bugzilla.mozilla.org/show_bug.cgi?id=877389> suggesting
that we could replace them.
As far as I can tell:
* In single argument forms, these appear to be virtually identical
when reporting to the browser console.
* Cu.reportError never(?) gets reported to stdout, but console.error
can be (via the devtools.console.stdout.* prefs).
* The two argument form of Cu.reportError, could be replaced by
generating an Error object and assigning the stack property on that
error object.
We could very easily do a direct replacement for the majority of cases
via ESLint tooling.
However, does anyone know of any cases that would not be covered when
switching to console.error?
Mark
--
You received this message because you are subscribed to the Google Groups
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/306461d1-cfdb-d299-e4e1-91ef1f0b26e0%40mozilla.com.