Bug 1812141 Comment 4 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

The error occurs because of this assertion: https://searchfox.org/mozilla-central/rev/5ccb73c0217d1710b10d6e6e297cf3396d10ec23/toolkit/components/utils/test/unit/test_ClientEnvironment.js#82-83. If we read the entire message for the error caught in the catch block, it reads: `"Error: Failed to load resource:///modules/AttributionCode.sys.mjs"`. The test expects a failure, but it appears that the error types a bit after conversion to an ESM. So the assertion fails because we're assuming a NS error result; instead we're just reading `"Error"`. There's already support for ns errors though, as suggested, for example, by: https://searchfox.org/mozilla-central/rev/5ccb73c0217d1710b10d6e6e297cf3396d10ec23/js/xpconnect/tests/unit/test_import_es6_modules.js#22,29.

I suspect the fix is to update the assertion for that test in `unit/test_ClientEnvironment.js` by ensuring that `ex.result` == `Cr.NS_ERROR_FILE_NOT_FOUND` instead.
The error occurs because of this assertion: https://searchfox.org/mozilla-central/rev/5ccb73c0217d1710b10d6e6e297cf3396d10ec23/toolkit/components/utils/test/unit/test_ClientEnvironment.js#82-83. If we read the entire message for the error caught in the catch block, it reads: `"Error: Failed to load resource:///modules/AttributionCode.sys.mjs"`. The test expects a failure, but it appears that the error type changes a bit after conversion to an ESM. So the assertion fails because we're assuming a NS error result; instead we're just reading `"Error"`. There's already support for ns errors though, as suggested, for example, by: https://searchfox.org/mozilla-central/rev/5ccb73c0217d1710b10d6e6e297cf3396d10ec23/js/xpconnect/tests/unit/test_import_es6_modules.js#22,29.

I suspect the fix is to update the assertion for that test in `unit/test_ClientEnvironment.js` by ensuring that `ex.result` == `Cr.NS_ERROR_FILE_NOT_FOUND` instead.

Back to Bug 1812141 Comment 4