| OLD | NEW |
| 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 import 'dart:uri'; | 7 import 'dart:uri'; |
| 8 | 8 |
| 9 // TODO(ahe): Rename prefix to 'api' when VM bug is fixed. | 9 // TODO(ahe): Rename prefix to 'api' when VM bug is fixed. |
| 10 import '../../compiler.dart' as api_e; | 10 import '../../compiler.dart' as api_e; |
| (...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1477 return result; | 1477 return result; |
| 1478 } | 1478 } |
| 1479 | 1479 |
| 1480 // TODO(aprelev@gmail.com): Peter believes that it would be great to | 1480 // TODO(aprelev@gmail.com): Peter believes that it would be great to |
| 1481 // make noMatch a required argument. Peter's suspicion is that most | 1481 // make noMatch a required argument. Peter's suspicion is that most |
| 1482 // callers of this method would benefit from using the noMatch method. | 1482 // callers of this method would benefit from using the noMatch method. |
| 1483 Element lookupConstructor(Selector selector, [Element noMatch(Element)]) { | 1483 Element lookupConstructor(Selector selector, [Element noMatch(Element)]) { |
| 1484 SourceString normalizedName; | 1484 SourceString normalizedName; |
| 1485 SourceString className = this.name; | 1485 SourceString className = this.name; |
| 1486 SourceString constructorName = selector.name; | 1486 SourceString constructorName = selector.name; |
| 1487 if (!identical(constructorName, const SourceString('')) && | 1487 if (!identical(constructorName, const SourceString(''))) { |
| 1488 ((className == null) || | |
| 1489 (constructorName.slowToString() != className.slowToString()))) { | |
| 1490 normalizedName = Elements.constructConstructorName(className, | 1488 normalizedName = Elements.constructConstructorName(className, |
| 1491 constructorName); | 1489 constructorName); |
| 1492 } else { | 1490 } else { |
| 1493 normalizedName = className; | 1491 normalizedName = className; |
| 1494 } | 1492 } |
| 1495 Element result = localLookup(normalizedName); | 1493 Element result = localLookup(normalizedName); |
| 1496 return validateConstructorLookupResults(selector, result, noMatch); | 1494 return validateConstructorLookupResults(selector, result, noMatch); |
| 1497 } | 1495 } |
| 1498 | 1496 |
| 1499 Element lookupFactoryConstructor(Selector selector, | 1497 Element lookupFactoryConstructor(Selector selector, |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1935 | 1933 |
| 1936 MetadataAnnotation ensureResolved(Compiler compiler) { | 1934 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 1937 if (resolutionState == STATE_NOT_STARTED) { | 1935 if (resolutionState == STATE_NOT_STARTED) { |
| 1938 compiler.resolver.resolveMetadataAnnotation(this); | 1936 compiler.resolver.resolveMetadataAnnotation(this); |
| 1939 } | 1937 } |
| 1940 return this; | 1938 return this; |
| 1941 } | 1939 } |
| 1942 | 1940 |
| 1943 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 1941 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 1944 } | 1942 } |
| OLD | NEW |