diff --git a/packages/core/src/render3/i18n/i18n_parse.ts b/packages/core/src/render3/i18n/i18n_parse.ts index 854408c1e0a..f4203b953a6 100644 --- a/packages/core/src/render3/i18n/i18n_parse.ts +++ b/packages/core/src/render3/i18n/i18n_parse.ts @@ -22,7 +22,6 @@ import {TNode, TNodeType} from '../interfaces/node'; import {SanitizerFn} from '../interfaces/sanitization'; import {HEADER_OFFSET, LView, TView} from '../interfaces/view'; import {getCurrentParentTNode, getCurrentTNode, setCurrentTNode} from '../state'; -import {attachDebugGetter} from '../util/debug_utils'; import {i18nCreateOpCodesToString, i18nRemoveOpCodesToString, i18nUpdateOpCodesToString, icuCreateOpCodesToString} from './i18n_debug'; import {addTNodeAndUpdateInsertBeforeIndex} from './i18n_insert_before_index'; @@ -52,6 +51,23 @@ function replaceNgsp(value: string): string { return value.replace(NGSP_UNICODE_REGEXP, ' '); } +/** + * 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 + */ +function attachDebugGetter(obj: T, debugGetter: (this: T) => any): void { + if (ngDevMode) { + Object.defineProperty(obj, 'debug', {get: debugGetter, enumerable: false}); + } else { + throw new Error( + 'This method should be guarded with `ngDevMode` so that it can be tree shaken in production!'); + } +} + /** * Create dynamic nodes from i18n translation block. * diff --git a/packages/core/src/render3/util/debug_utils.ts b/packages/core/src/render3/util/debug_utils.ts deleted file mode 100644 index 00e66e0ace7..00000000000 --- a/packages/core/src/render3/util/debug_utils.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -/** - * 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 - */ -export function attachDebugGetter(obj: T, debugGetter: (this: T) => any): void { - if (ngDevMode) { - Object.defineProperty(obj, 'debug', {get: debugGetter, enumerable: false}); - } else { - throw new Error( - 'This method should be guarded with `ngDevMode` so that it can be tree shaken in production!'); - } -}