Skip to content

Post-Order Traversal #17

@tkohlman

Description

@tkohlman

If you change the following code in the traverse function:

var tree = [filename];
...
// Prevents redundancy about each memoized step
tree = removeDups(tree);

...to the following:

var tree = []; // now empty
...
tree = tree.concat(filename); // added

// Prevents redundancy about each memoized step
tree = removeDups(tree);

...the resulting list should be the equivalent of a post-order traversal of the dependency tree, with the entry file as the last element in the list. The list would not only give you the set of files in the dependency tree, it would give you the proper concatenation order of the source files when bundling the files as part of a build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions