mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-14 05:14:28 -08:00
Promise.then non-function callback
This commit is contained in:
@@ -303,8 +303,8 @@ export const eval_modules = (
|
||||
}
|
||||
let children_copy = children
|
||||
|
||||
const make_callback = cb => cb == null
|
||||
? null
|
||||
const make_callback = cb => typeof(cb) != 'function'
|
||||
? cb
|
||||
: value => {
|
||||
const current = children
|
||||
children = children_copy
|
||||
|
||||
@@ -2818,6 +2818,15 @@ const y = x()`
|
||||
)
|
||||
}),
|
||||
|
||||
test('async/await then non-function', async () => {
|
||||
await assert_code_evals_to_async(
|
||||
`
|
||||
await Promise.resolve(1).then(2)
|
||||
`,
|
||||
1
|
||||
)
|
||||
}),
|
||||
|
||||
test('async/await Promise.then creates subcall', async () => {
|
||||
const i = await test_initial_state_async(`
|
||||
const x = () => 1
|
||||
|
||||
Reference in New Issue
Block a user