Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a .base property to class constructors for easy base class access #2

Closed
benjamn opened this issue Jun 15, 2013 · 0 comments
Closed

Comments

@benjamn
Copy link
Owner

benjamn commented Jun 15, 2013

This would enable the following style as an alternative to this._super:

var SubClass = BaseClass.extend({
    init: function(arg) {
        // These should all be equivalent:
        SubClass.base.init.call(this, arg);
        SubClass.base.init.apply(this, arguments);
        this._super(arg);
        this._super.apply(this, arguments);
    }
});

// Just to be perfectly clear:
assert(SubClass.base === BaseClass.prototype);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant