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

Function bindClassLikeDeclaration

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

Source from the content-addressed store, hash-verified

47512 }
47513 }
47514 function bindClassLikeDeclaration(node) {
47515 if (node.kind === 257 /* SyntaxKind.ClassDeclaration */) {
47516 bindBlockScopedDeclaration(node, 32 /* SymbolFlags.Class */, 899503 /* SymbolFlags.ClassExcludes */);
47517 }
47518 else {
47519 var bindingName = node.name ? node.name.escapedText : "__class" /* InternalSymbolName.Class */;
47520 bindAnonymousDeclaration(node, 32 /* SymbolFlags.Class */, bindingName);
47521 // Add name of class expression into the map for semantic classifier
47522 if (node.name) {
47523 classifiableNames.add(node.name.escapedText);
47524 }
47525 }
47526 var symbol = node.symbol;
47527 // TypeScript 1.0 spec (April 2014): 8.4
47528 // Every class automatically contains a static property member named 'prototype', the
47529 // type of which is an instantiation of the class type with type Any supplied as a type
47530 // argument for each type parameter. It is an error to explicitly declare a static
47531 // property member with the name 'prototype'.
47532 //
47533 // Note: we check for this here because this class may be merging into a module. The
47534 // module might have an exported variable called 'prototype'. We can't allow that as
47535 // that would clash with the built-in 'prototype' for the class.
47536 var prototypeSymbol = createSymbol(4 /* SymbolFlags.Property */ | 4194304 /* SymbolFlags.Prototype */, "prototype");
47537 var symbolExport = symbol.exports.get(prototypeSymbol.escapedName);
47538 if (symbolExport) {
47539 if (node.name) {
47540 ts.setParent(node.name, node);
47541 }
47542 file.bindDiagnostics.push(createDiagnosticForNode(symbolExport.declarations[0], ts.Diagnostics.Duplicate_identifier_0, ts.symbolName(prototypeSymbol)));
47543 }
47544 symbol.exports.set(prototypeSymbol.escapedName, prototypeSymbol);
47545 prototypeSymbol.parent = symbol;
47546 }
47547 function bindEnumDeclaration(node) {
47548 return ts.isEnumConst(node)
47549 ? bindBlockScopedDeclaration(node, 128 /* SymbolFlags.ConstEnum */, 899967 /* SymbolFlags.ConstEnumExcludes */)

Callers 1

bindWorkerFunction · 0.85

Calls 8

bindAnonymousDeclarationFunction · 0.85
createSymbolFunction · 0.85
createDiagnosticForNodeFunction · 0.85
addMethod · 0.65
getMethod · 0.65
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…