From c701664e07330a43138aeac58e86f5ec71f0c4cd Mon Sep 17 00:00:00 2001 From: Ted Sander Date: Wed, 15 Jul 2015 23:15:44 -0700 Subject: [PATCH] chore(transformers): remove reflector parameter from initReflector signature Remove reflector parameter from initReflector method to simplify ng_deps for reflection initialization. It wasn't used and was added for testability, but wasn't used. This keeps the interface simplier. --- .../angular2/src/transform/directive_linker/linker.dart | 3 +-- .../src/transform/directive_processor/rewriter.dart | 8 ++++++-- .../src/transform/reflection_remover/codegen.dart | 3 +-- .../directive_linker/simple_export_files/bar.ng_deps.dart | 5 +++-- .../simple_export_files/expected/bar.ng_deps.dart | 7 ++++--- .../simple_export_files/expected/foo.ng_deps.dart | 5 +++-- .../simple_export_files/expected/index.ng_deps.dart | 5 +++-- .../directive_linker/simple_export_files/foo.ng_deps.dart | 5 +++-- .../simple_export_files/index.ng_deps.dart | 3 ++- .../directive_linker/simple_files/bar.ng_deps.dart | 5 +++-- .../simple_files/expected/bar.ng_deps.dart | 7 ++++--- .../simple_files/expected/foo.ng_deps.dart | 5 +++-- .../simple_files/expected/index.ng_deps.dart | 5 +++-- .../directive_linker/simple_files/foo.ng_deps.dart | 5 +++-- .../directive_linker/simple_files/index.ng_deps.dart | 3 ++- .../expected/hello.ng_deps.dart | 5 +++-- .../custom_metadata/expected/package_soup.ng_deps.dart | 5 +++-- .../custom_metadata/expected/relative_soup.ng_deps.dart | 5 +++-- .../directive_processor/expected/hello.ng_deps.dart | 5 +++-- .../interface_chain_files/expected/soup.ng_deps.dart | 5 +++-- .../interfaces_files/expected/soup.ng_deps.dart | 5 +++-- .../invalid_url_files/expected/hello.ng_deps.dart | 5 +++-- .../multiple_style_urls_files/expected/hello.ng_deps.dart | 5 +++-- .../expected/hello.ng_deps.dart | 5 +++-- .../parameter_metadata/expected/soup.ng_deps.dart | 5 +++-- .../expected/hello.ng_deps.dart | 5 +++-- .../static_function_files/expected/hello.ng_deps.dart | 5 +++-- .../superclass_files/expected/soup.ng_deps.dart | 5 +++-- .../url_expression_files/expected/hello.ng_deps.dart | 5 +++-- .../list_of_types_files/expected/bar.ng_deps.dart | 5 +++-- .../simple_annotation_files/expected/bar.ng_deps.dart | 5 +++-- .../simple_annotation_files/expected/index.ng_deps.dart | 5 +++-- .../synthetic_ctor_files/expected/bar.ng_deps.dart | 5 +++-- .../two_annotations_files/expected/bar.ng_deps.dart | 5 +++-- .../integration/two_deps_files/expected/bar.ng_deps.dart | 5 +++-- .../reflection_remover/debug_files/expected/index.dart | 2 +- .../debug_mirrors_files/expected/index.dart | 2 +- .../reflection_remover_files/expected/index.dart | 2 +- .../reflection_remover/verbose_files/expected/index.dart | 2 +- 39 files changed, 108 insertions(+), 74 deletions(-) diff --git a/modules/angular2/src/transform/directive_linker/linker.dart b/modules/angular2/src/transform/directive_linker/linker.dart index e5341e1a04..81d2e2f038 100644 --- a/modules/angular2/src/transform/directive_linker/linker.dart +++ b/modules/angular2/src/transform/directive_linker/linker.dart @@ -72,8 +72,7 @@ Future linkNgDeps(AssetReader reader, AssetId entryPoint) async { importBuf.write(''' import '${linkedDepsMap[it.current]}' as i${i}; '''); - declarationBuf - .write('i${i}.${SETUP_METHOD_NAME}(${REFLECTOR_VAR_NAME});'); + declarationBuf.write('i${i}.${SETUP_METHOD_NAME}();'); ++i; } } diff --git a/modules/angular2/src/transform/directive_processor/rewriter.dart b/modules/angular2/src/transform/directive_processor/rewriter.dart index 59336ee42b..5f7516cbf2 100644 --- a/modules/angular2/src/transform/directive_processor/rewriter.dart +++ b/modules/angular2/src/transform/directive_processor/rewriter.dart @@ -94,6 +94,7 @@ class CreateNgDepsVisitor extends Object with SimpleAstVisitor { if (_wroteBaseLibImport) return; _wroteBaseLibImport = true; writer.print('''import '${path.basename(assetId.path)}';'''); + writer.print("import '$_REFLECTOR_IMPORT' as $_REF_PREFIX;"); } void _updateUsesNonLangLibs(UriBasedDirective directive) { @@ -118,7 +119,7 @@ class CreateNgDepsVisitor extends Object with SimpleAstVisitor { void _openFunctionWrapper() { _maybeWriteImport(); writer.print('var _visited = false;' - 'void ${SETUP_METHOD_NAME}(${REFLECTOR_VAR_NAME}) {' + 'void ${SETUP_METHOD_NAME}() {' 'if (_visited) return; _visited = true;'); } @@ -256,6 +257,9 @@ class CreateNgDepsVisitor extends Object with SimpleAstVisitor { _foundNgInjectable = true; // The receiver for cascaded calls. - writer.print(REFLECTOR_VAR_NAME); + writer.print('$_REF_PREFIX.$REFLECTOR_VAR_NAME'); } } + +const _REF_PREFIX = '_ngRef'; +const _REFLECTOR_IMPORT = 'package:angular2/src/reflection/reflection.dart'; diff --git a/modules/angular2/src/transform/reflection_remover/codegen.dart b/modules/angular2/src/transform/reflection_remover/codegen.dart index cba64a63f2..3c1b700352 100644 --- a/modules/angular2/src/transform/reflection_remover/codegen.dart +++ b/modules/angular2/src/transform/reflection_remover/codegen.dart @@ -53,8 +53,7 @@ class Codegen { var count = 0; return importUris - .map((_) => - '${prefix}${count++}.${SETUP_METHOD_NAME}(${reflectorExpression});') + .map((_) => '${prefix}${count++}.${SETUP_METHOD_NAME}();') .join(''); } } diff --git a/modules/angular2/test/transform/directive_linker/simple_export_files/bar.ng_deps.dart b/modules/angular2/test/transform/directive_linker/simple_export_files/bar.ng_deps.dart index 83e8c0bc92..f664a1acb2 100644 --- a/modules/angular2/test/transform/directive_linker/simple_export_files/bar.ng_deps.dart +++ b/modules/angular2/test/transform/directive_linker/simple_export_files/bar.ng_deps.dart @@ -1,14 +1,15 @@ library bar.ng_deps.dart; import 'bar.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; export 'foo.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(MyComponent, { 'factory': () => new MyComponent(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_linker/simple_export_files/expected/bar.ng_deps.dart b/modules/angular2/test/transform/directive_linker/simple_export_files/expected/bar.ng_deps.dart index 02d89317f6..164b2cf5d4 100644 --- a/modules/angular2/test/transform/directive_linker/simple_export_files/expected/bar.ng_deps.dart +++ b/modules/angular2/test/transform/directive_linker/simple_export_files/expected/bar.ng_deps.dart @@ -1,19 +1,20 @@ library bar.ng_deps.dart; import 'bar.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; export 'foo.dart'; import 'foo.ng_deps.dart' as i0; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(MyComponent, { 'factory': () => new MyComponent(), 'parameters': const [], 'annotations': const [const Component(selector: '[soup]')] }); - i0.initReflector(reflector); + i0.initReflector(); } diff --git a/modules/angular2/test/transform/directive_linker/simple_export_files/expected/foo.ng_deps.dart b/modules/angular2/test/transform/directive_linker/simple_export_files/expected/foo.ng_deps.dart index 0b7e7e7c40..1b98169901 100644 --- a/modules/angular2/test/transform/directive_linker/simple_export_files/expected/foo.ng_deps.dart +++ b/modules/angular2/test/transform/directive_linker/simple_export_files/expected/foo.ng_deps.dart @@ -1,13 +1,14 @@ library foo.ng_deps.dart; import 'foo.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(DependencyComponent, { 'factory': () => new DependencyComponent(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_linker/simple_export_files/expected/index.ng_deps.dart b/modules/angular2/test/transform/directive_linker/simple_export_files/expected/index.ng_deps.dart index 978e6da400..90ed3366a1 100644 --- a/modules/angular2/test/transform/directive_linker/simple_export_files/expected/index.ng_deps.dart +++ b/modules/angular2/test/transform/directive_linker/simple_export_files/expected/index.ng_deps.dart @@ -1,13 +1,14 @@ library web_foo.ng_deps.dart; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/application.dart'; import 'package:angular2/src/reflection/reflection_capabilities.dart'; import 'bar.dart'; import 'bar.ng_deps.dart' as i0; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - i0.initReflector(reflector); + i0.initReflector(); } diff --git a/modules/angular2/test/transform/directive_linker/simple_export_files/foo.ng_deps.dart b/modules/angular2/test/transform/directive_linker/simple_export_files/foo.ng_deps.dart index 0b7e7e7c40..1b98169901 100644 --- a/modules/angular2/test/transform/directive_linker/simple_export_files/foo.ng_deps.dart +++ b/modules/angular2/test/transform/directive_linker/simple_export_files/foo.ng_deps.dart @@ -1,13 +1,14 @@ library foo.ng_deps.dart; import 'foo.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(DependencyComponent, { 'factory': () => new DependencyComponent(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_linker/simple_export_files/index.ng_deps.dart b/modules/angular2/test/transform/directive_linker/simple_export_files/index.ng_deps.dart index b50e664e59..65fe6009b7 100644 --- a/modules/angular2/test/transform/directive_linker/simple_export_files/index.ng_deps.dart +++ b/modules/angular2/test/transform/directive_linker/simple_export_files/index.ng_deps.dart @@ -1,11 +1,12 @@ library web_foo.ng_deps.dart; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/application.dart'; import 'package:angular2/src/reflection/reflection_capabilities.dart'; import 'bar.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; } diff --git a/modules/angular2/test/transform/directive_linker/simple_files/bar.ng_deps.dart b/modules/angular2/test/transform/directive_linker/simple_files/bar.ng_deps.dart index 2cf2b550dd..3a2464e279 100644 --- a/modules/angular2/test/transform/directive_linker/simple_files/bar.ng_deps.dart +++ b/modules/angular2/test/transform/directive_linker/simple_files/bar.ng_deps.dart @@ -1,14 +1,15 @@ library bar.ng_deps.dart; import 'bar.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; import 'foo.dart' as dep; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(MyComponent, { 'factory': () => new MyComponent(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_linker/simple_files/expected/bar.ng_deps.dart b/modules/angular2/test/transform/directive_linker/simple_files/expected/bar.ng_deps.dart index b713fd1aa0..4284c726e9 100644 --- a/modules/angular2/test/transform/directive_linker/simple_files/expected/bar.ng_deps.dart +++ b/modules/angular2/test/transform/directive_linker/simple_files/expected/bar.ng_deps.dart @@ -1,15 +1,16 @@ library bar.ng_deps.dart; import 'bar.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; import 'foo.dart' as dep; import 'foo.ng_deps.dart' as i0; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(MyComponent, { 'factory': () => new MyComponent(), 'parameters': const [], @@ -18,5 +19,5 @@ void initReflector(reflector) { selector: '[soup]', viewInjector: const [dep.DependencyComponent]) ] }); - i0.initReflector(reflector); + i0.initReflector(); } diff --git a/modules/angular2/test/transform/directive_linker/simple_files/expected/foo.ng_deps.dart b/modules/angular2/test/transform/directive_linker/simple_files/expected/foo.ng_deps.dart index 0b7e7e7c40..1b98169901 100644 --- a/modules/angular2/test/transform/directive_linker/simple_files/expected/foo.ng_deps.dart +++ b/modules/angular2/test/transform/directive_linker/simple_files/expected/foo.ng_deps.dart @@ -1,13 +1,14 @@ library foo.ng_deps.dart; import 'foo.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(DependencyComponent, { 'factory': () => new DependencyComponent(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_linker/simple_files/expected/index.ng_deps.dart b/modules/angular2/test/transform/directive_linker/simple_files/expected/index.ng_deps.dart index 978e6da400..90ed3366a1 100644 --- a/modules/angular2/test/transform/directive_linker/simple_files/expected/index.ng_deps.dart +++ b/modules/angular2/test/transform/directive_linker/simple_files/expected/index.ng_deps.dart @@ -1,13 +1,14 @@ library web_foo.ng_deps.dart; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/application.dart'; import 'package:angular2/src/reflection/reflection_capabilities.dart'; import 'bar.dart'; import 'bar.ng_deps.dart' as i0; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - i0.initReflector(reflector); + i0.initReflector(); } diff --git a/modules/angular2/test/transform/directive_linker/simple_files/foo.ng_deps.dart b/modules/angular2/test/transform/directive_linker/simple_files/foo.ng_deps.dart index 0b7e7e7c40..1b98169901 100644 --- a/modules/angular2/test/transform/directive_linker/simple_files/foo.ng_deps.dart +++ b/modules/angular2/test/transform/directive_linker/simple_files/foo.ng_deps.dart @@ -1,13 +1,14 @@ library foo.ng_deps.dart; import 'foo.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(DependencyComponent, { 'factory': () => new DependencyComponent(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_linker/simple_files/index.ng_deps.dart b/modules/angular2/test/transform/directive_linker/simple_files/index.ng_deps.dart index b50e664e59..65fe6009b7 100644 --- a/modules/angular2/test/transform/directive_linker/simple_files/index.ng_deps.dart +++ b/modules/angular2/test/transform/directive_linker/simple_files/index.ng_deps.dart @@ -1,11 +1,12 @@ library web_foo.ng_deps.dart; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/application.dart'; import 'package:angular2/src/reflection/reflection_capabilities.dart'; import 'bar.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; } diff --git a/modules/angular2/test/transform/directive_processor/absolute_url_expression_files/expected/hello.ng_deps.dart b/modules/angular2/test/transform/directive_processor/absolute_url_expression_files/expected/hello.ng_deps.dart index 86deb5bc35..d7e31b282b 100644 --- a/modules/angular2/test/transform/directive_processor/absolute_url_expression_files/expected/hello.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/absolute_url_expression_files/expected/hello.ng_deps.dart @@ -1,14 +1,15 @@ library examples.src.hello_world.absolute_url_expression_files.ng_deps.dart; import 'hello.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/angular2.dart' show bootstrap, Component, Directive, View, NgElement; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(HelloCmp, { 'factory': () => new HelloCmp(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_processor/custom_metadata/expected/package_soup.ng_deps.dart b/modules/angular2/test/transform/directive_processor/custom_metadata/expected/package_soup.ng_deps.dart index fdcd3e2092..1d6a5399a0 100644 --- a/modules/angular2/test/transform/directive_processor/custom_metadata/expected/package_soup.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/custom_metadata/expected/package_soup.ng_deps.dart @@ -1,13 +1,14 @@ library dinner.package_soup.ng_deps.dart; import 'package_soup.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:soup/soup.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(PackageSoup, { 'factory': () => new PackageSoup(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_processor/custom_metadata/expected/relative_soup.ng_deps.dart b/modules/angular2/test/transform/directive_processor/custom_metadata/expected/relative_soup.ng_deps.dart index 5671571997..0b755da51a 100644 --- a/modules/angular2/test/transform/directive_processor/custom_metadata/expected/relative_soup.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/custom_metadata/expected/relative_soup.ng_deps.dart @@ -1,13 +1,14 @@ library dinner.relative_soup.ng_deps.dart; import 'relative_soup.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'annotations/soup.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(RelativeSoup, { 'factory': () => new RelativeSoup(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_processor/expected/hello.ng_deps.dart b/modules/angular2/test/transform/directive_processor/expected/hello.ng_deps.dart index 8f6a4690b6..f75b4a3610 100644 --- a/modules/angular2/test/transform/directive_processor/expected/hello.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/expected/hello.ng_deps.dart @@ -1,14 +1,15 @@ library examples.src.hello_world.index_common_dart.ng_deps.dart; import 'hello.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/angular2.dart' show bootstrap, Component, Directive, View, NgElement; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(HelloCmp, { 'factory': () => new HelloCmp(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_processor/interface_chain_files/expected/soup.ng_deps.dart b/modules/angular2/test/transform/directive_processor/interface_chain_files/expected/soup.ng_deps.dart index b6247f4757..a8a56b96f8 100644 --- a/modules/angular2/test/transform/directive_processor/interface_chain_files/expected/soup.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/interface_chain_files/expected/soup.ng_deps.dart @@ -1,13 +1,14 @@ library dinner.soup.ng_deps.dart; import 'soup.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(ChangingSoupComponent, { 'factory': () => new ChangingSoupComponent(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_processor/interfaces_files/expected/soup.ng_deps.dart b/modules/angular2/test/transform/directive_processor/interfaces_files/expected/soup.ng_deps.dart index 7e654c36ed..e64b99a8af 100644 --- a/modules/angular2/test/transform/directive_processor/interfaces_files/expected/soup.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/interfaces_files/expected/soup.ng_deps.dart @@ -1,13 +1,14 @@ library dinner.soup.ng_deps.dart; import 'soup.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(ChangingSoupComponent, { 'factory': () => new ChangingSoupComponent(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_processor/invalid_url_files/expected/hello.ng_deps.dart b/modules/angular2/test/transform/directive_processor/invalid_url_files/expected/hello.ng_deps.dart index 892af6e68a..b86c281599 100644 --- a/modules/angular2/test/transform/directive_processor/invalid_url_files/expected/hello.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/invalid_url_files/expected/hello.ng_deps.dart @@ -1,14 +1,15 @@ library test.transform.directive_processor.invalid_url_files.hello.ng_deps.dart; import 'hello.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/angular2.dart' show bootstrap, Component, Directive, View, NgElement; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(HelloCmp, { 'factory': () => new HelloCmp(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_processor/multiple_style_urls_files/expected/hello.ng_deps.dart b/modules/angular2/test/transform/directive_processor/multiple_style_urls_files/expected/hello.ng_deps.dart index b526731f45..697d1b1ce7 100644 --- a/modules/angular2/test/transform/directive_processor/multiple_style_urls_files/expected/hello.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/multiple_style_urls_files/expected/hello.ng_deps.dart @@ -1,14 +1,15 @@ library examples.src.hello_world.multiple_style_urls_files.ng_deps.dart; import 'hello.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/angular2.dart' show bootstrap, Component, Directive, View, NgElement; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(HelloCmp, { 'factory': () => new HelloCmp(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_processor/multiple_style_urls_not_inlined_files/expected/hello.ng_deps.dart b/modules/angular2/test/transform/directive_processor/multiple_style_urls_not_inlined_files/expected/hello.ng_deps.dart index 756bcfb917..12a4b6da44 100644 --- a/modules/angular2/test/transform/directive_processor/multiple_style_urls_not_inlined_files/expected/hello.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/multiple_style_urls_not_inlined_files/expected/hello.ng_deps.dart @@ -1,14 +1,15 @@ library examples.src.hello_world.multiple_style_urls_not_inlined_files.ng_deps.dart; import 'hello.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/angular2.dart' show bootstrap, Component, Directive, View, NgElement; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(HelloCmp, { 'factory': () => new HelloCmp(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_processor/parameter_metadata/expected/soup.ng_deps.dart b/modules/angular2/test/transform/directive_processor/parameter_metadata/expected/soup.ng_deps.dart index 9aab172039..a12608d621 100644 --- a/modules/angular2/test/transform/directive_processor/parameter_metadata/expected/soup.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/parameter_metadata/expected/soup.ng_deps.dart @@ -1,13 +1,14 @@ library dinner.soup.ng_deps.dart; import 'soup.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(SoupComponent, { 'factory': (String description, salt) => new SoupComponent(description, salt), diff --git a/modules/angular2/test/transform/directive_processor/split_url_expression_files/expected/hello.ng_deps.dart b/modules/angular2/test/transform/directive_processor/split_url_expression_files/expected/hello.ng_deps.dart index c6a09e72c2..5ce309dded 100644 --- a/modules/angular2/test/transform/directive_processor/split_url_expression_files/expected/hello.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/split_url_expression_files/expected/hello.ng_deps.dart @@ -1,14 +1,15 @@ library examples.src.hello_world.split_url_expression_files.ng_deps.dart; import 'hello.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/angular2.dart' show bootstrap, Component, Directive, View, NgElement; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(HelloCmp, { 'factory': () => new HelloCmp(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_processor/static_function_files/expected/hello.ng_deps.dart b/modules/angular2/test/transform/directive_processor/static_function_files/expected/hello.ng_deps.dart index 045b25032a..d2387ae284 100644 --- a/modules/angular2/test/transform/directive_processor/static_function_files/expected/hello.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/static_function_files/expected/hello.ng_deps.dart @@ -1,13 +1,14 @@ library static_function_files.hello.ng_deps.dart; import 'hello.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/angular2.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerFunction(getMessage, { 'parameters': const [const [const Inject(Message)]], 'annotations': const Injectable() diff --git a/modules/angular2/test/transform/directive_processor/superclass_files/expected/soup.ng_deps.dart b/modules/angular2/test/transform/directive_processor/superclass_files/expected/soup.ng_deps.dart index 377813bb16..9aac63d4a7 100644 --- a/modules/angular2/test/transform/directive_processor/superclass_files/expected/soup.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/superclass_files/expected/soup.ng_deps.dart @@ -1,13 +1,14 @@ library dinner.soup.ng_deps.dart; import 'soup.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(ChangingSoupComponent, { 'factory': () => new ChangingSoupComponent(), 'parameters': const [], diff --git a/modules/angular2/test/transform/directive_processor/url_expression_files/expected/hello.ng_deps.dart b/modules/angular2/test/transform/directive_processor/url_expression_files/expected/hello.ng_deps.dart index f9cbc9e520..23a168c271 100644 --- a/modules/angular2/test/transform/directive_processor/url_expression_files/expected/hello.ng_deps.dart +++ b/modules/angular2/test/transform/directive_processor/url_expression_files/expected/hello.ng_deps.dart @@ -1,14 +1,15 @@ library examples.src.hello_world.url_expression_files.ng_deps.dart; import 'hello.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/angular2.dart' show bootstrap, Component, Directive, View, NgElement; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(HelloCmp, { 'factory': () => new HelloCmp(), 'parameters': const [], diff --git a/modules/angular2/test/transform/integration/list_of_types_files/expected/bar.ng_deps.dart b/modules/angular2/test/transform/integration/list_of_types_files/expected/bar.ng_deps.dart index ea5db8c8ae..638bc7f81d 100644 --- a/modules/angular2/test/transform/integration/list_of_types_files/expected/bar.ng_deps.dart +++ b/modules/angular2/test/transform/integration/list_of_types_files/expected/bar.ng_deps.dart @@ -1,14 +1,15 @@ library bar.ng_deps.dart; import 'bar.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; import 'foo.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(MyComponent, { 'factory': (MyContext c) => new MyComponent(c), 'parameters': const [const [MyContext]], diff --git a/modules/angular2/test/transform/integration/simple_annotation_files/expected/bar.ng_deps.dart b/modules/angular2/test/transform/integration/simple_annotation_files/expected/bar.ng_deps.dart index d9644279d0..499fc5359f 100644 --- a/modules/angular2/test/transform/integration/simple_annotation_files/expected/bar.ng_deps.dart +++ b/modules/angular2/test/transform/integration/simple_annotation_files/expected/bar.ng_deps.dart @@ -1,13 +1,14 @@ library bar.ng_deps.dart; import 'bar.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(MyComponent, { 'factory': () => new MyComponent(), 'parameters': const [], diff --git a/modules/angular2/test/transform/integration/simple_annotation_files/expected/index.ng_deps.dart b/modules/angular2/test/transform/integration/simple_annotation_files/expected/index.ng_deps.dart index 69c78201a2..8e0a1c0adf 100644 --- a/modules/angular2/test/transform/integration/simple_annotation_files/expected/index.ng_deps.dart +++ b/modules/angular2/test/transform/integration/simple_annotation_files/expected/index.ng_deps.dart @@ -1,6 +1,7 @@ library web_foo.ng_deps.dart; import 'index.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/application.dart'; import 'package:angular2/src/reflection/reflection.dart'; import 'index.ng_deps.dart' as ngStaticInit0; @@ -8,8 +9,8 @@ import 'bar.dart'; import 'bar.ng_deps.dart' as i0; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - i0.initReflector(reflector); + i0.initReflector(); } diff --git a/modules/angular2/test/transform/integration/synthetic_ctor_files/expected/bar.ng_deps.dart b/modules/angular2/test/transform/integration/synthetic_ctor_files/expected/bar.ng_deps.dart index d9644279d0..499fc5359f 100644 --- a/modules/angular2/test/transform/integration/synthetic_ctor_files/expected/bar.ng_deps.dart +++ b/modules/angular2/test/transform/integration/synthetic_ctor_files/expected/bar.ng_deps.dart @@ -1,13 +1,14 @@ library bar.ng_deps.dart; import 'bar.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(MyComponent, { 'factory': () => new MyComponent(), 'parameters': const [], diff --git a/modules/angular2/test/transform/integration/two_annotations_files/expected/bar.ng_deps.dart b/modules/angular2/test/transform/integration/two_annotations_files/expected/bar.ng_deps.dart index 30bb290bd9..55833d6d45 100644 --- a/modules/angular2/test/transform/integration/two_annotations_files/expected/bar.ng_deps.dart +++ b/modules/angular2/test/transform/integration/two_annotations_files/expected/bar.ng_deps.dart @@ -4,14 +4,15 @@ import 'package:angular2/src/change_detection/pregen_proto_change_detector.dart' as _gen; import 'bar.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; import 'package:angular2/src/core/annotations_impl/view.dart'; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(MyComponent, { 'factory': () => new MyComponent(), 'parameters': const [], diff --git a/modules/angular2/test/transform/integration/two_deps_files/expected/bar.ng_deps.dart b/modules/angular2/test/transform/integration/two_deps_files/expected/bar.ng_deps.dart index 33d29a8dac..45ae0a39fd 100644 --- a/modules/angular2/test/transform/integration/two_deps_files/expected/bar.ng_deps.dart +++ b/modules/angular2/test/transform/integration/two_deps_files/expected/bar.ng_deps.dart @@ -1,14 +1,15 @@ library bar.ng_deps.dart; import 'bar.dart'; +import 'package:angular2/src/reflection/reflection.dart' as _ngRef; import 'package:angular2/src/core/annotations_impl/annotations.dart'; import 'foo.dart' as prefix; var _visited = false; -void initReflector(reflector) { +void initReflector() { if (_visited) return; _visited = true; - reflector + _ngRef.reflector ..registerType(MyComponent, { 'factory': (prefix.MyContext c, String inValue) => new MyComponent(c, inValue), diff --git a/modules/angular2/test/transform/reflection_remover/debug_files/expected/index.dart b/modules/angular2/test/transform/reflection_remover/debug_files/expected/index.dart index f81f56e599..4d1bc48d6a 100644 --- a/modules/angular2/test/transform/reflection_remover/debug_files/expected/index.dart +++ b/modules/angular2/test/transform/reflection_remover/debug_files/expected/index.dart @@ -16,7 +16,7 @@ import 'package:angular2/src/reflection/reflection.dart'; import 'package:angular2/src/reflection/debug_reflection_capabilities.dart';import 'index.ng_deps.dart' as ngStaticInit0; void main() { - reflector.reflectionCapabilities = new ReflectionCapabilities();ngStaticInit0.initReflector(reflector); + reflector.reflectionCapabilities = new ReflectionCapabilities();ngStaticInit0.initReflector(); bootstrap(MyComponent); } """; diff --git a/modules/angular2/test/transform/reflection_remover/debug_mirrors_files/expected/index.dart b/modules/angular2/test/transform/reflection_remover/debug_mirrors_files/expected/index.dart index 9576d93c8e..50b4897b7a 100644 --- a/modules/angular2/test/transform/reflection_remover/debug_mirrors_files/expected/index.dart +++ b/modules/angular2/test/transform/reflection_remover/debug_mirrors_files/expected/index.dart @@ -16,7 +16,7 @@ import 'package:angular2/src/reflection/reflection.dart'; import 'package:angular2/src/reflection/debug_reflection_capabilities.dart';import 'index.ng_deps.dart' as ngStaticInit0; void main() { - reflector.reflectionCapabilities = new ReflectionCapabilities();ngStaticInit0.initReflector(reflector); + reflector.reflectionCapabilities = new ReflectionCapabilities();ngStaticInit0.initReflector(); bootstrap(MyComponent); } """; diff --git a/modules/angular2/test/transform/reflection_remover/reflection_remover_files/expected/index.dart b/modules/angular2/test/transform/reflection_remover/reflection_remover_files/expected/index.dart index d8b7d4b9fa..a42c075df1 100644 --- a/modules/angular2/test/transform/reflection_remover/reflection_remover_files/expected/index.dart +++ b/modules/angular2/test/transform/reflection_remover/reflection_remover_files/expected/index.dart @@ -16,7 +16,7 @@ import 'package:angular2/src/reflection/reflection.dart'; /*import 'package:angular2/src/reflection/reflection_capabilities.dart';*/import 'index.ng_deps.dart' as ngStaticInit0; void main() { - /*reflector.reflectionCapabilities = new ReflectionCapabilities();*/ngStaticInit0.initReflector(reflector); + /*reflector.reflectionCapabilities = new ReflectionCapabilities();*/ngStaticInit0.initReflector(); bootstrap(MyComponent); } """; diff --git a/modules/angular2/test/transform/reflection_remover/verbose_files/expected/index.dart b/modules/angular2/test/transform/reflection_remover/verbose_files/expected/index.dart index 65884c6cb8..5e9b74325b 100644 --- a/modules/angular2/test/transform/reflection_remover/verbose_files/expected/index.dart +++ b/modules/angular2/test/transform/reflection_remover/verbose_files/expected/index.dart @@ -16,7 +16,7 @@ import 'package:angular2/src/reflection/reflection.dart'; import 'package:angular2/src/reflection/debug_reflection_capabilities.dart';import 'index.ng_deps.dart' as ngStaticInit0; void main() { - reflector.reflectionCapabilities = new ReflectionCapabilities(verbose: true);ngStaticInit0.initReflector(reflector); + reflector.reflectionCapabilities = new ReflectionCapabilities(verbose: true);ngStaticInit0.initReflector(); bootstrap(MyComponent); } """;