@@ -28,11 +28,11 @@ module API {
2828 * The most basic use of API graphs is typically as follows:
2929 * 1. Start with `API::moduleImport` for the relevant library.
3030 * 2. Follow up with a chain of accessors such as `getMember` describing how to get to the relevant API function.
31- * 3. Map the resulting API graph nodes to data-flow nodes, using `getASource ` or `getASink `.
31+ * 3. Map the resulting API graph nodes to data-flow nodes, using `asSource ` or `asSink `.
3232 *
3333 * For example, a simplified way to get arguments to `underscore.extend` would be
3434 * ```ql
35- * API::moduleImport("underscore").getMember("extend").getParameter(0).getASink ()
35+ * API::moduleImport("underscore").getMember("extend").getParameter(0).asSink ()
3636 * ```
3737 *
3838 * The most commonly used accessors are `getMember`, `getParameter`, and `getReturn`.
@@ -121,48 +121,48 @@ module API {
121121 /**
122122 * Get a data-flow node where this value may flow after entering the current codebase.
123123 *
124- * This is similar to `getASource ()` but additionally includes nodes that are transitively reachable by data flow.
125- * See `getASource ()` for examples.
124+ * This is similar to `asSource ()` but additionally includes nodes that are transitively reachable by data flow.
125+ * See `asSource ()` for examples.
126126 */
127127 pragma [ inline]
128128 DataFlow:: Node getAValueReachableFromSource ( ) {
129- Impl:: trackUseNode ( this .getASource ( ) ) .flowsTo ( result )
129+ Impl:: trackUseNode ( this .asSource ( ) ) .flowsTo ( result )
130130 }
131131
132132 /**
133133 * Get a data-flow node where this value enters the current codebase.
134134 *
135135 * For example:
136136 * ```js
137- * // API::moduleImport("fs").getASource ()
137+ * // API::moduleImport("fs").asSource ()
138138 * require('fs');
139139 *
140- * // API::moduleImport("fs").getMember("readFile").getASource ()
140+ * // API::moduleImport("fs").getMember("readFile").asSource ()
141141 * require('fs').readFile;
142142 *
143- * // API::moduleImport("fs").getMember("readFile").getReturn().getASource ()
143+ * // API::moduleImport("fs").getMember("readFile").getReturn().asSource ()
144144 * require('fs').readFile();
145145 *
146146 * require('fs').readFile(
147147 * filename,
148- * // 'y' matched by API::moduleImport("fs").getMember("readFile").getParameter(1).getParameter(0).getASource ()
148+ * // 'y' matched by API::moduleImport("fs").getMember("readFile").getParameter(1).getParameter(0).asSource ()
149149 * y => {
150150 * ...
151151 * });
152152 * ```
153153 */
154- DataFlow:: SourceNode getASource ( ) { Impl:: use ( this , result ) }
154+ DataFlow:: SourceNode asSource ( ) { Impl:: use ( this , result ) }
155155
156- /** DEPRECATED. This predicate has been renamed to `getASource `. */
157- deprecated DataFlow:: SourceNode getAnImmediateUse ( ) { result = this .getASource ( ) }
156+ /** DEPRECATED. This predicate has been renamed to `asSource `. */
157+ deprecated DataFlow:: SourceNode getAnImmediateUse ( ) { result = this .asSource ( ) }
158158
159159 /** DEPRECATED. This predicate has been renamed to `getAValueReachableFromSource`. */
160160 deprecated DataFlow:: Node getAUse ( ) { result = this .getAValueReachableFromSource ( ) }
161161
162162 /**
163163 * Gets a call to the function represented by this API component.
164164 */
165- CallNode getACall ( ) { result = this .getReturn ( ) .getASource ( ) }
165+ CallNode getACall ( ) { result = this .getReturn ( ) .asSource ( ) }
166166
167167 /**
168168 * Gets a call to the function represented by this API component,
@@ -177,7 +177,7 @@ module API {
177177 /**
178178 * Gets a `new` call to the function represented by this API component.
179179 */
180- NewNode getAnInstantiation ( ) { result = this .getInstance ( ) .getASource ( ) }
180+ NewNode getAnInstantiation ( ) { result = this .getInstance ( ) .asSource ( ) }
181181
182182 /**
183183 * Gets an invocation (with our without `new`) to the function represented by this API component.
@@ -193,27 +193,27 @@ module API {
193193 *
194194 * For example:
195195 * ```js
196- * // 'x' is matched by API::moduleImport("foo").getParameter(0).getASink ()
196+ * // 'x' is matched by API::moduleImport("foo").getParameter(0).asSink ()
197197 * require('foo')(x);
198198 *
199- * // 'x' is matched by API::moduleImport("foo").getParameter(0).getMember("prop").getASink ()
199+ * // 'x' is matched by API::moduleImport("foo").getParameter(0).getMember("prop").asSink ()
200200 * require('foo')({
201201 * prop: x
202202 * });
203203 * ```
204204 */
205- DataFlow:: Node getASink ( ) { Impl:: rhs ( this , result ) }
205+ DataFlow:: Node asSink ( ) { Impl:: rhs ( this , result ) }
206206
207207 /**
208208 * Get a data-flow node that transitively flows to an external library (or in general, any external codebase).
209209 *
210- * This is similar to `getASink ()` but additionally includes nodes that transitively reach a sink by data flow.
211- * See `getASink ()` for examples.
210+ * This is similar to `asSink ()` but additionally includes nodes that transitively reach a sink by data flow.
211+ * See `asSink ()` for examples.
212212 */
213- DataFlow:: Node getAValueReachingSink ( ) { result = Impl:: trackDefNode ( this .getASink ( ) ) }
213+ DataFlow:: Node getAValueReachingSink ( ) { result = Impl:: trackDefNode ( this .asSink ( ) ) }
214214
215- /** DEPRECATED. This predicate has been renamed to `getASink `. */
216- deprecated DataFlow:: Node getARhs ( ) { result = this .getASink ( ) }
215+ /** DEPRECATED. This predicate has been renamed to `asSink `. */
216+ deprecated DataFlow:: Node getARhs ( ) { result = this .asSink ( ) }
217217
218218 /** DEPRECATED. This predicate has been renamed to `getAValueReachingSink`. */
219219 deprecated DataFlow:: Node getAValueReachingRhs ( ) { result = this .getAValueReachingSink ( ) }
@@ -451,7 +451,7 @@ module API {
451451 * In other words, the value of a use of `that` may flow into the right-hand side of a
452452 * definition of this node.
453453 */
454- predicate refersTo ( Node that ) { this .getASink ( ) = that .getAValueReachableFromSource ( ) }
454+ predicate refersTo ( Node that ) { this .asSink ( ) = that .getAValueReachableFromSource ( ) }
455455
456456 /**
457457 * Gets the data-flow node that gives rise to this node, if any.
@@ -1301,8 +1301,8 @@ module API {
13011301 API:: Node callee ;
13021302
13031303 InvokeNode ( ) {
1304- this = callee .getReturn ( ) .getASource ( ) or
1305- this = callee .getInstance ( ) .getASource ( ) or
1304+ this = callee .getReturn ( ) .asSource ( ) or
1305+ this = callee .getInstance ( ) .asSource ( ) or
13061306 this = Impl:: getAPromisifiedInvocation ( callee , _, _)
13071307 }
13081308
@@ -1317,7 +1317,7 @@ module API {
13171317 * Gets an API node where a RHS of the node is the `i`th argument to this call.
13181318 */
13191319 pragma [ noinline]
1320- private Node getAParameterCandidate ( int i ) { result .getASink ( ) = this .getArgument ( i ) }
1320+ private Node getAParameterCandidate ( int i ) { result .asSink ( ) = this .getArgument ( i ) }
13211321
13221322 /** Gets the API node for a parameter of this invocation. */
13231323 Node getAParameter ( ) { result = this .getParameter ( _) }
@@ -1328,13 +1328,13 @@ module API {
13281328 /** Gets the API node for the return value of this call. */
13291329 Node getReturn ( ) {
13301330 result = callee .getReturn ( ) and
1331- result .getASource ( ) = this
1331+ result .asSource ( ) = this
13321332 }
13331333
13341334 /** Gets the API node for the object constructed by this invocation. */
13351335 Node getInstance ( ) {
13361336 result = callee .getInstance ( ) and
1337- result .getASource ( ) = this
1337+ result .asSource ( ) = this
13381338 }
13391339 }
13401340
0 commit comments