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

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

Issue 10310060: Generate getters and setters dynamically. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 8 years, 7 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/namer.dart
diff --git a/lib/compiler/implementation/namer.dart b/lib/compiler/implementation/namer.dart
index 2864e6435ed176216b0d8c79d3d792716e955a40..4eb016134debc020deaf245f48eadfcb8444003f 100644
--- a/lib/compiler/implementation/namer.dart
+++ b/lib/compiler/implementation/namer.dart
@@ -76,6 +76,18 @@ class Namer {
return 'get\$${privateName(lib, name)}';
}
+ String getDynamicFieldSetterNamerFunction(String functionName) {
+ return 'function $functionName(fieldName) { return "set\$" + fieldName; }';
kasperl 2012/05/09 07:53:15 Too much indentation. Wouldn't it look better with
ngeoffray 2012/05/09 08:50:28 Why not putting that in the JS blob instead?
floitsch 2012/05/09 13:58:36 Done.
+ }
+
+ String dynamicSetterName(String fieldName) => 'set\$$fieldName';
+
+ String getDynamicFieldGetterNamerFunction(String functionName) {
+ return 'function $functionName(fieldName) { return "get\$" + fieldName; }';
+ }
+
+ String dynamicGetterName(String fieldName) => 'get\$$fieldName';
+
String getFreshGlobalName(String proposedName) {
int usedCount = usedGlobals[proposedName];
if (usedCount === null) {

Powered by Google App Engine
This is Rietveld 408576698