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

Unified Diff: sdk/lib/_internal/pub/lib/src/dart.dart

Issue 147923003: Compile spawnUri entrypoints to JS with pub build/serve. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 11 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 | « no previous file | sdk/lib/_internal/pub/test/transformer/dart2js/converts_isolate_entrypoint_in_web_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/dart.dart
diff --git a/sdk/lib/_internal/pub/lib/src/dart.dart b/sdk/lib/_internal/pub/lib/src/dart.dart
index af2c409263a6ae267ad32ef6d0e2ee780bb42597..481e124dbe6485f940908b9a49c8029e5bf94d75 100644
--- a/sdk/lib/_internal/pub/lib/src/dart.dart
+++ b/sdk/lib/_internal/pub/lib/src/dart.dart
@@ -107,11 +107,14 @@ String get _libPath {
/// Returns whether [dart] looks like an entrypoint file.
bool isEntrypoint(CompilationUnit dart) {
+ // Allow two or fewer arguments so that entrypoints intended for use with
+ // [spawnUri] get counted.
+ //
// TODO(nweiz): this misses the case where a Dart file doesn't contain main(),
// but it parts in another file that does.
return dart.declarations.any((node) {
return node is FunctionDeclaration && node.name.name == "main" &&
- node.functionExpression.parameters.parameters.isEmpty;
+ node.functionExpression.parameters.parameters.length <= 2;
});
}
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/test/transformer/dart2js/converts_isolate_entrypoint_in_web_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698