debug.js
Version 1.x
Debuggability is one of the main concerns for any public library. It should provide a concise picture of produced, yet it should not affect size nor performance of said library.
debug.js
is a debug helper for dcl
. It augments dcl()
with enhanced error reporting, and provides debugging helpers. This module was
designed primarily to be used during development.
It can be included with following commands:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Module API
The return value of this module is an object, which is called dclDebug
in this documentation.
Main property:
- dclDebug.log() - logs class and/or object metainformation to
console.log
General error object:
- dclDebug.DclError - the base for all errors
“Class” composition error:
- dclDebug.CycleError - thrown when there is an unresolvable cycle in list of declared bases
Supercall and around advice errors:
- dclDebug.SuperCallError - thrown when an argument of dcl.superCall() or dcl.around() decorators is not a function
- dclDebug.SuperError - thrown when the next-in-line property is not a function, and a super call cannot be made
- dclDebug.SuperResultError - thrown when an argument of dcl.superCall() or dcl.around() decorators does not return a function (likely the double function pattern was not followed — see dcl.superCall() for details)
Chaining errors:
- dclDebug.ChainingError - thrown when composing a class with different chaining directives for the same method
- dclDebug.SetChainingError - thrown when setting a conflicting chaining