JS: make JsEmpty singleton
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
package com.google.dart.compiler.backend.js.ast
|
||||
|
||||
public class JsEmpty : SourceInfoAwareJsNode(), JsStatement {
|
||||
public object JsEmpty : SourceInfoAwareJsNode(), JsStatement {
|
||||
|
||||
override fun accept(v: JsVisitor) {
|
||||
v.visitEmpty(this)
|
||||
|
||||
@@ -26,7 +26,7 @@ public class JsEmptyExpression extends JsExpressionImpl {
|
||||
@Override
|
||||
@NotNull
|
||||
public JsStatement makeStmt() {
|
||||
return new JsEmpty();
|
||||
return JsEmpty.INSTANCE$;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -18,8 +18,6 @@ import static com.google.dart.compiler.backend.js.ast.JsNumberLiteral.JsIntLiter
|
||||
* A JavaScript program.
|
||||
*/
|
||||
public final class JsProgram extends SourceInfoAwareJsNode {
|
||||
@NotNull
|
||||
private final JsEmpty emptyStatement;
|
||||
@NotNull final JsExpression emptyExpression;
|
||||
|
||||
private JsProgramFragment[] fragments;
|
||||
@@ -36,15 +34,9 @@ public final class JsProgram extends SourceInfoAwareJsNode {
|
||||
topScope = new JsObjectScope(rootScope, "Global", unitId);
|
||||
setFragmentCount(1);
|
||||
|
||||
emptyStatement = new JsEmpty();
|
||||
emptyExpression = new JsEmptyExpression();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public JsEmpty getEmptyStatement() {
|
||||
return emptyStatement;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public JsExpression getEmptyExpression() {
|
||||
return emptyExpression;
|
||||
|
||||
Reference in New Issue
Block a user