Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: packages/code_transformers/lib/src/entry_point.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/code_transformers/lib/src/dart_sdk.dart ('k') | packages/code_transformers/lib/src/messages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « packages/code_transformers/lib/src/dart_sdk.dart ('k') | packages/code_transformers/lib/src/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698