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 87ae13592b62927c983f588aeb5f2ec2b3fdcd55..d3c552f073b812207f54ca2a5ff07acdb1b4a5b6 100644 |
| --- a/compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java |
| +++ b/compiler/java/com/google/dart/compiler/backend/js/GenerateJavascriptAST.java |
| @@ -1037,9 +1037,11 @@ public class GenerateJavascriptAST { |
| // Add the arguments to the constructor invocation. Note that the constructor call is still |
| // missing the 'tmp' variable. We will add it later. |
| List<DartParameter> params = x.getFunction().getParams(); |
| + List<JsName> jsArgNames = new ArrayList<JsName>(); |
| for (DartParameter p : params) { |
| // TODO(ngeoffray): We should actually copy the arguments. See b/4424659. |
| JsName argName = getJsName(p.getNormalizedNode().getSymbol()); |
| + jsArgNames.add(argName); |
| constructorInvocation.getArguments().add(argName.makeRef()); |
| } |
| @@ -1058,6 +1060,12 @@ public class GenerateJavascriptAST { |
| addInitializers(x, factoryFunction, tempVar); |
| rtt.maybeAddClassRuntimeTypeToConstructor(classElement, factoryFunction, tempVar.makeRef()); |
| JsNew jsNew = new JsNew(curClassJsName.makeRef()); |
| + if (classElement.getNativeName() != null && x.getFunction().getBody() == null) { |
|
floitsch
2012/01/16 13:23:26
I don't understand this code. (In any case add com
mmendez
2012/01/17 12:48:04
Added a comment in the code to match the comment i
|
| + List<JsExpression> newArguments = jsNew.getArguments(); |
| + for (JsName jsArgName : jsArgNames) { |
| + newArguments.add(jsArgName.makeRef()); |
| + } |
| + } |
| factoryFunction.getBody().getStatements().add(0, AstUtil.newVar(x, tempVar, jsNew)); |
| } |