* @function LevelRenderer.Group.prototype.eachChild * @description 遍历所有子节点。 * @param {function} cb - 回调函数。 * @param {Object} context - 上下文。
(cb, context)
| 182 | * @param {Object} context - 上下文。 |
| 183 | */ |
| 184 | eachChild(cb, context) { |
| 185 | var haveContext = !!context; |
| 186 | for (var i = 0; i < this._children.length; i++) { |
| 187 | var child = this._children[i]; |
| 188 | if (haveContext) { |
| 189 | cb.call(context, child); |
| 190 | } else { |
| 191 | cb(child); |
| 192 | } |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | |
| 197 | /** |
no test coverage detected