Skip to content

Commit 7ae0774

Browse files
committed
add test for location
1 parent ce9fec1 commit 7ae0774

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,6 +2399,20 @@ describe('Location', () => {
23992399
if (!node.loc) assert.fail();
24002400
assert.deepEqual(node.loc, { start: 3, end: 13 });
24012401
});
2402+
test.concurrent('comment', async () => {
2403+
let node: Ast.Node;
2404+
const parser = new Parser();
2405+
const nodes = parser.parse(`
2406+
/*
2407+
*/
2408+
// hoge
2409+
@f(a) { a }
2410+
`);
2411+
assert.equal(nodes.length, 1);
2412+
node = nodes[0];
2413+
if (!node.loc) assert.fail();
2414+
assert.deepEqual(node.loc, { start: 23, end: 33 });
2415+
});
24022416
});
24032417

24042418
describe('Variable declaration', () => {

0 commit comments

Comments
 (0)