JS: prevent generation of excessive this.$result statements in coroutines
This commit is contained in:
+3
-1
@@ -45,7 +45,9 @@ public class TemporaryVariable {
|
||||
|
||||
@NotNull
|
||||
public JsNameRef reference() {
|
||||
return variableName.makeRef();
|
||||
JsNameRef result = variableName.makeRef();
|
||||
MetadataProperties.setSynthetic(result, true);
|
||||
return result;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -53,8 +53,9 @@ public final class JsAstUtils {
|
||||
assert (jsNode instanceof JsExpression) || (jsNode instanceof JsStatement)
|
||||
: "Unexpected node of type: " + jsNode.getClass().toString();
|
||||
if (jsNode instanceof JsExpression) {
|
||||
JsExpressionStatement statement = new JsExpressionStatement((JsExpression) jsNode);
|
||||
if (jsNode instanceof JsNullLiteral) {
|
||||
JsExpression expression = (JsExpression) jsNode;
|
||||
JsExpressionStatement statement = new JsExpressionStatement(expression);
|
||||
if (expression instanceof JsNullLiteral || MetadataProperties.getSynthetic(expression)) {
|
||||
MetadataProperties.setSynthetic(statement, true);
|
||||
}
|
||||
return statement;
|
||||
|
||||
Reference in New Issue
Block a user