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

Unified Diff: pkg/compiler/lib/src/compile_time_constants.dart

Issue 742023002: Handle named and optional arguments in cps-ir. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix formatting Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/codegen/codegen.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compile_time_constants.dart
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index 7b0494365797ef2bd23e32e0e1b8c4fad197657e..a1048438ff4a8be257113c3149e1f8d0580f669d 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -643,20 +643,14 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
FunctionElement target,
{AstConstant compileArgument(Node node)}) {
assert(invariant(node, target.isImplementation));
- List<AstConstant> compiledArguments = <AstConstant>[];
AstConstant compileDefaultValue(VariableElement element) {
ConstantExpression constant = handler.compileConstant(element);
return new AstConstant.fromDefaultValue(element, constant);
}
target.computeSignature(compiler);
- bool succeeded = selector.addArgumentsToList(arguments,
- compiledArguments,
- target,
- compileArgument,
- compileDefaultValue,
- compiler.world);
- if (!succeeded) {
+
+ if (!selector.applies(target, compiler.world)) {
String name = Elements.constructorNameForDiagnostics(
target.enclosingClass.name, target.name);
compiler.reportFatalError(
@@ -664,7 +658,10 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
MessageKind.INVALID_CONSTRUCTOR_ARGUMENTS,
{'constructorName': name});
}
- return compiledArguments;
+ return selector.makeArgumentsList2(arguments,
+ target,
+ compileArgument,
+ compileDefaultValue);
}
AstConstant visitNewExpression(NewExpression node) {
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/codegen/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698