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

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

Issue 1665683002: Revert "Create ElementAnnotation objects prior to resolution." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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; 5 library analyzer.test.generated.resolver_test;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/visitor.dart'; 10 import 'package:analyzer/dart/ast/visitor.dart';
(...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 _listener.assertNoErrors(); 1597 _listener.assertNoErrors();
1598 } 1598 }
1599 1599
1600 void test_visitEnumDeclaration() { 1600 void test_visitEnumDeclaration() {
1601 ClassElementImpl enumElement = 1601 ClassElementImpl enumElement =
1602 ElementFactory.enumElement(_typeProvider, ('E')); 1602 ElementFactory.enumElement(_typeProvider, ('E'));
1603 EnumDeclaration enumNode = AstFactory.enumDeclaration2('E', []); 1603 EnumDeclaration enumNode = AstFactory.enumDeclaration2('E', []);
1604 Annotation annotationNode = 1604 Annotation annotationNode =
1605 AstFactory.annotation(AstFactory.identifier3('a')); 1605 AstFactory.annotation(AstFactory.identifier3('a'));
1606 annotationNode.element = ElementFactory.classElement2('A'); 1606 annotationNode.element = ElementFactory.classElement2('A');
1607 annotationNode.elementAnnotation = new ElementAnnotationImpl(enumElement);
1608 enumNode.metadata.add(annotationNode); 1607 enumNode.metadata.add(annotationNode);
1609 enumNode.name.staticElement = enumElement; 1608 enumNode.name.staticElement = enumElement;
1610 List<ElementAnnotation> metadata = <ElementAnnotation>[
1611 annotationNode.elementAnnotation
1612 ];
1613 _resolveNode(enumNode); 1609 _resolveNode(enumNode);
1614 expect(metadata[0].element, annotationNode.element); 1610 List<ElementAnnotation> metadata = enumElement.metadata;
1611 expect(metadata, hasLength(1));
1615 } 1612 }
1616 1613
1617 void test_visitExportDirective_noCombinators() { 1614 void test_visitExportDirective_noCombinators() {
1618 ExportDirective directive = AstFactory.exportDirective2(null); 1615 ExportDirective directive = AstFactory.exportDirective2(null);
1619 directive.element = ElementFactory 1616 directive.element = ElementFactory
1620 .exportFor(ElementFactory.library(_definingLibrary.context, "lib")); 1617 .exportFor(ElementFactory.library(_definingLibrary.context, "lib"));
1621 _resolveNode(directive); 1618 _resolveNode(directive);
1622 _listener.assertNoErrors(); 1619 _listener.assertNoErrors();
1623 } 1620 }
1624 1621
(...skipping 15407 matching lines...) Expand 10 before | Expand all | Expand 10 after
17032 17029
17033 void _resolveTestUnit(String code) { 17030 void _resolveTestUnit(String code) {
17034 testCode = code; 17031 testCode = code;
17035 testSource = addSource(testCode); 17032 testSource = addSource(testCode);
17036 LibraryElement library = resolve2(testSource); 17033 LibraryElement library = resolve2(testSource);
17037 assertNoErrors(testSource); 17034 assertNoErrors(testSource);
17038 verify([testSource]); 17035 verify([testSource]);
17039 testUnit = resolveCompilationUnit(testSource, library); 17036 testUnit = resolveCompilationUnit(testSource, library);
17040 } 17037 }
17041 } 17038 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/all_the_rest_test.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698