MCPcopy Create free account
hub / github.com/mozilla/rhino / throwStatement

Method throwStatement

rhino/src/main/java/org/mozilla/javascript/Parser.java:2094–2107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2092 }
2093
2094 private ThrowStatement throwStatement() throws IOException {
2095 if (currentToken != Token.THROW) codeBug();
2096 consumeToken();
2097 int pos = ts.tokenBeg, lineno = lineNumber(), column = columnNumber();
2098 if (peekTokenOrEOL() == Token.EOL) {
2099 // ECMAScript does not allow new lines before throw expression,
2100 // see bug 256617
2101 reportError("msg.bad.throw.eol");
2102 }
2103 AstNode expr = expr(false);
2104 ThrowStatement pn = new ThrowStatement(pos, expr);
2105 pn.setLineColumnNumber(lineno, column);
2106 return pn;
2107 }
2108
2109 // If we match a NAME, consume the token and return the statement
2110 // with that label. If the name does not match an existing label,

Callers 1

statementHelperMethod · 0.95

Calls 8

codeBugMethod · 0.95
consumeTokenMethod · 0.95
lineNumberMethod · 0.95
columnNumberMethod · 0.95
peekTokenOrEOLMethod · 0.95
reportErrorMethod · 0.95
exprMethod · 0.95
setLineColumnNumberMethod · 0.80

Tested by

no test coverage detected