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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/elements/elements.dart

Issue 11472022: Reject constructor names that conflict with members. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: dart/sdk/lib/_internal/compiler/implementation/elements/elements.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/elements/elements.dart b/dart/sdk/lib/_internal/compiler/implementation/elements/elements.dart
index d0caf293318de8c86f9a46cbc5fe3da084f58b0e..5426c727876cbb3663a4752b2ed788ca34b9c3b6 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/elements/elements.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/elements/elements.dart
@@ -1857,6 +1857,16 @@ class Elements {
return new SourceString('$r\$$s');
}
+ 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));
+ }
+ return null;
+ }
+
/**
* Map an operator-name to a valid Dart identifier.
*

Powered by Google App Engine
This is Rietveld 408576698