| 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 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 | 1247 |
| 1248 void emitRuntimeTypeSupport(CodeBuffer buffer) { | 1248 void emitRuntimeTypeSupport(CodeBuffer buffer) { |
| 1249 RuntimeTypes rti = backend.rti; | 1249 RuntimeTypes rti = backend.rti; |
| 1250 TypeChecks typeChecks = rti.requiredChecks; | 1250 TypeChecks typeChecks = rti.requiredChecks; |
| 1251 | 1251 |
| 1252 // Add checks to the constructors of instantiated classes. | 1252 // Add checks to the constructors of instantiated classes. |
| 1253 for (ClassElement cls in typeChecks) { | 1253 for (ClassElement cls in typeChecks) { |
| 1254 String holder = namer.isolateAccess(backend.getImplementationClass(cls)); | 1254 String holder = namer.isolateAccess(backend.getImplementationClass(cls)); |
| 1255 for (TypeCheck check in typeChecks[cls]) { | 1255 for (TypeCheck check in typeChecks[cls]) { |
| 1256 ClassElement cls = check.cls; | 1256 ClassElement cls = check.cls; |
| 1257 buffer.write('$holder.${namer.operatorIs(check.cls)}$_=${_}true$N'); | |
| 1258 buffer.write('$holder.${namer.operatorIs(cls)}$_=${_}true$N'); | 1257 buffer.write('$holder.${namer.operatorIs(cls)}$_=${_}true$N'); |
| 1259 Substitution substitution = check.substitution; | 1258 Substitution substitution = check.substitution; |
| 1260 if (substitution != null) { | 1259 if (substitution != null) { |
| 1261 String body = substitution.getCode(rti, false); | 1260 String body = substitution.getCode(rti, false); |
| 1262 buffer.write('$holder.${namer.substitutionName(cls)}$_=${_}$body$N'); | 1261 buffer.write('$holder.${namer.substitutionName(cls)}$_=${_}$body$N'); |
| 1263 } | 1262 } |
| 1264 }; | 1263 }; |
| 1265 } | 1264 } |
| 1266 } | 1265 } |
| 1267 | 1266 |
| (...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3166 """; | 3165 """; |
| 3167 const String HOOKS_API_USAGE = """ | 3166 const String HOOKS_API_USAGE = """ |
| 3168 // The code supports the following hooks: | 3167 // The code supports the following hooks: |
| 3169 // dartPrint(message) - if this function is defined it is called | 3168 // dartPrint(message) - if this function is defined it is called |
| 3170 // instead of the Dart [print] method. | 3169 // instead of the Dart [print] method. |
| 3171 // dartMainRunner(main) - if this function is defined, the Dart [main] | 3170 // dartMainRunner(main) - if this function is defined, the Dart [main] |
| 3172 // method will not be invoked directly. | 3171 // method will not be invoked directly. |
| 3173 // Instead, a closure that will invoke [main] is | 3172 // Instead, a closure that will invoke [main] is |
| 3174 // passed to [dartMainRunner]. | 3173 // passed to [dartMainRunner]. |
| 3175 """; | 3174 """; |
| OLD | NEW |