Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit bb16d92

Browse files
committed
fix: Remove deprecated calls to DI bind(Type, inject[])
fixes #1259 closes #1260
1 parent aabe363 commit bb16d92

File tree

7 files changed

+30
-22
lines changed

7 files changed

+30
-22
lines changed

lib/core/module_internal.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ class CoreModule extends Module {
4040
bind(FormatterMap);
4141
bind(Interpolate);
4242
bind(RootScope);
43-
bind(Scope, inject: [RootScope]);
43+
bind(Scope, toInstanceOf: RootScope);
4444
bind(ClosureMap, toFactory: () => throw "Must provide dynamic/static ClosureMap.", inject: []);
4545
bind(ScopeStats);
4646
bind(ScopeStatsEmitter);
4747
bind(ScopeStatsConfig);
4848
bind(Object, toValue: {}); // RootScope context
4949

50-
bind(Parser, inject: [DynamicParser]);
51-
bind(ParserBackend, inject: [DynamicParserBackend]);
50+
bind(Parser, toInstanceOf: DynamicParser);
51+
bind(ParserBackend, toInstanceOf: DynamicParserBackend);
5252
bind(DynamicParser);
5353
bind(DynamicParserBackend);
5454
bind(Lexer);

lib/core_dom/module_internal.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ class CoreDomModule extends Module {
7272
bind(Compiler, toImplementation: TaggingCompiler);
7373
bind(CompilerConfig);
7474

75-
bind(ComponentFactory, inject: [SHADOW_DOM_COMPONENT_FACTORY_KEY]);
75+
bind(ComponentFactory, toInstanceOf: SHADOW_DOM_COMPONENT_FACTORY_KEY);
7676
bind(ShadowDomComponentFactory);
7777
bind(TranscludingComponentFactory);
7878
bind(Content);
7979
bind(ContentPort, toValue: null);
8080
bind(ComponentCssRewriter);
8181
bind(WebPlatform);
82-
82+
8383
bind(Http);
8484
bind(UrlRewriter);
8585
bind(HttpBackend);

lib/mock/module.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class AngularMockModule extends Module {
6363
bind(MockHttpBackend);
6464
bind(Element, toValue: document.body);
6565
bind(Node, toValue: document.body);
66-
bind(HttpBackend, inject:[MOCK_HTTP_BACKEND_KEY]);
66+
bind(HttpBackend, toInstanceOf: MOCK_HTTP_BACKEND_KEY);
6767
bind(VmTurnZone, toFactory: () {
6868
return new VmTurnZone()
6969
..onError = (e, s, LongStackTrace ls) => dump('EXCEPTION: $e\n$s\n$ls');

lib/tools/expression_extractor.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ main(args) {
5858
..bind(DynamicParser)
5959
..bind(DartGetterSetterGen)
6060
..bind(CacheRegister)
61-
..bind(Parser, inject: [DynamicParser])
62-
..bind(ParserBackend, inject: [DartGetterSetterGen]);
61+
..bind(Parser, toInstanceOf: DynamicParser)
62+
..bind(ParserBackend, toInstanceOf: DartGetterSetterGen);
6363
Injector injector = new ModuleInjector([module]);
6464

6565
runZoned(() {

pubspec.lock

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ packages:
44
analyzer:
55
description: analyzer
66
source: hosted
7-
version: "0.15.7"
7+
version: "0.18.0"
88
args:
99
description: args
1010
source: hosted
1111
version: "0.10.0+2"
1212
barback:
1313
description: barback
1414
source: hosted
15-
version: "0.13.0"
15+
version: "0.14.1+3"
1616
benchmark_harness:
1717
description: benchmark_harness
1818
source: hosted
@@ -24,11 +24,11 @@ packages:
2424
code_transformers:
2525
description: code_transformers
2626
source: hosted
27-
version: "0.1.4+2"
27+
version: "0.1.5"
2828
collection:
2929
description: collection
3030
source: hosted
31-
version: "0.9.2"
31+
version: "0.9.4"
3232
di:
3333
description: di
3434
source: hosted
@@ -44,7 +44,7 @@ packages:
4444
intl:
4545
description: intl
4646
source: hosted
47-
version: "0.9.10"
47+
version: "0.8.10+4"
4848
js:
4949
description: js
5050
source: hosted
@@ -56,15 +56,19 @@ packages:
5656
matcher:
5757
description: matcher
5858
source: hosted
59-
version: "0.10.0"
59+
version: "0.11.0"
60+
meta:
61+
description: meta
62+
source: hosted
63+
version: "0.8.8"
6064
mock:
6165
description: mock
6266
source: hosted
63-
version: "0.11.0+1"
67+
version: "0.11.0+2"
6468
path:
6569
description: path
6670
source: hosted
67-
version: "1.2.0"
71+
version: "1.2.1"
6872
perf_api:
6973
description: perf_api
7074
source: hosted
@@ -80,20 +84,24 @@ packages:
8084
source_maps:
8185
description: source_maps
8286
source: hosted
83-
version: "0.9.0"
87+
version: "0.9.3"
8488
stack_trace:
8589
description: stack_trace
8690
source: hosted
87-
version: "0.9.3+2"
91+
version: "1.0.2"
92+
typed_mock:
93+
description: typed_mock
94+
source: hosted
95+
version: "0.0.4"
8896
unittest:
8997
description: unittest
9098
source: hosted
91-
version: "0.11.0"
99+
version: "0.11.0+3"
92100
utf:
93101
description: utf
94102
source: hosted
95103
version: "0.9.0"
96104
web_components:
97105
description: web_components
98106
source: hosted
99-
version: "0.3.4"
107+
version: "0.3.5+1"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
browser: '>=0.10.0 <0.11.0'
2020
code_transformers: '>=0.1.4+2 <0.2.0'
2121
collection: '>=0.9.1 <1.0.0'
22-
di: '>=2.0.0 <3.0.0'
22+
di: '>=2.0.1 <3.0.0'
2323
html5lib: '>=0.10.0 <0.11.0'
2424
intl: '>=0.8.7 <0.10.0'
2525
perf_api: '>=0.0.8 <0.1.0'

test/core/parser/generated_getter_setter_spec.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import 'generated_getter_setter.dart' as gen;
77
main() {
88
describe('hybrid getter-setter', () {
99
beforeEachModule((Module module) {
10-
module..bind(Parser, inject: [DynamicParser])
10+
module..bind(Parser, toInstanceOf: DynamicParser)
1111
..bind(ClosureMap, toValue: gen.closureMap);
1212
});
1313
parser_spec.main();

0 commit comments

Comments
 (0)