| 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 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3252 functions.push(property); | 3251 functions.push(property); |
| 3253 } else { | 3252 } else { |
| 3254 $$[property] = element; | 3253 $$[property] = element; |
| 3255 classes.push(property); | 3254 classes.push(property); |
| 3256 classes.push(element[""]); | 3255 classes.push(element[""]); |
| 3257 } | 3256 } |
| 3258 } | 3257 } |
| 3259 libraries.push([name, uri, classes, functions]); | 3258 libraries.push([name, uri, classes, functions]); |
| 3260 } | 3259 } |
| 3261 })'''; | 3260 })'''; |
| OLD | NEW |