From f40802f1bd3c12a640006f9930d63438153081fc Mon Sep 17 00:00:00 2001 From: JoostK Date: Wed, 8 Dec 2021 22:14:32 +0100 Subject: [PATCH] refactor(compiler): remove unused `unsupported` function (#44411) This function is no longer used so is being removed. PR Close #44411 --- packages/compiler/src/render3/view/template.ts | 3 +-- packages/compiler/src/render3/view/util.ts | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/compiler/src/render3/view/template.ts b/packages/compiler/src/render3/view/template.ts index 9d24319752c..17a079c1a07 100644 --- a/packages/compiler/src/render3/view/template.ts +++ b/packages/compiler/src/render3/view/template.ts @@ -38,7 +38,7 @@ import {createLocalizeStatements} from './i18n/localize_utils'; import {I18nMetaVisitor} from './i18n/meta'; import {assembleBoundTextPlaceholders, assembleI18nBoundString, declareI18nVariable, getTranslationConstPrefix, hasI18nMeta, I18N_ICU_MAPPING_PREFIX, i18nFormatPlaceholderNames, icuFromI18nMessage, isI18nRootNode, isSingleI18nIcu, placeholdersToParams, TRANSLATION_VAR_PREFIX, wrapI18nPlaceholder} from './i18n/util'; import {StylingBuilder, StylingInstruction} from './styling_builder'; -import {asLiteral, chainedInstruction, CONTEXT_NAME, getAttrsForDirectiveMatching, getInterpolationArgsLength, IMPLICIT_REFERENCE, invalid, NON_BINDABLE_ATTR, REFERENCE_PREFIX, RENDER_FLAGS, RESTORED_VIEW_CONTEXT_NAME, trimTrailingNulls, unsupported} from './util'; +import {asLiteral, chainedInstruction, CONTEXT_NAME, getAttrsForDirectiveMatching, getInterpolationArgsLength, IMPLICIT_REFERENCE, invalid, NON_BINDABLE_ATTR, REFERENCE_PREFIX, RENDER_FLAGS, RESTORED_VIEW_CONTEXT_NAME, trimTrailingNulls} from './util'; @@ -171,7 +171,6 @@ export class TemplateDefinitionBuilder implements t.Visitor, LocalResolver */ private _bindingScope: BindingScope; private _valueConverter: ValueConverter; - private _unsupported = unsupported; // i18n context local to this template private i18n: I18nContext|null = null; diff --git a/packages/compiler/src/render3/view/util.ts b/packages/compiler/src/render3/view/util.ts index f9685832bfc..3263008821a 100644 --- a/packages/compiler/src/render3/view/util.ts +++ b/packages/compiler/src/render3/view/util.ts @@ -67,13 +67,6 @@ export function temporaryAllocator(statements: o.Statement[], name: string): () } -export function unsupported(this: void|Function, feature: string): never { - if (this) { - throw new Error(`Builder ${this.constructor.name} doesn't support ${feature} yet`); - } - throw new Error(`Feature ${feature} is not supported yet`); -} - export function invalid(this: t.Visitor, arg: o.Expression|o.Statement|t.Node): never { throw new Error( `Invalid state: Visitor ${this.constructor.name} doesn't handle ${arg.constructor.name}`);