diff --git a/src/lib/super.js b/src/lib/super.js index 4eb2374969..1b552cf1b2 100644 --- a/src/lib/super.js +++ b/src/lib/super.js @@ -56,16 +56,17 @@ return fn.apply(this, arrayOfArgs || []); } }; - function nextSuper(proto, name, caller) { // look for an inherited prototype that implements name - while (proto && - (!proto.hasOwnProperty(name) || proto[name] === caller)) { + while (proto) { + if ((proto[name] !== caller) && proto[name]) { + return proto; + } proto = getPrototypeOf(proto); } - return proto; }; + function memoizeSuper(method, name, proto) { // find and cache next prototype containing `name` // we need the prototype so we can do another lookup