mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
fix value explorer for destructuring
This commit is contained in:
14
test/test.js
14
test/test.js
@@ -873,9 +873,15 @@ export const tests = [
|
||||
const frame = active_frame(i)
|
||||
assert_equal(
|
||||
// value for z in return statement
|
||||
frame.children[1].children[0].children[0].result.value,
|
||||
find_node(frame.children[1], n => n.value == 'z').result.value,
|
||||
1
|
||||
)
|
||||
// TODO not implemented
|
||||
//assert_equal(
|
||||
// // value for x in arguments
|
||||
// find_node(frame.children[0], n => n.value == 'x').result.value,
|
||||
// 1
|
||||
//)
|
||||
}),
|
||||
|
||||
test('array spread not iterable', () => {
|
||||
@@ -2653,6 +2659,12 @@ const y = x()`
|
||||
})
|
||||
}),
|
||||
|
||||
test('move_cursor destructuring default', () => {
|
||||
const code = `const [x = 1, y] = [undefined, 2]`
|
||||
const s = test_initial_state(code)
|
||||
assert_equal(s.value_explorer.result.value, {x: 1, y: 2})
|
||||
}),
|
||||
|
||||
test('move_cursor after type toplevel', () => {
|
||||
const code = `1`
|
||||
const s1 = test_initial_state(code)
|
||||
|
||||
Reference in New Issue
Block a user