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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/elements/elements.dart

Issue 138543005: Redo "Make dart2js typed_data implementation classes private" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: dart2dart status Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 elements; 5 library elements;
6 6
7 7
8 import '../tree/tree.dart'; 8 import '../tree/tree.dart';
9 import '../util/util.dart'; 9 import '../util/util.dart';
10 import '../resolution/resolution.dart'; 10 import '../resolution/resolution.dart';
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 Compiler compiler) { 559 Compiler compiler) {
560 return element == compiler.filledListConstructor 560 return element == compiler.filledListConstructor
561 && node.isCall 561 && node.isCall
562 && !node.arguments.isEmpty 562 && !node.arguments.isEmpty
563 && !node.arguments.tail.isEmpty 563 && !node.arguments.tail.isEmpty
564 && node.arguments.tail.tail.isEmpty; 564 && node.arguments.tail.tail.isEmpty;
565 } 565 }
566 566
567 static bool isConstructorOfTypedArraySubclass(Element element, 567 static bool isConstructorOfTypedArraySubclass(Element element,
568 Compiler compiler) { 568 Compiler compiler) {
569 if (compiler.typedDataClass == null) return false; 569 if (compiler.typedDataLibrary == null) return false;
570 ClassElement cls = element.getEnclosingClass(); 570 if (!element.isConstructor()) return false;
571 if (cls == null || !element.isConstructor()) return false; 571 FunctionElement constructor = element;
572 return compiler.world.isSubclass(compiler.typedDataClass, cls) 572 constructor = constructor.redirectionTarget;
573 && cls.getLibrary() == compiler.typedDataLibrary 573 ClassElement cls = constructor.getEnclosingClass();
574 && element.name == ''; 574 return cls.getLibrary() == compiler.typedDataLibrary
575 && cls.isNative()
576 && compiler.world.isSubtype(compiler.typedDataClass, cls)
577 && compiler.world.isSubtype(compiler.listClass, cls)
578 && constructor.name == '';
575 } 579 }
576 580
577 static bool switchStatementHasContinue(SwitchStatement node, 581 static bool switchStatementHasContinue(SwitchStatement node,
578 TreeElements elements) { 582 TreeElements elements) {
579 for (SwitchCase switchCase in node.cases) { 583 for (SwitchCase switchCase in node.cases) {
580 for (Node labelOrCase in switchCase.labelsAndCases) { 584 for (Node labelOrCase in switchCase.labelsAndCases) {
581 Node label = labelOrCase.asLabel(); 585 Node label = labelOrCase.asLabel();
582 if (label != null) { 586 if (label != null) {
583 LabelElement labelElement = elements[label]; 587 LabelElement labelElement = elements[label];
584 if (labelElement != null && labelElement.isContinueTarget) { 588 if (labelElement != null && labelElement.isContinueTarget) {
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 Token get endToken; 1007 Token get endToken;
1004 1008
1005 // TODO(kasperl): Try to get rid of these. 1009 // TODO(kasperl): Try to get rid of these.
1006 void set annotatedElement(Element value); 1010 void set annotatedElement(Element value);
1007 void set resolutionState(int value); 1011 void set resolutionState(int value);
1008 1012
1009 MetadataAnnotation ensureResolved(Compiler compiler); 1013 MetadataAnnotation ensureResolved(Compiler compiler);
1010 } 1014 }
1011 1015
1012 abstract class VoidElement extends Element {} 1016 abstract class VoidElement extends Element {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698