Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: pkg/compiler/lib/src/compile_time_constants.dart

Issue 908863003: dart2js cps: Handle optional parameters in builder. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 /// A [ConstantEnvironment] provides access for constants compiled for variable 7 /// A [ConstantEnvironment] provides access for constants compiled for variable
8 /// initializers. 8 /// initializers.
9 abstract class ConstantEnvironment { 9 abstract class ConstantEnvironment {
10 /// Returns the constant for the initializer of [element]. 10 /// Returns the constant for the initializer of [element].
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 target.enclosingClass.name, target.name); 669 target.enclosingClass.name, target.name);
670 compiler.reportError( 670 compiler.reportError(
671 node, 671 node,
672 MessageKind.INVALID_CONSTRUCTOR_ARGUMENTS, 672 MessageKind.INVALID_CONSTRUCTOR_ARGUMENTS,
673 {'constructorName': name}); 673 {'constructorName': name});
674 674
675 return new List<AstConstant>.filled( 675 return new List<AstConstant>.filled(
676 target.functionSignature.parameterCount, 676 target.functionSignature.parameterCount,
677 new ErroneousAstConstant(context, node)); 677 new ErroneousAstConstant(context, node));
678 } 678 }
679 return selector.makeArgumentsList2(arguments, 679 return selector.makeArgumentsList(arguments,
680 target, 680 target,
681 compileArgument, 681 compileArgument,
682 compileDefaultValue); 682 compileDefaultValue);
683 } 683 }
684 684
685 AstConstant visitNewExpression(NewExpression node) { 685 AstConstant visitNewExpression(NewExpression node) {
686 if (!node.isConst) { 686 if (!node.isConst) {
687 return signalNotCompileTimeConstant(node); 687 return signalNotCompileTimeConstant(node);
688 } 688 }
689 689
690 Send send = node.send; 690 Send send = node.send;
691 FunctionElement constructor = elements[send]; 691 FunctionElement constructor = elements[send];
692 if (Elements.isUnresolved(constructor)) { 692 if (Elements.isUnresolved(constructor)) {
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 ConstantValue get value => expression.value; 1117 ConstantValue get value => expression.value;
1118 1118
1119 String toString() => expression.toString(); 1119 String toString() => expression.toString();
1120 } 1120 }
1121 1121
1122 /// A synthetic constant used to recover from errors. 1122 /// A synthetic constant used to recover from errors.
1123 class ErroneousAstConstant extends AstConstant { 1123 class ErroneousAstConstant extends AstConstant {
1124 ErroneousAstConstant(Element element, Node node) 1124 ErroneousAstConstant(Element element, Node node)
1125 : super(element, node, new ErroneousConstantExpression()); 1125 : super(element, node, new ErroneousConstantExpression());
1126 } 1126 }
OLDNEW
« no previous file with comments | « pkg/analyzer2dart/lib/src/cps_generator.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698