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

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

Issue 2968563002: Introduce a reusable mechanism for representing synthetic kernel objects. (Closed)
Patch Set: 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/kernel/kernel_shadow_ast.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 37d5f8c7345f878bcfd7f6358d90f026ef76ebe2..351dae1409b48ac77cb3c4fed76bb41f994d9fad 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -972,7 +972,7 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
isStatic: isStatic,
isTopLevel: !isStatic && !isSuper);
warning(message, charOffset);
- return new Throw(error);
+ return new KernelSyntheticExpression(new Throw(error));
}
}
@@ -2530,8 +2530,8 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
/// }
variable = new VariableDeclaration.forValue(null);
body = combineStatements(
- new KernelExpressionStatement(lvalue
- .buildAssignment(new VariableGet(variable), voidContext: true)),
+ new KernelSyntheticStatement(new ExpressionStatement(lvalue
+ .buildAssignment(new VariableGet(variable), voidContext: true))),
body);
} else {
variable = new VariableDeclaration.forValue(buildCompileTimeError(
@@ -2973,9 +2973,9 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
// extracted. Similar for statements and initializers. See also [issue
// 29717](https://github.com/dart-lang/sdk/issues/29717)
addCompileTimeError(charOffset, error, wasHandled: true);
- return library.loader.throwCompileConstantError(library.loader
- .buildCompileTimeError(
- formatUnexpected(uri, charOffset, error), charOffset));
+ return new KernelSyntheticExpression(library.loader
+ .throwCompileConstantError(library.loader.buildCompileTimeError(
+ formatUnexpected(uri, charOffset, error), charOffset)));
}
Expression wrapInCompileTimeError(Expression expression, String message) {
@@ -3005,8 +3005,9 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
warning("The class '$className' is abstract and can't be instantiated.",
charOffset);
Builder constructor = library.loader.getAbstractClassInstantiationError();
- return new Throw(buildStaticInvocation(constructor.target,
- new KernelArguments(<Expression>[new StringLiteral(className)])));
+ return new KernelSyntheticExpression(new Throw(buildStaticInvocation(
+ constructor.target,
+ new KernelArguments(<Expression>[new StringLiteral(className)]))));
}
Statement buildCompileTimeErrorStatement(error, [int charOffset = -1]) {
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698