| 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 InterfaceType type = elements.getType(node); | 631 InterfaceType type = elements.getType(node); |
| 632 List<Constant> evaluateArguments(FunctionElement constructor) { | 632 List<Constant> evaluateArguments(FunctionElement constructor) { |
| 633 Selector selector = elements.getSelector(send); | 633 Selector selector = elements.getSelector(send); |
| 634 return evaluateArgumentsToConstructor( | 634 return evaluateArgumentsToConstructor( |
| 635 node, selector, send.arguments, constructor); | 635 node, selector, send.arguments, constructor); |
| 636 } | 636 } |
| 637 return makeConstructedConstant(node, type, constructor, evaluateArguments); | 637 return makeConstructedConstant(node, type, constructor, evaluateArguments); |
| 638 } | 638 } |
| 639 | 639 |
| 640 Constant makeConstructedConstant( | 640 Constant makeConstructedConstant( |
| 641 Node node, InterfaceType type, FunctionElement constructor, | 641 Spannable node, InterfaceType type, FunctionElement constructor, |
| 642 List<Constant> getArguments(FunctionElement constructor)) { | 642 List<Constant> getArguments(FunctionElement constructor)) { |
| 643 if (constructor.isRedirectingFactory) { | 643 if (constructor.isRedirectingFactory) { |
| 644 type = constructor.computeTargetType(compiler, type); | 644 type = constructor.computeTargetType(compiler, type); |
| 645 } | 645 } |
| 646 | 646 |
| 647 // The redirection chain of this element may not have been resolved through | 647 // The redirection chain of this element may not have been resolved through |
| 648 // a post-process action, so we have to make sure it is done here. | 648 // a post-process action, so we have to make sure it is done here. |
| 649 compiler.resolver.resolveRedirectionChain(constructor, node); | 649 compiler.resolver.resolveRedirectionChain(constructor, node); |
| 650 constructor = constructor.redirectionTarget; | 650 constructor = constructor.redirectionTarget; |
| 651 ClassElement classElement = constructor.getEnclosingClass(); | 651 ClassElement classElement = constructor.getEnclosingClass(); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 if (fieldValue == null) { | 881 if (fieldValue == null) { |
| 882 // Use the default value. | 882 // Use the default value. |
| 883 fieldValue = handler.compileConstant(field); | 883 fieldValue = handler.compileConstant(field); |
| 884 } | 884 } |
| 885 jsNewArguments.add(fieldValue); | 885 jsNewArguments.add(fieldValue); |
| 886 }, | 886 }, |
| 887 includeSuperAndInjectedMembers: true); | 887 includeSuperAndInjectedMembers: true); |
| 888 return jsNewArguments; | 888 return jsNewArguments; |
| 889 } | 889 } |
| 890 } | 890 } |
| OLD | NEW |