MCPcopy
hub / github.com/vitejs/vite / setScope

Function setScope

packages/vite/src/node/ssr/ssrTransform.ts:461–471  ·  view source on GitHub ↗
(node: ESTree.Node, name: string)

Source from the content-addressed store, hash-verified

459 const identifiers: [id: any, stack: ESTree.Node[]][] = []
460
461 const setScope = (node: ESTree.Node, name: string) => {
462 let scopeIds = scopeMap.get(node)
463 if (scopeIds && scopeIds.has(name)) {
464 return
465 }
466 if (!scopeIds) {
467 scopeIds = new Set()
468 scopeMap.set(node, scopeIds)
469 }
470 scopeIds.add(name)
471 }
472
473 function isInScope(name: string, parents: ESTree.Node[]) {
474 return parents.some((node) => scopeMap.get(node)?.has(name))

Callers 2

handlePatternFunction · 0.85
enterFunction · 0.85

Calls 4

hasMethod · 0.80
addMethod · 0.80
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected