-
Notifications
You must be signed in to change notification settings - Fork 1.8k
JS: Improvements from manual data flow investigations #5555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with one concern about an async api. (I think it is fine to bundle these unrelated changes into a single PR)
exists(DataFlow::CallNode call | | ||
call = | ||
API::moduleImport(["@babel/standalone", "@babel/core"]) | ||
.getMember(["transform", "transformSync"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is .transform
async? Won't that make the succ
turn up as a parameter to a callback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah you're right. I thought transform
would return a promise but after a closer look it just becomes synchronous if you don't give it a callback. There's also transformAsync
which does return a promise.
Since neither transformSync
nor transformAsync
accept a third parameter I just added an extra case for the callback parameter.
Adds some missing features I noticed while investigating data flows through some projects:
lodash-es
to thelodash
modelbabel.transform
redux-form
RouteMatch
objects to thereact-router
modelreact-native-base64
to the base64 libraryo[o.length] = y
as a taint step as it does the same aso.push(y)
Evaluations: (internal links)