DCL

An elegant OOP with mixins + AOP for JavaScript.

dclDebug.SuperCallError

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

Examples

Wrong supercalling method
1
2
3
4
5
6
7
8
9
var dcl = require("dcl"),
  dclDebug = require("dcl/debug");

var A = dcl(null, {
  declaredClass: "A",
  m: dcl.superCall("Should be a function, but it is a string.")
});

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

You will see the following exception:

1
2
dcl: argument of around advice or supercall decorator
should be a function in: A, method: m

Fork me on GitHub