nl_tokens: / * Define a relaxed toposort which does not check for ( or worry about ) cyclic dependencies .
pl_tokens: function toposort ( dependencies ) { var sorted = [ ] , visited = { } ; function visit ( key ) { if ( ! visited [ <mask> ] ) { visited [ key ] = true ; if ( ! dependencies [ key ] ) { throw new Error ( 'A dependency is given which is not defined' + key ) ; } dependencies [ key ] . dependencies . forEach ( visit ) ; sorted . push ( key ) ; } } for ( var key in dependencies ) { visit ( key ) ; } return sorted ; }