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

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

Issue 751553003: Extend resolution Scope with ResolutionContext and set it for ResolverVisitor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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
« no previous file with comments | « pkg/analyzer/test/generated/incremental_resolver_test.dart ('k') | no next file » | 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) 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 engine.resolver_test; 5 library engine.resolver_test;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/src/generated/ast.dart'; 9 import 'package:analyzer/src/generated/ast.dart';
10 import 'package:analyzer/src/generated/element.dart'; 10 import 'package:analyzer/src/generated/element.dart';
(...skipping 1903 matching lines...) Expand 10 before | Expand all | Expand 10 after
1914 * identifier. 1914 * identifier.
1915 * 1915 *
1916 * @param node the expression to be resolved 1916 * @param node the expression to be resolved
1917 * @param enclosingClass the element representing the class enclosing the iden tifier 1917 * @param enclosingClass the element representing the class enclosing the iden tifier
1918 * @return the element to which the expression was resolved 1918 * @return the element to which the expression was resolved
1919 */ 1919 */
1920 void _resolveInClass(AstNode node, ClassElement enclosingClass) { 1920 void _resolveInClass(AstNode node, ClassElement enclosingClass) {
1921 try { 1921 try {
1922 Scope outerScope = _visitor.nameScope_J2DAccessor as Scope; 1922 Scope outerScope = _visitor.nameScope_J2DAccessor as Scope;
1923 try { 1923 try {
1924 _visitor.enclosingClass_J2DAccessor = enclosingClass; 1924 _visitor.enclosingClass = enclosingClass;
1925 EnclosedScope innerScope = new ClassScope( 1925 EnclosedScope innerScope = new ClassScope(
1926 new TypeParameterScope(outerScope, enclosingClass), 1926 new TypeParameterScope(outerScope, enclosingClass),
1927 enclosingClass); 1927 enclosingClass);
1928 _visitor.nameScope_J2DAccessor = innerScope; 1928 _visitor.nameScope_J2DAccessor = innerScope;
1929 node.accept(_resolver); 1929 node.accept(_resolver);
1930 } finally { 1930 } finally {
1931 _visitor.enclosingClass_J2DAccessor = null; 1931 _visitor.enclosingClass = null;
1932 _visitor.nameScope_J2DAccessor = outerScope; 1932 _visitor.nameScope_J2DAccessor = outerScope;
1933 } 1933 }
1934 } catch (exception) { 1934 } catch (exception) {
1935 throw new IllegalArgumentException("Could not resolve node", exception); 1935 throw new IllegalArgumentException("Could not resolve node", exception);
1936 } 1936 }
1937 } 1937 }
1938 1938
1939 /** 1939 /**
1940 * Return the element associated with the given expression after the resolver has resolved the 1940 * Return the element associated with the given expression after the resolver has resolved the
1941 * expression. 1941 * expression.
(...skipping 11492 matching lines...) Expand 10 before | Expand all | Expand 10 after
13434 // check propagated type 13434 // check propagated type
13435 FunctionType propagatedType = node.propagatedType as FunctionType; 13435 FunctionType propagatedType = node.propagatedType as FunctionType;
13436 expect(propagatedType.returnType, test.typeProvider.stringType); 13436 expect(propagatedType.returnType, test.typeProvider.stringType);
13437 } on AnalysisException catch (e, stackTrace) { 13437 } on AnalysisException catch (e, stackTrace) {
13438 thrownException[0] = new CaughtException(e, stackTrace); 13438 thrownException[0] = new CaughtException(e, stackTrace);
13439 } 13439 }
13440 } 13440 }
13441 return null; 13441 return null;
13442 } 13442 }
13443 } 13443 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/incremental_resolver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698