修改get.copy
This commit is contained in:
parent
05d148d10e
commit
e66d6778e0
|
@ -824,14 +824,8 @@ export class Get extends Uninstantable {
|
||||||
const constructor = obj.constructor;
|
const constructor = obj.constructor;
|
||||||
let target;
|
let target;
|
||||||
if (!canTranverse[getType(obj)]) {
|
if (!canTranverse[getType(obj)]) {
|
||||||
try {
|
target = obj;
|
||||||
// @ts-ignore
|
return target;
|
||||||
target = new constructor(obj);
|
|
||||||
} catch (error) {
|
|
||||||
if (obj instanceof HTMLElement) {
|
|
||||||
target = obj.cloneNode(true); // 不能cloneNode就寄吧,累了
|
|
||||||
} else throw error
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
else target = constructor ? new constructor() : Object.create(null);
|
else target = constructor ? new constructor() : Object.create(null);
|
||||||
|
|
Loading…
Reference in New Issue