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

Side by Side Diff: pkg/compiler/lib/src/kernel/front_end_adapter.dart

Issue 2991003002: dart2js: throw when receiving an internal-problem error from the FE. (Closed)
Patch Set: Created 3 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Helper classes and methods to adapt between `package:compiler` and 5 /// Helper classes and methods to adapt between `package:compiler` and
6 /// `package:front_end` APIs. 6 /// `package:front_end` APIs.
7 library compiler.kernel.front_end_adapter; 7 library compiler.kernel.front_end_adapter;
8 8
9 import 'dart:async'; 9 import 'dart:async';
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 } 75 }
76 76
77 /// Report a [message] received from the front-end, using dart2js's 77 /// Report a [message] received from the front-end, using dart2js's
78 /// [DiagnosticReporter]. 78 /// [DiagnosticReporter].
79 void reportFrontEndMessage( 79 void reportFrontEndMessage(
80 DiagnosticReporter reporter, fe.CompilationMessage message) { 80 DiagnosticReporter reporter, fe.CompilationMessage message) {
81 // TODO(sigmund): translate message kinds using message.dart2jsCode 81 // TODO(sigmund): translate message kinds using message.dart2jsCode
82 MessageKind kind = MessageKind.GENERIC; 82 MessageKind kind = MessageKind.GENERIC;
83 switch (message.severity) { 83 switch (message.severity) {
84 case fe.Severity.internalProblem:
85 throw message.message;
84 case fe.Severity.error: 86 case fe.Severity.error:
85 case fe.Severity.internalProblem:
86 reporter.reportErrorMessage( 87 reporter.reportErrorMessage(
87 NO_LOCATION_SPANNABLE, kind, {'text': message.message}); 88 NO_LOCATION_SPANNABLE, kind, {'text': message.message});
88 break; 89 break;
89 case fe.Severity.warning: 90 case fe.Severity.warning:
90 reporter.reportWarningMessage( 91 reporter.reportWarningMessage(
91 NO_LOCATION_SPANNABLE, kind, {'text': message.message}); 92 NO_LOCATION_SPANNABLE, kind, {'text': message.message});
92 break; 93 break;
93 case fe.Severity.nit: 94 case fe.Severity.nit:
94 reporter.reportHintMessage( 95 reporter.reportHintMessage(
95 NO_LOCATION_SPANNABLE, kind, {'text': message.message}); 96 NO_LOCATION_SPANNABLE, kind, {'text': message.message});
96 break; 97 break;
97 default: 98 default:
98 throw new UnimplementedError('unhandled severity ${message.severity}'); 99 throw new UnimplementedError('unhandled severity ${message.severity}');
99 } 100 }
100 } 101 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698