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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2951453002: [kernel] Make fasta call a new constructor on FallThroughError (Closed)
Patch Set: Addressed comments Created 3 years, 6 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 | « no previous file | pkg/front_end/lib/src/fasta/loader.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/body_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 1528888cb06c7d89355eedec77e5feffa9af4bb7..657e1be992be10e7956710023fcf65226af27ef9 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -40,6 +40,8 @@ import 'package:kernel/core_types.dart' show CoreTypes;
import 'frontend_accessors.dart' show buildIsNull, makeBinary, makeLet;
+import '../messages.dart' as messages show getLocationFromUri;
+
import '../../scanner/token.dart' show BeginToken, Token;
import '../scanner/token.dart' show isBinaryOperator, isMinusOperator;
@@ -2996,9 +2998,15 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
Expression buildFallThroughError(int charOffset) {
warningNotError("Switch case may fall through to next case.", charOffset);
- Builder constructor = library.loader.getFallThroughError();
+
+ Location location = messages.getLocationFromUri(uri, charOffset);
+
return new Throw(buildStaticInvocation(
- constructor.target, new Arguments.empty(),
+ library.loader.coreTypes.fallThroughErrorUrlAndLineConstructor,
+ new Arguments(<Expression>[
+ new StringLiteral(location?.file ?? uri.toString()),
+ new IntLiteral(location?.line ?? 0)
+ ]),
charOffset: charOffset));
}
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698