Skip to content

Commit ecb46e8

Browse files
committed
JS: extension point -> extensible predicate
1 parent 3d5c06b commit ecb46e8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/codeql/codeql-language-guides/customizing-library-models-for-javascript.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ A data extension for JavaScript is a YAML file of form:
1414
extensions:
1515
- addsTo:
1616
pack: codeql/javascript-all
17-
extensible: <name of extension point>
17+
extensible: <name of extensible predicate>
1818
data:
1919
- <tuple1>
2020
- <tuple2>
2121
- ...
2222
23-
The data extension can contribute to the following extension points:
23+
The data extension can contribute to the following extensible predicates:
2424

2525
- **sourceModel**\(type, path, kind)
2626
- **sinkModel**\(type, path, kind)
@@ -56,7 +56,7 @@ This can be achieved with the following data extension:
5656
5757
To break this down:
5858

59-
- Since we're adding a new sink, we add a tuple to the **sinkModel** extension point.
59+
- Since we're adding a new sink, we add a tuple to the **sinkModel** extensible predicate.
6060
- The first column, **"execa"**, identifies a set of values from which to begin the search for the sink.
6161
The string **"execa"** means we start at the places where the codebase imports the NPM package **execa**.
6262
- The second column is an access path that is evaluated from left to right, starting at the values that were identified by the first column.
@@ -94,7 +94,7 @@ This source is already known by the CodeQL JS analysis, but we'll show how it co
9494
9595
To break this down:
9696

97-
- Since we're adding a new taint source, we add a tuple to the **sourceModel** extension point.
97+
- Since we're adding a new taint source, we add a tuple to the **sourceModel** extensible predicate.
9898
- The first column, **"global"**, begins the search at references to the global object (also known as **window** in browser contexts). This is a special JavaScript object that contains all global variables and methods.
9999
- **Member[addEventListener]** selects accesses to the **addEventListener** member.
100100
- **Argument[1]** selects the second argument of calls to that member (the argument containing the callback).
@@ -193,7 +193,7 @@ Using a **typeModel** tuple we can tell our model that this function returns an
193193
194194
To break this down:
195195

196-
- Since we're providing type information, we add a tuple to the **typeModel** extension point.
196+
- Since we're providing type information, we add a tuple to the **typeModel** extensible predicate.
197197
- The first column, **"mysql.Connection"**, names the type that we're adding a new definition for.
198198
- The second column, **"@example/db"**, begins the search at imports of the hypothetical NPM package **@example/db**.
199199
- **Member[getConnection]** selects references to the **getConnection** member from that package.
@@ -238,7 +238,7 @@ This flow is already recognized by the CodeQL JS analysis, but this is how it co
238238
239239
To break this down:
240240

241-
- Since we're adding flow *through* a function call, we add a tuple to the **summaryModel** extension point.
241+
- Since we're adding flow *through* a function call, we add a tuple to the **summaryModel** extensible predicate.
242242
- The first column, **"global"**, begins the search for relevant calls at references to the global object.
243243
In JavaScript, global variables are properties of the global object, so this lets us access global variables or functions.
244244
- The second column, **Member[decodeURIComponent]**, is a path leading to the function calls we wish to model.
@@ -277,7 +277,7 @@ This flow is already recognized by the CodeQL JS analysis, but we'll show how it
277277
278278
To break this down:
279279

280-
- Since we're adding flow *through* a function call, we add a tuple to the **summaryModel** extension point.
280+
- Since we're adding flow *through* a function call, we add a tuple to the **summaryModel** extensible predicate.
281281
- The first column, **"underscore"**, begins the search for relevant calls at places where the **underscore** package is imported.
282282
- The second column, **Member[forEach]**, selects references to the **forEach** member from the **underscore** package.
283283
- The third column specifies the input of the flow:
@@ -296,10 +296,10 @@ To break this down:
296296
Reference material
297297
------------------
298298

299-
The following sections provide reference material for extension points, access paths, types, and kinds.
299+
The following sections provide reference material for extensible predicates, access paths, types, and kinds.
300300

301-
Extension points
302-
----------------
301+
Extensible predicates
302+
---------------------
303303

304304
sourceModel(type, path, kind)
305305
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -397,7 +397,7 @@ Types
397397
-----
398398

399399
A type is a string that identifies a set of values.
400-
In each of the extension points mentioned above, the first column is always the name of a type.
400+
In each of the extensible predicates mentioned above, the first column is always the name of a type.
401401
A type can be defined by adding **typeModel** tuples for that type. Additionally, the following built-in types are available:
402402

403403
- The name of an NPM package matches imports of that package. For example, the type **express** matches the expression **require("express")**. If the package name includes dots, it must be surrounded by single quotes, such as in **'lodash.escape'**.

0 commit comments

Comments
 (0)