You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: javascript/ql/experimental/adaptivethreatmodeling/lib/experimental/adaptivethreatmodeling/FunctionBodyFeatures.qll
+12-4Lines changed: 12 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -7,22 +7,30 @@
7
7
import javascript
8
8
privateimport FeaturizationConfig
9
9
10
+
/**
11
+
* Returns a tokenized representation of the AST node for use in the `enclosingFunctionBody`
12
+
* feature.
13
+
*/
10
14
stringgetTokenizedAstNode(ASTNodenode){
11
-
// NB: Unary and binary operator expressions e.g. -a, a + b and compound
12
-
// assignments e.g. a += b can be identified by the expression type.
15
+
// e.g. `x` -> "x"
13
16
result=node.(Identifier).getName()
14
17
or
15
18
// Computed property accesses for which we can predetermine the property being accessed.
16
-
// NB: May alias with operators e.g. could have '+' as a property name.
19
+
// e.g. we'll featurize the `["date"]` part of `response["date"]` as `date`
17
20
result=node.(IndexExpr).getPropertyName()
18
21
or
19
22
// We use `getRawValue` to give us distinct representations for `0xa`, `0xA`, and `10`.
0 commit comments