From 32b6d0f2dc8fcd71e6b2518b9bbe0c41c64a80b3 Mon Sep 17 00:00:00 2001 From: "baohua.kang" Date: Wed, 29 Nov 2023 09:46:11 +0800 Subject: [PATCH] fix: fix sandbox/with/document.ts, MicroDocument.hasInstance throw error when target is null --- src/sandbox/with/document.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sandbox/with/document.ts b/src/sandbox/with/document.ts index 919a634ed..218db3aec 100644 --- a/src/sandbox/with/document.ts +++ b/src/sandbox/with/document.ts @@ -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 }