Page MenuHomePhabricator

OOjs: Add a 'super' property in inheritClass
Closed, ResolvedPublic

Description

Similar to nodejs' util.inherits (example / source code).

So one can do:

function Foo() {}

Foo.prototype.something = function () {};

function BarFoo() {

BarFoo.super.call(this);

}

oo.inheritClass( BarFoo, Foo );

BarFoo.prototype.something = function () {

BarFoo.super.prototype.something.apply(this);

};
NodeJS calls it super_ (with trailing underscore), I guess we don't want to do that.


Moved from https://github.com/trevorparscal/oojs/issues/16.


Version: unspecified
Severity: enhancement

Details

Reference
bz56978

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:34 AM
bzimport added a project: OOjs core.
bzimport set Reference to bz56978.

Change-Id: Ic301140d2e0ad99eddc83f9031e12a7641fd10ae