| 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 * Names are generated through three stages: | 10 * Names are generated through three stages: |
| (...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1342 } else if (name == 'unary-') { | 1342 } else if (name == 'unary-') { |
| 1343 return r'$negate'; | 1343 return r'$negate'; |
| 1344 } else { | 1344 } else { |
| 1345 return name; | 1345 return name; |
| 1346 } | 1346 } |
| 1347 } | 1347 } |
| 1348 | 1348 |
| 1349 String get incrementalHelperName => r'$dart_unsafe_incremental_support'; | 1349 String get incrementalHelperName => r'$dart_unsafe_incremental_support'; |
| 1350 | 1350 |
| 1351 jsAst.Expression get accessIncrementalHelper { | 1351 jsAst.Expression get accessIncrementalHelper { |
| 1352 assert(compiler.hasIncrementalSupport); | |
| 1353 return js('self.${incrementalHelperName}'); | 1352 return js('self.${incrementalHelperName}'); |
| 1354 } | 1353 } |
| 1355 | 1354 |
| 1356 void forgetElement(Element element) { | 1355 void forgetElement(Element element) { |
| 1357 String globalName = userGlobals[element]; | 1356 String globalName = userGlobals[element]; |
| 1358 invariant(element, globalName != null, message: 'No global name.'); | 1357 invariant(element, globalName != null, message: 'No global name.'); |
| 1359 usedGlobalNames.remove(globalName); | 1358 usedGlobalNames.remove(globalName); |
| 1360 userGlobals.remove(element); | 1359 userGlobals.remove(element); |
| 1361 } | 1360 } |
| 1362 } | 1361 } |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1769 if (!first) { | 1768 if (!first) { |
| 1770 sb.write('_'); | 1769 sb.write('_'); |
| 1771 } | 1770 } |
| 1772 sb.write('_'); | 1771 sb.write('_'); |
| 1773 visit(parameter); | 1772 visit(parameter); |
| 1774 first = true; | 1773 first = true; |
| 1775 } | 1774 } |
| 1776 } | 1775 } |
| 1777 } | 1776 } |
| 1778 } | 1777 } |
| OLD | NEW |