MCPcopy
hub / github.com/webpack/webpack / walkStatements

Method walkStatements

lib/javascript/JavascriptParser.js:2176–2196  ·  view source on GitHub ↗

* Walking iterates the statements and expressions and processes them * @param {(Statement | ModuleDeclaration)[]} statements statements

(statements)

Source from the content-addressed store, hash-verified

2174 * @param {(Statement | ModuleDeclaration)[]} statements statements
2175 */
2176 walkStatements(statements) {
2177 let onlyFunctionDeclaration = false;
2178
2179 for (let index = 0, len = statements.length; index < len; index++) {
2180 const statement = statements[index];
2181
2182 if (
2183 onlyFunctionDeclaration &&
2184 statement.type !== "FunctionDeclaration" &&
2185 this.hooks.unusedStatement.call(/** @type {Statement} */ (statement))
2186 ) {
2187 continue;
2188 }
2189
2190 this.walkStatement(statement);
2191
2192 if (this.scope.terminated) {
2193 onlyFunctionDeclaration = true;
2194 }
2195 }
2196 }
2197
2198 /**
2199 * Walking iterates the statements and expressions and processes them

Callers 6

walkBlockStatementMethod · 0.95
walkForStatementMethod · 0.95
walkForInStatementMethod · 0.95
walkForOfStatementMethod · 0.95
walkSwitchCasesMethod · 0.95
parseMethod · 0.95

Calls 2

walkStatementMethod · 0.95
callMethod · 0.45

Tested by

no test coverage detected