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

Unified Diff: lib/compiler/implementation/namer.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
« no previous file with comments | « lib/compiler/implementation/emitter.dart ('k') | tests/language/src/Naming2Test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/namer.dart
diff --git a/lib/compiler/implementation/namer.dart b/lib/compiler/implementation/namer.dart
index 7aa40cf6d77579aaca2bc0d81c478bd82ad1901a..8680ac740b738f368376602dd1b798281d124059 100644
--- a/lib/compiler/implementation/namer.dart
+++ b/lib/compiler/implementation/namer.dart
@@ -63,7 +63,11 @@ class Namer {
}
String instanceFieldName(LibraryElement lib, SourceString name) {
- return privateName(lib, name);
+ String proposedName = privateName(lib, name);
+ if (jsReserved.contains(proposedName)) {
+ return '$proposedName\$';
ngeoffray 2012/04/23 18:38:15 This code very much looks like JsName.getValid, sh
floitsch 2012/04/25 08:42:24 Thanks. Addressed in CL 10223002.
+ }
+ return proposedName;
}
String setterName(LibraryElement lib, SourceString name) {
« no previous file with comments | « lib/compiler/implementation/emitter.dart ('k') | tests/language/src/Naming2Test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698