MCPcopy
hub / github.com/webpack/webpack / blockPreWalkStatement

Method blockPreWalkStatement

lib/javascript/JavascriptParser.js:2261–2289  ·  view source on GitHub ↗

* Block pre walk statement. * @param {Statement | ModuleDeclaration | MaybeNamedClassDeclaration | MaybeNamedFunctionDeclaration} statement statement

(statement)

Source from the content-addressed store, hash-verified

2259 * @param {Statement | ModuleDeclaration | MaybeNamedClassDeclaration | MaybeNamedFunctionDeclaration} statement statement
2260 */
2261 blockPreWalkStatement(statement) {
2262 /** @type {StatementPath} */
2263 (this.statementPath).push(statement);
2264 if (this.hooks.blockPreStatement.call(statement)) {
2265 this.prevStatement =
2266 /** @type {StatementPath} */
2267 (this.statementPath).pop();
2268 return;
2269 }
2270 switch (statement.type) {
2271 case "ExportDefaultDeclaration":
2272 this.blockPreWalkExportDefaultDeclaration(statement);
2273 break;
2274 case "ExportNamedDeclaration":
2275 this.blockPreWalkExportNamedDeclaration(statement);
2276 break;
2277 case "VariableDeclaration":
2278 this.blockPreWalkVariableDeclaration(statement);
2279 break;
2280 case "ClassDeclaration":
2281 this.blockPreWalkClassDeclaration(statement);
2282 break;
2283 case "ExpressionStatement":
2284 this.blockPreWalkExpressionStatement(statement);
2285 }
2286 this.prevStatement =
2287 /** @type {StatementPath} */
2288 (this.statementPath).pop();
2289 }
2290
2291 /**
2292 * Processes the provided statement.

Calls 8

popMethod · 0.80
pushMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected