Files
angular-docs-cn/modules/angular2/src/core/reflection/reflection.dart
T
Tim Blasi 0a3a17ff10 fix(dart/reflection): Fix NoReflectionCapabilities interface
Make `NoReflectionCapabilities` conform to the `PlatformReflectionCapbilities`
api, which prevents some confusing error messages.

Closes #5559

Closes #5578
2015-12-03 22:11:26 +00:00

60 lines
1.3 KiB
Dart

library reflection.reflection;
import 'reflector.dart';
import 'types.dart';
export 'reflector.dart';
import 'platform_reflection_capabilities.dart';
import 'package:angular2/src/facade/lang.dart';
class NoReflectionCapabilities implements PlatformReflectionCapabilities {
@override
bool isReflectionEnabled() {
return false;
}
@override
Function factory(Type type) {
throw "Cannot find reflection information on ${stringify(type)}";
}
@override
List interfaces(Type type) {
throw "Cannot find reflection information on ${stringify(type)}";
}
@override
List parameters(dynamic type) {
throw "Cannot find reflection information on ${stringify(type)}";
}
@override
List annotations(dynamic type) {
throw "Cannot find reflection information on ${stringify(type)}";
}
@override
Map propMetadata(dynamic type) {
throw "Cannot find reflection information on ${stringify(type)}";
}
@override
GetterFn getter(String name) {
throw "Cannot find getter ${name}";
}
@override
SetterFn setter(String name) {
throw "Cannot find setter ${name}";
}
@override
MethodFn method(String name) {
throw "Cannot find method ${name}";
}
@override
String importUri(Type type) => './';
}
final Reflector reflector = new Reflector(new NoReflectionCapabilities());