Match-id-ebfb7eb1a6693fb72c23d8ba7798ee6f1ba9772d

This commit is contained in:
* 2022-01-26 14:53:01 +08:00 committed by *
parent d074f507fb
commit d8f6349c31
1 changed files with 7 additions and 4 deletions

View File

@ -110,9 +110,12 @@ function extendAttribute(target, source) {
'deltaX', 'deltaY', 'deltaZ', 'deltaMode',
];
attributes.forEach(attr => {
if (typeof source[attr] !== 'undefined') {
if (typeof source[attr] === 'function') {
const length = attributes.length;
for (let i = 0; i < length; i++) {
const attr = attributes[i];
const type = source[attr];
if (type !== 'undefined') {
if (type === 'function') {
target[attr] = function() {
return source[attr].apply(source, arguments);
};
@ -120,5 +123,5 @@ function extendAttribute(target, source) {
target[attr] = source[attr];
}
}
})
}
}