DCL

An elegant OOP with mixins + AOP for JavaScript.

dcl.ChainingError

Version 2.x

dcl.ChainingError is present only when dcl/debug is imported. Otherwise, Error will be thrown.

It is thrown, when dcl is used to mix bases with different chaining orders for the same method.

dcl.ChainingError is based on dcl.DclError.

Examples

Conflicting chains
1
2
3
4
5
6
7
8
9
10
11
12
13
var dcl = require("dcl/debug");

var A = dcl({declaredClass: "A"});
dcl.chainAfter(A, "m");

var B = dcl({declaredClass: "B"});
dcl.chainBefore(B, "m");

var ChainConflict = dcl([A, B], {
  declaredClass: "ChainConflict"
});

// At this point dcl.ChainingError will be thrown.

You will see the following exception:

1
dcl: conflicting chain directives in ChainConflict for m, was after, set to before