Skip to content

Commit 5c5df3d

Browse files
committed
ensure super works on prototype challenged platforms (IE). This ensures we find Element.bind via super.
1 parent 6180e9a commit 5c5df3d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/lib/super.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,17 @@
5656
return fn.apply(this, arrayOfArgs || []);
5757
}
5858
};
59-
6059
function nextSuper(proto, name, caller) {
6160
// look for an inherited prototype that implements name
62-
while (proto &&
63-
(!proto.hasOwnProperty(name) || proto[name] === caller)) {
61+
while (proto) {
62+
if ((proto[name] !== caller) && proto[name]) {
63+
return proto;
64+
}
6465
proto = getPrototypeOf(proto);
6566
}
66-
return proto;
6767
};
6868

69+
6970
function memoizeSuper(method, name, proto) {
7071
// find and cache next prototype containing `name`
7172
// we need the prototype so we can do another lookup

0 commit comments

Comments
 (0)