Skip to content

Commit

Permalink
refactor: remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb authored and chuckjaz committed Oct 5, 2016
1 parent 7e5413d commit faf5d90
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 47 deletions.
1 change: 0 additions & 1 deletion modules/@angular/compiler/src/private_import_core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
19 changes: 0 additions & 19 deletions modules/@angular/core/src/change_detection/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand Down
4 changes: 0 additions & 4 deletions modules/@angular/core/src/core_private_export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 0 additions & 4 deletions modules/@angular/core/src/metadata/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
2 changes: 0 additions & 2 deletions modules/@angular/platform-browser/src/private_import_core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
}

if (type === RenderComponentType) {
return this._deserializeRenderComponentType(map);
} else if (type === ViewEncapsulation) {
return VIEW_ENCAPSULATION_VALUES[map];
} else if (type === LocationType) {
}

if (type === ViewEncapsulation) {
return map as ViewEncapsulation;
}

if (type === LocationType) {
return this._deserializeLocation(map);
} else {
throw new Error('No deserializer for ' + type.toString());
}

throw new Error('No deserializer for ' + type.toString());
}

private _serializeLocation(loc: LocationType): Object {
Expand Down

0 comments on commit faf5d90

Please sign in to comment.