Skip to content

Commit

Permalink
Cleanup dispatch_super runtime helper
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Aug 2, 2013
1 parent 8c43aa4 commit e9a8db5
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions corelib/opal/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,20 +298,16 @@

// Super dispatcher
Opal.dispatch_super = function(obj, jsid, args, defs) {
var dispatcher;

if (defs) {
if (obj._isClass) {
return defs._super['$' + jsid].apply(obj, args);
}
else {
return obj._klass._proto['$' + jsid].apply(obj, args);
}
}
if (obj._isClass) {
return obj._klass['$' + jsid].apply(obj, args);
dispatcher = obj._isClass ? defs._super : obj._klass._proto;
}
else {
return obj._klass._super._proto['$' + jsid].apply(obj, args);
dispatcher = obj._isClass ? obj._klass : obj._klass._super._proto;
}

return dispatcher['$' + jsid].apply(obj, args);
};

// return helper
Expand Down

0 comments on commit e9a8db5

Please sign in to comment.