| 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 class ConstantEmitter { | 7 class ConstantEmitter { |
| 8 ConstantReferenceEmitter _referenceEmitter; | 8 ConstantReferenceEmitter _referenceEmitter; |
| 9 ConstantInitializerEmitter _initializerEmitter; | 9 ConstantInitializerEmitter _initializerEmitter; |
| 10 | 10 |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 List<jsAst.Expression> valueList = <jsAst.Expression>[]; | 325 List<jsAst.Expression> valueList = <jsAst.Expression>[]; |
| 326 for (int i = 0; i < values.length; i++) { | 326 for (int i = 0; i < values.length; i++) { |
| 327 valueList.add(_reference(values[i])); | 327 valueList.add(_reference(values[i])); |
| 328 } | 328 } |
| 329 return valueList; | 329 return valueList; |
| 330 } | 330 } |
| 331 | 331 |
| 332 jsAst.Expression maybeAddTypeArguments(InterfaceType type, | 332 jsAst.Expression maybeAddTypeArguments(InterfaceType type, |
| 333 jsAst.Expression value) { | 333 jsAst.Expression value) { |
| 334 if (type is InterfaceType && | 334 if (type is InterfaceType && |
| 335 !type.isRaw && | 335 !type.treatAsRaw && |
| 336 backend.classNeedsRti(type.element)) { | 336 backend.classNeedsRti(type.element)) { |
| 337 InterfaceType interface = type; | 337 InterfaceType interface = type; |
| 338 RuntimeTypes rti = backend.rti; | 338 RuntimeTypes rti = backend.rti; |
| 339 Iterable<String> arguments = interface.typeArguments | 339 Iterable<String> arguments = interface.typeArguments |
| 340 .toList(growable: false) | 340 .toList(growable: false) |
| 341 .map((DartType type) => rti.getTypeRepresentation(type, (_){})); | 341 .map((DartType type) => rti.getTypeRepresentation(type, (_){})); |
| 342 jsAst.Expression argumentList = | 342 jsAst.Expression argumentList = |
| 343 new jsAst.LiteralString('[${arguments.join(', ')}]'); | 343 new jsAst.LiteralString('[${arguments.join(', ')}]'); |
| 344 return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()), | 344 return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()), |
| 345 [value, argumentList]); | 345 [value, argumentList]); |
| 346 } | 346 } |
| 347 return value; | 347 return value; |
| 348 } | 348 } |
| 349 } | 349 } |
| OLD | NEW |