dcl.chainAfter()
Version 2.x
This function declares that methods with a certain name should be chained in the inheritance order (the first method runs first).
Description
dcl.chainAfter()
sets the after
chaining rule for a method. It takes two parameters:
Ctr
- the constructor function created by dcl().name
- the method name to be chained inCtr
’s prototype.
Following rules should be followed:
- It is impossible to “unchain” a chained method.
- It is impossible to change a chained method once it was set from “before” to “after” or in the opposite direction.
- Chaining should be declared only for base-less “classes”.
- It is an error to mix “classes” with different chaining rules for the same method.
- It is possible to declare chaining for a method without actually declaring the method.
The function returns true
, if it was able to define a required chaining, false
, if a constructor was not defined by dcl(), and throws an error, if a chaining conflict was detected.
1 2 3 4 5 6 |
|
Notes
By default, all constructors produced by dcl
use after
chaining.
Implementation
It is implemented in terms of dcl.chainWith() and dcl.weaveAfter:
1 2 3 |
|