From 81f3f32217936fa26b433ad8c8b8f26145d72865 Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Thu, 19 Mar 2015 20:56:19 +0100 Subject: [PATCH] refactor(DirectiveParser): remove checks for missing directives Based on the discussion in #776 we can't reliably check if a given element has a particular property at the compilation time. As such the existing algorithm detecting "missing" directives can't be used. We need to see if there is a different / better algorithm or maybe those checks need to be moved later in the process (runtime). Leaving integration tests in place (disabled) so we can come back to the topic after unblocking the situation. This commit effectivelly reverts 94e203b9df6c4b79ba30f1f08fc54ff919f722e1 --- .../compiler/pipeline/directive_parser.js | 69 +----------- .../pipeline/element_binder_builder.js | 16 +-- .../test/core/compiler/integration_spec.js | 101 +++++++++--------- 3 files changed, 63 insertions(+), 123 deletions(-) diff --git a/modules/angular2/src/core/compiler/pipeline/directive_parser.js b/modules/angular2/src/core/compiler/pipeline/directive_parser.js index 864f2ceec2..2c60b0f7f2 100644 --- a/modules/angular2/src/core/compiler/pipeline/directive_parser.js +++ b/modules/angular2/src/core/compiler/pipeline/directive_parser.js @@ -1,5 +1,5 @@ import {isPresent, isBlank, BaseException, assertionsEnabled, RegExpWrapper} from 'angular2/src/facade/lang'; -import {List, MapWrapper, StringMapWrapper} from 'angular2/src/facade/collection'; +import {List, MapWrapper} from 'angular2/src/facade/collection'; import {DOM} from 'angular2/src/dom/dom_adapter'; import {SelectorMatcher} from '../selector'; import {CssSelector} from '../selector'; @@ -10,9 +10,6 @@ import {CompileStep} from './compile_step'; import {CompileElement} from './compile_element'; import {CompileControl} from './compile_control'; -import {isSpecialProperty} from './element_binder_builder'; -import {dashCaseToCamelCase, camelCaseToDashCase} from './util'; - var PROPERTY_BINDING_REGEXP = RegExpWrapper.create('^ *([^\\s\\|]+)'); /** @@ -60,53 +57,15 @@ export class DirectiveParser extends CompileStep { }); // Note: We assume that the ViewSplitter already did its work, i.e. template directive should - // only be present on