forked from mirrors/gecko-dev
Bug 1829630 - [bidi] Throw explicit error for missing stacks in script module r=webdriver-reviewers,Sasha
Depends on D176353 Differential Revision: https://phabricator.services.mozilla.com/D176354
This commit is contained in:
parent
93f5685ca6
commit
111dd3a198
1 changed files with 11 additions and 1 deletions
|
|
@ -66,8 +66,18 @@ class ScriptModule extends WindowGlobalBiDiModule {
|
|||
|
||||
#buildExceptionDetails(exception, stack, realm, resultOwnership, options) {
|
||||
exception = this.#toRawObject(exception);
|
||||
const frames = lazy.getFramesFromStack(stack) || [];
|
||||
|
||||
// A stacktrace is mandatory to build exception details and a missing stack
|
||||
// means we encountered an unexpected issue. Throw with an explicit error.
|
||||
if (!stack) {
|
||||
throw new Error(
|
||||
`Missing stack, unable to build exceptionDetails for exception: ${lazy.stringify(
|
||||
exception
|
||||
)}`
|
||||
);
|
||||
}
|
||||
|
||||
const frames = lazy.getFramesFromStack(stack) || [];
|
||||
const callFrames = frames
|
||||
// Remove chrome/internal frames
|
||||
.filter(frame => !lazy.isChromeFrame(frame))
|
||||
|
|
|
|||
Loading…
Reference in a new issue