[meta] Improve error reporting code
Categories
(Core :: JavaScript Engine, task, P3)
Tracking
()
People
(Reporter: evilpie, Unassigned)
References
(Depends on 9 open bugs)
Details
(Keywords: meta)
Our current error reporting code is very old and quite complicated. Here is a first list of ideas on how to improve this:
Remove "extra" warningsRemove "werror"Remove JSREPORT_* flags- Separate error and warning reporting
- Simpler error reporting API like
ThrowError(cx, JSMSG_UNDECLARED_VAR, "xyz");
- Make JSErrorReport type better with ownership and less manual memory management
- UTF8 vs Latin1
Updated•1 year ago
|
Comment 1•1 year ago
|
||
Note that ThrowError
ought be split up into ThrowError
, ThrowTypeError
, ThrowRangeError
, and so on, making error numbers either not encode/dictate an error type or asserting at runtime if there's a mismatch. (We already do the latter in self-hosted code for its forms of these functions.)
And all these functions, and the error-reporting internals, need at some point to be adjusted to not use varargs but rather template varargs, that cons the trailing arguments up into a list structure of some sort. (This may or may not be slightly afield of this bug's purpose, unclear.)
Reporter | ||
Comment 2•1 year ago
|
||
I like the idea. DOM code uses functions with the same name and uses a template parameter to statically assert the correct error type.
One annoying thing about SpiderMonkey is that we might need 4 variants: ASCII, Latin1, UTF-8 and Unicode/~UCS-2.
Description
•