Chromium Code Reviews| 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 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1475 return result; | 1475 return result; |
| 1476 } | 1476 } |
| 1477 | 1477 |
| 1478 // TODO(aprelev@gmail.com): Peter believes that it would be great to | 1478 // TODO(aprelev@gmail.com): Peter believes that it would be great to |
| 1479 // make noMatch a required argument. Peter's suspicion is that most | 1479 // make noMatch a required argument. Peter's suspicion is that most |
| 1480 // callers of this method would benefit from using the noMatch method. | 1480 // callers of this method would benefit from using the noMatch method. |
| 1481 Element lookupConstructor(Selector selector, [Element noMatch(Element)]) { | 1481 Element lookupConstructor(Selector selector, [Element noMatch(Element)]) { |
| 1482 SourceString normalizedName; | 1482 SourceString normalizedName; |
| 1483 SourceString className = this.name; | 1483 SourceString className = this.name; |
| 1484 SourceString constructorName = selector.name; | 1484 SourceString constructorName = selector.name; |
| 1485 if (!identical(constructorName, const SourceString('')) && | 1485 if (!identical(constructorName, const SourceString(''))) { |
|
ahe
2012/10/26 04:39:10
Actually, I think this should be ==, not identical
aam-me
2012/10/26 10:59:55
Done.
| |
| 1486 ((className == null) || | |
| 1487 (constructorName.slowToString() != className.slowToString()))) { | |
| 1488 normalizedName = Elements.constructConstructorName(className, | 1486 normalizedName = Elements.constructConstructorName(className, |
| 1489 constructorName); | 1487 constructorName); |
| 1490 } else { | 1488 } else { |
| 1491 normalizedName = className; | 1489 normalizedName = className; |
| 1492 } | 1490 } |
| 1493 Element result = localLookup(normalizedName); | 1491 Element result = localLookup(normalizedName); |
| 1494 return validateConstructorLookupResults(selector, result, noMatch); | 1492 return validateConstructorLookupResults(selector, result, noMatch); |
| 1495 } | 1493 } |
| 1496 | 1494 |
| 1497 Element lookupFactoryConstructor(Selector selector, | 1495 Element lookupFactoryConstructor(Selector selector, |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1933 | 1931 |
| 1934 MetadataAnnotation ensureResolved(Compiler compiler) { | 1932 MetadataAnnotation ensureResolved(Compiler compiler) { |
| 1935 if (resolutionState == STATE_NOT_STARTED) { | 1933 if (resolutionState == STATE_NOT_STARTED) { |
| 1936 compiler.resolver.resolveMetadataAnnotation(this); | 1934 compiler.resolver.resolveMetadataAnnotation(this); |
| 1937 } | 1935 } |
| 1938 return this; | 1936 return this; |
| 1939 } | 1937 } |
| 1940 | 1938 |
| 1941 String toString() => 'MetadataAnnotation($value, $resolutionState)'; | 1939 String toString() => 'MetadataAnnotation($value, $resolutionState)'; |
| 1942 } | 1940 } |
| OLD | NEW |