From bfe3efab3b2d802c3c4b325cc7300a180c5e6559 Mon Sep 17 00:00:00 2001 From: Rado Kirov Date: Mon, 26 Oct 2015 07:23:13 -0700 Subject: [PATCH] chore(compiler): dead code clean-up. Dead code that uglifyJS found. Closes #4907 --- .../src/core/change_detection/dynamic_change_detector.ts | 3 --- modules/angular2/src/core/compiler/html_parser.ts | 2 -- modules/angular2/src/core/compiler/runtime_metadata.ts | 4 ---- modules/angular2/src/core/compiler/template_parser.ts | 4 ---- modules/angular2/src/core/render/dom/dom_renderer.ts | 9 --------- modules/angular2/src/core/render/view_factory.ts | 6 ------ 6 files changed, 28 deletions(-) diff --git a/modules/angular2/src/core/change_detection/dynamic_change_detector.ts b/modules/angular2/src/core/change_detection/dynamic_change_detector.ts index 21e085dba7..654e413486 100644 --- a/modules/angular2/src/core/change_detection/dynamic_change_detector.ts +++ b/modules/angular2/src/core/change_detection/dynamic_change_detector.ts @@ -391,10 +391,7 @@ export class DynamicChangeDetector extends AbstractChangeDetector { _readContext(proto: ProtoRecord, values: any[]) { if (proto.contextIndex == -1) { return this._getDirectiveFor(proto.directiveIndex); - } else { - return values[proto.contextIndex]; } - return values[proto.contextIndex]; } diff --git a/modules/angular2/src/core/compiler/html_parser.ts b/modules/angular2/src/core/compiler/html_parser.ts index 33bc2d9d62..5800a66796 100644 --- a/modules/angular2/src/core/compiler/html_parser.ts +++ b/modules/angular2/src/core/compiler/html_parser.ts @@ -19,8 +19,6 @@ import { import {escapeDoubleQuoteString} from './util'; import {Injectable} from 'angular2/src/core/di'; -const NG_NON_BINDABLE = 'ng-non-bindable'; - @Injectable() export class HtmlParser { parse(template: string, sourceInfo: string): HtmlAst[] { diff --git a/modules/angular2/src/core/compiler/runtime_metadata.ts b/modules/angular2/src/core/compiler/runtime_metadata.ts index d7d4b9a3ca..2dfbf27484 100644 --- a/modules/angular2/src/core/compiler/runtime_metadata.ts +++ b/modules/angular2/src/core/compiler/runtime_metadata.ts @@ -20,10 +20,6 @@ import {reflector} from 'angular2/src/core/reflection/reflection'; import {Injectable} from 'angular2/src/core/di'; import {MODULE_SUFFIX} from './util'; -// group 1: "property" from "[property]" -// group 2: "event" from "(event)" -var HOST_REG_EXP = /^(?:(?:\[([^\]]+)\])|(?:\(([^\)]+)\)))$/g; - @Injectable() export class RuntimeMetadataResolver { private _cache = new Map(); diff --git a/modules/angular2/src/core/compiler/template_parser.ts b/modules/angular2/src/core/compiler/template_parser.ts index 107dbe2858..ce9083d52e 100644 --- a/modules/angular2/src/core/compiler/template_parser.ts +++ b/modules/angular2/src/core/compiler/template_parser.ts @@ -628,10 +628,6 @@ class BoundElementOrDirectiveProperty { public sourceInfo: string) {} } -class ParseError { - constructor(public message: string, public sourceInfo: string) {} -} - export function splitClasses(classAttrValue: string): string[] { return StringWrapper.split(classAttrValue.trim(), /\s+/g); } diff --git a/modules/angular2/src/core/render/dom/dom_renderer.ts b/modules/angular2/src/core/render/dom/dom_renderer.ts index e97fed9074..d65442aef1 100644 --- a/modules/angular2/src/core/render/dom/dom_renderer.ts +++ b/modules/angular2/src/core/render/dom/dom_renderer.ts @@ -322,15 +322,6 @@ function moveNodesAfterSibling(sibling, nodes) { } } -function moveChildNodes(source: Node, target: Node) { - var currChild = DOM.firstChild(source); - while (isPresent(currChild)) { - var nextChild = DOM.nextSibling(currChild); - DOM.appendChild(target, currChild); - currChild = nextChild; - } -} - function decoratePreventDefault(eventHandler: Function): Function { return (event) => { var allowDefaultBehavior = eventHandler(event); diff --git a/modules/angular2/src/core/render/view_factory.ts b/modules/angular2/src/core/render/view_factory.ts index ae3fec85fd..b60b951f0b 100644 --- a/modules/angular2/src/core/render/view_factory.ts +++ b/modules/angular2/src/core/render/view_factory.ts @@ -252,9 +252,3 @@ class Component { []; } } - -function addAll(source: any[], target: any[]) { - for (var i = 0; i < source.length; i++) { - target.push(source[i]); - } -}