| 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 /** | 5 /** |
| 6 * Assigns JavaScript identifiers to Dart variables, class-names and members. | 6 * Assigns JavaScript identifiers to Dart variables, class-names and members. |
| 7 */ | 7 */ |
| 8 class Namer { | 8 class Namer { |
| 9 final Compiler compiler; | 9 final Compiler compiler; |
| 10 | 10 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 } | 189 } |
| 190 | 190 |
| 191 String isolateAccess(Element element) { | 191 String isolateAccess(Element element) { |
| 192 return "$CURRENT_ISOLATE.${getName(element)}"; | 192 return "$CURRENT_ISOLATE.${getName(element)}"; |
| 193 } | 193 } |
| 194 | 194 |
| 195 String isolatePropertyAccess(Element element) { | 195 String isolatePropertyAccess(Element element) { |
| 196 return "$ISOLATE.prototype.${getName(element)}"; | 196 return "$ISOLATE.prototype.${getName(element)}"; |
| 197 } | 197 } |
| 198 | 198 |
| 199 String isolateBailoutPropertyAccess(Element element) { | |
| 200 return '${isolatePropertyAccess(element)}\$bailout'; | |
| 201 } | |
| 202 | |
| 203 String isolateBailoutAccess(Element element) { | 199 String isolateBailoutAccess(Element element) { |
| 204 return '${isolateAccess(element)}\$bailout'; | 200 return '${isolateAccess(element)}\$bailout'; |
| 205 } | 201 } |
| 206 | 202 |
| 207 String operatorIs(Element element) { | 203 String operatorIs(Element element) { |
| 208 return 'is\$${getName(element)}'; | 204 return 'is\$${getName(element)}'; |
| 209 } | 205 } |
| 210 | 206 |
| 211 String safeName(String name) { | 207 String safeName(String name) { |
| 212 if (jsReserved.contains(name) || name.startsWith('\$')) { | 208 if (jsReserved.contains(name) || name.startsWith('\$')) { |
| 213 name = "\$$name"; | 209 name = "\$$name"; |
| 214 assert(!jsReserved.contains(name)); | 210 assert(!jsReserved.contains(name)); |
| 215 } | 211 } |
| 216 return name; | 212 return name; |
| 217 } | 213 } |
| 218 } | 214 } |
| OLD | NEW |