Skip to content

Commit

Permalink
fix: fix sandbox/with/document.ts, MicroDocument.hasInstance throw er…
Browse files Browse the repository at this point in the history
…ror when target is null
  • Loading branch information
baohua.kang committed Nov 29, 2023
1 parent 3fd755c commit 32b6d0f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sandbox/with/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ function createMicroDocument (appName: string, proxyDocument: Document): Functio
class MicroDocument {
static [Symbol.hasInstance] (target: unknown) {
let proto = target
while (proto = Object.getPrototypeOf(proto)) {
while (proto) {
proto = Object.getPrototypeOf(proto)
if (proto === MicroDocument.prototype) {
return true
}
Expand Down

0 comments on commit 32b6d0f

Please sign in to comment.