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

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

Issue 2933813002: Follow-up to CLs 2933723002 and 2932973003. (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
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 59578cedf592ed68c0ea720ce38745bfcbb6d7c6..f4e6794123bac9faa99e42767cb520261d869596 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -2041,18 +2041,19 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
return new KernelConstructorInvocation(target, initialTarget, arguments,
isConst: isConst)
..fileOffset = charOffset;
- } else if (target is Procedure && target.kind == ProcedureKind.Factory) {
- return new KernelFactoryConstructorInvocation(
- target, initialTarget, arguments,
- isConst: isConst)
- ..fileOffset = charOffset;
} else {
- Procedure factory = target;
- if (isConst && !factory.isConst) {
+ Procedure procedure = target;
+ if (isConst && !procedure.isConst) {
return buildCompileTimeError("Not a const factory.", charOffset);
+ } else if (procedure.isFactory) {
+ return new KernelFactoryConstructorInvocation(
+ target, initialTarget, arguments,
+ isConst: isConst)
+ ..fileOffset = charOffset;
+ } else {
+ return new KernelStaticInvocation(target, arguments, isConst: isConst)
+ ..fileOffset = charOffset;
}
- return new KernelStaticInvocation(target, arguments, isConst: isConst)
- ..fileOffset = charOffset;
}
}

Powered by Google App Engine
This is Rietveld 408576698