| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart'; | 8 import '../common/names.dart'; |
| 9 import '../constants/constructors.dart'; | 9 import '../constants/constructors.dart'; |
| 10 import '../constants/expressions.dart'; | 10 import '../constants/expressions.dart'; |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 | 784 |
| 785 Map<FieldEntity, ConstantExpression> fieldMap = | 785 Map<FieldEntity, ConstantExpression> fieldMap = |
| 786 <FieldEntity, ConstantExpression>{}; | 786 <FieldEntity, ConstantExpression>{}; |
| 787 | 787 |
| 788 void registerField(ir.Field field, ConstantExpression constant) { | 788 void registerField(ir.Field field, ConstantExpression constant) { |
| 789 fieldMap[elementAdapter.getField(field)] = constant; | 789 fieldMap[elementAdapter.getField(field)] = constant; |
| 790 } | 790 } |
| 791 | 791 |
| 792 if (!isRedirecting) { | 792 if (!isRedirecting) { |
| 793 for (ir.Field field in cls.fields) { | 793 for (ir.Field field in cls.fields) { |
| 794 if (field.isStatic) continue; |
| 794 if (field.initializer != null) { | 795 if (field.initializer != null) { |
| 795 registerField(field, field.initializer.accept(this)); | 796 registerField(field, field.initializer.accept(this)); |
| 796 } | 797 } |
| 797 } | 798 } |
| 798 } | 799 } |
| 799 | 800 |
| 800 ConstructedConstantExpression superConstructorInvocation; | 801 ConstructedConstantExpression superConstructorInvocation; |
| 801 for (ir.Initializer initializer in node.initializers) { | 802 for (ir.Initializer initializer in node.initializers) { |
| 802 if (initializer is ir.FieldInitializer) { | 803 if (initializer is ir.FieldInitializer) { |
| 803 registerField(initializer.field, initializer.value.accept(this)); | 804 registerField(initializer.field, initializer.value.accept(this)); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 814 } | 815 } |
| 815 if (isRedirecting) { | 816 if (isRedirecting) { |
| 816 return new RedirectingGenerativeConstantConstructor( | 817 return new RedirectingGenerativeConstantConstructor( |
| 817 defaultValues, superConstructorInvocation); | 818 defaultValues, superConstructorInvocation); |
| 818 } else { | 819 } else { |
| 819 return new GenerativeConstantConstructor( | 820 return new GenerativeConstantConstructor( |
| 820 type, defaultValues, fieldMap, superConstructorInvocation); | 821 type, defaultValues, fieldMap, superConstructorInvocation); |
| 821 } | 822 } |
| 822 } | 823 } |
| 823 } | 824 } |
| OLD | NEW |