Skip to content

Import Cycle Detection throws unhandled error when graph is not fully a cycle #1535

Open
@leeyi45

Description

@leeyi45

Consider the following set of programs

// /a.js
import { b } from './b.js';
b;

// /b.js
import { a } from './a.js';
a;

// /program.js
import { a } from './a.js';
a;

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingminorless important than important but more than nice-to-have

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions