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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 15024008: Avoid syntax errors on oddly named fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add dart2js_native test Created 7 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
« no previous file with comments | « no previous file | dart/tests/compiler/dart2js_native/oddly_named_fields_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index 37be935d403a9aff6d503c8ced25b6b4056aee8f..cfc1967a3e6346b9a99fc76ab5c63fbf34ee9c16 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -312,10 +312,10 @@ class CodeEmitterTask extends CompilerTask {
js.for_('var i = 0', 'i < fields.length', 'i++', [
js.if_('i != 0', js('str += ", "')),
- js('var field = fields[i]'),
- js('field = generateAccessor(field, prototype)'),
- js('str += field'),
- js('body += ("this." + field + " = " + field + ";\\n")')
+ js('var field = generateAccessor(fields[i], prototype)'),
+ js('var parameter = "parameter_" + field'),
+ js('str += parameter'),
+ js('body += ("this." + field + " = " + parameter + ";\\n")')
]),
js('str += (") {" + body + "}\\nreturn " + cls)'),
« no previous file with comments | « no previous file | dart/tests/compiler/dart2js_native/oddly_named_fields_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698