Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Access to super method and constructor like Java.
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

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() + ')';
};
Something went wrong with that request. Please try again.