You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running /program.js causes the directed graph's cycle finder to throws an unhandled error "Node '/playground/program.js' has no incoming edges. This should never happen."
The tests in js-slang account for when all files together form some cycle. In this case however, the cycle only exists between /a.js and /b.js, so the entrypoint program /program.js is not part of that cycle.
Does the program to be run need to be part of the cycle? In my view, importing a module that cyclically depends on some other module is ill-defined.
I don't have a particular opinion on this, just that this specific condition needs to be handled gracefully
leeyi45
changed the title
Import Cycle Detection throws errors when graph is not fully a cycle
Import Cycle Detection throws unhandled error when graph is not fully a cycle
Feb 14, 2024
I see. We should catch this error and display a more reasonable error message. Something like:
"program /playground/program.js has cyclic dependencies in its import declarations"
Consider the following set of programs
Running
/program.js
causes the directed graph's cycle finder to throws an unhandled error"Node '/playground/program.js' has no incoming edges. This should never happen."
The tests in
js-slang
account for when all files together form some cycle. In this case however, the cycle only exists between/a.js
and/b.js
, so the entrypoint program/program.js
is not part of that cycle.Link to example program
The text was updated successfully, but these errors were encountered: