Skip to content

Commit 48003bf

Browse files
author
artra
committed
fix inherited function properties
1 parent 4fabf69 commit 48003bf

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

blocks-common/i-jquery/__inherit/i-jquery__inherit.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,20 @@ function override(base, result, add) {
5757
if($.isFunction(prop) &&
5858
(!hasIntrospection || prop.toString().indexOf('.__base') > -1)) {
5959

60-
var baseMethod = base[name] || function() {};
61-
result[name] = function() {
62-
var baseSaved = this.__base;
63-
this.__base = baseMethod;
64-
var result = prop.apply(this, arguments);
65-
this.__base = baseSaved;
66-
return result;
67-
};
60+
var baseMethod = base[name] || function() {},
61+
wrapper = function() {
62+
var baseSaved = this.__base;
63+
this.__base = baseMethod;
64+
var result = prop.apply(this, arguments);
65+
this.__base = baseSaved;
66+
return result;
67+
};
68+
69+
for (var functionProperty in prop) {
70+
if (prop.hasOwnProperty(functionProperty)) {
71+
wrapper[functionProperty] = prop[functionProperty];
72+
}
73+
}
6874

6975
}
7076
else {

0 commit comments

Comments
 (0)