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

Function addName

test/fixtures/snapshot/typescript.js:80298–80325  ·  view source on GitHub ↗
(names, location, name, meaning)

Source from the content-addressed store, hash-verified

80296 }
80297 }
80298 function addName(names, location, name, meaning) {
80299 var prev = names.get(name);
80300 if (prev) {
80301 // For private identifiers, do not allow mixing of static and instance members with the same name
80302 if ((prev & 16 /* DeclarationMeaning.PrivateStatic */) !== (meaning & 16 /* DeclarationMeaning.PrivateStatic */)) {
80303 error(location, ts.Diagnostics.Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name, ts.getTextOfNode(location));
80304 }
80305 else {
80306 var prevIsMethod = !!(prev & 8 /* DeclarationMeaning.Method */);
80307 var isMethod = !!(meaning & 8 /* DeclarationMeaning.Method */);
80308 if (prevIsMethod || isMethod) {
80309 if (prevIsMethod !== isMethod) {
80310 error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location));
80311 }
80312 // If this is a method/method duplication is might be an overload, so this will be handled when overloads are considered
80313 }
80314 else if (prev & meaning & ~16 /* DeclarationMeaning.PrivateStatic */) {
80315 error(location, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(location));
80316 }
80317 else {
80318 names.set(name, prev | meaning);
80319 }
80320 }
80321 }
80322 else {
80323 names.set(name, meaning);
80324 }
80325 }
80326 }
80327 /**
80328 * Static members being set on a constructor function may conflict with built-in properties

Callers 2

appendSourceMapFunction · 0.85

Calls 6

errorFunction · 0.70
enterFunction · 0.70
exitFunction · 0.70
getMethod · 0.65
setMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…