refactor: remove dead code

This commit is contained in:
Victor Berchet 2016-09-18 16:15:43 -07:00 committed by Rado Kirov
parent 58605cf350
commit 425c1e6042
8 changed files with 21 additions and 49 deletions

View File

@ -12,7 +12,6 @@ export const isDefaultChangeDetectionStrategy: typeof r.isDefaultChangeDetection
r.isDefaultChangeDetectionStrategy;
export type ChangeDetectorStatus = typeof r._ChangeDetectorStatus;
export const ChangeDetectorStatus: typeof r.ChangeDetectorStatus = r.ChangeDetectorStatus;
r.CHANGE_DETECTION_STRATEGY_VALUES;
export type LifecycleHooks = typeof r._LifecycleHooks;
export const LifecycleHooks: typeof r.LifecycleHooks = r.LifecycleHooks;
export const LIFECYCLE_HOOKS_VALUES: typeof r.LIFECYCLE_HOOKS_VALUES = r.LIFECYCLE_HOOKS_VALUES;

View File

@ -14,7 +14,7 @@ import {KeyValueDifferFactory, KeyValueDiffers} from './differs/keyvalue_differs
export {SimpleChanges} from '../metadata/lifecycle_hooks';
export {SimpleChange, UNINITIALIZED, ValueUnwrapper, WrappedValue, devModeEqual, looseIdentical} from './change_detection_util';
export {ChangeDetectorRef} from './change_detector_ref';
export {CHANGE_DETECTION_STRATEGY_VALUES, ChangeDetectionStrategy, ChangeDetectorStatus, isDefaultChangeDetectionStrategy} from './constants';
export {ChangeDetectionStrategy, ChangeDetectorStatus, isDefaultChangeDetectionStrategy} from './constants';
export {CollectionChangeRecord, DefaultIterableDifferFactory} from './differs/default_iterable_differ';
export {DefaultIterableDiffer} from './differs/default_iterable_differ';
export {DefaultKeyValueDifferFactory, KeyValueChangeRecord} from './differs/default_keyvalue_differ';

View File

