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 import '../common.dart'; | 5 import '../common.dart'; |
6 import '../compiler.dart' show Compiler; | 6 import '../compiler.dart' show Compiler; |
7 import '../constants/values.dart'; | 7 import '../constants/values.dart'; |
8 import '../dart_types.dart'; | 8 import '../dart_types.dart'; |
9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
10 import '../io/code_output.dart'; | 10 import '../io/code_output.dart'; |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
308 jsAst.Expression constructor = | 308 jsAst.Expression constructor = |
309 backend.emitter.constructorAccess(constant.type.element); | 309 backend.emitter.constructorAccess(constant.type.element); |
310 List<jsAst.Expression> fields = <jsAst.Expression>[]; | 310 List<jsAst.Expression> fields = <jsAst.Expression>[]; |
311 element.forEachInstanceField((_, FieldElement field) { | 311 element.forEachInstanceField((_, FieldElement field) { |
312 fields.add(constantReferenceGenerator(constant.fields[field])); | 312 fields.add(constantReferenceGenerator(constant.fields[field])); |
313 }, includeSuperAndInjectedMembers: true); | 313 }, includeSuperAndInjectedMembers: true); |
314 if (backend.classNeedsRtiField(constant.type.element)) { | 314 if (backend.classNeedsRtiField(constant.type.element)) { |
315 fields.add(_reifiedTypeArguments(constant.type)); | 315 fields.add(_reifiedTypeArguments(constant.type)); |
316 } | 316 } |
317 jsAst.New instantiation = new jsAst.New(constructor, fields); | 317 jsAst.New instantiation = new jsAst.New(constructor, fields); |
318 return maybeAddTypeArguments(constant.type, instantiation); | 318 return instantiation; |
Siggi Cherem (dart-lang)
2016/09/16 18:39:02
to clarify: is this because the type-information i
sra1
2016/09/16 20:09:08
Exactly. Line 315.
| |
319 } | 319 } |
320 | 320 |
321 String stripComments(String rawJavaScript) { | 321 String stripComments(String rawJavaScript) { |
322 return rawJavaScript.replaceAll(COMMENT_RE, ''); | 322 return rawJavaScript.replaceAll(COMMENT_RE, ''); |
323 } | 323 } |
324 | 324 |
325 jsAst.Expression maybeAddTypeArguments( | 325 jsAst.Expression maybeAddTypeArguments( |
326 InterfaceType type, jsAst.Expression value) { | 326 InterfaceType type, jsAst.Expression value) { |
327 if (type is InterfaceType && | 327 if (type is InterfaceType && |
328 !type.treatAsRaw && | 328 !type.treatAsRaw && |
(...skipping 20 matching lines...) Expand all Loading... | |
349 arguments.add(rtiEncoder.getTypeRepresentation(argument, unexpected)); | 349 arguments.add(rtiEncoder.getTypeRepresentation(argument, unexpected)); |
350 } | 350 } |
351 return new jsAst.ArrayInitializer(arguments); | 351 return new jsAst.ArrayInitializer(arguments); |
352 } | 352 } |
353 | 353 |
354 @override | 354 @override |
355 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { | 355 jsAst.Expression visitDeferred(DeferredConstantValue constant, [_]) { |
356 return constantReferenceGenerator(constant.referenced); | 356 return constantReferenceGenerator(constant.referenced); |
357 } | 357 } |
358 } | 358 } |
OLD | NEW |