Skip to content

Commit

Permalink
fixes #315, order of libraries in the HTML file
Browse files Browse the repository at this point in the history
the lesson here is never use .importedLibraries ... we might want to change it in analyzer to use LinkedHashSet ...

R=vsm@google.com

Review URL: https://codereview.chromium.org/1337993004 .
  • Loading branch information
John Messerly committed Sep 15, 2015
1 parent ff1b78c commit bcec623
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions pkg/dev_compiler/lib/src/compiler.dart
Expand Up @@ -152,8 +152,8 @@ class BatchCompiler extends AbstractCompiler {
// TODO(jmesserly): in incremental mode, we can skip the transitive
// compile of imports/exports.
_compileLibrary(_dartCore); // implicit dart:core dependency
library.importedLibraries.forEach(_compileLibrary);
library.exportedLibraries.forEach(_compileLibrary);
for (var import in library.imports) _compileLibrary(import.importedLibrary);
for (var export in library.exports) _compileLibrary(export.exportedLibrary);

var unitElements = [library.definingCompilationUnit]..addAll(library.parts);
var units = <CompilationUnit>[];
Expand Down Expand Up @@ -269,8 +269,9 @@ class BatchCompiler extends AbstractCompiler {
var uri = lib.source.uri;
if (!loaded.add(uri)) return;
_collectLibraries(_dartCore, loaded);
for (var l in lib.importedLibraries) _collectLibraries(l, loaded);
for (var l in lib.exportedLibraries) _collectLibraries(l, loaded);

for (var l in lib.imports) _collectLibraries(l.importedLibrary, loaded);
for (var l in lib.exports) _collectLibraries(l.exportedLibrary, loaded);
// Move the item to the end of the list.
loaded.remove(uri);
loaded.add(uri);
Expand Down
Expand Up @@ -51,8 +51,8 @@ <h1>drfibonacci's Sunflower Spectacular</h1>
<script src="../dev_compiler/runtime/dart/mirrors.js"></script>
<script src="../dev_compiler/runtime/dart/_js_mirrors.js"></script>
<script src="../dev_compiler/runtime/dart/js.js"></script>
<script src="dom.js"></script>
<script src="circle.js"></script>
<script src="dom.js"></script>
<script src="painter.js"></script>
<script src="sunflower.js"></script>
<script>dart_library.start('sunflower/sunflower');</script>
Expand Down

0 comments on commit bcec623

Please sign in to comment.