Skip to content

Commit 32ae99b

Browse files
fix(core): don't extend html elements (#4691)
* fix(core): dont extend html elements Co-authored-by: Vladimir Kharlampidi <[email protected]>
1 parent 0d578b0 commit 32ae99b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/utils/utils.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,15 @@ function isObject(o) {
9595
function extend(...args) {
9696
const to = Object(args[0]);
9797
const noExtend = ['__proto__', 'constructor', 'prototype'];
98+
// eslint-disable-next-line
99+
const HTMLElement = typeof window !== 'undefined' ? window.HTMLElement : undefined;
98100
for (let i = 1; i < args.length; i += 1) {
99101
const nextSource = args[i];
100-
if (nextSource !== undefined && nextSource !== null) {
102+
if (
103+
nextSource !== undefined &&
104+
nextSource !== null &&
105+
!(HTMLElement && nextSource instanceof HTMLElement)
106+
) {
101107
const keysArray = Object.keys(Object(nextSource)).filter((key) => noExtend.indexOf(key) < 0);
102108
for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
103109
const nextKey = keysArray[nextIndex];

0 commit comments

Comments
 (0)