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

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

Issue 2906333002: Move buildMethodInvocation to BodyBuilder. (Closed)
Patch Set: Created 3 years, 7 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/fasta_accessors.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 4530a30d2b14c9f92a5b68fd3bed1fa6d01e0337..cd811698d09bc372a6d9b670082ebd9798a4127c 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -2776,6 +2776,26 @@ class BodyBuilder extends ScopeListener<JumpTarget> implements BuilderHelper {
}
@override
+ Expression buildMethodInvocation(
+ Expression receiver, Name name, Arguments arguments, int offset,
+ {bool isConstantExpression: false, bool isNullAware: false}) {
+ if (isNullAware) {
+ VariableDeclaration variable = new VariableDeclaration.forValue(receiver);
+ return makeLet(
+ variable,
+ new ConditionalExpression(
+ buildIsNull(new VariableGet(variable)),
+ new NullLiteral(),
+ new MethodInvocation(new VariableGet(variable), name, arguments)
+ ..fileOffset = offset,
+ const DynamicType()));
+ } else {
+ return new KernelMethodInvocation(receiver, name, arguments)
+ ..fileOffset = offset;
+ }
+ }
+
+ @override
void addCompileTimeErrorFromMessage(FastaMessage message) {
library.addCompileTimeError(message.charOffset, message.message,
fileUri: message.uri);
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698