Skip to content

Commit 91104dc

Browse files
committed
JS: Localize charpred of API::EntryPoint
This is needed for localizing ApiLabel later
1 parent 82fb5e9 commit 91104dc

File tree

19 files changed

+29
-1
lines changed

19 files changed

+29
-1
lines changed

javascript/ql/lib/semmle/javascript/ApiGraphs.qll

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,17 +676,21 @@ module API {
676676
* Imports and exports are considered entry points by default, but additional entry points may
677677
* be added by extending this class. Typical examples include global variables.
678678
*/
679+
overlay[local]
679680
abstract class EntryPoint extends string {
680681
bindingset[this]
681682
EntryPoint() { any() }
682683

683684
/** Gets a data-flow node where a value enters the current codebase through this entry-point. */
685+
overlay[global]
684686
DataFlow::SourceNode getASource() { none() }
685687

686688
/** Gets a data-flow node where a value leaves the current codebase through this entry-point. */
689+
overlay[global]
687690
DataFlow::Node getASink() { none() }
688691

689692
/** Gets an API-node for this entry point. */
693+
overlay[global]
690694
API::Node getANode() { result = root().getASuccessor(Label::entryPoint(this)) }
691695
}
692696

javascript/ql/lib/semmle/javascript/frameworks/ClientRequests.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ module ClientRequest {
198198
private string urlPropertyName() { result = "url" or result = "uri" }
199199

200200
/** An API entry-point for the global variable `axios`. */
201+
overlay[local?]
201202
private class AxiosGlobalEntryPoint extends API::EntryPoint {
202203
AxiosGlobalEntryPoint() { this = "axiosGlobal" }
203204

javascript/ql/lib/semmle/javascript/frameworks/D3.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ private import semmle.javascript.security.dataflow.DomBasedXssCustomizations
66
/** Provides classes and predicates modeling aspects of the `d3` library. */
77
module D3 {
88
/** The global variable `d3` as an entry point for API graphs. */
9+
overlay[local?]
910
private class D3GlobalEntry extends API::EntryPoint {
1011
D3GlobalEntry() { this = "D3GlobalEntry" }
1112

javascript/ql/lib/semmle/javascript/frameworks/Electron.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ module Electron {
4141
BrowserView() { this = DataFlow::moduleMember("electron", "BrowserView").getAnInstantiation() }
4242
}
4343

44+
overlay[local?]
4445
private class ElectronEntryPoint extends API::EntryPoint {
4546
ElectronEntryPoint() { this = "Electron.Browser" }
4647

javascript/ql/lib/semmle/javascript/frameworks/History.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import javascript
55
/** Provides classes modeling the [`history`](https://npmjs.org/package/history) library. */
66
module History {
77
/** The global variable `HistoryLibrary` as an entry point for API graphs. */
8+
overlay[local?]
89
private class HistoryGlobalEntry extends API::EntryPoint {
910
HistoryGlobalEntry() { this = "HistoryLibrary" }
1011

javascript/ql/lib/semmle/javascript/frameworks/Immutable.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ private module Immutable {
1313
/**
1414
* An API entrypoint for the global `Immutable` variable.
1515
*/
16+
overlay[local?]
1617
private class ImmutableGlobalEntry extends API::EntryPoint {
1718
ImmutableGlobalEntry() { this = "ImmutableGlobalEntry" }
1819

javascript/ql/lib/semmle/javascript/frameworks/Logging.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ private module Console {
3232
/**
3333
* An API entrypoint for the global `console` variable.
3434
*/
35+
overlay[local?]
3536
private class ConsoleGlobalEntry extends API::EntryPoint {
3637
ConsoleGlobalEntry() { this = "ConsoleGlobalEntry" }
3738

javascript/ql/lib/semmle/javascript/frameworks/Nest.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ module NestJS {
140140
}
141141

142142
/** API node entry point for custom implementations of `ValidationPipe` (a common pattern). */
143+
overlay[local?]
143144
private class ValidationNodeEntry extends API::EntryPoint {
144145
ValidationNodeEntry() { this = "ValidationNodeEntry" }
145146

javascript/ql/lib/semmle/javascript/frameworks/Redux.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,6 +1099,7 @@ module Redux {
10991099
* Used to catch cases where the `connect` function was not recognized by API graphs (usually because of it being
11001100
* wrapped in another function, which API graphs won't look through).
11011101
*/
1102+
overlay[local?]
11021103
private class HeuristicConnectEntryPoint extends API::EntryPoint {
11031104
HeuristicConnectEntryPoint() { this = "react-redux-connect" }
11041105

javascript/ql/lib/semmle/javascript/frameworks/Templating.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ module Templating {
703703
*
704704
* These API nodes are used in the `getTemplateInput` predicate.
705705
*/
706-
overlay[global]
706+
overlay[local?]
707707
private class IncludeFunctionAsEntryPoint extends API::EntryPoint {
708708
IncludeFunctionAsEntryPoint() { this = "IncludeFunctionAsEntryPoint" }
709709

0 commit comments

Comments
 (0)