conditional reference to HTMLIFrameElement

This will prevent an exception being thrown in workers.
This commit is contained in:
David Reed 2022-11-23 13:57:14 -05:00
parent 26d17cd241
commit 602414a586
No known key found for this signature in database
GPG key ID: 2211691D8A1EE72F

View file

@ -700,7 +700,10 @@ function __uvHook(window, config = {}, bare = '/bare/') {
}, },
}); });
const contentWindowGet = Object.getOwnPropertyDescriptor( // HTMLIFrameElement may not be defined (workers)
const contentWindowGet =
HTMLIFrameElement &&
Object.getOwnPropertyDescriptor(
HTMLIFrameElement.prototype, HTMLIFrameElement.prototype,
'contentWindow' 'contentWindow'
).get; ).get;