Skip to content

Commit ee45ee0

Browse files
committed
エスケープされた予約語をキーに持つオブジェクトリテラルのテスト
1 parent b47dcfe commit ee45ee0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/literals.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,15 @@ describe('literal', () => {
241241
});
242242
});
243243

244+
test.concurrent('obj (escaped reserved word as key)', async () => {
245+
const res = await exe(`
246+
<: {
247+
\\u0064\\u0065\\u0066\\u0061\\u0075\\u006c\\u0074: 42,
248+
}
249+
`);
250+
eq(res, OBJ(new Map([['default', NUM(42)]])));
251+
})
252+
244253
test.concurrent('obj (invalid key)', async () => {
245254
assert.rejects(() => exe(`
246255
<: {

0 commit comments

Comments
 (0)