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

Method forLoopInit

rhino/src/main/java/org/mozilla/javascript/Parser.java:1907–1925  ·  view source on GitHub ↗
(int tt)

Source from the content-addressed store, hash-verified

1905 }
1906
1907 private AstNode forLoopInit(int tt) throws IOException {
1908 try {
1909 inForInit = true; // checked by variables() and relExpr()
1910 AstNode init = null;
1911 if (tt == Token.SEMI) {
1912 init = new EmptyExpression(ts.tokenBeg, 1);
1913 // We haven't consumed the token, so we need the CURRENT lexer position
1914 init.setLineColumnNumber(ts.getLineno(), ts.getTokenColumn());
1915 } else if (tt == Token.VAR || tt == Token.LET) {
1916 consumeToken();
1917 init = variables(tt, ts.tokenBeg, false);
1918 } else {
1919 init = expr(false);
1920 }
1921 return init;
1922 } finally {
1923 inForInit = false;
1924 }
1925 }
1926
1927 private TryStatement tryStatement() throws IOException {
1928 if (currentToken != Token.TRY) codeBug();

Callers 1

forLoopMethod · 0.95

Calls 6

consumeTokenMethod · 0.95
variablesMethod · 0.95
exprMethod · 0.95
setLineColumnNumberMethod · 0.80
getTokenColumnMethod · 0.80
getLinenoMethod · 0.65

Tested by

no test coverage detected