Index: packages/code_transformers/lib/src/entry_point.dart |
diff --git a/packages/code_transformers/lib/src/entry_point.dart b/packages/code_transformers/lib/src/entry_point.dart |
index 21f7acf41163f1de214d33ea27185423ce69475c..b6544095a4f3105b1364a6ff9e100741052287a7 100644 |
--- a/packages/code_transformers/lib/src/entry_point.dart |
+++ b/packages/code_transformers/lib/src/entry_point.dart |
@@ -4,7 +4,7 @@ |
import 'dart:async'; |
import 'package:analyzer/analyzer.dart' as analyzer; |
-import 'package:analyzer/src/generated/ast.dart'; |
+import 'package:analyzer/dart/ast/ast.dart'; |
import 'package:barback/barback.dart'; |
/// Checks to see if the provided AssetId is a Dart file in a directory which |
@@ -15,12 +15,8 @@ import 'package:barback/barback.dart'; |
bool isPossibleDartEntryId(AssetId id) { |
if (id.extension != '.dart') return false; |
- return [ |
- 'benchmark', |
- 'example', |
- 'test', |
- 'web' |
- ].any((dir) => id.path.startsWith("$dir/")); |
+ return ['benchmark', 'example', 'test', 'web'] |
+ .any((dir) => id.path.startsWith("$dir/")); |
} |
/// Checks to see if the provided Asset is possibly a Dart entry point. |
@@ -43,10 +39,10 @@ Future<bool> isPossibleDartEntry(Asset asset) { |
bool _couldBeEntrypoint(CompilationUnit compilationUnit) { |
// Allow two or fewer arguments so that entrypoints intended for use with |
// [spawnUri] get counted. |
- var hasMain = compilationUnit.declarations.any( |
- (node) => node is FunctionDeclaration && |
- node.name.name == "main" && |
- node.functionExpression.parameters.parameters.length <= 2); |
+ var hasMain = compilationUnit.declarations.any((node) => |
+ node is FunctionDeclaration && |
+ node.name.name == "main" && |
+ node.functionExpression.parameters.parameters.length <= 2); |
if (hasMain) return true; |