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

Unified Diff: pkg/compiler/lib/src/js_backend/constant_emitter.dart

Issue 1383483006: Extract DiagnosticReporter implementation from Compiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fixes after rebase. Created 5 years, 2 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: pkg/compiler/lib/src/js_backend/constant_emitter.dart
diff --git a/pkg/compiler/lib/src/js_backend/constant_emitter.dart b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
index 3f38a2899a048e1bdb715181ca9c3d259e67f338..f1d7f746648f26d509d55ad0b7afec80b8324dc8 100644
--- a/pkg/compiler/lib/src/js_backend/constant_emitter.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
@@ -39,6 +39,8 @@ class ConstantEmitter
jsAst.Expression this.constantReferenceGenerator(ConstantValue constant),
this.makeConstantList);
+ DiagnosticReporter get reporter => compiler.reporter;
+
/**
* Constructs a literal expression that evaluates to the constant. Uses a
* canonical name unless the constant can be emitted multiple times (as for
@@ -54,7 +56,7 @@ class ConstantEmitter
@override
jsAst.Expression visitFunction(FunctionConstantValue constant, [_]) {
- compiler.internalError(NO_LOCATION_SPANNABLE,
+ reporter.internalError(NO_LOCATION_SPANNABLE,
"The function constant does not need specific JS code.");
return null;
}
@@ -220,7 +222,7 @@ class ConstantEmitter
} else if (field.name == JavaScriptMapConstant.JS_DATA_NAME) {
arguments.add(jsGeneralMap());
} else {
- compiler.internalError(field,
+ reporter.internalError(field,
"Compiler has unexpected field ${field.name} for "
"${className}.");
}
@@ -233,7 +235,7 @@ class ConstantEmitter
emittedArgumentCount != 4) ||
(className == JavaScriptMapConstant.DART_GENERAL_CLASS &&
emittedArgumentCount != 1)) {
- compiler.internalError(classElement,
+ reporter.internalError(classElement,
"Compiler and ${className} disagree on number of fields.");
}
@@ -273,7 +275,7 @@ class ConstantEmitter
case SyntheticConstantKind.NAME:
return constant.payload;
default:
- compiler.internalError(NO_LOCATION_SPANNABLE,
+ reporter.internalError(NO_LOCATION_SPANNABLE,
"Unexpected DummyConstantKind ${constant.kind}");
return null;
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/codegen/task.dart ('k') | pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698