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

Side by Side Diff: pkg/analyzer/test/generated/resolver_test_case.dart

Issue 2027893002: Start separating ClassElementImpl for Class and Enum. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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) 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 analyzer.test.generated.resolver_test_case; 5 library analyzer.test.generated.resolver_test_case;
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/visitor.dart'; 8 import 'package:analyzer/dart/ast/visitor.dart';
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/dart/element/type.dart'; 10 import 'package:analyzer/dart/element/type.dart';
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 FileBasedSource definingCompilationUnitSource = createNamedSource(fileName); 539 FileBasedSource definingCompilationUnitSource = createNamedSource(fileName);
540 List<CompilationUnitElement> sourcedCompilationUnits; 540 List<CompilationUnitElement> sourcedCompilationUnits;
541 if (typeNames == null) { 541 if (typeNames == null) {
542 sourcedCompilationUnits = CompilationUnitElement.EMPTY_LIST; 542 sourcedCompilationUnits = CompilationUnitElement.EMPTY_LIST;
543 } else { 543 } else {
544 int count = typeNames.length; 544 int count = typeNames.length;
545 sourcedCompilationUnits = new List<CompilationUnitElement>(count); 545 sourcedCompilationUnits = new List<CompilationUnitElement>(count);
546 for (int i = 0; i < count; i++) { 546 for (int i = 0; i < count; i++) {
547 String typeName = typeNames[i]; 547 String typeName = typeNames[i];
548 ClassElementImpl type = 548 ClassElementImpl type =
549 new ClassElementImpl.forNode(AstFactory.identifier3(typeName)); 549 new ClassElementImpl_Class.forNode(AstFactory.identifier3(typeName)) ;
550 String fileName = "$typeName.dart"; 550 String fileName = "$typeName.dart";
551 CompilationUnitElementImpl compilationUnit = 551 CompilationUnitElementImpl compilationUnit =
552 new CompilationUnitElementImpl(fileName); 552 new CompilationUnitElementImpl(fileName);
553 compilationUnit.source = createNamedSource(fileName); 553 compilationUnit.source = createNamedSource(fileName);
554 compilationUnit.librarySource = definingCompilationUnitSource; 554 compilationUnit.librarySource = definingCompilationUnitSource;
555 compilationUnit.types = <ClassElement>[type]; 555 compilationUnit.types = <ClassElement>[type];
556 sourcedCompilationUnits[i] = compilationUnit; 556 sourcedCompilationUnits[i] = compilationUnit;
557 } 557 }
558 } 558 }
559 CompilationUnitElementImpl compilationUnit = 559 CompilationUnitElementImpl compilationUnit =
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 * text. Otherwise, [expected] is used directly a [Matcher] to match the type. 837 * text. Otherwise, [expected] is used directly a [Matcher] to match the type.
838 */ 838 */
839 _expectType(DartType type, expected) { 839 _expectType(DartType type, expected) {
840 if (expected is String) { 840 if (expected is String) {
841 expect(type.toString(), expected); 841 expect(type.toString(), expected);
842 } else { 842 } else {
843 expect(type, expected); 843 expect(type, expected);
844 } 844 }
845 } 845 }
846 } 846 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698