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 29a33e122ee900d8d126d359dbbdc386371d7203..9771fe92249c6253023d70f7bd909545afb7770e 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; |
ahe
2017/06/19 14:33:06
import '../messages.dart' show getLocationFromUri;
jensj
2017/06/20 11:24:49
Done.
|
+ |
import '../../scanner/token.dart' show BeginToken, Token; |
import '../scanner/token.dart' show isBinaryOperator, isMinusOperator; |
@@ -2996,9 +2998,16 @@ 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(); |
ahe
2017/06/19 14:33:06
Would you mind removing all the getFallThroughErro
jensj
2017/06/20 11:24:48
Done.
|
+ |
+ Location location = |
+ charOffset >= 0 ? messages.getLocationFromUri(uri, charOffset) : null; |
ahe
2017/06/19 14:33:06
Call this unconditionally.
jensj
2017/06/20 11:24:49
Done.
|
+ |
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)); |
} |