MCPcopy Index your code
hub / github.com/nodejs/node / VariableDeclarator

Function VariableDeclarator

tools/eslint-rules/prefer-primordials.js:201–224  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

199 }
200 },
201 VariableDeclarator(node) {
202 const name = node.init?.name;
203 if (name === 'primordials' && node.id.type === 'ObjectPattern') {
204 const name = node.id.properties.find(({ key }) => polyfilledSet.has(key.name))?.key.name;
205 if (name) {
206 context.report({
207 node,
208 messageId: 'errorPolyfill',
209 data: { name },
210 });
211 return;
212 }
213 }
214 if (name !== undefined && isTarget(nameMap, name) &&
215 node.id.type === 'Identifier' &&
216 !globalScope.set.get(name)?.defs.length) {
217 reported.add(node.init.range[0]);
218 context.report({
219 node,
220 messageId: 'error',
221 data: { name },
222 });
223 }
224 },
225 };
226 },
227};

Callers

nothing calls this directly

Calls 6

isTargetFunction · 0.85
findMethod · 0.65
hasMethod · 0.65
getMethod · 0.65
addMethod · 0.65
reportMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…