From 5c5df3df94e08f6705d1bee0f8591c0c5e680ec4 Mon Sep 17 00:00:00 2001 From: Steve Orvell Date: Mon, 16 Sep 2013 18:39:06 -0700 Subject: [PATCH] ensure super works on prototype challenged platforms (IE). This ensures we find Element.bind via super. --- src/lib/super.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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