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

traverse perf improvements & fix acorn opts #50

Closed zertosh closed 9 years ago

zertosh commented 9 years ago

Making up for my oversight in https://github.com/substack/node-detective/pull/46.

zertosh commented 9 years ago

before:

$ for i in {1..5}; do node detect.js; done
125
126
127
127
126

after:

for i in {1..5}; do node detect.js; done
97
99
97
101
102
zertosh commented 9 years ago

PS: opts.tolerant was introduced in https://github.com/substack/node-detective/commit/77db823fb1156c4f6590e12c77ff213b9a3aec45. I think it was used to do the same thing as allowReturnOutsideFunction, since the commit message talks about needing a wrapper before.

zertosh commented 9 years ago

Maybe after https://github.com/substack/astw/pull/8, we can use that instead.

zertosh commented 9 years ago

tracking as part of https://github.com/substack/node-browserify/issues/1279