Last modified: 2014-03-13 17:14:43 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58978, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56978 - OOjs: Add a 'super' property in inheritClass
OOjs: Add a 'super' property in inheritClass
Status: RESOLVED FIXED
Product: OOjs
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Normal enhancement
: ---
Assigned To: Krinkle
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-13 00:25 UTC by Krinkle
Modified: 2014-03-13 17:14 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2013-11-13 00:25:27 UTC
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.
Comment 1 Krinkle 2014-03-13 17:14:43 UTC
Change-Id: Ic301140d2e0ad99eddc83f9031e12a7641fd10ae

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links