-
Notifications
You must be signed in to change notification settings - Fork 1.9k
JS: support flow out of "this" in constructor call #765
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
JS: support flow out of "this" in constructor call #765
Conversation
ghost
left a comment
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.
I suppose we are still waiting for the performance evaluation?
The change note can be added in one of the other child PRs of #760.
|
The evaluation from the parent PR should still apply as it includes this commit. |
xiemaisi
left a comment
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.
Broadly LGTM, minor suggestions.
| or | ||
| exists(Function f, DataFlow::Node mid, DataFlow::Node base | | ||
| exists(Function f, DataFlow::Node mid | | ||
| // `f` stores its parameter `pred` in property `prop` of a value that it returns, |
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.
Comment needs to be generalised slightly since we're no longer requiring that the value is returned.
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.
Do we need a concomitant change in TrackedNodes.qll?
| /** | ||
| * Holds if `f` may return `base`, which has a write of property `prop` with right-hand side `rhs`. | ||
| */ | ||
| predicate receiverPropWrite(Function f, string prop, DataFlow::Node rhs) { |
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.
Can we make this private?
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.
I moved this as well as returnedPropWrite into FlowSteps.qll so they are private and can be shared with TrackedNode.qll.
Technically this is breaking since DataFlow::returnedPropWrite was public and not marked as internal. But it's kind of an obscure thing to try and use from the outside, so rather than deprecating it I think a change note should suffice in this case, WDYT?
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.
Definitely; that predicate being public was an oversight.
| exists(Function f | calls(succ, f) | | ||
| returnExpr(f, pred, _) | ||
| or | ||
| succ instanceof DataFlow::NewNode and |
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.
Again, perhaps worth generalising the doc comment to explain about this case.
f8b4bbd to
a1c7f32
Compare
|
Rebased to resolve conflicts, PTAL overall. |
The first commit from #760