MCPcopy
hub / github.com/webpack/webpack / getVarInfo

Method getVarInfo

lib/javascript/JavascriptParser.js:4069–4091  ·  view source on GitHub ↗
(argOrThis)

Source from the content-addressed store, hash-verified

4067 * @returns {string | VariableInfo | undefined} var info
4068 */
4069 const getVarInfo = (argOrThis) => {
4070 const renameIdentifier = this.getRenameIdentifier(argOrThis);
4071 if (
4072 renameIdentifier &&
4073 this.callHooksForInfo(
4074 this.hooks.canRename,
4075 renameIdentifier,
4076 /** @type {Expression} */
4077 (argOrThis)
4078 ) &&
4079 !this.callHooksForInfo(
4080 this.hooks.rename,
4081 renameIdentifier,
4082 /** @type {Expression} */
4083 (argOrThis)
4084 )
4085 ) {
4086 return typeof renameIdentifier === "string"
4087 ? /** @type {string} */ (this.getVariableInfo(renameIdentifier))
4088 : renameIdentifier;
4089 }
4090 this.walkExpression(argOrThis);
4091 };
4092 const { params, type } = functionExpression;
4093 const arrow = type === "ArrowFunctionExpression";
4094 const renameThis = currentThis ? getVarInfo(currentThis) : null;

Callers

nothing calls this directly

Calls 4

getRenameIdentifierMethod · 0.95
callHooksForInfoMethod · 0.95
getVariableInfoMethod · 0.95
walkExpressionMethod · 0.95

Tested by

no test coverage detected