Chromium Code Reviews| Index: compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java |
| diff --git a/compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java b/compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java |
| index b93d12ed2730b929c8a05f5e18edcf182904f45b..7dbd3cfc998d858584422540e825cb106cd346d3 100644 |
| --- a/compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java |
| +++ b/compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java |
| @@ -2766,7 +2766,7 @@ public class GenerateJavascriptAST { |
| if (method != null) { |
| if (!generateDirectCallArgs(x, method, jsInvoke)) { |
| - // Call cannot succeed. Return false to generate $nsme() in its place. |
| + // Call cannot succeed. Generate $nsme() invocation. |
| return AstUtil.newInvocation(new JsNameRef("$nsme")); |
| } |
| } else { |
| @@ -2818,7 +2818,7 @@ public class GenerateJavascriptAST { |
| for (VariableElement param : target.getParameters()) { |
| String name = param.getName(); |
| if (name != null) { |
| - DartExpression namedArg = namedArgs.get(param.getName()); |
| + DartExpression namedArg = namedArgs.remove(name); |
| if (namedArg != null) { |
| if (!param.getModifiers().isNamed()) { |
| // Provided a named argument to a positional parameter. |
| @@ -2842,6 +2842,11 @@ public class GenerateJavascriptAST { |
| ++idx; |
| } |
| + // May be specified named arguments without corresponding named parameters. |
|
zundel
2012/01/23 16:18:21
I assume what this means:
// Caller specified a n
scheglov
2012/01/23 19:32:27
Done.
|
| + if (!namedArgs.isEmpty()) { |
| + return false; |
| + } |
| + |
| if (posUsed != posArgs.size()) { |
| // Unused positional arguments. |
| return false; |
| @@ -2989,7 +2994,7 @@ public class GenerateJavascriptAST { |
| // Compile time constants expressions must be canonicalized. |
| // We do this with the javascript native "$intern" method. |
| - private JsExpression maybeInternConst(JsExpression newExpr, List<? extends Type> typeParams) { |
| + private JsExpression maybeInternConst(JsExpression newExpr, List<Type> typeParams) { |
| JsInvocation intern = AstUtil.newInvocation(new JsNameRef(INTERN_CONST_FUNCTION), newExpr); |
| if (typeParams != null && typeParams.size() != 0) { |
| JsArrayLiteral arr = new JsArrayLiteral(); |