MCPcopy Create free account
hub / github.com/nodejs/node / exits

Function exits

tools/eslint-rules/no-keyobject-public-accessors.js:57–68  ·  view source on GitHub ↗
(statement)

Source from the content-addressed store, hash-verified

55}
56
57function exits(statement) {
58 if (!statement) return false;
59 switch (statement.type) {
60 case 'BlockStatement':
61 return statement.body.length > 0 && exits(statement.body.at(-1));
62 case 'ReturnStatement':
63 case 'ThrowStatement':
64 return true;
65 default:
66 return false;
67 }
68}
69
70function findStatementInBlock(node) {
71 let current = node;

Callers 1

Calls 1

atMethod · 0.45

Tested by

no test coverage detected