add object declarations

This commit is contained in:
Kurt Hutten IrevDev
2023-01-01 21:48:30 +11:00
parent 84d76b5763
commit dbf8a993e5
8 changed files with 355 additions and 0 deletions

View File

@ -190,6 +190,22 @@ show(mySketch)
yo: [1, '2', 3, 9],
})
})
it('execute object expression', () => {
const code = [
'const three = 3',
"const yo = {aStr: 'str', anum: 2, identifier: three, binExp: 4 + 5}",
].join('\n')
const { root } = exe(code)
expect(root).toEqual({
three: 3,
yo: {
aStr: 'str',
anum: 2,
identifier: 3,
binExp: 9,
},
})
})
})
// helpers