Access to super method and constructor like Java.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
package.json
superclass.js

README.md

jssuper

You can call method and constructor of super class like Java.

Install

npm install superclass

Initalize

node:

//add option "--harmony_proxies"
require('superclass');

web:

<script src="path/to/superclass.js"></script>

Usage

Call constructor:

function A(message) {
    this.message = message;
}

function B() {
    this.super('hello!');
}
B.prototype = Object.create(A.prototype);

Call method:

A.prototype.foo = function() {
    return '#' + this.message + '#';
};

B.prototype.foo = function() {
    return '(' + this.super.foo() + ')';
};