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

Unified Diff: pkg/compiler/lib/src/native/ssa.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
« no previous file with comments | « pkg/compiler/lib/src/native/native.dart ('k') | pkg/compiler/lib/src/ordered_typeset.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/native/ssa.dart
diff --git a/pkg/compiler/lib/src/native/ssa.dart b/pkg/compiler/lib/src/native/ssa.dart
index 1e06af26ab072f9d10bcacfba9a41946e6706945..a93338b858d5eab6eb51e4aad24470e951a852dc 100644
--- a/pkg/compiler/lib/src/native/ssa.dart
+++ b/pkg/compiler/lib/src/native/ssa.dart
@@ -11,6 +11,7 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) {
FunctionElement element = builder.work.element;
NativeEmitter nativeEmitter = builder.nativeEmitter;
JavaScriptBackend backend = builder.backend;
+ DiagnosticReporter reporter = compiler.reporter;
HInstruction convertDartClosure(ParameterElement parameter,
FunctionType type) {
@@ -40,7 +41,7 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) {
LiteralString jsCode = nativeBody.asLiteralString();
String str = jsCode.dartString.slowToString();
if (nativeRedirectionRegExp.hasMatch(str)) {
- compiler.internalError(
+ reporter.internalError(
nativeBody, "Deprecated syntax, use @JSName('name') instead.");
}
hasBody = true;
@@ -80,7 +81,7 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) {
} else if (element.kind == ElementKind.SETTER) {
nativeMethodCall = '$receiver$nativeMethodName = $foreignParameters';
} else {
- builder.compiler.internalError(element,
+ builder.reporter.internalError(element,
'Unexpected kind: "${element.kind}".');
}
@@ -98,7 +99,7 @@ void handleSsaNative(SsaBuilder builder, Expression nativeBody) {
.addSuccessor(builder.graph.exit);
} else {
if (parameters.parameterCount != 0) {
- compiler.internalError(nativeBody,
+ reporter.internalError(nativeBody,
'native "..." syntax is restricted to '
'functions with zero parameters.');
}
« no previous file with comments | « pkg/compiler/lib/src/native/native.dart ('k') | pkg/compiler/lib/src/ordered_typeset.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698