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

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

Issue 1811173003: Support per-library serialization. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 8 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/compiler/lib/src/dart_types.dart ('k') | pkg/compiler/lib/src/elements/elements.dart » ('j') | 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) 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 // this signature must not have more required parameters. Having more 503 // this signature must not have more required parameters. Having more
504 // optional parameters is not a problem, they simply are never provided 504 // optional parameters is not a problem, they simply are never provided
505 // by call sites of a call to a method with the other signature. 505 // by call sites of a call to a method with the other signature.
506 int otherTotalCount = signature.parameterCount; 506 int otherTotalCount = signature.parameterCount;
507 return requiredParameterCount <= otherTotalCount 507 return requiredParameterCount <= otherTotalCount
508 && parameterCount >= otherTotalCount; 508 && parameterCount >= otherTotalCount;
509 } 509 }
510 return true; 510 return true;
511 } 511 }
512 } 512 }
513
514 abstract class MixinApplicationElementCommon
515 implements MixinApplicationElement {
516 Link<ConstructorElement> get constructors {
517 throw new UnsupportedError('Unimplemented $this.constructors');
518 }
519
520 FunctionElement _lookupLocalConstructor(String name) {
521 for (Link<Element> link = constructors;
522 !link.isEmpty;
523 link = link.tail) {
524 if (link.head.name == name) return link.head;
525 }
526 return null;
527 }
528
529 @override
530 Element localLookup(String name) {
531 Element constructor = _lookupLocalConstructor(name);
532 if (constructor != null) return constructor;
533 if (mixin == null) return null;
534 Element mixedInElement = mixin.localLookup(name);
535 if (mixedInElement == null) return null;
536 return mixedInElement.isInstanceMember ? mixedInElement : null;
537 }
538
539 @override
540 void forEachLocalMember(void f(Element member)) {
541 constructors.forEach(f);
542 if (mixin != null) mixin.forEachLocalMember((Element mixedInElement) {
543 if (mixedInElement.isInstanceMember) f(mixedInElement);
544 });
545 }
546 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dart_types.dart ('k') | pkg/compiler/lib/src/elements/elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698