Enable ESLint rule no-throw-literal in toolkit/
Categories
(Toolkit :: General, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: Kwan, Assigned: Kwan)
References
Details
Attachments
(2 files)
no-throw-literal helps ensure that when we do throw errors, they come with stack traces that help track down the source of the error.
Assignee | ||
Comment 1•5 years ago
|
||
Result of running:
$ mach eslint -funix toolkit/ | sed -Ee 's/:.+//' - | xargs sed -E
-e 's/throw ((["])[^"]+\2);/throw new Error(\1);/g' \ -e 's/throw ((["
])[^"]+\2 + [^ ";]+);/throw new Error(\1);/g'
-e 's/throw (/throw new Error(/g' -i
...and then reverting a couple of places where comments were touched,
as well as changes to toolkit/components/ctypes/tests/unit/test_jsctypes.js
that required expectation changes to
toolkit/components/ctypes/tests/chrome/test_ctypes.xul
Assignee | ||
Comment 2•5 years ago
|
||
Includes an otherwise-automated change to test_jsctypes.js that required an
expectation change in test_ctypes.xul.
Updated•5 years ago
|
Pushed by aiakab@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5e262e96eac7 toolkit/ automated ESLint no-throw-literal fixes. r=Standard8 https://hg.mozilla.org/integration/autoland/rev/64a7117d2260 toolkit/ manual ESLint no-throw-literal fixes. r=Standard8
Comment 4•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5e262e96eac7
https://hg.mozilla.org/mozilla-central/rev/64a7117d2260
Description
•