DCL

An elegant OOP with mixins + AOP for JavaScript.

dclDebug.SuperError

dclDebug.SuperError is present only when dcl/debug is required. It is thrown when a super method is not a function. It works for supercalls, and class-level and object-level advices.

Examples

Wrong super
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var dcl = require("dcl"),
  dclDebug = require("dcl/debug");

var A = dcl(null, {
  declaredClass: "A",
  m: 42 // not a function
});

var B = dcl(A, {
  declaredClass: "B",
  m: dcl.superCall(function(sup){
    return sup ? sup.call(this) : 0;
  })
});

// At this point dclError.SuperError will be thrown.

You will see the following exception:

1
dcl: super method should be a function in: B, method: m

Fork me on GitHub