mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2025-01-09 08:24:10 -08:00
JS: fix crash on some JavaScript constructs in hand-written runtime code
This commit is contained in:
parent
3b170df2ca
commit
810ee0f49e
|
@ -29,6 +29,7 @@ import org.mozilla.javascript.ast.ConditionalExpression;
|
||||||
import org.mozilla.javascript.ast.ContinueStatement;
|
import org.mozilla.javascript.ast.ContinueStatement;
|
||||||
import org.mozilla.javascript.ast.DoLoop;
|
import org.mozilla.javascript.ast.DoLoop;
|
||||||
import org.mozilla.javascript.ast.ElementGet;
|
import org.mozilla.javascript.ast.ElementGet;
|
||||||
|
import org.mozilla.javascript.ast.EmptyExpression;
|
||||||
import org.mozilla.javascript.ast.EmptyStatement;
|
import org.mozilla.javascript.ast.EmptyStatement;
|
||||||
import org.mozilla.javascript.ast.ExpressionStatement;
|
import org.mozilla.javascript.ast.ExpressionStatement;
|
||||||
import org.mozilla.javascript.ast.ForInLoop;
|
import org.mozilla.javascript.ast.ForInLoop;
|
||||||
|
@ -133,7 +134,11 @@ public class AstVisitor {
|
||||||
visitParenthesized((ParenthesizedExpression) node);
|
visitParenthesized((ParenthesizedExpression) node);
|
||||||
break;
|
break;
|
||||||
case Token.EMPTY:
|
case Token.EMPTY:
|
||||||
|
if (node instanceof EmptyStatement) {
|
||||||
visitEmpty((EmptyStatement) node);
|
visitEmpty((EmptyStatement) node);
|
||||||
|
} else {
|
||||||
|
visitEmpty((EmptyExpression) node);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case Token.EXPR_VOID:
|
case Token.EXPR_VOID:
|
||||||
case Token.EXPR_RESULT:
|
case Token.EXPR_RESULT:
|
||||||
|
@ -377,6 +382,9 @@ public class AstVisitor {
|
||||||
protected void visitEmpty(EmptyStatement node) {
|
protected void visitEmpty(EmptyStatement node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void visitEmpty(EmptyExpression node) {
|
||||||
|
}
|
||||||
|
|
||||||
protected void visitName(Name node) {
|
protected void visitName(Name node) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user