From e66d6778e077a7a5ea09ba0c44a669fea3d7bfe1 Mon Sep 17 00:00:00 2001 From: kuangthree Date: Sun, 7 Jan 2024 14:51:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9get.copy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/get/index.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/noname/get/index.js b/noname/get/index.js index 69d0e6009..c41c21fda 100644 --- a/noname/get/index.js +++ b/noname/get/index.js @@ -824,14 +824,8 @@ export class Get extends Uninstantable { const constructor = obj.constructor; let target; if (!canTranverse[getType(obj)]) { - try { - // @ts-ignore - target = new constructor(obj); - } catch (error) { - if (obj instanceof HTMLElement) { - target = obj.cloneNode(true); // 不能cloneNode就寄吧,累了 - } else throw error - } + target = obj; + return target; } // @ts-ignore else target = constructor ? new constructor() : Object.create(null);