MCPcopy Create free account
hub / github.com/nodejs/node / VariableDeclarator

Function VariableDeclarator

tools/eslint-rules/no-keyobject-public-accessors.js:238–264  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

236
237 return {
238 VariableDeclarator(node) {
239 if (isInternalCryptoKeysRequire(node.init)) {
240 if (node.id.type === 'Identifier') {
241 namespaceNames.add(node.id.name);
242 return;
243 }
244
245 if (node.id.type !== 'ObjectPattern') return;
246
247 for (const property of node.id.properties) {
248 if (property.type !== 'Property') continue;
249 const keyName = property.key.name ?? property.key.value;
250 if (property.value.type !== 'Identifier') continue;
251 const localName = property.value.name;
252 if (keyName === 'isKeyObject') {
253 isKeyObjectNames.add(localName);
254 } else if (keyObjectClassNames.has(keyName)) {
255 knownKeyObjectClassNames.add(localName);
256 }
257 }
258 return;
259 }
260
261 if (node.id.type === 'Identifier' && isKeyObjectFactory(node.init)) {
262 knownKeyObjectNames.add(node.id.name);
263 }
264 },
265
266 MemberExpression(node) {
267 const property = getPropertyName(node);

Callers

nothing calls this directly

Calls 4

isKeyObjectFactoryFunction · 0.85
addMethod · 0.65
hasMethod · 0.65

Tested by

no test coverage detected