| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Assigns JavaScript identifiers to Dart variables, class-names and members. | 8 * Assigns JavaScript identifiers to Dart variables, class-names and members. |
| 9 */ | 9 */ |
| 10 class Namer implements ClosureNamer { | 10 class Namer implements ClosureNamer { |
| (...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1174 DartType type = constant.representedType; | 1174 DartType type = constant.representedType; |
| 1175 JavaScriptBackend backend = compiler.backend; | 1175 JavaScriptBackend backend = compiler.backend; |
| 1176 String name = backend.rti.getRawTypeRepresentation(type); | 1176 String name = backend.rti.getRawTypeRepresentation(type); |
| 1177 addIdentifier(name); | 1177 addIdentifier(name); |
| 1178 } | 1178 } |
| 1179 | 1179 |
| 1180 visitInterceptor(InterceptorConstant constant) { | 1180 visitInterceptor(InterceptorConstant constant) { |
| 1181 addRoot(constant.dispatchedType.element.name); | 1181 addRoot(constant.dispatchedType.element.name); |
| 1182 add('methods'); | 1182 add('methods'); |
| 1183 } | 1183 } |
| 1184 |
| 1185 visitDummyReceiver(DummyReceiverConstant constant) { |
| 1186 add('dummy_receiver'); |
| 1187 } |
| 1184 } | 1188 } |
| 1185 | 1189 |
| 1186 /** | 1190 /** |
| 1187 * Generates canonical hash values for [Constant]s. | 1191 * Generates canonical hash values for [Constant]s. |
| 1188 * | 1192 * |
| 1189 * Unfortunately, [Constant.hashCode] is not stable under minor perturbations, | 1193 * Unfortunately, [Constant.hashCode] is not stable under minor perturbations, |
| 1190 * so it can't be used for generating names. This hasher keeps consistency | 1194 * so it can't be used for generating names. This hasher keeps consistency |
| 1191 * between runs by basing hash values of the names of elements, rather than | 1195 * between runs by basing hash values of the names of elements, rather than |
| 1192 * their hashCodes. | 1196 * their hashCodes. |
| 1193 */ | 1197 */ |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1382 if (!first) { | 1386 if (!first) { |
| 1383 sb.write('_'); | 1387 sb.write('_'); |
| 1384 } | 1388 } |
| 1385 sb.write('_'); | 1389 sb.write('_'); |
| 1386 visit(link.head); | 1390 visit(link.head); |
| 1387 first = true; | 1391 first = true; |
| 1388 } | 1392 } |
| 1389 } | 1393 } |
| 1390 } | 1394 } |
| 1391 } | 1395 } |
| OLD | NEW |