Skip to content

Commit 55bf4ad

Browse files
committed
JavaScript: Fix bug in javascript/tree-debug.ts for long indents
1 parent 13ad308 commit 55bf4ad

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

rewrite-javascript/rewrite/src/javascript/tree-debug.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ const EXCLUDED_PROPERTIES = new Set([
6262
]);
6363

6464
/**
65-
* Subscript digits for counts.
65+
* Subscript digits for counts (index 0-9 maps to ₀-₉).
6666
*/
67-
const SUBSCRIPTS = ['', '₁', '₂', '₃', '₄', '₅', '₆', '₇', '₈', '₉'];
67+
const SUBSCRIPTS = ['', '₁', '₂', '₃', '₄', '₅', '₆', '₇', '₈', '₉'];
6868

6969
/**
7070
* Format a count as subscript. Count of 1 is implicit (empty string).

rewrite-javascript/rewrite/test/javascript/tree-debug.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ describe("LST Debug Utilities", () => {
8686
const result = formatWhitespace(" \t\t");
8787
expect(result).toBe("'·₂-₂'");
8888
});
89+
90+
test("10 spaces shows ·₁₀", () => {
91+
const result = formatWhitespace(" "); // 10 spaces
92+
expect(result).toBe("'·₁₀'");
93+
});
94+
95+
test("12 spaces shows ·₁₂", () => {
96+
const result = formatWhitespace(" "); // 12 spaces
97+
expect(result).toBe("'·₁₂'");
98+
});
8999
});
90100

91101
describe("formatSpace", () => {

0 commit comments

Comments
 (0)