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

Side by Side Diff: pkg/compiler/lib/src/elements/common.dart

Issue 1417103002: Add ElementKind for factory constructors. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 2 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /// Mixins that implement convenience methods on [Element] subclasses. 5 /// Mixins that implement convenience methods on [Element] subclasses.
6 6
7 library elements.common; 7 library elements.common;
8 8
9 import '../common/names.dart' show 9 import '../common/names.dart' show
10 Names, 10 Names,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 bool get isConstructor => isGenerativeConstructor || isFactoryConstructor; 53 bool get isConstructor => isGenerativeConstructor || isFactoryConstructor;
54 54
55 @override 55 @override
56 bool get isGenerativeConstructor => 56 bool get isGenerativeConstructor =>
57 kind == ElementKind.GENERATIVE_CONSTRUCTOR; 57 kind == ElementKind.GENERATIVE_CONSTRUCTOR;
58 58
59 @override 59 @override
60 bool get isGenerativeConstructorBody => 60 bool get isGenerativeConstructorBody =>
61 kind == ElementKind.GENERATIVE_CONSTRUCTOR_BODY; 61 kind == ElementKind.GENERATIVE_CONSTRUCTOR_BODY;
62 62
63 bool get isFactoryConstructor =>
64 kind == ElementKind.FACTORY_CONSTRUCTOR;
65
63 @override 66 @override
64 bool get isVariable => kind == ElementKind.VARIABLE; 67 bool get isVariable => kind == ElementKind.VARIABLE;
65 68
66 @override 69 @override
67 bool get isField => kind == ElementKind.FIELD; 70 bool get isField => kind == ElementKind.FIELD;
68 71
69 @override 72 @override
70 bool get isAbstractField => kind == ElementKind.ABSTRACT_FIELD; 73 bool get isAbstractField => kind == ElementKind.ABSTRACT_FIELD;
71 74
72 @override 75 @override
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 // this signature must not have more required parameters. Having more 487 // this signature must not have more required parameters. Having more
485 // optional parameters is not a problem, they simply are never provided 488 // optional parameters is not a problem, they simply are never provided
486 // by call sites of a call to a method with the other signature. 489 // by call sites of a call to a method with the other signature.
487 int otherTotalCount = signature.parameterCount; 490 int otherTotalCount = signature.parameterCount;
488 return requiredParameterCount <= otherTotalCount 491 return requiredParameterCount <= otherTotalCount
489 && parameterCount >= otherTotalCount; 492 && parameterCount >= otherTotalCount;
490 } 493 }
491 return true; 494 return true;
492 } 495 }
493 } 496 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart ('k') | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698