chore: analyzer fixes for Dart transformer

This commit is contained in:
Kevin Moore
2015-04-01 13:47:42 -07:00
committed by Rado Kirov
parent 25c709c58e
commit d77f409093
4 changed files with 11 additions and 14 deletions

View File

@ -160,7 +160,7 @@ class _TemplateExtractVisitor extends Object with RecursiveAstVisitor<Object> {
// 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<Object> {
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;
}

View File

@ -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<String> getterNames = [];
final List<String> getterNames = <String>[];
/// The names of all requested `setter`s.
final List<String> setterNames = [];
final List<String> setterNames = <String>[];
/// The names of all requested `method`s.
final List<String> methodNames = [];
final List<String> methodNames = <String>[];
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;