From 846354473d4c2150b10d81f7740dc28c0bb4be5e Mon Sep 17 00:00:00 2001 From: Jacob MacDonald Date: Mon, 11 May 2015 14:25:25 -0700 Subject: [PATCH] chore(cleanup): Remove some unused files. --- .../src/transform/common/classdef_parser.dart | 86 ------------------- .../custom_metadata/chicken_soup.dart | 19 ---- .../expected/chicken_soup.ng_deps.dart | 17 ---- .../expected/split_pea_soup.ng_deps.dart | 17 ---- .../expected/tortilla_soup.ng_deps.dart | 17 ---- .../custom_metadata/split_pea_soup.dart | 19 ---- .../custom_metadata/tortilla_soup.dart | 19 ---- 7 files changed, 194 deletions(-) delete mode 100644 modules/angular2/src/transform/common/classdef_parser.dart delete mode 100644 modules/angular2/test/transform/directive_processor/custom_metadata/chicken_soup.dart delete mode 100644 modules/angular2/test/transform/directive_processor/custom_metadata/expected/chicken_soup.ng_deps.dart delete mode 100644 modules/angular2/test/transform/directive_processor/custom_metadata/expected/split_pea_soup.ng_deps.dart delete mode 100644 modules/angular2/test/transform/directive_processor/custom_metadata/expected/tortilla_soup.ng_deps.dart delete mode 100644 modules/angular2/test/transform/directive_processor/custom_metadata/split_pea_soup.dart delete mode 100644 modules/angular2/test/transform/directive_processor/custom_metadata/tortilla_soup.dart diff --git a/modules/angular2/src/transform/common/classdef_parser.dart b/modules/angular2/src/transform/common/classdef_parser.dart deleted file mode 100644 index b3fcfcf506..0000000000 --- a/modules/angular2/src/transform/common/classdef_parser.dart +++ /dev/null @@ -1,86 +0,0 @@ -library angular2.src.transform.common.classdef_parser; - -import 'dart:async'; - -import 'package:analyzer/analyzer.dart'; -import 'package:angular2/src/transform/common/asset_reader.dart'; -import 'package:angular2/src/transform/common/logging.dart'; -import 'package:barback/barback.dart'; -import 'package:code_transformers/assets.dart'; - -/// Creates a mapping of {@link AssetId}s to the {@link ClassDeclaration}s which they -/// define. -Future>> createTypeMap( - AssetReader reader, AssetId id) { - return _recurse(reader, id); -} - -Future>> _recurse( - AssetReader reader, AssetId id, - [_ClassDefVisitor visitor, Set seen]) async { - if (seen == null) seen = new Set(); - if (visitor == null) visitor = new _ClassDefVisitor(); - - if (seen.contains(id)) return visitor.result; - seen.add(id); - - var hasAsset = await reader.hasInput(id); - if (!hasAsset) return visitor.result; - - var code = await reader.readAsString(id); - visitor.current = id; - parseCompilationUnit(code, - name: id.path, - parseFunctionBodies: false, - suppressErrors: true).accept(visitor); - var toWait = []; - visitor.dependencies[id] - .map((node) => stringLiteralToString(node.uri)) - .where(_isNotDartImport) - .forEach((uri) { - var nodeId = uriToAssetId(id, uri, logger, null); - toWait.add(_recurse(reader, nodeId, visitor, seen)); - }); - - await Future.wait(toWait); - return visitor.result; -} - -bool _isNotDartImport(String uri) => !uri.startsWith('dart:'); - -class _ClassDefVisitor extends Object with RecursiveAstVisitor { - final Map> result = {}; - final Map> dependencies = {}; - List _currentClass; - List _currentDependencies; - - void set current(AssetId val) { - _currentDependencies = dependencies.putIfAbsent(val, () => []); - _currentClass = result.putIfAbsent(val, () => []); - } - - // TODO(kegluneq): Handle `part` directives. - @override - Object visitPartDirective(PartDirective node) => null; - - @override - Object visitImportDirective(ImportDirective node) { - _currentDependencies.add(node); - return null; - } - - @override - Object visitExportDirective(ExportDirective node) { - _currentDependencies.add(node); - return null; - } - - @override - Object visitFunctionDeclaration(FunctionDeclaration node) => null; - - @override - Object visitClassDeclaration(ClassDeclaration node) { - _currentClass.add(node); - return null; - } -} diff --git a/modules/angular2/test/transform/directive_processor/custom_metadata/chicken_soup.dart b/modules/angular2/test/transform/directive_processor/custom_metadata/chicken_soup.dart deleted file mode 100644 index 16c05f64c0..0000000000 --- a/modules/angular2/test/transform/directive_processor/custom_metadata/chicken_soup.dart +++ /dev/null @@ -1,19 +0,0 @@ -library dinner.chicken_soup; - -import 'package:angular2/di.dart' show Injectable; -import 'package:angular2/src/facade/lang.dart' show CONST; - -class Food implements Injectable { - @CONST() - const Food() : super(); -} - -class Soup extends Food { - @CONST() - const Soup() : super(); -} - -@Soup() -class ChickenSoup { - ChickenSoup(); -} diff --git a/modules/angular2/test/transform/directive_processor/custom_metadata/expected/chicken_soup.ng_deps.dart b/modules/angular2/test/transform/directive_processor/custom_metadata/expected/chicken_soup.ng_deps.dart deleted file mode 100644 index bc0f589cc7..0000000000 --- a/modules/angular2/test/transform/directive_processor/custom_metadata/expected/chicken_soup.ng_deps.dart +++ /dev/null @@ -1,17 +0,0 @@ -library dinner.chicken_soup.ng_deps.dart; - -import 'chicken_soup.dart'; -import 'package:angular2/di.dart' show Injectable; -import 'package:angular2/src/facade/lang.dart' show CONST; - -var _visited = false; -void initReflector(reflector) { - if (_visited) return; - _visited = true; - reflector - ..registerType(ChickenSoup, { - 'factory': () => new ChickenSoup(), - 'parameters': const [], - 'annotations': const [const Soup()] - }); -} diff --git a/modules/angular2/test/transform/directive_processor/custom_metadata/expected/split_pea_soup.ng_deps.dart b/modules/angular2/test/transform/directive_processor/custom_metadata/expected/split_pea_soup.ng_deps.dart deleted file mode 100644 index 398886ac42..0000000000 --- a/modules/angular2/test/transform/directive_processor/custom_metadata/expected/split_pea_soup.ng_deps.dart +++ /dev/null @@ -1,17 +0,0 @@ -library dinner.split_pea_soup.ng_deps.dart; - -import 'split_pea_soup.dart'; -import 'package:angular2/di.dart' show Injectable; -import 'package:angular2/src/facade/lang.dart' show CONST; - -var _visited = false; -void initReflector(reflector) { - if (_visited) return; - _visited = true; - reflector - ..registerType(SplitPea, { - 'factory': () => new SplitPea(), - 'parameters': const [], - 'annotations': const [const Soup()] - }); -} diff --git a/modules/angular2/test/transform/directive_processor/custom_metadata/expected/tortilla_soup.ng_deps.dart b/modules/angular2/test/transform/directive_processor/custom_metadata/expected/tortilla_soup.ng_deps.dart deleted file mode 100644 index c7d4b26a27..0000000000 --- a/modules/angular2/test/transform/directive_processor/custom_metadata/expected/tortilla_soup.ng_deps.dart +++ /dev/null @@ -1,17 +0,0 @@ -library dinner.tortilla_soup.ng_deps.dart; - -import 'tortilla_soup.dart'; -import 'package:angular2/di.dart' show Injectable; -import 'package:angular2/src/facade/lang.dart' show CONST; - -var _visited = false; -void initReflector(reflector) { - if (_visited) return; - _visited = true; - reflector - ..registerType(TortillaSoup, { - 'factory': () => new TortillaSoup(), - 'parameters': const [], - 'annotations': const [const Soup()] - }); -} diff --git a/modules/angular2/test/transform/directive_processor/custom_metadata/split_pea_soup.dart b/modules/angular2/test/transform/directive_processor/custom_metadata/split_pea_soup.dart deleted file mode 100644 index 6accf12e6e..0000000000 --- a/modules/angular2/test/transform/directive_processor/custom_metadata/split_pea_soup.dart +++ /dev/null @@ -1,19 +0,0 @@ -library dinner.split_pea_soup; - -import 'package:angular2/di.dart' show Injectable; -import 'package:angular2/src/facade/lang.dart' show CONST; - -class Food extends Injectable { - @CONST() - const Food() : super(); -} - -class Soup implements Food { - @CONST() - const Soup() : super(); -} - -@Soup() -class SplitPeaSoup { - SplitPeaSoup(); -} diff --git a/modules/angular2/test/transform/directive_processor/custom_metadata/tortilla_soup.dart b/modules/angular2/test/transform/directive_processor/custom_metadata/tortilla_soup.dart deleted file mode 100644 index 165c3596d4..0000000000 --- a/modules/angular2/test/transform/directive_processor/custom_metadata/tortilla_soup.dart +++ /dev/null @@ -1,19 +0,0 @@ -library dinner.tortilla_soup; - -import 'package:angular2/di.dart' show Injectable; -import 'package:angular2/src/facade/lang.dart' show CONST; - -class Food extends Injectable { - @CONST() - const Food() : super(); -} - -class Soup extends Food { - @CONST() - const Soup() : super(); -} - -@Soup() -class TortillaSoup { - TortillaSoup(); -}