Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

test(machine): retain functions after inline declarations [M1]

Corey Olson829d5befdff6
diff --git a/test/machine.test.js b/test/machine.test.js
index 37bf417f..c3602f49 100644
--- a/test/machine.test.js
+++ b/test/machine.test.js
@@ -123,7 +123,8 @@ function functionsIn(source) {
const start = START.exec(line);
if (!start) continue;
const end = line.trimEnd();
- if (start[1]) open = { name: start[1], lines: [line], ends: (next) => next === '}' };
+ if (start[1] && end.endsWith('}')) bodies.set(start[1], line);
+ else if (start[1]) open = { name: start[1], lines: [line], ends: (next) => next === '}' };
else if (end.endsWith(';')) bodies.set(start[2], line);
else if (end.endsWith('{')) open = { name: start[2], lines: [line], ends: (next) => next === '};' };
else open = { name: start[2], lines: [line], ends: (next) => next.trimEnd().endsWith(';') };