todo: assignment pattern

This commit is contained in:
cha0s 2024-07-26 07:04:36 -05:00
parent dd675efa5c
commit df56438656

View File

@ -446,6 +446,26 @@ test('executes member expressions', async () => {
}); });
}); });
test.todo('declares with assignment pattern', async () => {
let sandbox;
sandbox = new Sandbox(
await parse(`
const {Player: {id: owner = 0} = {}, Position} = {};
owner;
`),
);
expect(sandbox.run().value)
.to.equal(0);
sandbox = new Sandbox(
await parse(`
const {Player: {id: [owner = 0]} = {id: []}, Position} = {};
owner;
`),
);
expect(sandbox.run().value)
.to.equal(0);
});
test('handles nested yields', async () => { test('handles nested yields', async () => {
expect( expect(
await finish(new Sandbox( await finish(new Sandbox(