speed up by using acorn tokenizer when possible#73
Open
goto-bus-stop wants to merge 11 commits intomasterfrom
Open
speed up by using acorn tokenizer when possible#73goto-bus-stop wants to merge 11 commits intomasterfrom
goto-bus-stop wants to merge 11 commits intomasterfrom
Conversation
40baf44 to
76c9161
Compare
bcomnes
approved these changes
Dec 25, 2017
Member
bcomnes
left a comment
There was a problem hiding this comment.
LGTM, and the conflict is very simple to fix, just bumping the ECMA version. I'm not to confident on what the side effects of this change could be though.
Member
|
Fixed the merge conflict |
Merged
Member
Author
|
yeah not sure about side effects either, might try using it in some more projects first |
05af6e5 to
038c74c
Compare
If a function expression declares a `require` parameter, its body is not analyzed for `require()` calls. This is mostly helpful for bundles that were already browserified, `detective` will ignore the calls to browser-pack's require runtime.
Member
Author
|
Well that got a lot more complex to support the scope stuff introduced by #79 😆 it looks like it works tho, will do a major bump for this to be safe (+ the scope stuff may technically be breaking as well) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a
findFastfunction that's exactly likedetective.find, but doesn't parse the source. detective.find automatically uses findFast if possible.we cannot do this if a custom
isRequirefunction is provided, because that can check an arbitrarily complexcallee. If a customisRequirefunction is not provided we only have to check for a single token with nameopts.word,so then we can look at only the token stream.acorn's tokenizer ignores comments so things like
require /* xyz */ ('abc')already work.when
opts.nodesis set, detected require calls are parsed usingacorn.parseExpressionAt.opts.fullParsecan be set in order to always do a full parse. this can be useful if folks want to make sure that all syntax is correct.I've so far found only one case where this doesn't work:
may add a special case for that if there's nothing else.
e;
Before:
After: