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

Function createClassFromFunctionDeclaration

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

Source from the content-addressed store, hash-verified

151316 return cls;
151317 }
151318 function createClassFromFunctionDeclaration(node) {
151319 var memberElements = createClassElementsFromSymbol(ctorSymbol);
151320 if (node.body) {
151321 memberElements.unshift(ts.factory.createConstructorDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, node.parameters, node.body));
151322 }
151323 var modifiers = getModifierKindFromSource(node, 93 /* SyntaxKind.ExportKeyword */);
151324 var cls = ts.factory.createClassDeclaration(/*decorators*/ undefined, modifiers, node.name,
151325 /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements);
151326 // Don't call copyComments here because we'll already leave them in place
151327 return cls;
151328 }
151329 }
151330 function getModifierKindFromSource(source, kind) {
151331 return ts.filter(source.modifiers, function (modifier) { return modifier.kind === kind; });

Callers 1

doChangeFunction · 0.85

Calls 3

unshiftMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…