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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 return r'$or'; | 983 return r'$or'; |
984 } else if (name == '-') { | 984 } else if (name == '-') { |
985 return r'$sub'; | 985 return r'$sub'; |
986 } else if (name == 'unary-') { | 986 } else if (name == 'unary-') { |
987 return r'$negate'; | 987 return r'$negate'; |
988 } else { | 988 } else { |
989 return name; | 989 return name; |
990 } | 990 } |
991 } | 991 } |
992 | 992 |
| 993 String get incrementalHelperName => r'$dart_unsafe_eval'; |
| 994 |
| 995 jsAst.Expression get accessIncrementalHelper { |
| 996 assert(compiler.hasIncrementalSupport); |
| 997 return js('self.${incrementalHelperName}'); |
| 998 } |
| 999 |
993 void forgetElement(Element element) { | 1000 void forgetElement(Element element) { |
994 String globalName = globals[element]; | 1001 String globalName = globals[element]; |
995 invariant(element, globalName != null, message: 'No global name.'); | 1002 invariant(element, globalName != null, message: 'No global name.'); |
996 usedGlobalNames.remove(globalName); | 1003 usedGlobalNames.remove(globalName); |
997 globals.remove(element); | 1004 globals.remove(element); |
998 } | 1005 } |
999 } | 1006 } |
1000 | 1007 |
1001 /** | 1008 /** |
1002 * Generator of names for [ConstantValue] values. | 1009 * Generator of names for [ConstantValue] values. |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1380 if (!first) { | 1387 if (!first) { |
1381 sb.write('_'); | 1388 sb.write('_'); |
1382 } | 1389 } |
1383 sb.write('_'); | 1390 sb.write('_'); |
1384 visit(parameter); | 1391 visit(parameter); |
1385 first = true; | 1392 first = true; |
1386 } | 1393 } |
1387 } | 1394 } |
1388 } | 1395 } |
1389 } | 1396 } |
OLD | NEW |