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

Function findSuperCallAndStatementIndex

test/fixtures/snapshot/typescript.js:99270–99285  ·  view source on GitHub ↗
(originalBodyStatements, existingPrologue)

Source from the content-addressed store, hash-verified

99268 return body;
99269 }
99270 function findSuperCallAndStatementIndex(originalBodyStatements, existingPrologue) {
99271 for (var i = existingPrologue.length; i < originalBodyStatements.length; i += 1) {
99272 var superCall = ts.getSuperCallFromStatement(originalBodyStatements[i]);
99273 if (superCall) {
99274 // With a super() call, split the statements into pre-super() and 'body' (post-super())
99275 return {
99276 superCall: superCall,
99277 superStatementIndex: i,
99278 };
99279 }
99280 }
99281 // Since there was no super() call found, consider all statements to be in the main 'body' (post-super())
99282 return {
99283 superStatementIndex: -1,
99284 };
99285 }
99286 /**
99287 * We want to try to avoid emitting a return statement in certain cases if a user already returned something.
99288 * It would generate obviously dead code, so we'll try to make things a little bit prettier

Callers 1

transformConstructorBodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…