@ -66,25 +66,6 @@ export enum ChangeDetectorStatus {
Destroyed,
}
/**
* List of possible {@link ChangeDetectionStrategy} values.
*/
export var CHANGE_DETECTION_STRATEGY_VALUES = [
ChangeDetectionStrategy.OnPush,
ChangeDetectionStrategy.Default,
];
/**
* List of possible {@link ChangeDetectorStatus} values.
*/
export var CHANGE_DETECTOR_STATUS_VALUES = [
ChangeDetectorStatus.CheckOnce,
ChangeDetectorStatus.Checked,
ChangeDetectorStatus.CheckAlways,
ChangeDetectorStatus.Detached,
ChangeDetectorStatus.Errored,
ChangeDetectorStatus.Destroyed,
];
export function isDefaultChangeDetectionStrategy(changeDetectionStrategy: ChangeDetectionStrategy):
boolean {
return isBlank(changeDetectionStrategy) ||

View File

@ -44,7 +44,6 @@ export var __core_private__: {
isDefaultChangeDetectionStrategy: typeof constants.isDefaultChangeDetectionStrategy,
ChangeDetectorStatus: typeof constants.ChangeDetectorStatus,
_ChangeDetectorStatus?: constants.ChangeDetectorStatus,
CHANGE_DETECTION_STRATEGY_VALUES: typeof constants.CHANGE_DETECTION_STRATEGY_VALUES,
constructDependencies: typeof reflective_provider.constructDependencies,
LifecycleHooks: typeof lifecycle_hooks.LifecycleHooks,
_LifecycleHooks?: lifecycle_hooks.LifecycleHooks,
@ -69,7 +68,6 @@ export var __core_private__: {
flattenNestedViewRenderNodes: typeof view_utils.flattenNestedViewRenderNodes,
interpolate: typeof view_utils.interpolate,
ViewUtils: typeof view_utils.ViewUtils, _ViewUtils?: view_utils.ViewUtils,
VIEW_ENCAPSULATION_VALUES: typeof metadata_view.VIEW_ENCAPSULATION_VALUES,
ViewMetadata: typeof metadata_view.ViewMetadata, _ViewMetadata?: metadata_view.ViewMetadata,
DebugContext: typeof debug_context.DebugContext, _DebugContext?: debug_context.DebugContext,
StaticNodeDebugInfo: typeof debug_context.StaticNodeDebugInfo,
@ -124,7 +122,6 @@ export var __core_private__: {
} = {
isDefaultChangeDetectionStrategy: constants.isDefaultChangeDetectionStrategy,
ChangeDetectorStatus: constants.ChangeDetectorStatus,
CHANGE_DETECTION_STRATEGY_VALUES: constants.CHANGE_DETECTION_STRATEGY_VALUES,
constructDependencies: reflective_provider.constructDependencies,
LifecycleHooks: lifecycle_hooks.LifecycleHooks,
LIFECYCLE_HOOKS_VALUES: lifecycle_hooks.LIFECYCLE_HOOKS_VALUES,
@ -141,7 +138,6 @@ export var __core_private__: {
flattenNestedViewRenderNodes: view_utils.flattenNestedViewRenderNodes,
interpolate: view_utils.interpolate,
ViewUtils: view_utils.ViewUtils,
VIEW_ENCAPSULATION_VALUES: metadata_view.VIEW_ENCAPSULATION_VALUES,
ViewMetadata: metadata_view.ViewMetadata,
DebugContext: debug_context.DebugContext,
StaticNodeDebugInfo: debug_context.StaticNodeDebugInfo,

View File

@ -37,10 +37,6 @@ export enum ViewEncapsulation {
None
}
export var VIEW_ENCAPSULATION_VALUES =
[ViewEncapsulation.Emulated, ViewEncapsulation.Native, ViewEncapsulation.None];
/**
* Metadata properties available for configuring Views.
*

View File

@ -12,8 +12,6 @@ export type RenderDebugInfo = typeof r._RenderDebugInfo;
export var RenderDebugInfo: typeof r.RenderDebugInfo = r.RenderDebugInfo;
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
export var VIEW_ENCAPSULATION_VALUES: typeof r.VIEW_ENCAPSULATION_VALUES =
r.VIEW_ENCAPSULATION_VALUES;
export type DebugDomRootRenderer = typeof r._DebugDomRootRenderer;
export var DebugDomRootRenderer: typeof r.DebugDomRootRenderer = r.DebugDomRootRenderer;

View File

@ -13,9 +13,6 @@ export var RenderDebugInfo: typeof r.RenderDebugInfo = r.RenderDebugInfo;
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
export var VIEW_ENCAPSULATION_VALUES: typeof r.VIEW_ENCAPSULATION_VALUES =
r.VIEW_ENCAPSULATION_VALUES;
export type DebugDomRootRenderer = typeof r._DebugDomRootRenderer;
export var DebugDomRootRenderer: typeof r.DebugDomRootRenderer = r.DebugDomRootRenderer;
export var reflector: typeof r.reflector = r.reflector;

View File

@ -9,7 +9,6 @@
import {Injectable, RenderComponentType, Type, ViewEncapsulation} from '@angular/core';
import {isArray, isPresent} from '../../facade/lang';
import {VIEW_ENCAPSULATION_VALUES} from '../../private_import_core';
import {RenderStore} from './render_store';
import {LocationType} from './serialized_types';
@ -54,26 +53,32 @@ export class Serializer {
if (!isPresent(map)) {
return null;
}
if (isArray(map)) {
var obj: any[] = [];
(<any[]>map).forEach(val => obj.push(this.deserialize(val, type, data)));
return obj;
if (Array.isArray(map)) {
return (<any[]>map).map(val => this.deserialize(val, type, data));
}
if (type == PRIMITIVE) {
if (type === PRIMITIVE) {
return map;
}
if (type == RenderStoreObject) {
if (type === RenderStoreObject) {
return this._renderStore.deserialize(map);
} else if (type === RenderComponentType) {
return this._deserializeRenderComponentType(map);
} else if (type === ViewEncapsulation) {
return VIEW_ENCAPSULATION_VALUES[map];
} else if (type === LocationType) {
return this._deserializeLocation(map);
} else {
throw new Error('No deserializer for ' + type.toString());
}
if (type === RenderComponentType) {
return this._deserializeRenderComponentType(map);
}
if (type === ViewEncapsulation) {
return map as ViewEncapsulation;
}
if (type === LocationType) {
return this._deserializeLocation(map);
}
throw new Error('No deserializer for ' + type.toString());
}
private _serializeLocation(loc: LocationType): Object {