MCPcopy
hub / github.com/lebab/lebab / isLexicalVariableProhibited

Function isLexicalVariableProhibited

src/transform/let.js:202–215  ·  view source on GitHub ↗
(group)

Source from the content-addressed store, hash-verified

200// if (true) { const x = 10; }
201//
202function isLexicalVariableProhibited(group) {
203 const node = group.getNode();
204 const parentNode = group.getParentNode();
205
206 if (parentNode.type === 'IfStatement') {
207 return parentNode.consequent === node || parentNode.alternate === node;
208 }
209
210 if (isAnyForStatement(parentNode) || isAnyWhileStatement(parentNode)) {
211 return parentNode.body === node;
212 }
213
214 return false;
215}
216
217function logWarningForVarKind(node) {
218 if (node.kind === 'var') {

Callers 1

Calls 4

isAnyForStatementFunction · 0.85
isAnyWhileStatementFunction · 0.85
getParentNodeMethod · 0.80
getNodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…