diff --git a/modules/angular2/src/transform/directive_processor/transformer.dart b/modules/angular2/src/transform/directive_processor/transformer.dart index e53d922e05..9d73658fc8 100644 --- a/modules/angular2/src/transform/directive_processor/transformer.dart +++ b/modules/angular2/src/transform/directive_processor/transformer.dart @@ -2,7 +2,6 @@ library angular2.transform.directive_processor.transformer; import 'dart:async'; -import 'package:angular2/src/transform/common/formatter.dart'; import 'package:angular2/src/transform/common/logging.dart' as log; import 'package:angular2/src/transform/common/names.dart'; import 'package:angular2/src/transform/common/options.dart'; diff --git a/modules/angular2/src/transform/reflection_remover/codegen.dart b/modules/angular2/src/transform/reflection_remover/codegen.dart index 1f85f03e9b..a2ecb2ff3b 100644 --- a/modules/angular2/src/transform/reflection_remover/codegen.dart +++ b/modules/angular2/src/transform/reflection_remover/codegen.dart @@ -77,7 +77,7 @@ class _ReflectorVisitor extends Object with SimpleAstVisitor { @override Expression visitPropertyAccess(PropertyAccess node) { - if (node == null || node.target == null) return; + if (node == null || node.target == null) return null; return node.target; } diff --git a/modules/angular2/src/transform/template_compiler/generator.dart b/modules/angular2/src/transform/template_compiler/generator.dart index 9e0daf5b56..5ed551d6a5 100644 --- a/modules/angular2/src/transform/template_compiler/generator.dart +++ b/modules/angular2/src/transform/template_compiler/generator.dart @@ -160,7 +160,7 @@ class _TemplateExtractVisitor extends Object with RecursiveAstVisitor { // TODO(kegluneq): Remove this limitation. if (node.name is! Label || node.name.label is! SimpleIdentifier) { logger.error( - 'Angular 2 currently only supports simple identifiers in directives', + 'Angular 2 currently only supports simple identifiers in directives.' ' Source: ${node}'); return null; } @@ -168,7 +168,7 @@ class _TemplateExtractVisitor extends Object with RecursiveAstVisitor { if (keyString == 'inline' || keyString == 'url') { if (node.expression is! SimpleStringLiteral) { logger.error( - 'Angular 2 currently only supports string literals in directives', + 'Angular 2 currently only supports string literals in directives.' ' Source: ${node}'); return null; } diff --git a/modules/angular2/src/transform/template_compiler/recording_reflection_capabilities.dart b/modules/angular2/src/transform/template_compiler/recording_reflection_capabilities.dart index a49f20f7e1..2bfd492717 100644 --- a/modules/angular2/src/transform/template_compiler/recording_reflection_capabilities.dart +++ b/modules/angular2/src/transform/template_compiler/recording_reflection_capabilities.dart @@ -8,15 +8,13 @@ import 'package:angular2/src/reflection/types.dart'; /// reflectively accessed at runtime. class RecordingReflectionCapabilities implements ReflectionCapabilities { /// The names of all requested `getter`s. - final List getterNames = []; + final List getterNames = []; /// The names of all requested `setter`s. - final List setterNames = []; + final List setterNames = []; /// The names of all requested `method`s. - final List methodNames = []; + final List methodNames = []; - void _notImplemented(String name) { - throw 'Not implemented: $name'; - } + _notImplemented(String name) => throw 'Not implemented: $name'; Function factory(Type type) => _notImplemented('factory'); @@ -24,10 +22,6 @@ class RecordingReflectionCapabilities implements ReflectionCapabilities { List annotations(typeOrFunc) => _notImplemented('annotations'); - static GetterFn _nullGetter = (Object p) => null; - static SetterFn _nullSetter = (Object p, v) => null; - static MethodFn _nullMethod = (Object p, List a) => null; - GetterFn getter(String name) { getterNames.add(name); return _nullGetter; @@ -43,3 +37,7 @@ class RecordingReflectionCapabilities implements ReflectionCapabilities { return _nullMethod; } } + +_nullGetter(Object p) => null; +_nullSetter(Object p, v) => null; +_nullMethod(Object p, List a) => null;