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

Function checkReflectCollision

test/fixtures/snapshot/typescript.js:82380–82408  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

82378 }
82379 }
82380 function checkReflectCollision(node) {
82381 var hasCollision = false;
82382 if (ts.isClassExpression(node)) {
82383 // ClassExpression names don't contribute to their containers, but do matter for any of their block-scoped members.
82384 for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
82385 var member = _a[_i];
82386 if (getNodeCheckFlags(member) & 134217728 /* NodeCheckFlags.ContainsSuperPropertyInStaticInitializer */) {
82387 hasCollision = true;
82388 break;
82389 }
82390 }
82391 }
82392 else if (ts.isFunctionExpression(node)) {
82393 // FunctionExpression names don't contribute to their containers, but do matter for their contents
82394 if (getNodeCheckFlags(node) & 134217728 /* NodeCheckFlags.ContainsSuperPropertyInStaticInitializer */) {
82395 hasCollision = true;
82396 }
82397 }
82398 else {
82399 var container = ts.getEnclosingBlockScopeContainer(node);
82400 if (container && getNodeCheckFlags(container) & 134217728 /* NodeCheckFlags.ContainsSuperPropertyInStaticInitializer */) {
82401 hasCollision = true;
82402 }
82403 }
82404 if (hasCollision) {
82405 ts.Debug.assert(ts.isNamedDeclaration(node) && ts.isIdentifier(node.name), "The target of a Reflect collision check should be an identifier");
82406 errorSkippedOn("noEmit", node, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers, ts.declarationNameToString(node.name), "Reflect");
82407 }
82408 }
82409 function checkCollisionsForDeclarationName(node, name) {
82410 if (!name)
82411 return;

Callers

nothing calls this directly

Calls 3

getNodeCheckFlagsFunction · 0.85
errorSkippedOnFunction · 0.85
assertMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…