1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env node
function add(a, b) {
// BREAKPOINT_MARKER: add_body
const result = a + b;
return result;
}
function factorial(n) {
// BREAKPOINT_MARKER: factorial_body
if (n <= 1) {
return 1;
}
return n * factorial(n - 1);
}
function multiply(a, b) {
// BREAKPOINT_MARKER: multiply_body
return a * b;
}
function main() {
// BREAKPOINT_MARKER: main_start
const x = 10;
const y = 20;
const message = "hello";
const obj = { name: "test", value: 42 };
const arr = [1, 2, 3, 4, 5];
// BREAKPOINT_MARKER: before_add
const sumResult = add(x, y);
console.log(`Sum: ${sumResult}`);
// BREAKPOINT_MARKER: before_multiply
const product = multiply(x, y);
console.log(`Product: ${product}`);
// BREAKPOINT_MARKER: before_factorial
const fact = factorial(5);
console.log(`Factorial: ${fact}`);
// BREAKPOINT_MARKER: before_exit
return 0;
}
// BREAKPOINT_MARKER: entry_point
process.exit(main());