mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
fix
This commit is contained in:
18
test/test.js
18
test/test.js
@@ -820,6 +820,23 @@ export const tests = [
|
||||
assert_equal(frame.children[0].children[0].children[0].result.value, [1,2,3])
|
||||
}),
|
||||
|
||||
test('eval_frame default arg', () => {
|
||||
const code = `
|
||||
const x = 1
|
||||
function y(z = x) {
|
||||
return z
|
||||
}
|
||||
y()
|
||||
`
|
||||
const tree = eval_tree(code)
|
||||
const frame = eval_frame(tree.children[0])
|
||||
assert_equal(
|
||||
// value for z in return statement
|
||||
frame.children[1].children[0].children[0].result.value,
|
||||
1
|
||||
)
|
||||
}),
|
||||
|
||||
test('module not found', () => {
|
||||
const parsed = parse_modules(
|
||||
'a',
|
||||
@@ -3174,6 +3191,7 @@ const y = x()`
|
||||
patch_builtin('random', null)
|
||||
}),
|
||||
|
||||
|
||||
test('record io cache discarded if args does not match', async () => {
|
||||
// Patch fetch
|
||||
patch_builtin('fetch', async () => 'first')
|
||||
|
||||
Reference in New Issue
Block a user