Skip to content


Incorrect "Cyclic dependency" exception #1

andrewschaaf opened this Issue · 2 comments

2 participants

# MAIN ---> 1 ---> 2
#   \--------------\---->3
DepGraph = require 'dep-graph'
derp = new DepGraph
derp.add "MAIN", "1"
derp.add "MAIN", "3"
derp.add "1", "2"
derp.add "2", "3"
console.log derp.getChain "MAIN"
Error: Cyclic dependency from 2 to 3
    at DepGraph.getChain (/node_modules/dep-graph/lib/dep-graph.js:39:17)
    at DepGraph.getChain (/node_modules/dep-graph/lib/dep-graph.js:46:14)
    at DepGraph.getChain (/node_modules/dep-graph/lib/dep-graph.js:46:14)
    at Object. (.:9:20)
    at Object. (.:10:4)
    at Module._compile (module.js:402:26)
    at (/usr/local/lib/node_modules/coffee-script/lib/coffee-script.js:57:25)
    at /usr/local/lib/node_modules/coffee-script/lib/command.js:147:29
    at Socket. (/usr/local/lib/node_modules/coffee-script/lib/command.js:181:14)
    at Socket.emit (events.js:61:17)


Ha, meme well-taken!

I think I've fixed the problem, but I'd much appreciate it if you'd throw some more test cases at me.

  "fixes counter-example promptly for free",
  "takes meme well")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.