diff --git a/modules/@angular/compiler/src/aot/static_symbol.ts b/modules/@angular/compiler/src/aot/static_symbol.ts index 66c195e53b..02f137907d 100644 --- a/modules/@angular/compiler/src/aot/static_symbol.ts +++ b/modules/@angular/compiler/src/aot/static_symbol.ts @@ -6,10 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ -export function isStaticSymbol(value: any): value is StaticSymbol { - return typeof value === 'object' && value !== null && value['name'] && value['filePath']; -} - /** * A token representing the a reference to a static type. * diff --git a/modules/@angular/compiler/src/aot/summary_resolver.ts b/modules/@angular/compiler/src/aot/summary_resolver.ts index 7a36549be7..7f9709bc4f 100644 --- a/modules/@angular/compiler/src/aot/summary_resolver.ts +++ b/modules/@angular/compiler/src/aot/summary_resolver.ts @@ -10,7 +10,7 @@ import {SummaryResolver} from '../summary_resolver'; import {GeneratedFile} from './generated_file'; import {StaticReflector} from './static_reflector'; -import {StaticSymbol, isStaticSymbol} from './static_symbol'; +import {StaticSymbol} from './static_symbol'; import {filterFileByPatterns} from './utils'; const STRIP_SRC_FILE_SUFFIXES = /(\.ts|\.d\.ts|\.js|\.jsx|\.tsx)$/; @@ -43,7 +43,7 @@ export class AotSummaryResolver implements SummaryResolver { serializeSummaries(srcFileUrl: string, summaries: CompileTypeSummary[]): GeneratedFile { const jsonReplacer = (key: string, value: any) => { - if (key === 'reference' && isStaticSymbol(value)) { + if (key === 'reference' && value instanceof StaticSymbol) { // We convert the source filenames into output filenames, // as the generated summary file will be used when the current // compilation unit is used as a library diff --git a/modules/@angular/compiler/src/compile_metadata.ts b/modules/@angular/compiler/src/compile_metadata.ts index 846763cc6c..ea74092c5f 100644 --- a/modules/@angular/compiler/src/compile_metadata.ts +++ b/modules/@angular/compiler/src/compile_metadata.ts @@ -8,7 +8,7 @@ import {ChangeDetectionStrategy, SchemaMetadata, Type, ViewEncapsulation} from '@angular/core'; -import {StaticSymbol, isStaticSymbol} from './aot/static_symbol'; +import {StaticSymbol} from './aot/static_symbol'; import {ListWrapper} from './facade/collection'; import {isPresent, stringify} from './facade/lang'; import {LifecycleHooks, reflector} from './private_import_core'; @@ -87,7 +87,7 @@ export function identifierName(compileIdentifier: CompileIdentifierMetadata): st return null; } const ref = compileIdentifier.reference; - if (isStaticSymbol(ref)) { + if (ref instanceof StaticSymbol) { return ref.name; } if (ref['__anonymousType']) { @@ -106,7 +106,7 @@ export function identifierName(compileIdentifier: CompileIdentifierMetadata): st export function identifierModuleUrl(compileIdentifier: CompileIdentifierMetadata): string { const ref = compileIdentifier.reference; - if (isStaticSymbol(ref)) { + if (ref instanceof StaticSymbol) { return ref.filePath; } return reflector.importUri(ref); diff --git a/modules/@angular/compiler/src/identifiers.ts b/modules/@angular/compiler/src/identifiers.ts index 112a82f45d..2d0d80cb5b 100644 --- a/modules/@angular/compiler/src/identifiers.ts +++ b/modules/@angular/compiler/src/identifiers.ts @@ -8,7 +8,7 @@ import {ANALYZE_FOR_ENTRY_COMPONENTS, AnimationTransitionEvent, ChangeDetectionStrategy, ChangeDetectorRef, ComponentFactory, ComponentFactoryResolver, ComponentRef, ElementRef, Injector, LOCALE_ID, NgModuleFactory, QueryList, RenderComponentType, Renderer, SecurityContext, SimpleChange, TRANSLATIONS_FORMAT, TemplateRef, ViewContainerRef, ViewEncapsulation} from '@angular/core'; -import {StaticSymbol, isStaticSymbol} from './aot/static_symbol'; +import {StaticSymbol} from './aot/static_symbol'; import {CompileIdentifierMetadata, CompileTokenMetadata, identifierModuleUrl, identifierName} from './compile_metadata'; import {AnimationGroupPlayer, AnimationKeyframe, AnimationSequencePlayer, AnimationStyles, AnimationTransition, AppView, ChangeDetectorStatus, CodegenComponentFactoryResolver, ComponentRef_, DebugAppView, DebugContext, NgModuleInjector, NoOpAnimationPlayer, StaticNodeDebugInfo, TemplateRef_, UNINITIALIZED, ValueUnwrapper, ViewContainer, ViewType, balanceAnimationKeyframes, clearStyles, collectAndResolveStyles, devModeEqual, prepareFinalAnimationStyles, reflector, registerModuleFactory, renderStyles, view_utils} from './private_import_core'; diff --git a/modules/@angular/compiler/src/metadata_resolver.ts b/modules/@angular/compiler/src/metadata_resolver.ts index ef34d727ba..28d20135fe 100644 --- a/modules/@angular/compiler/src/metadata_resolver.ts +++ b/modules/@angular/compiler/src/metadata_resolver.ts @@ -8,7 +8,7 @@ import {AnimationAnimateMetadata, AnimationEntryMetadata, AnimationGroupMetadata, AnimationKeyframesSequenceMetadata, AnimationMetadata, AnimationStateDeclarationMetadata, AnimationStateMetadata, AnimationStateTransitionMetadata, AnimationStyleMetadata, AnimationWithStepsMetadata, Attribute, ChangeDetectionStrategy, Component, Directive, Host, Inject, Injectable, ModuleWithProviders, Optional, Provider, Query, SchemaMetadata, Self, SkipSelf, Type, resolveForwardRef} from '@angular/core'; -import {isStaticSymbol} from './aot/static_symbol'; +import {StaticSymbol} from './aot/static_symbol'; import {assertArrayOfStrings, assertInterpolationSymbols} from './assertions'; import * as cpl from './compile_metadata'; import {DirectiveNormalizer} from './directive_normalizer'; @@ -863,12 +863,12 @@ function flattenAndDedupeArray(tree: any[]): Array { } function isValidType(value: any): boolean { - return isStaticSymbol(value) || (value instanceof Type); + return (value instanceof StaticSymbol) || (value instanceof Type); } export function componentModuleUrl( reflector: ReflectorReader, type: Type, cmpMetadata: Component): string { - if (isStaticSymbol(type)) { + if (type instanceof StaticSymbol) { return type.filePath; }