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 dart2js; | 5 part of dart2js; |
6 | 6 |
7 /** | 7 /** |
8 * The [ConstantHandler] keeps track of compile-time constants, | 8 * The [ConstantHandler] keeps track of compile-time constants, |
9 * initializations of global and static fields, and default values of | 9 * initializations of global and static fields, and default values of |
10 * optional parameters. | 10 * optional parameters. |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 assignArgumentsToParameters(arguments); | 798 assignArgumentsToParameters(arguments); |
799 evaluateConstructorInitializers(); | 799 evaluateConstructorInitializers(); |
800 }); | 800 }); |
801 } | 801 } |
802 | 802 |
803 List<Constant> buildJsNewArguments(ClassElement classElement) { | 803 List<Constant> buildJsNewArguments(ClassElement classElement) { |
804 List<Constant> jsNewArguments = <Constant>[]; | 804 List<Constant> jsNewArguments = <Constant>[]; |
805 classElement.implementation.forEachInstanceField( | 805 classElement.implementation.forEachInstanceField( |
806 (ClassElement enclosing, Element field) { | 806 (ClassElement enclosing, Element field) { |
807 Constant fieldValue = fieldValues[field]; | 807 Constant fieldValue = fieldValues[field]; |
808 if (fieldValue === null) { | 808 if (fieldValue == null) { |
809 // Use the default value. | 809 // Use the default value. |
810 fieldValue = compiler.compileConstant(field); | 810 fieldValue = compiler.compileConstant(field); |
811 } | 811 } |
812 jsNewArguments.add(fieldValue); | 812 jsNewArguments.add(fieldValue); |
813 }, | 813 }, |
814 includeBackendMembers: true, | 814 includeBackendMembers: true, |
815 includeSuperMembers: true); | 815 includeSuperMembers: true); |
816 return jsNewArguments; | 816 return jsNewArguments; |
817 } | 817 } |
818 } | 818 } |
OLD | NEW |