@@ -3,13 +3,17 @@ library angular.app.static;
3
3
import 'package:di/static_injector.dart' ;
4
4
import 'package:di/di.dart' show TypeFactory, Injector;
5
5
import 'package:angular/bootstrap.dart' ;
6
- import 'package:angular/core/module_internal .dart' ;
6
+ import 'package:angular/core/registry .dart' ;
7
7
import 'package:angular/core/parser/parser.dart' ;
8
+ import 'package:angular/core/parser/parser_static.dart' ;
8
9
import 'package:angular/core/parser/dynamic_parser.dart' ;
9
10
import 'package:angular/core/registry_static.dart' ;
10
11
import 'package:angular/change_detection/change_detection.dart' ;
11
12
import 'package:angular/change_detection/dirty_checking_change_detector_static.dart' ;
12
13
14
+ export 'package:angular/core/parser/parser_static.dart' show
15
+ StaticClosureMap;
16
+
13
17
class _StaticApplication extends Application {
14
18
final Map <Type , TypeFactory > typeFactories;
15
19
@@ -29,44 +33,6 @@ class _StaticApplication extends Application {
29
33
new StaticInjector (modules: modules, typeFactories: typeFactories);
30
34
}
31
35
32
- class StaticClosureMap extends ClosureMap {
33
- final Map <String , Getter > getters;
34
- final Map <String , Setter > setters;
35
- final Map <String , Symbol > symbols;
36
-
37
- StaticClosureMap (this .getters, this .setters, this .symbols);
38
-
39
- Getter lookupGetter (String name) {
40
- Getter getter = getters[name];
41
- if (getter == null ) throw "No getter for '$name '." ;
42
- return getter;
43
- }
44
-
45
- Setter lookupSetter (String name) {
46
- Setter setter = setters[name];
47
- if (setter == null ) throw "No setter for '$name '." ;
48
- return setter;
49
- }
50
-
51
- MethodClosure lookupFunction (String name, CallArguments arguments) {
52
- var fn = lookupGetter (name);
53
- return (o, posArgs, namedArgs) {
54
- var sNamedArgs = {};
55
- namedArgs.forEach ((name, value) => sNamedArgs[symbols[name]] = value);
56
- if (o is Map ) {
57
- var fn = o[name];
58
- if (fn is Function ) {
59
- return Function .apply (fn, posArgs, sNamedArgs);
60
- } else {
61
- throw "Property '$name ' is not of type function." ;
62
- }
63
- } else {
64
- return Function .apply (fn (o), posArgs, sNamedArgs);
65
- }
66
- };
67
- }
68
- }
69
-
70
36
Application staticApplication (
71
37
Map <Type , TypeFactory > typeFactories,
72
38
Map <Type , Object > metadata,
0 commit comments