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

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

Issue 2689543002: Fasta: Change BodyBuilder.buildCompileTimeError to throw an instance of _CompileTimeError. (Closed)
Patch Set: Done Created 3 years, 10 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 | no next file » | 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 9b304e488f675c3b6fcc619d83f7e83b90c576de..51e9cd8f03088c08de40b7f961c585dcb0a0c3a0 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -2186,7 +2186,13 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
Expression buildCompileTimeError(error, [int charOffset = -1]) {
String message = new InputError(uri, charOffset, error).format();
print(message);
- return new Throw(new StringLiteral(message));
+ // TODO(ahe): Use a method on TargetImplementation for looking up the
+ // constructor.
+ final Constructor constructor = coreTypes.getCoreClass(
+ "dart:core", "_CompileTimeError").constructors.first;
+ return new Throw(new ConstructorInvocation(
+ constructor,
+ new Arguments(<Expression>[new StringLiteral(message)])));
}
Statement buildCompileTimeErrorStatement(error, [int charOffset = -1]) {
« 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