browserify / detective

Find all calls to require() no matter how deeply nested using a proper walk of the AST
Other
414 stars 60 forks source link

handle deep chaining; (fix issue #11) #12

Closed dominictarr closed 12 years ago

dominictarr commented 12 years ago

Added failing test, then fixed it.

Instead of inspecting the children of the node, inspect it's parents...

The traversal stops on each string, so check if that string is the child of a call to require.

Can't say this is the best solution, but this fixes the deep chaining bug #11, with a short edit distance from the original code.

ghost commented 12 years ago

This pull request is excellent: the failing test comes first and the fix mostly involves deleting lines.