Skip to content

Commit 543e183

Browse files
committed
JS: Describe 1-step aliasing rule
1 parent baa3c35 commit 543e183

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

javascript/ql/lib/semmle/javascript/endpoints/EndpointNaming.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,14 @@ predicate functionHasPrimaryName(DataFlow::FunctionNode function, string package
355355
/**
356356
* Holds if `(aliasPackage, aliasName)` is an alias for `(primaryPackage, primaryName)`,
357357
* defined at `aliasDef`.
358+
*
359+
* Only the last component of an access path is reported as an alias, the prefix always
360+
* uses the primary name for that access path. The aliases for the prefix are reported
361+
* as separate tuples.
362+
*
363+
* For example, we might report that `a.b.C` is an alias for `a.b.c`, and that `a.B` is an alias for `a.b`.
364+
* By combining the two aliasing facts, we may conclude that `a.B.C` is an alias for `a.b.c`, but this fact is not
365+
* reported separately.
358366
*/
359367
predicate aliasDefinition(
360368
string primaryPackage, string primaryName, string aliasPackage, string aliasName,

0 commit comments

Comments
 (0)