| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 case ElementKind.PARAMETER: | 156 case ElementKind.PARAMETER: |
| 157 // The name is not guaranteed to be unique. | 157 // The name is not guaranteed to be unique. |
| 158 return guess; | 158 return guess; |
| 159 | 159 |
| 160 case ElementKind.GENERATIVE_CONSTRUCTOR: | 160 case ElementKind.GENERATIVE_CONSTRUCTOR: |
| 161 case ElementKind.FUNCTION: | 161 case ElementKind.FUNCTION: |
| 162 case ElementKind.CLASS: | 162 case ElementKind.CLASS: |
| 163 case ElementKind.FIELD: | 163 case ElementKind.FIELD: |
| 164 case ElementKind.GETTER: | 164 case ElementKind.GETTER: |
| 165 case ElementKind.SETTER: | 165 case ElementKind.SETTER: |
| 166 case ElementKind.TYPEDEF: |
| 166 String result = getFreshGlobalName(guess); | 167 String result = getFreshGlobalName(guess); |
| 167 globals[element] = result; | 168 globals[element] = result; |
| 168 return result; | 169 return result; |
| 169 | 170 |
| 170 default: | 171 default: |
| 171 compiler.internalError('getName for unknown kind: ${element.kind}', | 172 compiler.internalError('getName for unknown kind: ${element.kind}', |
| 172 node: element.parseNode(compiler)); | 173 node: element.parseNode(compiler)); |
| 173 } | 174 } |
| 174 } | 175 } |
| 175 } | 176 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 187 } | 188 } |
| 188 | 189 |
| 189 String isolateBailoutAccess(Element element) { | 190 String isolateBailoutAccess(Element element) { |
| 190 return '${isolateAccess(element)}\$bailout'; | 191 return '${isolateAccess(element)}\$bailout'; |
| 191 } | 192 } |
| 192 | 193 |
| 193 String operatorIs(Element element) { | 194 String operatorIs(Element element) { |
| 194 return 'is\$${getName(element)}'; | 195 return 'is\$${getName(element)}'; |
| 195 } | 196 } |
| 196 } | 197 } |
| OLD | NEW |