DCL

An elegant OOP with mixins + AOP for JavaScript.

dcl.Super

This is a constructor, which serves as a foundation of method decorators used by dcl. It is not intended to be used by end-users, and useful only for extending dcl itself.

Description

Method decorators produce objects based on dcl.Super. It is only useful for extending dcl.

By default a decorated method is exposed as a property f on a decorator object.

Examples

Using dcl.Super
1
2
3
4
5
6
7
for(var name in o){
  var m = o[name];
  if(m && m instanceof dcl.Super){
    console.log("Method " + name + " is decorated.");
    console.log("It has " + m.f.length + " arguments.");
  }
}

The example above is not going to work on fully constructed objects because by that time all dcl.Super objects would be replaced by generated functions.

Fork me on GitHub