This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(merge): ensure that jqlite->jqlite and DOM->DOM
Previously we were wrapping DOM elements into jqlite objects when cloning and vice versa. Fixes #12286 (comment)
- Loading branch information
1 parent
4ff6c85
commit 75292a6
Showing
2 changed files
with
5 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -360,8 +360,10 @@ function baseExtend(dst, objs, deep) { | |
dst[key] = new Date(src.valueOf()); | ||
} else if (isRegExp(src)) { | ||
dst[key] = new RegExp(src); | ||
} else if (src.nodeName) { | ||
dst[key] = src.cloneNode(true); | ||
} else if (isElement(src)) { | ||
dst[key] = src[0] ? jqLite(src).clone()[0] : jqLite(src).clone(); | ||
dst[key] = jqLite(src).clone(); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
petebacondarwin
Author
Contributor
|
||
} else { | ||
if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {}; | ||
baseExtend(dst[key], [src], true); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Minor, but couldn't we just do
src.clone()
? Or is there some hidden gotcha ?