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

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
« no previous file with comments | « lib/src/codegen/code_generator.dart ('k') | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f4082ca0ebf7d2621a7bd66d88b2215609addf28 100644
--- a/lib/src/codegen/dart_codegen.dart
+++ b/lib/src/codegen/dart_codegen.dart
@@ -435,28 +435,18 @@ class DartGenerator extends codegenerator.CodeGenerator {
out.finalize();
}
- void _generateLibrary(Iterable<CompilationUnit> units, LibraryInfo info,
- CheckerReporter reporter) {
- doOne(unit) {
+ String generateLibrary(
+ LibraryUnit library, LibraryInfo info, CheckerReporter reporter) {
+ _vm = new reifier.VariableManager();
+ _extraImports = new Set<LibraryElement>();
+
+ for (var unit in library.partsThenLibrary) {
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);
- }
- String generateLibrary(Iterable<CompilationUnit> units, LibraryInfo info,
- CheckerReporter reporter) {
- _vm = new reifier.VariableManager();
- _extraImports = new Set<LibraryElement>();
- _generateLibrary(units, info, reporter);
_extraImports = null;
_vm = null;
return null;
@@ -486,9 +476,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.partsThenLibrary) {
var outputDir = makeOutputDirectory(info, unit);
reporter.enterSource(unit.element.source);
generateUnit(unit, info, outputDir);
« no previous file with comments | « lib/src/codegen/code_generator.dart ('k') | lib/src/codegen/js_codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698