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
|
@NotNull
|
||||||
public JsNameRef reference() {
|
public JsNameRef reference() {
|
||||||
return variableName.makeRef();
|
JsNameRef result = variableName.makeRef();
|
||||||
|
MetadataProperties.setSynthetic(result, true);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -53,8 +53,9 @@ public final class JsAstUtils {
|
|||||||
assert (jsNode instanceof JsExpression) || (jsNode instanceof JsStatement)
|
assert (jsNode instanceof JsExpression) || (jsNode instanceof JsStatement)
|
||||||
: "Unexpected node of type: " + jsNode.getClass().toString();
|
: "Unexpected node of type: " + jsNode.getClass().toString();
|
||||||
if (jsNode instanceof JsExpression) {
|
if (jsNode instanceof JsExpression) {
|
||||||
JsExpressionStatement statement = new JsExpressionStatement((JsExpression) jsNode);
|
JsExpression expression = (JsExpression) jsNode;
|
||||||
if (jsNode instanceof JsNullLiteral) {
|
JsExpressionStatement statement = new JsExpressionStatement(expression);
|
||||||
|
if (expression instanceof JsNullLiteral || MetadataProperties.getSynthetic(expression)) {
|
||||||
MetadataProperties.setSynthetic(statement, true);
|
MetadataProperties.setSynthetic(statement, true);
|
||||||
}
|
}
|
||||||
return statement;
|
return statement;
|
||||||
|
|||||||
Reference in New Issue
Block a user