JS parser: fixed JsInvocation mapping

This commit is contained in:
Alexey Tsvetkov
2014-12-01 16:43:58 +03:00
parent 46326fe5ac
commit 272788cb27
2 changed files with 7 additions and 10 deletions
+2 -2
View File
@@ -9,6 +9,6 @@
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="js.dart-ast" />
<orderEntry type="library" name="kotlin-runtime" level="project" />
<orderEntry type="library" name="intellij-core" level="project" />
</component>
</module>
</module>
@@ -19,6 +19,7 @@ import com.google.dart.compiler.backend.js.ast.*;
import com.google.dart.compiler.backend.js.ast.JsLiteral.JsBooleanLiteral;
import com.google.dart.compiler.common.SourceInfo;
import com.google.gwt.dev.js.rhino.*;
import com.intellij.util.SmartList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -385,25 +386,21 @@ public class JsParser {
}
private JsInvocation mapCall(Node callNode) throws JsParserException {
JsInvocation invocation = new JsInvocation();
// Map the target expression.
//
Node from = callNode.getFirstChild();
JsExpression to = mapExpression(from);
invocation.setQualifier(to);
JsExpression qualifier = mapExpression(from);
// Iterate over and map the arguments.
//
List<JsExpression> args = invocation.getArguments();
List<JsExpression> arguments = new SmartList<JsExpression>();
from = from.getNext();
while (from != null) {
to = mapExpression(from);
args.add(to);
arguments.add(mapExpression(from));
from = from.getNext();
}
return invocation;
return new JsInvocation(qualifier, arguments);
}
private JsExpression mapConditional(Node condNode) throws JsParserException {