Skip to content

Commit

Permalink
Check constructor name
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasBuelens committed Jan 3, 2024
1 parent ac16720 commit 1dd085e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/stub/dom-exception.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ function isDOMExceptionConstructor(ctor: unknown): ctor is DOMExceptionConstruct
if (!(typeof ctor === 'function' || typeof ctor === 'object')) {
return false;
}
if ((ctor as DOMExceptionConstructor).name !== 'DOMException') {
return false;
}
try {
new (ctor as DOMExceptionConstructor)();
return true;
Expand Down

0 comments on commit 1dd085e

Please sign in to comment.