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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_emitter/class_emitter.dart

Issue 425023002: Ensure that unmangled private names are unique. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart2js.js_emitter; 5 part of dart2js.js_emitter;
6 6
7 class ClassEmitter extends CodeEmitterHelper { 7 class ClassEmitter extends CodeEmitterHelper {
8 /** 8 /**
9 * Documentation wanted -- johnniwinther 9 * Documentation wanted -- johnniwinther
10 * 10 *
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // constructors, so we don't need the fields unless we are generating 147 // constructors, so we don't need the fields unless we are generating
148 // accessors at runtime. 148 // accessors at runtime.
149 if (!classIsNative || needsAccessor) { 149 if (!classIsNative || needsAccessor) {
150 var metadata = task.metadataEmitter.buildMetadataFunction(field); 150 var metadata = task.metadataEmitter.buildMetadataFunction(field);
151 if (metadata != null) { 151 if (metadata != null) {
152 hasMetadata = true; 152 hasMetadata = true;
153 } else { 153 } else {
154 metadata = new jsAst.LiteralNull(); 154 metadata = new jsAst.LiteralNull();
155 } 155 }
156 fieldMetadata.add(metadata); 156 fieldMetadata.add(metadata);
157 recordMangledField(field, accessorName, field.name); 157 recordMangledField(field, accessorName,
158 namer.privateName(field.library, field.name));
158 String fieldName = name; 159 String fieldName = name;
159 String fieldCode = ''; 160 String fieldCode = '';
160 String reflectionMarker = ''; 161 String reflectionMarker = '';
161 if (!needsAccessor) { 162 if (!needsAccessor) {
162 // Emit field for constructor generation. 163 // Emit field for constructor generation.
163 assert(!classIsNative); 164 assert(!classIsNative);
164 } else { 165 } else {
165 // Emit (possibly renaming) field name so we can add accessors at 166 // Emit (possibly renaming) field name so we can add accessors at
166 // runtime. 167 // runtime.
167 if (name != accessorName) { 168 if (name != accessorName) {
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 computeTypeVariable = 616 computeTypeVariable =
616 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index); 617 js(r'this.$builtinTypeInfo && this.$builtinTypeInfo[#]', index);
617 } 618 }
618 jsAst.Expression convertRtiToRuntimeType = 619 jsAst.Expression convertRtiToRuntimeType =
619 namer.elementAccess(backend.findHelper('convertRtiToRuntimeType')); 620 namer.elementAccess(backend.findHelper('convertRtiToRuntimeType'));
620 builder.addProperty(name, 621 builder.addProperty(name,
621 js('function () { return #(#) }', 622 js('function () { return #(#) }',
622 [convertRtiToRuntimeType, computeTypeVariable])); 623 [convertRtiToRuntimeType, computeTypeVariable]));
623 } 624 }
624 } 625 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698