superclass
v0.1.0
Published
Access to super method and constructor like Java.
Downloads
8
Readme
jssuper
You can access to method and constructor of super class like Java.
Initalize
node:
//add option "--harmony_proxies"
require('superclass');
web:
<script src="path/to/superclass.js"></script>
Usage
Access to constructor:
function A(message) {
this.message = message;
}
function B() {
this.super('hello!');
}
B.prototype = Object.create(A.prototype);
Access to method:
A.prototype.foo = function() {
return '#' + this.message + '#';
};
B.prototype.foo = function() {
return '(' + this.super.foo() + ')';
};