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

Unified Diff: lib/src/codegen/dart_codegen.dart

Issue 1011153002: js: fix core.Object, output order, static const fields (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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
Index: lib/src/codegen/dart_codegen.dart
diff --git a/lib/src/codegen/dart_codegen.dart b/lib/src/codegen/dart_codegen.dart
index 3fa931bcf087c67a44c747c0a8eeda042eed5cdc..a25b9e21992822bc6c61c1b321eebf4f6b40ad2d 100644
--- a/lib/src/codegen/dart_codegen.dart
+++ b/lib/src/codegen/dart_codegen.dart
@@ -435,28 +435,23 @@ class DartGenerator extends codegenerator.CodeGenerator {
out.finalize();
}
- void _generateLibrary(Iterable<CompilationUnit> units, LibraryInfo info,
- CheckerReporter reporter) {
+ void _generateLibrary(
+ LibraryUnit unit, LibraryInfo info, CheckerReporter reporter) {
doOne(unit) {
var outputDir = makeOutputDirectory(info, unit);
reporter.enterSource(unit.element.source);
generateUnit(unit, info, outputDir);
reporter.leaveSource();
}
- isLib(unit) => unit.directives.any((d) => d is LibraryDirective);
- isNotLib(unit) => !isLib(unit);
- var libs = units.where(isLib);
- var parts = units.where(isNotLib);
- assert(libs.length == 1 || (libs.length == 0 && parts.length == 1));
- parts.forEach(doOne);
- libs.forEach(doOne);
+ unit.parts.forEach(doOne);
+ doOne(unit.library);
}
- String generateLibrary(Iterable<CompilationUnit> units, LibraryInfo info,
- CheckerReporter reporter) {
+ String generateLibrary(
+ LibraryUnit unit, LibraryInfo info, CheckerReporter reporter) {
_vm = new reifier.VariableManager();
_extraImports = new Set<LibraryElement>();
- _generateLibrary(units, info, reporter);
+ _generateLibrary(unit, info, reporter);
_extraImports = null;
_vm = null;
return null;
@@ -486,9 +481,9 @@ class EmptyDartGenerator extends codegenerator.CodeGenerator {
EmptyDartGenerator(String outDir, Uri root, TypeRules rules, this.options)
: super(outDir, root, rules);
- String generateLibrary(Iterable<CompilationUnit> units, LibraryInfo info,
- CheckerReporter reporter) {
- for (var unit in units) {
+ String generateLibrary(
+ LibraryUnit library, LibraryInfo info, CheckerReporter reporter) {
+ for (var unit in library.units) {
var outputDir = makeOutputDirectory(info, unit);
reporter.enterSource(unit.element.source);
generateUnit(unit, info, outputDir);

Powered by Google App Engine
This is Rietveld 408576698