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

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

Issue 2752943003: [Fasta] Do not emit default arguments at callsite (Closed)
Patch Set: [Fasta] Do not emit default arguments at callsite 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]);
ahe 2017/03/16 15:37:35 We can also remove this field, and all methods tha
344 }
345
346 int finishStaticInvocations() { 340 int finishStaticInvocations() {
347 CloneVisitor cloner; 341 CloneVisitor cloner;
348 for (var list in argumentsWithMissingDefaultValues) { 342 for (var list in argumentsWithMissingDefaultValues) {
349 final Arguments arguments = list[0]; 343 final Arguments arguments = list[0];
350 final FunctionNode function = list[1]; 344 final FunctionNode function = list[1];
351 345
352 Expression defaultArgumentFrom(Expression expression) { 346 Expression defaultArgumentFrom(Expression expression) {
353 if (expression == null) { 347 if (expression == null) {
354 return new NullLiteral(); 348 return new NullLiteral();
355 } 349 }
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 } 427 }
434 } 428 }
435 429
436 bool isConstructorName(String name, String className) { 430 bool isConstructorName(String name, String className) {
437 if (name.startsWith(className)) { 431 if (name.startsWith(className)) {
438 if (name.length == className.length) return true; 432 if (name.length == className.length) return true;
439 if (name.startsWith(".", className.length)) return true; 433 if (name.startsWith(".", className.length)) return true;
440 } 434 }
441 return false; 435 return false;
442 } 436 }
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