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 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 return r'$or'; | 986 return r'$or'; |
987 } else if (name == '-') { | 987 } else if (name == '-') { |
988 return r'$sub'; | 988 return r'$sub'; |
989 } else if (name == 'unary-') { | 989 } else if (name == 'unary-') { |
990 return r'$negate'; | 990 return r'$negate'; |
991 } else { | 991 } else { |
992 return name; | 992 return name; |
993 } | 993 } |
994 } | 994 } |
995 | 995 |
996 String get incrementalHelperName => r'$dart_unsafe_eval'; | 996 String get incrementalHelperName => r'$dart_unsafe_incremental_support'; |
997 | 997 |
998 jsAst.Expression get accessIncrementalHelper { | 998 jsAst.Expression get accessIncrementalHelper { |
999 assert(compiler.hasIncrementalSupport); | 999 assert(compiler.hasIncrementalSupport); |
1000 return js('self.${incrementalHelperName}'); | 1000 return js('self.${incrementalHelperName}'); |
1001 } | 1001 } |
1002 | 1002 |
1003 void forgetElement(Element element) { | 1003 void forgetElement(Element element) { |
1004 String globalName = globals[element]; | 1004 String globalName = globals[element]; |
1005 invariant(element, globalName != null, message: 'No global name.'); | 1005 invariant(element, globalName != null, message: 'No global name.'); |
1006 usedGlobalNames.remove(globalName); | 1006 usedGlobalNames.remove(globalName); |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1416 if (!first) { | 1416 if (!first) { |
1417 sb.write('_'); | 1417 sb.write('_'); |
1418 } | 1418 } |
1419 sb.write('_'); | 1419 sb.write('_'); |
1420 visit(parameter); | 1420 visit(parameter); |
1421 first = true; | 1421 first = true; |
1422 } | 1422 } |
1423 } | 1423 } |
1424 } | 1424 } |
1425 } | 1425 } |
OLD | NEW |