Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/elements/elements.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/elements/elements.dart b/sdk/lib/_internal/compiler/implementation/elements/elements.dart |
| index 2bd5812663ef3023a38e94c602f19a8ae01eece0..519da0646b497f407034fbb7140c417bb57a657f 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/elements/elements.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/elements/elements.dart |
| @@ -353,21 +353,21 @@ class Elements { |
| return isLocal(element); |
| } |
| - static SourceString constructConstructorName(SourceString receiver, |
| - SourceString selector) { |
| - String r = receiver.slowToString(); |
| - String s = selector.slowToString(); |
| - return new SourceString('$r\$$s'); |
| + static SourceString reconstructConstructorNameSourceString(Element element) { |
|
ahe
2013/07/11 10:09:42
Can we get rid of these methods?
Johnni Winther
2013/07/11 13:09:19
That requires changes to reflection. Added a TODO.
|
| + if (element.name == const SourceString('')) { |
| + return element.getEnclosingClass().name; |
| + } else { |
| + return new SourceString(reconstructConstructorName(element)); |
| + } |
| } |
| - |
| - static SourceString deconstructConstructorName(SourceString name, |
| - ClassElement holder) { |
| - String r = '${holder.name.slowToString()}\$'; |
| - String s = name.slowToString(); |
| - if (s.startsWith(r)) { |
| - return new SourceString(s.substring(r.length)); |
| + |
| + static String reconstructConstructorName(Element element) { |
| + String className = element.getEnclosingClass().name.slowToString(); |
| + if (element.name == const SourceString('')) { |
| + return className; |
| + } else { |
| + return '$className\$${element.name.slowToString()}'; |
| } |
| - return null; |
| } |
| /** |