MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / createCloneMethod

Function createCloneMethod

packages/alphatab/scripts/CloneEmitter.ts:300–327  ·  view source on GitHub ↗
(
    program: ts.Program,
    input: ts.ClassDeclaration,
    importer: (name: string, module: string) => void
)

Source from the content-addressed store, hash-verified

298}
299
300function createCloneMethod(
301 program: ts.Program,
302 input: ts.ClassDeclaration,
303 importer: (name: string, module: string) => void
304) {
305 return ts.factory.createMethodDeclaration(
306 [
307 ts.factory.createModifier(ts.SyntaxKind.PublicKeyword),
308 ts.factory.createModifier(ts.SyntaxKind.StaticKeyword)
309 ],
310 undefined,
311 'clone',
312 undefined,
313 undefined,
314 [
315 ts.factory.createParameterDeclaration(
316 undefined,
317 undefined,
318 'original',
319 undefined,
320 ts.factory.createTypeReferenceNode(input.name!.text, undefined),
321 undefined
322 )
323 ],
324 ts.factory.createTypeReferenceNode(input.name!.text, undefined),
325 generateCloneBody(program, input, importer)
326 );
327}
328
329export default createEmitter('cloneable', (program, input) => {
330 console.log(`Writing Cloner for ${input.name!.text}`);

Callers 1

CloneEmitter.tsFile · 0.85

Calls 1

generateCloneBodyFunction · 0.85

Tested by

no test coverage detected