mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
not iterable error
This commit is contained in:
31
test/test.js
31
test/test.js
@@ -837,6 +837,23 @@ export const tests = [
|
||||
)
|
||||
}),
|
||||
|
||||
test('array spread not iterable', () => {
|
||||
assert_code_error(
|
||||
`[...null]`,
|
||||
new Error('null is not iterable'),
|
||||
)
|
||||
}),
|
||||
|
||||
test('args spread not iterable', () => {
|
||||
assert_code_error(
|
||||
`
|
||||
function x() {}
|
||||
x(...null)
|
||||
`,
|
||||
new Error('null is not iterable'),
|
||||
)
|
||||
}),
|
||||
|
||||
test('module not found', () => {
|
||||
const parsed = parse_modules(
|
||||
'a',
|
||||
@@ -2336,6 +2353,20 @@ const y = x()`
|
||||
assert_equal(s2.value_explorer.result.error.message, 'boom')
|
||||
}),
|
||||
|
||||
test('move_cursor error in fn args bug', () => {
|
||||
const code = `
|
||||
function x() {}
|
||||
x(null.foo)
|
||||
`
|
||||
const i = test_initial_state(code)
|
||||
|
||||
const m = COMMANDS.move_cursor(i, code.indexOf('x(null'))
|
||||
assert_equal(
|
||||
m.value_explorer.result.error,
|
||||
new Error("Cannot read properties of null (reading 'foo')")
|
||||
)
|
||||
}),
|
||||
|
||||
test('frame follows cursor toplevel', () => {
|
||||
const code = `
|
||||
const x = () => {
|
||||
|
||||
Reference in New Issue
Block a user