| OLD | NEW |
| 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.src.dart.resolver.scope; | 5 library analyzer.src.dart.resolver.scope; |
| 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/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 Map<String, Element> get definedNames { | 987 Map<String, Element> get definedNames { |
| 988 Map<String, Element> definedNames = <String, Element>{}; | 988 Map<String, Element> definedNames = <String, Element>{}; |
| 989 _definedNames.forEach((String name, Element element) { | 989 _definedNames.forEach((String name, Element element) { |
| 990 definedNames["$_prefix.$name"] = element; | 990 definedNames["$_prefix.$name"] = element; |
| 991 }); | 991 }); |
| 992 return definedNames; | 992 return definedNames; |
| 993 } | 993 } |
| 994 | 994 |
| 995 @override | 995 @override |
| 996 Element get(String name) { | 996 Element get(String name) { |
| 997 if (name.startsWith(_prefix)) { | 997 if (name.length > _length && name.startsWith(_prefix)) { |
| 998 if (name.codeUnitAt(_length) == '.'.codeUnitAt(0)) { | 998 if (name.codeUnitAt(_length) == '.'.codeUnitAt(0)) { |
| 999 return _definedNames[name.substring(_length + 1)]; | 999 return _definedNames[name.substring(_length + 1)]; |
| 1000 } | 1000 } |
| 1001 } | 1001 } |
| 1002 return null; | 1002 return null; |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 @override | 1005 @override |
| 1006 Element getPrefixed(String prefix, String name) { | 1006 Element getPrefixed(String prefix, String name) { |
| 1007 if (prefix == _prefix) { | 1007 if (prefix == _prefix) { |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 | 1209 |
| 1210 /** | 1210 /** |
| 1211 * Define the type parameters declared by the [classElement]. | 1211 * Define the type parameters declared by the [classElement]. |
| 1212 */ | 1212 */ |
| 1213 void _defineTypeParameters(ClassElement classElement) { | 1213 void _defineTypeParameters(ClassElement classElement) { |
| 1214 for (TypeParameterElement typeParameter in classElement.typeParameters) { | 1214 for (TypeParameterElement typeParameter in classElement.typeParameters) { |
| 1215 define(typeParameter); | 1215 define(typeParameter); |
| 1216 } | 1216 } |
| 1217 } | 1217 } |
| 1218 } | 1218 } |
| OLD | NEW |