MCPcopy Create free account
hub / github.com/angular/angular / attachDebugGetter

Function attachDebugGetter

packages/core/src/render3/i18n/i18n_parse.ts:107–115  ·  view source on GitHub ↗

* Patch a `debug` property getter on top of the existing object. * * NOTE: always call this method with `ngDevMode && attachDebugObject(...)` * * @param obj Object to patch * @param debugGetter Getter returning a value to patch

(obj: T, debugGetter: (this: T) => any)

Source from the content-addressed store, hash-verified

105 * @param debugGetter Getter returning a value to patch
106 */
107function attachDebugGetter<T>(obj: T, debugGetter: (this: T) => any): void {
108 if (ngDevMode) {
109 Object.defineProperty(obj, 'debug', {get: debugGetter, enumerable: false});
110 } else {
111 throw new Error(
112 'This method should be guarded with `ngDevMode` so that it can be tree shaken in production!',
113 );
114 }
115}
116
117/**
118 * Create dynamic nodes from i18n translation block.

Callers 4

i18nStartFirstCreatePassFunction · 0.85
i18nAttributesFirstPassFunction · 0.85
parseIcuCaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected