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

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

Issue 1067553004: Factor out reporting from rules (Closed) Base URL: git@github.com:dart-lang/dart-dev-compiler.git@master
Patch Set: Created 5 years, 8 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
« lib/src/checker/rules.dart ('K') | « lib/src/codegen/dart_codegen.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index 7f88892402f977ce167400e29f15cf9c443c26d1..31ab6535fae86b3984ff8afebeb421b18f339ed1 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -27,7 +27,6 @@ import 'package:dev_compiler/src/js/js_ast.dart' show js;
import 'package:dev_compiler/src/checker/rules.dart';
import 'package:dev_compiler/src/info.dart';
import 'package:dev_compiler/src/options.dart';
-import 'package:dev_compiler/src/report.dart';
import 'package:dev_compiler/src/utils.dart';
import 'code_generator.dart';
@@ -51,12 +50,6 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
final LibraryInfo libraryInfo;
final TypeRules rules;
- // TODO(jmesserly): this is needed because RestrictedTypeRules can send
- // messages to CheckerReporter, for things like missing types.
- // We should probably refactor so this can't happen, as codegen would be too
- // late to be issuing these messages.
- final CheckerReporter _checkerReporter;
-
/// The variable for the target of the current `..` cascade expression.
SimpleIdentifier _cascadeTarget;
/// The variable for the current catch clause
@@ -116,7 +109,7 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
/// Memoized results of [_inLibraryCycle].
final _libraryCycleMemo = new HashMap<LibraryElement, bool>();
- JSCodegenVisitor(this.libraryInfo, this.rules, this._checkerReporter);
+ JSCodegenVisitor(this.libraryInfo, this.rules);
LibraryElement get currentLibrary => libraryInfo.library;
@@ -201,7 +194,6 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
var source = node.element.source;
_constEvaluator = new ConstantEvaluator(source, rules.provider);
- _checkerReporter.enterSource(source);
// TODO(jmesserly): scriptTag, directives.
var body = <JS.Statement>[];
@@ -230,8 +222,6 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ConversionVisitor {
_flushLazyFields(body);
_flushLibraryProperties(body);
- _checkerReporter.leaveSource();
-
assert(_pendingPrivateNames.isEmpty);
return _statement(body);
}
@@ -2386,9 +2376,8 @@ class JSGenerator extends CodeGenerator {
JSGenerator(String outDir, Uri root, TypeRules rules, this.options)
: super(outDir, root, rules);
- String generateLibrary(
- LibraryUnit unit, LibraryInfo info, CheckerReporter reporter) {
- var jsTree = new JSCodegenVisitor(info, rules, reporter).emitLibrary(unit);
+ String generateLibrary(LibraryUnit unit, LibraryInfo info) {
+ var jsTree = new JSCodegenVisitor(info, rules).emitLibrary(unit);
var outputPath = path.join(outDir, jsOutputPath(info, root));
new Directory(path.dirname(outputPath)).createSync(recursive: true);
« lib/src/checker/rules.dart ('K') | « lib/src/codegen/dart_codegen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698