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

Unified Diff: lib/compiler/implementation/js_backend/namer.dart

Issue 11191078: Make hashCode a getter and not a method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 2 months 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: lib/compiler/implementation/js_backend/namer.dart
diff --git a/lib/compiler/implementation/js_backend/namer.dart b/lib/compiler/implementation/js_backend/namer.dart
index 21c46c34c39fec3d31ca1f5df2f27fe6c4d66590..44470d1b4cf774946b40e24658b4e1bb7b5cc260 100644
--- a/lib/compiler/implementation/js_backend/namer.dart
+++ b/lib/compiler/implementation/js_backend/namer.dart
@@ -82,6 +82,10 @@ class Namer {
return 'c\$${target.nestingLevel}';
}
+ /**
+ * If the [name] is not private returns [:name.slowToString():]. Otherwise
+ * mangles the [name] so that each library has a unique name.
+ */
String privateName(LibraryElement lib, SourceString name) {
if (name.isPrivate()) {
String nameString = name.slowToString();
@@ -163,6 +167,13 @@ class Namer {
return 'set\$$fieldName';
}
+ String publicGetterName(SourceString name) {
+ // We dynamically create getters from the field-name. The getter name must
+ // therefore be derived from the instance field-name.
+ String fieldName = safeName(name.slowToString());
+ return 'get\$$fieldName';
+ }
+
String getterName(LibraryElement lib, SourceString name) {
// We dynamically create getters from the field-name. The getter name must
// therefore be derived from the instance field-name.

Powered by Google App Engine
This is Rietveld 408576698