Skip to content

Commit 9fb73f4

Browse files
committed
JS: rename ReactComponent::getAThisAccess -> getAThisNode
1 parent fd58039 commit 9fb73f4

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

change-notes/1.19/analysis-javascript.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@
3838
* The flow configuration framework now supports distinguishing and tracking different kinds of taint, specified by an extensible class `FlowLabel` (which can also be referred to by its alias `TaintKind`).
3939

4040
* The `DataFlow::ThisNode` class now corresponds to the implicit receiver parameter of a function, as opposed to an indivdual `this` expression. This means `getALocalSource` now maps all `this` expressions within a given function to the same source. The data-flow node associated with a `ThisExpr` can no longer be cast to `DataFlow::SourceNode` or `DataFlow::ThisNode` - it is recomended to use `getALocalSource` before casting or instead of casting.
41+
42+
* `ReactComponent::getAThisAccess` has been renamed to `getAThisNode`. The old name is still usable but is deprecated. It no longer gets individual `this` expressions, but the `ThisNode` mentioned above.

javascript/ql/src/semmle/javascript/frameworks/React.qll

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,20 @@ abstract class ReactComponent extends ASTNode {
5454
/**
5555
* Gets the `this` node in an instance method of this component.
5656
*/
57-
DataFlow::SourceNode getAThisAccess() {
57+
DataFlow::SourceNode getAThisNode() {
5858
result.(DataFlow::ThisNode).getBinder().getFunction() = getInstanceMethod(_)
5959
}
6060

61+
/**
62+
* Gets the `this` node in an instance method of this component.
63+
*
64+
* DEPRECATED: Use `getAThisNode` instead.
65+
*/
66+
deprecated
67+
DataFlow::SourceNode getAThisAccess() {
68+
result = getAThisNode()
69+
}
70+
6171
/**
6272
* Gets an access to the `props` object of this component.
6373
*

0 commit comments

Comments
 (0)