OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 import 'dart:async'; | 4 import 'dart:async'; |
5 | 5 |
6 import 'package:analyzer/analyzer.dart' as analyzer; | 6 import 'package:analyzer/analyzer.dart' as analyzer; |
7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
8 import 'package:barback/barback.dart'; | 8 import 'package:barback/barback.dart'; |
9 | 9 |
10 /// Checks to see if the provided AssetId is a Dart file in a directory which | 10 /// Checks to see if the provided AssetId is a Dart file in a directory which |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 if (hasMain) return true; | 51 if (hasMain) return true; |
52 | 52 |
53 // If it has an export or a part, assume the worst- that the main could be | 53 // If it has an export or a part, assume the worst- that the main could be |
54 // in there. | 54 // in there. |
55 // We avoid loading those since this can be run from isPrimaryAsset calls | 55 // We avoid loading those since this can be run from isPrimaryAsset calls |
56 // where we do not have access to other sources. | 56 // where we do not have access to other sources. |
57 return compilationUnit.directives | 57 return compilationUnit.directives |
58 .any((node) => node is ExportDirective || node is PartDirective); | 58 .any((node) => node is ExportDirective || node is PartDirective); |
59 } | 59 } |
OLD | NEW |