OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 * A function element that represents a closure call. The signature is copied | 8 * A function element that represents a closure call. The signature is copied |
9 * from the given element. | 9 * from the given element. |
10 */ | 10 */ |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 // emit all possible sends on intercepted methods. | 961 // emit all possible sends on intercepted methods. |
962 for (Selector selector in backend.usedInterceptors) { | 962 for (Selector selector in backend.usedInterceptors) { |
963 String name; | 963 String name; |
964 String comma = ''; | 964 String comma = ''; |
965 String parameters = ''; | 965 String parameters = ''; |
966 if (selector.isGetter()) { | 966 if (selector.isGetter()) { |
967 name = backend.namer.getterName(selector.library, selector.name); | 967 name = backend.namer.getterName(selector.library, selector.name); |
968 } else if (selector.isSetter()) { | 968 } else if (selector.isSetter()) { |
969 name = backend.namer.setterName(selector.library, selector.name); | 969 name = backend.namer.setterName(selector.library, selector.name); |
970 } else { | 970 } else { |
971 assert(selector.isCall()); | 971 assert(selector.isCall() || selector.isOperator()); |
972 name = backend.namer.instanceMethodInvocationName( | 972 name = backend.namer.instanceMethodInvocationName( |
973 selector.library, selector.name, selector); | 973 selector.library, selector.name, selector); |
974 if (selector.argumentCount > 0) { | 974 if (selector.argumentCount > 0) { |
975 comma = ', '; | 975 comma = ', '; |
976 int i = 0; | 976 int i = 0; |
977 for (; i < selector.argumentCount - 1; i++) { | 977 for (; i < selector.argumentCount - 1; i++) { |
978 parameters = '${parameters}a$i, '; | 978 parameters = '${parameters}a$i, '; |
979 } | 979 } |
980 parameters = '${parameters}a$i'; | 980 parameters = '${parameters}a$i'; |
981 } | 981 } |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1756 const String HOOKS_API_USAGE = """ | 1756 const String HOOKS_API_USAGE = """ |
1757 // Generated by dart2js, the Dart to JavaScript compiler. | 1757 // Generated by dart2js, the Dart to JavaScript compiler. |
1758 // The code supports the following hooks: | 1758 // The code supports the following hooks: |
1759 // dartPrint(message) - if this function is defined it is called | 1759 // dartPrint(message) - if this function is defined it is called |
1760 // instead of the Dart [print] method. | 1760 // instead of the Dart [print] method. |
1761 // dartMainRunner(main) - if this function is defined, the Dart [main] | 1761 // dartMainRunner(main) - if this function is defined, the Dart [main] |
1762 // method will not be invoked directly. | 1762 // method will not be invoked directly. |
1763 // Instead, a closure that will invoke [main] is | 1763 // Instead, a closure that will invoke [main] is |
1764 // passed to [dartMainRunner]. | 1764 // passed to [dartMainRunner]. |
1765 """; | 1765 """; |
OLD | NEW |