| 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 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant); | 7 typedef jsAst.Expression _ConstantReferenceGenerator(ConstantValue constant); |
| 8 | 8 |
| 9 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array); | 9 typedef jsAst.Expression _ConstantListGenerator(jsAst.Expression array); |
| 10 | 10 |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 String stripComments(String rawJavaScript) { | 302 String stripComments(String rawJavaScript) { |
| 303 return rawJavaScript.replaceAll(COMMENT_RE, ''); | 303 return rawJavaScript.replaceAll(COMMENT_RE, ''); |
| 304 } | 304 } |
| 305 | 305 |
| 306 jsAst.Expression maybeAddTypeArguments(InterfaceType type, | 306 jsAst.Expression maybeAddTypeArguments(InterfaceType type, |
| 307 jsAst.Expression value) { | 307 jsAst.Expression value) { |
| 308 if (type is InterfaceType && | 308 if (type is InterfaceType && |
| 309 !type.treatAsRaw && | 309 !type.treatAsRaw && |
| 310 backend.classNeedsRti(type.element)) { | 310 backend.classNeedsRti(type.element)) { |
| 311 InterfaceType interface = type; | 311 InterfaceType interface = type; |
| 312 RuntimeTypes rti = backend.rti; | 312 RuntimeTypesEncoder rtiEncoder = backend.rtiEncoder; |
| 313 Iterable<jsAst.Expression> arguments = interface.typeArguments | 313 Iterable<jsAst.Expression> arguments = interface.typeArguments |
| 314 .map((DartType type) => | 314 .map((DartType type) => |
| 315 rti.getTypeRepresentationWithPlaceholders(type, (_){})); | 315 rtiEncoder.getTypeRepresentationWithPlaceholders(type, (_){})); |
| 316 jsAst.Expression argumentList = | 316 jsAst.Expression argumentList = |
| 317 new jsAst.ArrayInitializer(arguments.toList()); | 317 new jsAst.ArrayInitializer(arguments.toList()); |
| 318 return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()), | 318 return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()), |
| 319 [value, argumentList]); | 319 [value, argumentList]); |
| 320 } | 320 } |
| 321 return value; | 321 return value; |
| 322 } | 322 } |
| 323 | 323 |
| 324 @override | 324 @override |
| 325 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { | 325 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { |
| 326 return constantReferenceGenerator(constant.referenced); | 326 return constantReferenceGenerator(constant.referenced); |
| 327 } | 327 } |
| 328 } | 328 } |
| OLD | NEW |