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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 for (int i = 0; i < values.length; i++) { | 319 for (int i = 0; i < values.length; i++) { |
320 valueList.add(_reference(values[i])); | 320 valueList.add(_reference(values[i])); |
321 } | 321 } |
322 return valueList; | 322 return valueList; |
323 } | 323 } |
324 | 324 |
325 jsAst.Expression maybeAddTypeArguments(InterfaceType type, | 325 jsAst.Expression maybeAddTypeArguments(InterfaceType type, |
326 jsAst.Expression value) { | 326 jsAst.Expression value) { |
327 if (type is InterfaceType && | 327 if (type is InterfaceType && |
328 !type.isRaw && | 328 !type.isRaw && |
329 backend.needsRti(type.element)) { | 329 backend.classNeedsRti(type.element)) { |
330 InterfaceType interface = type; | 330 InterfaceType interface = type; |
331 RuntimeTypes rti = backend.rti; | 331 RuntimeTypes rti = backend.rti; |
332 Iterable<String> arguments = interface.typeArguments | 332 Iterable<String> arguments = interface.typeArguments |
333 .toList(growable: false) | 333 .toList(growable: false) |
334 .map((DartType type) => rti.getTypeRepresentation(type, (_){})); | 334 .map((DartType type) => rti.getTypeRepresentation(type, (_){})); |
335 jsAst.Expression argumentList = | 335 jsAst.Expression argumentList = |
336 new jsAst.LiteralString('[${arguments.join(', ')}]'); | 336 new jsAst.LiteralString('[${arguments.join(', ')}]'); |
337 return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()), | 337 return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()), |
338 [value, argumentList]); | 338 [value, argumentList]); |
339 } | 339 } |
340 return value; | 340 return value; |
341 } | 341 } |
342 } | 342 } |
OLD | NEW |