Version 1.0 glow.debug
API Quick Reference
JavaScript is required to use the quick reference
Simple assert methods.
This module is only included in debug versions of Glow.
Methods
- assert
-
Checks that a condition is true.
Synopsis
glow.debug.assert(condition, message);Parameters
- condition
-
- Type
The condition to check
- message
-
- Type
The error message to use if the condition is false.
[Optional further description after newline]
Example
// check that the first argument to a function was a glow.dom.NodeList glow.debug.assert(aruments[0] instanceof glow.dom.NodeList, 'nodeList must be a glow.dom.NodeList'); - assertParameterObject
-
Checks that a parameter object contains certain parameters.
Synopsis
glow.debug.assertParameterObject(parameters, required, optional, message);Parameters
- parameters
-
- Type
The parameter object to check.
- required
-
- Type
The names of parameters that must be present.
- optional
-
- Type
The names of parameters that can be present.
- message
-
- Type
The error message to use (with more detailed information appended).
Example
// check that name is passed, and possibly email glow.debug.assertParameterObect(arguments[0], ['name'], ['email'], 'invalid parameters to addUser');