X Tutup
Skip to content

Commit 0a3a17f

Browse files
Tim Blasikegluneq
authored andcommitted
fix(dart/reflection): Fix NoReflectionCapabilities interface
Make `NoReflectionCapabilities` conform to the `PlatformReflectionCapbilities` api, which prevents some confusing error messages. Closes #5559 Closes #5578
1 parent 680f7e0 commit 0a3a17f

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

modules/angular2/src/core/reflection/reflection.dart

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,53 @@ import 'platform_reflection_capabilities.dart';
77
import 'package:angular2/src/facade/lang.dart';
88

99
class NoReflectionCapabilities implements PlatformReflectionCapabilities {
10+
@override
1011
bool isReflectionEnabled() {
1112
return false;
1213
}
1314

15+
@override
1416
Function factory(Type type) {
1517
throw "Cannot find reflection information on ${stringify(type)}";
1618
}
1719

20+
@override
1821
List interfaces(Type type) {
1922
throw "Cannot find reflection information on ${stringify(type)}";
2023
}
2124

22-
List parameters(Type type) {
25+
@override
26+
List parameters(dynamic type) {
2327
throw "Cannot find reflection information on ${stringify(type)}";
2428
}
2529

26-
List annotations(Type type) {
30+
@override
31+
List annotations(dynamic type) {
2732
throw "Cannot find reflection information on ${stringify(type)}";
2833
}
2934

30-
Map propMetadata(Type type) {
35+
@override
36+
Map propMetadata(dynamic type) {
3137
throw "Cannot find reflection information on ${stringify(type)}";
3238
}
3339

40+
@override
3441
GetterFn getter(String name) {
3542
throw "Cannot find getter ${name}";
3643
}
3744

45+
@override
3846
SetterFn setter(String name) {
3947
throw "Cannot find setter ${name}";
4048
}
4149

50+
@override
4251
MethodFn method(String name) {
4352
throw "Cannot find method ${name}";
4453
}
4554

55+
@override
4656
String importUri(Type type) => './';
47-
48-
String moduleId(Type type) => './';
4957
}
5058

5159
final Reflector reflector = new Reflector(new NoReflectionCapabilities());

modules/angular2/test/public_api_spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,6 @@ var NG_ALL = [
14491449
"NoReflectionCapabilities.interfaces():dart",
14501450
"NoReflectionCapabilities.isReflectionEnabled():dart",
14511451
"NoReflectionCapabilities.method():dart",
1452-
"NoReflectionCapabilities.moduleId():dart",
14531452
"NoReflectionCapabilities.parameters():dart",
14541453
"NoReflectionCapabilities.propMetadata():dart",
14551454
"NoReflectionCapabilities.setter():dart",

0 commit comments

Comments
 (0)
X Tutup