Chromium Code Reviews| Index: dart/frog/leg/scanner/scanner_task.dart |
| diff --git a/dart/frog/leg/scanner/scanner_task.dart b/dart/frog/leg/scanner/scanner_task.dart |
| index a4a4a4a7c471bd552aa29be4dfd31a8ce91685e3..d8f33894cc3c04009315794dcb92ecbc6f07c516 100644 |
| --- a/dart/frog/leg/scanner/scanner_task.dart |
| +++ b/dart/frog/leg/scanner/scanner_task.dart |
| @@ -16,13 +16,14 @@ class ScannerTask extends CompilerTask { |
| } |
| void processScriptTags(LibraryElement library) { |
| + LinkBuilder<ScriptTag> imports = new LinkBuilder<ScriptTag>(); |
| + Uri cwd = new Uri(scheme: 'file', path: compiler.currentDirectory); |
|
kasperl
2012/02/15 09:22:30
The named arguments are cool. Would it make sense
ahe
2012/02/15 09:46:55
I need to process source directives before I start
|
| + Uri base = cwd.resolve(library.script.name.toString()); |
| for (ScriptTag tag in library.tags.reverse()) { |
| SourceString argument = tag.argument.value.copyWithoutQuotes(1, 1); |
| - Uri cwd = new Uri(scheme: 'file', path: compiler.currentDirectory); |
| - Uri base = cwd.resolve(library.script.name.toString()); |
| Uri resolved = base.resolve(argument.toString()); |
| if (tag.isImport()) { |
| - importLibrary(library, loadLibrary(resolved, tag), tag.prefix); |
| + imports.addLast(tag); |
| } else if (tag.isLibrary()) { |
| if (library.libraryTag !== null) { |
| compiler.cancel("duplicated library declaration", node: tag); |
| @@ -38,6 +39,11 @@ class ScannerTask extends CompilerTask { |
| compiler.cancel("illegal script tag: ${tag.tag}", node: tag); |
| } |
| } |
| + for (ScriptTag tag in imports.toLink()) { |
|
ngeoffray
2012/02/15 09:53:03
Maybe add a comment on why you need to import last
ahe
2012/02/15 15:08:42
Done.
|
| + SourceString argument = tag.argument.value.copyWithoutQuotes(1, 1); |
| + Uri resolved = base.resolve(argument.toString()); |
| + importLibrary(library, loadLibrary(resolved, tag), tag.prefix); |
| + } |
| if (compiler.coreLibrary !== null) { |
| importLibrary(library, compiler.coreLibrary, null); |
| } |