* Retrieves the all context of a node from tree context. * * Context is usually initialized at the root, but can be overridden at any point in the tree. * * @param defaults Any keys to override the retrieved context * @returns The context object or an empty object if there is discover
(defaults?: object)
| 274 | * @returns The context object or an empty object if there is discovered context |
| 275 | */ |
| 276 | public getAllContext(defaults?: object): any { |
| 277 | const ret = { ...defaults }; |
| 278 | for (const scope of this._scopes) { |
| 279 | Object.assign(ret, scope.node._context); |
| 280 | } |
| 281 | return ret; |
| 282 | } |
| 283 | |
| 284 | /** |
| 285 | * Retrieves a value from tree context. |