diff --git a/packages/compiler-cli/src/ngtsc/scope/src/dependency.ts b/packages/compiler-cli/src/ngtsc/scope/src/dependency.ts index 5bc06f47dc..e278c6e3d7 100644 --- a/packages/compiler-cli/src/ngtsc/scope/src/dependency.ts +++ b/packages/compiler-cli/src/ngtsc/scope/src/dependency.ts @@ -124,7 +124,6 @@ export class MetadataDtsModuleScopeResolver implements DtsModuleScopeResolver { // The export was not a directive, a pipe, or a module. This is an error. // TODO(alxhub): produce a ts.Diagnostic - throw new Error(`Exported value ${exportRef.debugName} was not a directive, pipe, or module`); } const exportScope: ExportScope = { diff --git a/packages/compiler-cli/src/transformers/node_emitter.ts b/packages/compiler-cli/src/transformers/node_emitter.ts index ae9df7a952..2a1cc6fd78 100644 --- a/packages/compiler-cli/src/transformers/node_emitter.ts +++ b/packages/compiler-cli/src/transformers/node_emitter.ts @@ -784,7 +784,6 @@ function modifierFromModifier(modifier: StmtModifier): ts.Modifier { case StmtModifier.Static: return ts.createToken(ts.SyntaxKind.StaticKeyword); } - return error(`unknown statement modifier`); } function translateModifiers(modifiers: StmtModifier[]|null): ts.Modifier[]|undefined { diff --git a/packages/compiler/src/constant_pool.ts b/packages/compiler/src/constant_pool.ts index af5f2f2f4f..8b119f0094 100644 --- a/packages/compiler/src/constant_pool.ts +++ b/packages/compiler/src/constant_pool.ts @@ -252,8 +252,6 @@ export class ConstantPool { case DefinitionKind.Pipe: return this.pipeDefinitions; } - error(`Unknown definition kind ${kind}`); - return this.componentDefinitions; } public propertyNameOf(kind: DefinitionKind): string { @@ -267,8 +265,6 @@ export class ConstantPool { case DefinitionKind.Pipe: return 'ɵpipe'; } - error(`Unknown definition kind ${kind}`); - return ''; } private freshName(): string { diff --git a/packages/compiler/src/render3/view/compiler.ts b/packages/compiler/src/render3/view/compiler.ts index 20390fd70b..a2aebdb9c8 100644 --- a/packages/compiler/src/render3/view/compiler.ts +++ b/packages/compiler/src/render3/view/compiler.ts @@ -432,7 +432,6 @@ function selectorsFromGlobalMetadata( } error('Unexpected query form'); - return o.NULL_EXPR; } function prepareQueryParams(query: R3QueryMetadata, constantPool: ConstantPool): o.Expression[] { diff --git a/packages/core/schematics/migrations/renderer-to-renderer2/helpers.ts b/packages/core/schematics/migrations/renderer-to-renderer2/helpers.ts index dcf11af830..a706d4ce53 100644 --- a/packages/core/schematics/migrations/renderer-to-renderer2/helpers.ts +++ b/packages/core/schematics/migrations/renderer-to-renderer2/helpers.ts @@ -56,8 +56,6 @@ function getHelperDeclaration(name: HelperFunction): ts.Node { case HelperFunction.splitNamespace: return getSplitNamespaceHelper(); } - - throw new Error(`Unsupported helper called "${name}".`); } /** Creates a helper for a custom `any` type during the migration. */ diff --git a/packages/core/src/render3/instructions/lview_debug.ts b/packages/core/src/render3/instructions/lview_debug.ts index a30d30ced7..1fd21dfbfd 100644 --- a/packages/core/src/render3/instructions/lview_debug.ts +++ b/packages/core/src/render3/instructions/lview_debug.ts @@ -102,7 +102,6 @@ function getLViewToClone(type: TViewType, name: string|null): Array { } return embeddedArray; } - throw new Error('unreachable code'); } function nameSuffix(text: string|null|undefined): string {