Rob Wu 28d48c8abb Bug 1856464 - Include stack in Assert.rejects r=jmaher
Assert.rejects uses callbacks in a way that the stack no longer includes
the original caller in the stack when the stack is generated.
Consequently, when AssertionError tries to identify the caller, it is
unable to do so, resulting in a `null` stack.

This `null` stack is passed by the SpecialPowers glue to
`do_report_result` in xpcshell/head.js, which doesn't expect a `null`
stack, and consequently the following error is reported:
"TypeError: can't access property "filename", stack is null"

To fix this issue, we save the stack (including the caller) upon
entering `Assert.rejects`, and forward that to `AssertionError`.

Differential Revision: https://phabricator.services.mozilla.com/D189863
2023-10-26 09:59:26 +00:00
..