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

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

Issue 10179001: Use shorter names for constructor arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make sure mangling is correct and update tests. Created 8 years, 8 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/emitter.dart
diff --git a/lib/compiler/implementation/emitter.dart b/lib/compiler/implementation/emitter.dart
index 6c8d84ed225094770504a91eabeeb2b08c022576..7370c2e2654ac06446cbc56722cbab0f3511b48f 100644
--- a/lib/compiler/implementation/emitter.dart
+++ b/lib/compiler/implementation/emitter.dart
@@ -237,8 +237,14 @@ function(child, parent) {
isFirst = false;
String memberName = namer.instanceFieldName(member.getLibrary(),
member.name);
- argumentsBuffer.add('${className}_$memberName');
- bodyBuffer.add(' this.$memberName = ${className}_$memberName;\n');
+ String parameter;
+ if (classElement === enclosingClass) {
+ parameter = memberName;
+ } else {
+ parameter = '${className}_$memberName';
+ }
+ argumentsBuffer.add(parameter);
+ bodyBuffer.add(' this.$memberName = $parameter;\n');
}
classElement.forEachInstanceField(generateFieldInit,
@@ -293,7 +299,7 @@ function(child, parent) {
emitInherits(classElement, buffer);
String attachTo(String name) => '$className.prototype.$name';
-
+
classElement.forEachMember(includeBackendMembers: true,
f: (ClassElement enclosing, Element member) {
if (member.isInstanceMember()) {
@@ -658,8 +664,8 @@ function(child, parent) {
});
}
- String buildIsolateSetup(StringBuffer buffer,
- Element appMain,
+ String buildIsolateSetup(StringBuffer buffer,
+ Element appMain,
Element isolateMain) {
String mainAccess = "${namer.isolateAccess(appMain)}";
String currentIsolate = "${namer.CURRENT_ISOLATE}";

Powered by Google App Engine
This is Rietveld 408576698