use of org.mozilla.javascript.ast.ThrowStatement in project HL4A by HL4A.
the class Parser method throwStatement.
private ThrowStatement throwStatement() throws IOException {
if (currentToken != Token.THROW)
codeBug();
consumeToken();
int pos = ts.tokenBeg, lineno = ts.lineno;
if (peekTokenOrEOL() == Token.EOL) {
// ECMAScript does not allow new lines before throw expression,
// see bug 256617
reportError("msg.bad.throw.eol");
}
AstNode expr = expr();
ThrowStatement pn = new ThrowStatement(pos, getNodeEnd(expr), expr);
pn.setLineno(lineno);
return pn;
}
use of org.mozilla.javascript.ast.ThrowStatement in project st-js by st-js.
the class RhinoJavaScriptBuilder method throwStatement.
/**
* {@inheritDoc}
*/
@Override
public AstNode throwStatement(AstNode expr) {
ThrowStatement s = new ThrowStatement();
s.setExpression(expr);
return s;
}
Aggregations