MCPcopy
hub / github.com/webpack/webpack / enterDeclaration

Method enterDeclaration

lib/javascript/JavascriptParser.js:2931–2950  ·  view source on GitHub ↗

* Processes the provided declaration. * @param {Declaration} declaration declaration * @param {OnIdent} onIdent on ident callback

(declaration, onIdent)

Source from the content-addressed store, hash-verified

2929 * @param {OnIdent} onIdent on ident callback
2930 */
2931 enterDeclaration(declaration, onIdent) {
2932 switch (declaration.type) {
2933 case "VariableDeclaration":
2934 for (const declarator of declaration.declarations) {
2935 switch (declarator.type) {
2936 case "VariableDeclarator": {
2937 this.enterPattern(declarator.id, onIdent);
2938 break;
2939 }
2940 }
2941 }
2942 break;
2943 case "FunctionDeclaration":
2944 this.enterPattern(declaration.id, onIdent);
2945 break;
2946 case "ClassDeclaration":
2947 this.enterPattern(declaration.id, onIdent);
2948 break;
2949 }
2950 }
2951
2952 /**
2953 * Module pre walk export named declaration.

Callers 1

Calls 1

enterPatternMethod · 0.95

Tested by

no test coverage detected