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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart

Issue 2755953002: Revert "[Fasta] Do not emit default arguments at callsite" (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library fasta.kernel_library_builder; 5 library fasta.kernel_library_builder;
6 6
7 import 'package:kernel/ast.dart'; 7 import 'package:kernel/ast.dart';
8 8
9 import 'package:kernel/clone.dart' show CloneVisitor; 9 import 'package:kernel/clone.dart' show CloneVisitor;
10 10
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 if (builder.next == null && other.next == null) { 330 if (builder.next == null && other.next == null) {
331 if (builder.isGetter && other.isSetter) { 331 if (builder.isGetter && other.isSetter) {
332 return new MixedAccessor(builder, other, this); 332 return new MixedAccessor(builder, other, this);
333 } else if (builder.isSetter && other.isGetter) { 333 } else if (builder.isSetter && other.isGetter) {
334 return new MixedAccessor(other, builder, this); 334 return new MixedAccessor(other, builder, this);
335 } 335 }
336 } 336 }
337 return new KernelInvalidTypeBuilder(name, charOffset, fileUri); 337 return new KernelInvalidTypeBuilder(name, charOffset, fileUri);
338 } 338 }
339 339
340 void addArgumentsWithMissingDefaultValues(
341 Arguments arguments, FunctionNode function) {
342 assert(partOfLibrary == null);
343 argumentsWithMissingDefaultValues.add([arguments, function]);
344 }
345
340 int finishStaticInvocations() { 346 int finishStaticInvocations() {
341 CloneVisitor cloner; 347 CloneVisitor cloner;
342 for (var list in argumentsWithMissingDefaultValues) { 348 for (var list in argumentsWithMissingDefaultValues) {
343 final Arguments arguments = list[0]; 349 final Arguments arguments = list[0];
344 final FunctionNode function = list[1]; 350 final FunctionNode function = list[1];
345 351
346 Expression defaultArgumentFrom(Expression expression) { 352 Expression defaultArgumentFrom(Expression expression) {
347 if (expression == null) { 353 if (expression == null) {
348 return new NullLiteral(); 354 return new NullLiteral();
349 } 355 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 } 433 }
428 } 434 }
429 435
430 bool isConstructorName(String name, String className) { 436 bool isConstructorName(String name, String className) {
431 if (name.startsWith(className)) { 437 if (name.startsWith(className)) {
432 if (name.length == className.length) return true; 438 if (name.length == className.length) return true;
433 if (name.startsWith(".", className.length)) return true; 439 if (name.startsWith(".", className.length)) return true;
434 } 440 }
435 return false; 441 return false;
436 } 442 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/kernel/body_builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698