mirror of
https://github.com/github/codeql.git
synced 2026-04-24 08:15:14 +02:00
Merge from main to resolve conflicts
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: majorAnalysis
|
||||
---
|
||||
* Added support for TypeScript 5.4.
|
||||
@@ -61,7 +61,13 @@ class AmdModuleDefinition extends CallExpr instanceof AmdModuleDefinition::Range
|
||||
}
|
||||
|
||||
/** Gets the `i`th dependency of this module definition. */
|
||||
PathExpr getDependency(int i) { result = this.getDependencies().getElement(i) }
|
||||
PathExpr getDependency(int i) {
|
||||
exists(Expr expr |
|
||||
expr = this.getDependencies().getElement(i) and
|
||||
not isPseudoDependency(expr.getStringValue()) and
|
||||
result = expr
|
||||
)
|
||||
}
|
||||
|
||||
/** Gets a dependency of this module definition. */
|
||||
PathExpr getADependency() {
|
||||
@@ -102,9 +108,10 @@ class AmdModuleDefinition extends CallExpr instanceof AmdModuleDefinition::Range
|
||||
/**
|
||||
* Holds if `p` is the parameter corresponding to dependency `dep`.
|
||||
*/
|
||||
predicate dependencyParameter(PathExpr dep, Parameter p) {
|
||||
predicate dependencyParameter(Expr dep, Parameter p) {
|
||||
exists(int i |
|
||||
dep = this.getDependency(i) and
|
||||
// Note: to avoid spurious recursion, do not depend on PathExpr here
|
||||
dep = this.getDependencies().getElement(i) and
|
||||
p = this.getFactoryParameter(i)
|
||||
)
|
||||
}
|
||||
@@ -122,9 +129,9 @@ class AmdModuleDefinition extends CallExpr instanceof AmdModuleDefinition::Range
|
||||
* `dep1` and `dep2`.
|
||||
*/
|
||||
Parameter getDependencyParameter(string name) {
|
||||
exists(PathExpr dep |
|
||||
exists(Expr dep |
|
||||
this.dependencyParameter(dep, result) and
|
||||
dep.getValue() = name
|
||||
name = dep.getStringValue()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -202,11 +209,15 @@ class AmdModuleDefinition extends CallExpr instanceof AmdModuleDefinition::Range
|
||||
}
|
||||
}
|
||||
|
||||
private predicate isPseudoDependency(string s) { s = ["exports", "require", "module"] }
|
||||
|
||||
/** An AMD dependency, considered as a path expression. */
|
||||
private class AmdDependencyPath extends PathExprCandidate {
|
||||
AmdDependencyPath() {
|
||||
exists(AmdModuleDefinition amd |
|
||||
this = amd.getDependencies().getAnElement() or
|
||||
this = amd.getDependencies().getAnElement() and
|
||||
not isPseudoDependency(this.getStringValue())
|
||||
or
|
||||
this = amd.getARequireCall().getAnArgument()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -23,31 +23,27 @@ private import semmle.javascript.internal.CachedStages
|
||||
* ```
|
||||
*/
|
||||
class AstNode extends @ast_node, NodeInStmtContainer {
|
||||
override Location getLocation() { hasLocation(this, result) }
|
||||
|
||||
override File getFile() {
|
||||
result = this.getLocation().getFile() // Specialized for performance reasons
|
||||
}
|
||||
|
||||
/** Gets the first token belonging to this element. */
|
||||
Token getFirstToken() {
|
||||
exists(Location l1, Location l2 |
|
||||
exists(DbLocation l1, DbLocation l2, string filepath, int startline, int startcolumn |
|
||||
l1 = this.getLocation() and
|
||||
l2 = result.getLocation() and
|
||||
l1.getFile() = l2.getFile() and
|
||||
l1.getStartLine() = l2.getStartLine() and
|
||||
l1.getStartColumn() = l2.getStartColumn()
|
||||
l1.hasLocationInfo(filepath, startline, startcolumn, _, _) and
|
||||
l2.hasLocationInfo(filepath, startline, startcolumn, _, _)
|
||||
)
|
||||
}
|
||||
|
||||
/** Gets the last token belonging to this element. */
|
||||
Token getLastToken() {
|
||||
exists(Location l1, Location l2 |
|
||||
exists(DbLocation l1, DbLocation l2, string filepath, int endline, int endcolumn |
|
||||
l1 = this.getLocation() and
|
||||
l2 = result.getLocation() and
|
||||
l1.getFile() = l2.getFile() and
|
||||
l1.getEndLine() = l2.getEndLine() and
|
||||
l1.getEndColumn() = l2.getEndColumn()
|
||||
l1.hasLocationInfo(filepath, _, _, endline, endcolumn) and
|
||||
l2.hasLocationInfo(filepath, _, _, endline, endcolumn)
|
||||
) and
|
||||
// exclude empty EOF token
|
||||
not result instanceof EOFToken
|
||||
|
||||
@@ -36,7 +36,8 @@ module ArrayTaintTracking {
|
||||
succ = call
|
||||
)
|
||||
or
|
||||
// `array.filter(x => x)` and `array.filter(x => !!x)` keeps the taint
|
||||
// `array.filter(x => x)` and `array.filter(x => !<something>)` keeps the taint
|
||||
// the latter is assumed to filter away only specific values, thus keeping the taint
|
||||
call.(DataFlow::MethodCallNode).getMethodName() = "filter" and
|
||||
pred = call.getReceiver() and
|
||||
succ = call and
|
||||
@@ -47,7 +48,7 @@ module ArrayTaintTracking {
|
||||
|
|
||||
param = ret
|
||||
or
|
||||
param = DataFlow::exprNode(ret.asExpr().(LogNotExpr).getOperand().(LogNotExpr).getOperand())
|
||||
ret.asExpr() instanceof LogNotExpr
|
||||
)
|
||||
or
|
||||
// `array.reduce` with tainted value in callback
|
||||
|
||||
@@ -356,9 +356,7 @@ class ControlFlowNode extends @cfg_node, Locatable, NodeInStmtContainer {
|
||||
* A synthetic CFG node that does not correspond to a statement or expression;
|
||||
* examples include guard nodes and entry/exit nodes.
|
||||
*/
|
||||
class SyntheticControlFlowNode extends @synthetic_cfg_node, ControlFlowNode {
|
||||
override Location getLocation() { hasLocation(this, result) }
|
||||
}
|
||||
class SyntheticControlFlowNode extends @synthetic_cfg_node, ControlFlowNode { }
|
||||
|
||||
/** A synthetic CFG node marking the entry point of a function or toplevel script. */
|
||||
class ControlFlowEntryNode extends SyntheticControlFlowNode, @entry_node {
|
||||
|
||||
@@ -15,8 +15,6 @@ import javascript
|
||||
* </pre>
|
||||
*/
|
||||
class Comment extends @comment, Locatable {
|
||||
override Location getLocation() { hasLocation(this, result) }
|
||||
|
||||
/** Gets the toplevel element this comment belongs to. */
|
||||
TopLevel getTopLevel() { comments(this, _, result, _, _) }
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ import javascript
|
||||
|
||||
/** An error encountered during extraction. */
|
||||
abstract class Error extends Locatable {
|
||||
override Location getLocation() { hasLocation(this, result) }
|
||||
|
||||
/** Gets the message associated with this error. */
|
||||
abstract string getMessage();
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import javascript
|
||||
private import NodeModuleResolutionImpl
|
||||
private import codeql.util.FileSystem
|
||||
private import internal.Locations
|
||||
|
||||
private module FsInput implements InputSig {
|
||||
abstract class ContainerBase extends @container {
|
||||
@@ -83,7 +84,7 @@ class File extends Container, Impl::File {
|
||||
*
|
||||
* Note that files have special locations starting and ending at line zero, column zero.
|
||||
*/
|
||||
Location getLocation() { hasLocation(this, result) }
|
||||
DbLocation getLocation() { result = getLocatableLocation(this) }
|
||||
|
||||
/** Gets the number of lines in this file. */
|
||||
int getNumberOfLines() { result = sum(int loc | numlines(this, loc, _, _) | loc) }
|
||||
|
||||
@@ -43,8 +43,6 @@ module HTML {
|
||||
class Element extends Locatable, @xmlelement {
|
||||
Element() { exists(FileContainingHtml f | xmlElements(this, _, _, _, f)) }
|
||||
|
||||
override Location getLocation() { xmllocations(this, result) }
|
||||
|
||||
/**
|
||||
* Gets the name of this HTML element.
|
||||
*
|
||||
@@ -122,8 +120,6 @@ module HTML {
|
||||
class Attribute extends Locatable, @xmlattribute {
|
||||
Attribute() { exists(FileContainingHtml f | xmlAttrs(this, _, _, _, _, f)) }
|
||||
|
||||
override Location getLocation() { xmllocations(this, result) }
|
||||
|
||||
/**
|
||||
* Gets the inline script of this attribute, if any.
|
||||
*/
|
||||
@@ -326,8 +322,6 @@ module HTML {
|
||||
* Holds if this text node is inside a `CDATA` tag.
|
||||
*/
|
||||
predicate isCData() { xmlChars(this, _, _, _, 1, _) }
|
||||
|
||||
override Location getLocation() { xmllocations(this, result) }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -349,7 +343,5 @@ module HTML {
|
||||
string getText() { result = this.toString().regexpCapture("(?s)<!--(.*)-->", 1) }
|
||||
|
||||
override string toString() { xmlComments(this, result, _, _) }
|
||||
|
||||
override Location getLocation() { xmllocations(this, result) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,6 @@ private import semmle.javascript.internal.CachedStages
|
||||
* </pre>
|
||||
*/
|
||||
class JSDoc extends @jsdoc, Locatable {
|
||||
override Location getLocation() { hasLocation(this, result) }
|
||||
|
||||
/** Gets the description text of this JSDoc comment. */
|
||||
string getDescription() { jsdoc(this, result, _) }
|
||||
|
||||
@@ -75,8 +73,6 @@ abstract class Documentable extends AstNode {
|
||||
* ```
|
||||
*/
|
||||
class JSDocTypeExprParent extends @jsdoc_type_expr_parent, Locatable {
|
||||
override Location getLocation() { hasLocation(this, result) }
|
||||
|
||||
/** Gets the JSDoc comment to which this element belongs. */
|
||||
JSDoc getJSDocComment() { none() }
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
import javascript
|
||||
private import semmle.javascript.internal.Locations
|
||||
|
||||
/**
|
||||
* A JSON-encoded value, which may be a primitive value, an array or an object.
|
||||
@@ -20,8 +21,6 @@ import javascript
|
||||
* ```
|
||||
*/
|
||||
class JsonValue extends @json_value, Locatable {
|
||||
override Location getLocation() { json_locations(this, result) }
|
||||
|
||||
/** Gets the parent value to which this value belongs, if any. */
|
||||
JsonValue getParent() { json(this, _, result, _, _) }
|
||||
|
||||
@@ -34,12 +33,7 @@ class JsonValue extends @json_value, Locatable {
|
||||
override string toString() { json(this, _, _, _, result) }
|
||||
|
||||
/** Gets the JSON file containing this value. */
|
||||
File getJsonFile() {
|
||||
exists(Location loc |
|
||||
json_locations(this, loc) and
|
||||
result = loc.getFile()
|
||||
)
|
||||
}
|
||||
File getJsonFile() { result = getLocatableLocation(this).getFile() }
|
||||
|
||||
/** If this is an object, gets the value of property `name`. */
|
||||
JsonValue getPropValue(string name) { json_properties(this, name, result) }
|
||||
@@ -172,7 +166,5 @@ class JsonObject extends @json_object, JsonValue {
|
||||
* An error reported by the JSON parser.
|
||||
*/
|
||||
class JsonParseError extends @json_parse_error, Error {
|
||||
override Location getLocation() { json_locations(this, result) }
|
||||
|
||||
override string getMessage() { json_errors(this, result) }
|
||||
}
|
||||
|
||||
@@ -14,8 +14,6 @@ import javascript
|
||||
* extracted with the `--extract-program-text` flag.
|
||||
*/
|
||||
class Line extends @line, Locatable {
|
||||
override Location getLocation() { hasLocation(this, result) }
|
||||
|
||||
/** Gets the toplevel element this line belongs to. */
|
||||
TopLevel getTopLevel() { lines(this, result, _, _) }
|
||||
|
||||
|
||||
@@ -1,38 +1,41 @@
|
||||
/** Provides classes for working with locations and program elements that have locations. */
|
||||
|
||||
import javascript
|
||||
private import internal.Locations
|
||||
|
||||
/**
|
||||
* A location as given by a file, a start line, a start column,
|
||||
* an end line, and an end column.
|
||||
*
|
||||
* This class is restricted to locations created by the extractor.
|
||||
*
|
||||
* For more information about locations see [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
|
||||
*/
|
||||
class Location extends @location {
|
||||
class DbLocation extends TDbLocation {
|
||||
/** Gets the file for this location. */
|
||||
File getFile() { locations_default(this, result, _, _, _, _) }
|
||||
File getFile() { dbLocationInfo(this, result, _, _, _, _) }
|
||||
|
||||
/** Gets the 1-based line number (inclusive) where this location starts. */
|
||||
int getStartLine() { locations_default(this, _, result, _, _, _) }
|
||||
int getStartLine() { dbLocationInfo(this, _, result, _, _, _) }
|
||||
|
||||
/** Gets the 1-based column number (inclusive) where this location starts. */
|
||||
int getStartColumn() { locations_default(this, _, _, result, _, _) }
|
||||
int getStartColumn() { dbLocationInfo(this, _, _, result, _, _) }
|
||||
|
||||
/** Gets the 1-based line number (inclusive) where this location ends. */
|
||||
int getEndLine() { locations_default(this, _, _, _, result, _) }
|
||||
int getEndLine() { dbLocationInfo(this, _, _, _, result, _) }
|
||||
|
||||
/** Gets the 1-based column number (inclusive) where this location ends. */
|
||||
int getEndColumn() { locations_default(this, _, _, _, _, result) }
|
||||
int getEndColumn() { dbLocationInfo(this, _, _, _, _, result) }
|
||||
|
||||
/** Gets the number of lines covered by this location. */
|
||||
int getNumLines() { result = this.getEndLine() - this.getStartLine() + 1 }
|
||||
|
||||
/** Holds if this location starts before location `that`. */
|
||||
pragma[inline]
|
||||
predicate startsBefore(Location that) {
|
||||
predicate startsBefore(DbLocation that) {
|
||||
exists(File f, int sl1, int sc1, int sl2, int sc2 |
|
||||
locations_default(this, f, sl1, sc1, _, _) and
|
||||
locations_default(that, f, sl2, sc2, _, _)
|
||||
dbLocationInfo(this, f, sl1, sc1, _, _) and
|
||||
dbLocationInfo(that, f, sl2, sc2, _, _)
|
||||
|
|
||||
sl1 < sl2
|
||||
or
|
||||
@@ -42,10 +45,10 @@ class Location extends @location {
|
||||
|
||||
/** Holds if this location ends after location `that`. */
|
||||
pragma[inline]
|
||||
predicate endsAfter(Location that) {
|
||||
predicate endsAfter(DbLocation that) {
|
||||
exists(File f, int el1, int ec1, int el2, int ec2 |
|
||||
locations_default(this, f, _, _, el1, ec1) and
|
||||
locations_default(that, f, _, _, el2, ec2)
|
||||
dbLocationInfo(this, f, _, _, el1, ec1) and
|
||||
dbLocationInfo(that, f, _, _, el2, ec2)
|
||||
|
|
||||
el1 > el2
|
||||
or
|
||||
@@ -57,10 +60,10 @@ class Location extends @location {
|
||||
* Holds if this location contains location `that`, meaning that it starts
|
||||
* before and ends after it.
|
||||
*/
|
||||
predicate contains(Location that) { this.startsBefore(that) and this.endsAfter(that) }
|
||||
predicate contains(DbLocation that) { this.startsBefore(that) and this.endsAfter(that) }
|
||||
|
||||
/** Holds if this location is empty. */
|
||||
predicate isEmpty() { exists(int l, int c | locations_default(this, _, l, c, l, c - 1)) }
|
||||
predicate isEmpty() { exists(int l, int c | dbLocationInfo(this, _, l, c, l, c - 1)) }
|
||||
|
||||
/** Gets a textual representation of this element. */
|
||||
string toString() { result = this.getFile().getBaseName() + ":" + this.getStartLine().toString() }
|
||||
@@ -76,22 +79,21 @@ class Location extends @location {
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
exists(File f |
|
||||
locations_default(this, f, startline, startcolumn, endline, endcolumn) and
|
||||
dbLocationInfo(this, f, startline, startcolumn, endline, endcolumn) and
|
||||
filepath = f.getAbsolutePath()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
final class Location = LocationImpl;
|
||||
|
||||
/** A program element with a location. */
|
||||
class Locatable extends @locatable {
|
||||
/** Gets the file this program element comes from. */
|
||||
File getFile() { result = this.getLocation().getFile() }
|
||||
|
||||
/** Gets this element's location. */
|
||||
Location getLocation() {
|
||||
// overridden by subclasses
|
||||
none()
|
||||
}
|
||||
final DbLocation getLocation() { result = getLocatableLocation(this) }
|
||||
|
||||
/**
|
||||
* Gets the line on which this element starts.
|
||||
@@ -142,16 +144,3 @@ class Locatable extends @locatable {
|
||||
*/
|
||||
string getAPrimaryQlClass() { result = "???" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A `File`, considered as a `Locatable`.
|
||||
*
|
||||
* For reasons of backwards compatibility, @file is a subtype of @locatable. This class exists to
|
||||
* provide an override of `Locatable.getLocation()` for @files, since it would otherwise default
|
||||
* to `none()`, which is unhelpful.
|
||||
*/
|
||||
private class FileLocatable extends File, Locatable {
|
||||
override Location getLocation() { result = File.super.getLocation() }
|
||||
|
||||
override string toString() { result = File.super.toString() }
|
||||
}
|
||||
|
||||
@@ -43,8 +43,6 @@ class RegExpParent extends Locatable, @regexpparent { }
|
||||
* ```
|
||||
*/
|
||||
class RegExpTerm extends Locatable, @regexpterm {
|
||||
override Location getLocation() { hasLocation(this, result) }
|
||||
|
||||
/** Gets the `i`th child term of this term. */
|
||||
RegExpTerm getChild(int i) { regexpterm(result, _, this, i, _) }
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class FirstLineOf extends Locatable {
|
||||
then endcolumn = xc
|
||||
else
|
||||
endcolumn =
|
||||
max(int c | any(Location l).hasLocationInfo(filepath, startline, _, startline, c))
|
||||
max(int c | any(DbLocation l).hasLocationInfo(filepath, startline, _, startline, c))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -488,6 +488,14 @@ class SsaDefinition extends TSsaDefinition {
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
);
|
||||
|
||||
/** Gets the location of this element. */
|
||||
final Location getLocation() {
|
||||
exists(string filepath, int startline, int startcolumn, int endline, int endcolumn |
|
||||
this.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) and
|
||||
result.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
)
|
||||
}
|
||||
|
||||
/** Gets the function or toplevel to which this definition belongs. */
|
||||
StmtContainer getContainer() { result = this.getBasicBlock().getContainer() }
|
||||
}
|
||||
|
||||
@@ -17,8 +17,6 @@ import javascript
|
||||
* ```
|
||||
*/
|
||||
class Token extends Locatable, @token {
|
||||
override Location getLocation() { hasLocation(this, result) }
|
||||
|
||||
/** Gets the toplevel syntactic structure to which this token belongs. */
|
||||
TopLevel getTopLevel() { tokeninfo(this, _, result, _, _) }
|
||||
|
||||
|
||||
@@ -329,9 +329,9 @@ class LocalVariable extends Variable {
|
||||
* If the variable has one or more declarations, the location of the first declaration is used.
|
||||
* If the variable has no declaration, the entry point of its declaring container is used.
|
||||
*/
|
||||
Location getLocation() {
|
||||
DbLocation getLocation() {
|
||||
result =
|
||||
min(Location loc |
|
||||
min(DbLocation loc |
|
||||
loc = this.getADeclaration().getLocation()
|
||||
|
|
||||
loc order by loc.getStartLine(), loc.getStartColumn()
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
import semmle.files.FileSystem
|
||||
private import semmle.javascript.internal.Locations
|
||||
|
||||
private class TXmlLocatable =
|
||||
@xmldtd or @xmlelement or @xmlattribute or @xmlnamespace or @xmlcomment or @xmlcharacters;
|
||||
@@ -10,7 +11,7 @@ private class TXmlLocatable =
|
||||
/** An XML element that has a location. */
|
||||
class XmlLocatable extends @xmllocatable, TXmlLocatable {
|
||||
/** Gets the source location for this element. */
|
||||
Location getLocation() { xmllocations(this, result) }
|
||||
DbLocation getLocation() { result = getLocatableLocation(this) }
|
||||
|
||||
/**
|
||||
* Holds if this element is at the specified location.
|
||||
@@ -22,10 +23,7 @@ class XmlLocatable extends @xmllocatable, TXmlLocatable {
|
||||
predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
exists(File f, Location l | l = this.getLocation() |
|
||||
locations_default(l, f, startline, startcolumn, endline, endcolumn) and
|
||||
filepath = f.getAbsolutePath()
|
||||
)
|
||||
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
|
||||
/** Gets a textual representation of this element. */
|
||||
|
||||
@@ -9,9 +9,9 @@ import javascript
|
||||
private import codeql.yaml.Yaml as LibYaml
|
||||
|
||||
private module YamlSig implements LibYaml::InputSig {
|
||||
class LocatableBase extends @yaml_locatable, Locatable {
|
||||
override Location getLocation() { yaml_locations(this, result) }
|
||||
}
|
||||
class Location = DbLocation;
|
||||
|
||||
class LocatableBase extends @yaml_locatable, Locatable { }
|
||||
|
||||
import javascript
|
||||
|
||||
@@ -52,8 +52,6 @@ import LibYaml::Make<YamlSig>
|
||||
private class MyYmlNode extends Locatable instanceof YamlNode {
|
||||
override string getAPrimaryQlClass() { result = YamlNode.super.getAPrimaryQlClass() }
|
||||
|
||||
override Location getLocation() { result = YamlNode.super.getLocation() }
|
||||
|
||||
override string toString() { result = YamlNode.super.toString() }
|
||||
}
|
||||
|
||||
|
||||
@@ -145,13 +145,16 @@ module DataFlow {
|
||||
* For more information, see
|
||||
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
|
||||
*/
|
||||
cached
|
||||
predicate hasLocationInfo(
|
||||
final predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
none()
|
||||
this.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
|
||||
/** Gets the location of this node. */
|
||||
cached
|
||||
Location getLocation() { none() }
|
||||
|
||||
/** Gets the file this data flow node comes from. */
|
||||
File getFile() { none() } // overridden in subclasses
|
||||
|
||||
@@ -292,11 +295,9 @@ module DataFlow {
|
||||
|
||||
override BasicBlock getBasicBlock() { astNode = result.getANode() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
override Location getLocation() {
|
||||
Stages::DataFlowStage::ref() and
|
||||
astNode.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
result = astNode.getLocation()
|
||||
}
|
||||
|
||||
override File getFile() { result = astNode.getFile() }
|
||||
@@ -317,11 +318,7 @@ module DataFlow {
|
||||
|
||||
override BasicBlock getBasicBlock() { result = ssa.getBasicBlock() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
ssa.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = ssa.getLocation() }
|
||||
|
||||
override string toString() { result = ssa.getSourceVariable().getName() }
|
||||
|
||||
@@ -340,13 +337,7 @@ module DataFlow {
|
||||
|
||||
override BasicBlock getBasicBlock() { result = prop.(ControlFlowNode).getBasicBlock() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
prop.(Locatable)
|
||||
.getLocation()
|
||||
.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = prop.(Locatable).getLocation() }
|
||||
|
||||
override string toString() { result = prop.(AstNode).toString() }
|
||||
|
||||
@@ -367,11 +358,7 @@ module DataFlow {
|
||||
|
||||
override BasicBlock getBasicBlock() { result = rest.getBasicBlock() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
rest.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = rest.getLocation() }
|
||||
|
||||
override string toString() { result = "..." + rest.toString() }
|
||||
|
||||
@@ -392,11 +379,7 @@ module DataFlow {
|
||||
|
||||
override BasicBlock getBasicBlock() { result = elt.getBasicBlock() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
elt.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = elt.getLocation() }
|
||||
|
||||
override string toString() { result = elt.toString() }
|
||||
|
||||
@@ -421,11 +404,7 @@ module DataFlow {
|
||||
|
||||
override BasicBlock getBasicBlock() { result = elt.getBasicBlock() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
elt.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = elt.getLocation() }
|
||||
|
||||
override string toString() { result = elt.toString() }
|
||||
|
||||
@@ -445,11 +424,7 @@ module DataFlow {
|
||||
|
||||
override BasicBlock getBasicBlock() { result = call.getBasicBlock() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
call.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = call.getLocation() }
|
||||
|
||||
override string toString() { result = "reflective call" }
|
||||
|
||||
@@ -466,11 +441,7 @@ module DataFlow {
|
||||
|
||||
override BasicBlock getBasicBlock() { result = imprt.getBasicBlock() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
imprt.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = imprt.getLocation() }
|
||||
|
||||
override string toString() { result = imprt.toString() }
|
||||
|
||||
@@ -960,11 +931,7 @@ module DataFlow {
|
||||
|
||||
override string toString() { result = attr.toString() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
attr.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = attr.getLocation() }
|
||||
|
||||
/** Gets the attribute corresponding to this data flow node. */
|
||||
HTML::Attribute getAttribute() { result = attr }
|
||||
@@ -982,11 +949,7 @@ module DataFlow {
|
||||
|
||||
override string toString() { result = attr.toString() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
attr.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = attr.getLocation() }
|
||||
|
||||
/** Gets the attribute corresponding to this data flow node. */
|
||||
XmlAttribute getAttribute() { result = attr }
|
||||
@@ -1004,11 +967,7 @@ module DataFlow {
|
||||
|
||||
override string toString() { result = "exceptional return of " + function.describe() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
function.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = function.getLocation() }
|
||||
|
||||
override BasicBlock getBasicBlock() { result = function.getExit().getBasicBlock() }
|
||||
|
||||
@@ -1030,11 +989,7 @@ module DataFlow {
|
||||
|
||||
override string toString() { result = "return of " + function.describe() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
function.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = function.getLocation() }
|
||||
|
||||
override BasicBlock getBasicBlock() { result = function.getExit().getBasicBlock() }
|
||||
|
||||
@@ -1056,11 +1011,7 @@ module DataFlow {
|
||||
|
||||
override string toString() { result = "'arguments' object of " + function.describe() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
function.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = function.getLocation() }
|
||||
|
||||
override BasicBlock getBasicBlock() { result = function.getEntry().getBasicBlock() }
|
||||
|
||||
@@ -1082,11 +1033,7 @@ module DataFlow {
|
||||
|
||||
override string toString() { result = "exceptional return of " + invoke.toString() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
invoke.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = invoke.getLocation() }
|
||||
|
||||
override BasicBlock getBasicBlock() { result = invoke.getBasicBlock() }
|
||||
|
||||
@@ -1358,15 +1305,10 @@ module DataFlow {
|
||||
exists(StmtContainer container | this = TThisNode(container) | result = container.getEntry())
|
||||
}
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
override Location getLocation() {
|
||||
// Use the function entry as the location
|
||||
exists(StmtContainer container | this = TThisNode(container) |
|
||||
container
|
||||
.getEntry()
|
||||
.getLocation()
|
||||
.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
result = container.getEntry().getLocation()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1385,11 +1327,7 @@ module DataFlow {
|
||||
|
||||
override BasicBlock getBasicBlock() { result = variable.getDeclaringContainer().getStartBB() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
variable.getLocation().hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = variable.getLocation() }
|
||||
|
||||
override string toString() { result = variable.getName() }
|
||||
}
|
||||
@@ -1401,13 +1339,7 @@ module DataFlow {
|
||||
|
||||
override BasicBlock getBasicBlock() { none() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
this.getTag()
|
||||
.getLocation()
|
||||
.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
override Location getLocation() { result = this.getTag().getLocation() }
|
||||
|
||||
override string toString() { result = this.getTag().toString() }
|
||||
}
|
||||
|
||||
@@ -1262,6 +1262,12 @@ module ClassNode {
|
||||
result.getFile() = f
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
private DataFlow::NewNode getAnInstantiationInFile(string name, File f) {
|
||||
result = AccessPath::getAReferenceTo(name).(DataFlow::LocalSourceNode).getAnInstantiation() and
|
||||
result.getFile() = f
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a reference to the function `func`, where there exists a read/write of the "prototype" property on that reference.
|
||||
*/
|
||||
@@ -1273,7 +1279,7 @@ module ClassNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* A function definition with prototype manipulation as a `ClassNode` instance.
|
||||
* A function definition, targeted by a `new`-call or with prototype manipulation, seen as a `ClassNode` instance.
|
||||
*/
|
||||
class FunctionStyleClass extends Range, DataFlow::ValueNode {
|
||||
override Function astNode;
|
||||
@@ -1284,9 +1290,12 @@ module ClassNode {
|
||||
(
|
||||
exists(getAFunctionValueWithPrototype(function))
|
||||
or
|
||||
exists(string name |
|
||||
this = AccessPath::getAnAssignmentTo(name) and
|
||||
function = any(NewNode new).getCalleeNode().analyze().getAValue()
|
||||
or
|
||||
exists(string name | this = AccessPath::getAnAssignmentTo(name) |
|
||||
exists(getAPrototypeReferenceInFile(name, this.getFile()))
|
||||
or
|
||||
exists(getAnInstantiationInFile(name, this.getFile()))
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -241,24 +241,25 @@ module CallGraph {
|
||||
)
|
||||
}
|
||||
|
||||
private DataFlow::FunctionNode getAMethodOnPlainObject(DataFlow::SourceNode node) {
|
||||
private DataFlow::FunctionNode getAMethodOnObject(DataFlow::SourceNode node) {
|
||||
(
|
||||
(
|
||||
node instanceof DataFlow::ObjectLiteralNode
|
||||
or
|
||||
node instanceof DataFlow::FunctionNode
|
||||
) and
|
||||
result = node.getAPropertySource()
|
||||
or
|
||||
result = node.(DataFlow::ObjectLiteralNode).getPropertyGetter(_)
|
||||
or
|
||||
result = node.(DataFlow::ObjectLiteralNode).getPropertySetter(_)
|
||||
) and
|
||||
not node.getTopLevel().isExterns()
|
||||
not node.getTopLevel().isExterns() and
|
||||
// Ignore writes to `this` inside a constructor, since this is already handled by instance method tracking
|
||||
not exists(DataFlow::ClassNode cls |
|
||||
node = cls.getConstructor().getReceiver()
|
||||
or
|
||||
node = cls.(DataFlow::ClassNode::FunctionStyleClass).getAPrototypeReference()
|
||||
)
|
||||
}
|
||||
|
||||
private predicate shouldTrackObjectWithMethods(DataFlow::SourceNode node) {
|
||||
exists(getAMethodOnPlainObject(node))
|
||||
exists(getAMethodOnObject(node))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -292,7 +293,7 @@ module CallGraph {
|
||||
predicate impliedReceiverStep(DataFlow::SourceNode pred, DataFlow::SourceNode succ) {
|
||||
exists(DataFlow::SourceNode host |
|
||||
pred = getAnAllocationSiteRef(host) and
|
||||
succ = getAMethodOnPlainObject(host).getReceiver()
|
||||
succ = getAMethodOnObject(host).getReceiver()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,8 @@ private module Cached {
|
||||
CopyStep(PropertyName prop) or
|
||||
LoadStoreStep(PropertyName fromProp, PropertyName toProp) {
|
||||
SharedTypeTrackingStep::loadStoreStep(_, _, fromProp, toProp)
|
||||
or
|
||||
summarizedLoadStoreStep(_, _, fromProp, toProp)
|
||||
} or
|
||||
WithoutPropStep(PropertySet props) { SharedTypeTrackingStep::withoutPropStep(_, _, props) }
|
||||
}
|
||||
@@ -69,6 +71,26 @@ private module Cached {
|
||||
AccessPath::isAssignedInUniqueFile(global)
|
||||
}
|
||||
|
||||
bindingset[fun]
|
||||
pragma[inline_late]
|
||||
private DataFlow::PropRead getStoredPropRead(DataFlow::FunctionNode fun, string storeProp) {
|
||||
result = fun.getAReturn().getALocalSource().getAPropertySource(storeProp)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `loadProp` of `param` is stored in the `storeProp` property of the return value of `fun`.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
private predicate summarizedLoadStoreStep(
|
||||
DataFlow::ParameterNode param, DataFlow::FunctionNode fun, string loadProp, string storeProp
|
||||
) {
|
||||
exists(DataFlow::PropRead read |
|
||||
read = getStoredPropRead(fun, storeProp) and
|
||||
read.getBase().getALocalSource() = param and
|
||||
read.getPropertyName() = loadProp
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Use `TypeBackTracker.smallstep()` instead.
|
||||
*/
|
||||
@@ -156,6 +178,14 @@ private module Cached {
|
||||
exists(string prop |
|
||||
param.getAPropertyRead(prop).flowsTo(fun.getAReturn()) and
|
||||
summary = LoadStep(prop)
|
||||
or
|
||||
fun.getAReturn().getALocalSource().getAPropertySource(prop) = param and
|
||||
summary = StoreStep(prop)
|
||||
)
|
||||
or
|
||||
exists(string loadProp, string storeProp |
|
||||
summarizedLoadStoreStep(param, fun, loadProp, storeProp) and
|
||||
summary = LoadStoreStep(loadProp, storeProp)
|
||||
)
|
||||
) and
|
||||
if param = fun.getAParameter()
|
||||
|
||||
@@ -277,9 +277,16 @@ private predicate nameFromGlobal(DataFlow::Node node, string package, string nam
|
||||
(if node.getTopLevel().isExterns() then badness = -10 else badness = 10)
|
||||
}
|
||||
|
||||
/** Gets an API node whose value is exposed to client code. */
|
||||
private API::Node exposedNode() {
|
||||
result = API::moduleExport(_)
|
||||
or
|
||||
result = exposedNode().getASuccessor()
|
||||
}
|
||||
|
||||
/** Holds if an instance of `cls` can be exposed to client code. */
|
||||
private predicate hasEscapingInstance(DataFlow::ClassNode cls) {
|
||||
cls.getAnInstanceReference().flowsTo(any(API::Node n).asSink())
|
||||
cls.getAnInstanceReference().flowsTo(exposedNode().asSink())
|
||||
}
|
||||
|
||||
private predicate sourceNodeHasNameCandidate(
|
||||
|
||||
@@ -36,8 +36,6 @@ module Templating {
|
||||
|
||||
/** A placeholder tag for a templating engine. */
|
||||
class TemplatePlaceholderTag extends @template_placeholder_tag, Locatable {
|
||||
override Location getLocation() { hasLocation(this, result) }
|
||||
|
||||
override string toString() { template_placeholder_tag_info(this, _, result) }
|
||||
|
||||
/** Gets the full text of the template tag, including delimiters. */
|
||||
@@ -107,7 +105,12 @@ module Templating {
|
||||
* Gets the innermost JavaScript expression containing this template tag, if any.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
Expr getEnclosingExpr() { expr_contains_template_tag_location(result, this.getLocation()) }
|
||||
Expr getEnclosingExpr() {
|
||||
exists(@location loc |
|
||||
hasLocation(this, loc) and
|
||||
expr_contains_template_tag_location(result, loc)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -136,7 +136,7 @@ module Stages {
|
||||
or
|
||||
exists(DataFlow::ssaDefinitionNode(_))
|
||||
or
|
||||
any(DataFlow::Node node).hasLocationInfo(_, _, _, _, _)
|
||||
exists(any(DataFlow::Node node).getLocation())
|
||||
or
|
||||
exists(any(DataFlow::Node node).toString())
|
||||
or
|
||||
|
||||
171
javascript/ql/lib/semmle/javascript/internal/Locations.qll
Normal file
171
javascript/ql/lib/semmle/javascript/internal/Locations.qll
Normal file
@@ -0,0 +1,171 @@
|
||||
/** Provides classes for working with locations and program elements that have locations. */
|
||||
|
||||
import javascript
|
||||
|
||||
// Should _not_ be cached, as that would require the data flow stage to be evaluated
|
||||
// in order to evaluate the AST stage. Ideally, we would cache each injector separately,
|
||||
// but that's not possible. Instead, we cache all predicates that need the injectors
|
||||
// to be tuple numbered.
|
||||
newtype TLocation =
|
||||
TDbLocation(@location loc) or
|
||||
TSynthLocation(string filepath, int startline, int startcolumn, int endline, int endcolumn) {
|
||||
any(SsaDefinition def).hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn) and
|
||||
// avoid overlap with existing DB locations
|
||||
not exists(File f |
|
||||
locations_default(_, f, startline, startcolumn, endline, endcolumn) and
|
||||
f.getAbsolutePath() = filepath
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* A location as given by a file, a start line, a start column,
|
||||
* an end line, and an end column.
|
||||
*
|
||||
* For more information about locations see [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
|
||||
*/
|
||||
abstract class LocationImpl extends TLocation {
|
||||
/** Gets the file for this location. */
|
||||
abstract File getFile();
|
||||
|
||||
/** Gets the 1-based line number (inclusive) where this location starts. */
|
||||
abstract int getStartLine();
|
||||
|
||||
/** Gets the 1-based column number (inclusive) where this location starts. */
|
||||
abstract int getStartColumn();
|
||||
|
||||
/** Gets the 1-based line number (inclusive) where this location ends. */
|
||||
abstract int getEndLine();
|
||||
|
||||
/** Gets the 1-based column number (inclusive) where this location ends. */
|
||||
abstract int getEndColumn();
|
||||
|
||||
/** Gets the number of lines covered by this location. */
|
||||
int getNumLines() { result = this.getEndLine() - this.getStartLine() + 1 }
|
||||
|
||||
/** Holds if this location starts before location `that`. */
|
||||
pragma[inline]
|
||||
predicate startsBefore(Location that) {
|
||||
exists(string f, int sl1, int sc1, int sl2, int sc2 |
|
||||
this.hasLocationInfo(f, sl1, sc1, _, _) and
|
||||
that.hasLocationInfo(f, sl2, sc2, _, _)
|
||||
|
|
||||
sl1 < sl2
|
||||
or
|
||||
sl1 = sl2 and sc1 < sc2
|
||||
)
|
||||
}
|
||||
|
||||
/** Holds if this location ends after location `that`. */
|
||||
pragma[inline]
|
||||
predicate endsAfter(Location that) {
|
||||
exists(string f, int el1, int ec1, int el2, int ec2 |
|
||||
this.hasLocationInfo(f, _, _, el1, ec1) and
|
||||
that.hasLocationInfo(f, _, _, el2, ec2)
|
||||
|
|
||||
el1 > el2
|
||||
or
|
||||
el1 = el2 and ec1 > ec2
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this location contains location `that`, meaning that it starts
|
||||
* before and ends after it.
|
||||
*/
|
||||
predicate contains(Location that) { this.startsBefore(that) and this.endsAfter(that) }
|
||||
|
||||
/** Holds if this location is empty. */
|
||||
predicate isEmpty() { exists(int l, int c | this.hasLocationInfo(_, l, c, l, c - 1)) }
|
||||
|
||||
/** Gets a textual representation of this element. */
|
||||
string toString() { result = this.getFile().getBaseName() + ":" + this.getStartLine().toString() }
|
||||
|
||||
/**
|
||||
* Holds if this element is at the specified location.
|
||||
* The location spans column `startcolumn` of line `startline` to
|
||||
* column `endcolumn` of line `endline` in file `filepath`.
|
||||
* For more information, see
|
||||
* [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/).
|
||||
*/
|
||||
abstract predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
);
|
||||
}
|
||||
|
||||
class DbLocationImpl extends LocationImpl instanceof DbLocation {
|
||||
override File getFile() { result = DbLocation.super.getFile() }
|
||||
|
||||
override int getStartLine() { result = DbLocation.super.getStartLine() }
|
||||
|
||||
override int getStartColumn() { result = DbLocation.super.getStartColumn() }
|
||||
|
||||
override int getEndLine() { result = DbLocation.super.getEndLine() }
|
||||
|
||||
override int getEndColumn() { result = DbLocation.super.getEndColumn() }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
DbLocation.super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
}
|
||||
|
||||
class SynthLocationImpl extends LocationImpl, TSynthLocation {
|
||||
override File getFile() { synthLocationInfo(this, result.getAbsolutePath(), _, _, _, _) }
|
||||
|
||||
override int getStartLine() { synthLocationInfo(this, _, result, _, _, _) }
|
||||
|
||||
override int getStartColumn() { synthLocationInfo(this, _, _, result, _, _) }
|
||||
|
||||
override int getEndLine() { synthLocationInfo(this, _, _, _, result, _) }
|
||||
|
||||
override int getEndColumn() { synthLocationInfo(this, _, _, _, _, result) }
|
||||
|
||||
override predicate hasLocationInfo(
|
||||
string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
synthLocationInfo(this, filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
}
|
||||
|
||||
cached
|
||||
private module Cached {
|
||||
cached
|
||||
DbLocation getLocatableLocation(@locatable l) {
|
||||
exists(@location loc |
|
||||
hasLocation(l, loc) or
|
||||
xmllocations(l, loc) or
|
||||
json_locations(l, loc) or
|
||||
yaml_locations(l, loc)
|
||||
|
|
||||
result = TDbLocation(loc)
|
||||
)
|
||||
}
|
||||
|
||||
cached
|
||||
predicate dbLocationInfo(
|
||||
DbLocation l, File f, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
exists(@location loc |
|
||||
l = TDbLocation(loc) and
|
||||
locations_default(loc, f, startline, startcolumn, endline, endcolumn)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
import Cached
|
||||
|
||||
cached
|
||||
private module CachedInDataFlowStage {
|
||||
private import semmle.javascript.internal.CachedStages
|
||||
|
||||
cached
|
||||
predicate synthLocationInfo(
|
||||
SynthLocationImpl l, string filepath, int startline, int startcolumn, int endline, int endcolumn
|
||||
) {
|
||||
Stages::DataFlowStage::ref() and
|
||||
l = TSynthLocation(filepath, startline, startcolumn, endline, endcolumn)
|
||||
}
|
||||
}
|
||||
|
||||
private import CachedInDataFlowStage
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: minorAnalysis
|
||||
---
|
||||
* The call graph has been improved, leading to more alerts for data flow based queries.
|
||||
@@ -25,3 +25,24 @@ MyOtherStream.prototype.instanceProp = 1; /* def=moduleImport("classes").getMemb
|
||||
MyOtherStream.classProp = 1; /* def=moduleImport("classes").getMember("exports").getMember("MyOtherStream").getMember("classProp") */
|
||||
|
||||
module.exports.MyOtherStream = MyOtherStream;
|
||||
|
||||
|
||||
// function-style class without .prototype reference
|
||||
function MyThirdStream() { /* use=moduleImport("classes").getMember("exports").getMember("MyThirdStream").getInstance() */
|
||||
}
|
||||
let instance = new MyThirdStream(); /* use=moduleImport("classes").getMember("exports").getMember("MyThirdStream").getInstance() */
|
||||
|
||||
module.exports.MyThirdStream = MyThirdStream;
|
||||
|
||||
|
||||
// function-style class without .prototype reference (through global variable)
|
||||
(function(f) {
|
||||
foo.bar = function() { /* use=moduleImport("classes").getMember("exports").getMember("bar").getInstance() */
|
||||
}
|
||||
})(foo = foo || {});
|
||||
|
||||
(function(f) {
|
||||
let x = new f.bar(); /* use=moduleImport("classes").getMember("exports").getMember("bar").getInstance() */
|
||||
})(foo = foo || {});
|
||||
|
||||
module.exports.bar = foo.bar;
|
||||
|
||||
@@ -61,7 +61,6 @@ amdModuleDefinition
|
||||
| umd.js:4:9:4:43 | define( ... actory) | umd.js:1:18:1:24 | factory |
|
||||
| umd.js:4:9:4:43 | define( ... actory) | umd.js:9:9:14:1 | functio ... };\\n} |
|
||||
amdModuleDependencies
|
||||
| tst2.js:1:1:3:2 | define( ... 42;\\n}) | tst2.js:1:9:1:17 | 'exports' |
|
||||
| tst3.js:1:1:3:2 | define( ... 42;\\n}) | tst3.js:2:21:2:25 | './a' |
|
||||
| tst4.js:1:1:11:2 | define( ... };\\n}) | tst4.js:2:9:2:14 | 'a.js' |
|
||||
| tst4.js:1:1:11:2 | define( ... };\\n}) | tst4.js:3:9:3:13 | 'foo' |
|
||||
|
||||
@@ -135,6 +135,7 @@ test_getAFunctionValue
|
||||
| tst.js:3:1:3:1 | h | tst.js:3:5:3:17 | function() {} |
|
||||
| tst.js:3:1:3:17 | h = function() {} | tst.js:3:5:3:17 | function() {} |
|
||||
| tst.js:3:5:3:17 | function() {} | tst.js:3:5:3:17 | function() {} |
|
||||
| tst.js:4:1:4:1 | k | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:4:1:4:5 | k = g | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:4:5:4:5 | g | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:6:1:6:1 | f | tst.js:1:1:1:15 | function f() {} |
|
||||
@@ -142,13 +143,23 @@ test_getAFunctionValue
|
||||
| tst.js:8:1:8:1 | h | tst.js:3:5:3:17 | function() {} |
|
||||
| tst.js:9:1:9:1 | k | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:11:1:20:1 | functio ... \\tf();\\n} | tst.js:11:1:20:1 | functio ... \\tf();\\n} |
|
||||
| tst.js:11:12:11:12 | m | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:11:12:11:12 | m | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:12:6:12:6 | m | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:12:6:12:27 | n | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:12:6:12:27 | n | tst.js:12:15:12:27 | function() {} |
|
||||
| tst.js:12:10:12:10 | m | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:12:10:12:10 | m | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:12:10:12:10 | m | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:12:10:12:27 | m \|\| function() {} | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:12:10:12:27 | m \|\| function() {} | tst.js:12:15:12:27 | function() {} |
|
||||
| tst.js:12:15:12:27 | function() {} | tst.js:12:15:12:27 | function() {} |
|
||||
| tst.js:13:2:13:16 | function p() {} | tst.js:13:2:13:16 | function p() {} |
|
||||
| tst.js:13:11:13:11 | p | tst.js:13:2:13:16 | function p() {} |
|
||||
| tst.js:14:2:14:2 | m | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:15:2:15:2 | l | tst.js:11:1:20:1 | functio ... \\tf();\\n} |
|
||||
| tst.js:16:2:16:17 | arguments.callee | tst.js:11:1:20:1 | functio ... \\tf();\\n} |
|
||||
| tst.js:17:2:17:2 | n | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:17:2:17:2 | n | tst.js:12:15:12:27 | function() {} |
|
||||
| tst.js:18:2:18:2 | p | tst.js:13:2:13:16 | function p() {} |
|
||||
| tst.js:19:2:19:2 | f | tst.js:1:1:1:15 | function f() {} |
|
||||
@@ -463,8 +474,10 @@ test_getACallee
|
||||
| tst.js:7:1:7:3 | g() | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:8:1:8:3 | h() | tst.js:3:5:3:17 | function() {} |
|
||||
| tst.js:9:1:9:3 | k() | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:14:2:14:4 | m() | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:15:2:15:4 | l() | tst.js:11:1:20:1 | functio ... \\tf();\\n} |
|
||||
| tst.js:16:2:16:19 | arguments.callee() | tst.js:11:1:20:1 | functio ... \\tf();\\n} |
|
||||
| tst.js:17:2:17:4 | n() | tst.js:2:9:2:21 | function() {} |
|
||||
| tst.js:17:2:17:4 | n() | tst.js:12:15:12:27 | function() {} |
|
||||
| tst.js:18:2:18:4 | p() | tst.js:13:2:13:16 | function p() {} |
|
||||
| tst.js:19:2:19:4 | f() | tst.js:1:1:1:15 | function f() {} |
|
||||
|
||||
@@ -13,3 +13,9 @@ export function getEscapingInstance() {
|
||||
} // $ name=(pack1).getEscapingInstance
|
||||
|
||||
export function publicFunction() {} // $ name=(pack1).publicFunction
|
||||
|
||||
// Escapes into an upstream library, but is not exposed downstream
|
||||
class InternalClass {
|
||||
m() {}
|
||||
}
|
||||
require('foo').bar(new InternalClass());
|
||||
|
||||
@@ -124,6 +124,8 @@ nodes
|
||||
| file://:0:0:0:0 | (Arguments) | semmle.label | (Arguments) |
|
||||
| file://:0:0:0:0 | (Arguments) | semmle.label | (Arguments) |
|
||||
| file://:0:0:0:0 | (Arguments) | semmle.label | (Arguments) |
|
||||
| file://:0:0:0:0 | (Arguments) | semmle.label | (Arguments) |
|
||||
| file://:0:0:0:0 | (Arguments) | semmle.label | (Arguments) |
|
||||
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
|
||||
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
|
||||
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
|
||||
@@ -167,6 +169,9 @@ nodes
|
||||
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
|
||||
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
|
||||
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
|
||||
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
|
||||
| file://:0:0:0:0 | (Parameters) | semmle.label | (Parameters) |
|
||||
| file://:0:0:0:0 | (TypeParameters) | semmle.label | (TypeParameters) |
|
||||
| file://:0:0:0:0 | (TypeParameters) | semmle.label | (TypeParameters) |
|
||||
| file://:0:0:0:0 | (TypeParameters) | semmle.label | (TypeParameters) |
|
||||
| file://:0:0:0:0 | (TypeParameters) | semmle.label | (TypeParameters) |
|
||||
@@ -1757,8 +1762,63 @@ nodes
|
||||
| tst.ts:483:46:483:50 | [LocalTypeAccess] Pair3 | semmle.label | [LocalTypeAccess] Pair3 |
|
||||
| tst.ts:483:46:483:58 | [GenericTypeExpr] Pair3<string> | semmle.label | [GenericTypeExpr] Pair3<string> |
|
||||
| tst.ts:483:52:483:57 | [KeywordTypeExpr] string | semmle.label | [KeywordTypeExpr] string |
|
||||
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | semmle.label | [NamespaceDeclaration] module ... }); } |
|
||||
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | semmle.order | 90 |
|
||||
| tst.ts:486:8:486:11 | [VarDecl] TS54 | semmle.label | [VarDecl] TS54 |
|
||||
| tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | semmle.label | [FunctionDeclStmt] functio ... 0]; } |
|
||||
| tst.ts:487:12:487:28 | [VarDecl] createStreetLight | semmle.label | [VarDecl] createStreetLight |
|
||||
| tst.ts:487:30:487:30 | [Identifier] C | semmle.label | [Identifier] C |
|
||||
| tst.ts:487:30:487:45 | [TypeParameter] C extends string | semmle.label | [TypeParameter] C extends string |
|
||||
| tst.ts:487:40:487:45 | [KeywordTypeExpr] string | semmle.label | [KeywordTypeExpr] string |
|
||||
| tst.ts:487:48:487:53 | [SimpleParameter] colors | semmle.label | [SimpleParameter] colors |
|
||||
| tst.ts:487:56:487:56 | [LocalTypeAccess] C | semmle.label | [LocalTypeAccess] C |
|
||||
| tst.ts:487:56:487:58 | [ArrayTypeExpr] C[] | semmle.label | [ArrayTypeExpr] C[] |
|
||||
| tst.ts:487:61:487:72 | [SimpleParameter] defaultColor | semmle.label | [SimpleParameter] defaultColor |
|
||||
| tst.ts:487:76:487:82 | [LocalTypeAccess] NoInfer | semmle.label | [LocalTypeAccess] NoInfer |
|
||||
| tst.ts:487:76:487:85 | [GenericTypeExpr] NoInfer<C> | semmle.label | [GenericTypeExpr] NoInfer<C> |
|
||||
| tst.ts:487:84:487:84 | [LocalTypeAccess] C | semmle.label | [LocalTypeAccess] C |
|
||||
| tst.ts:487:88:489:3 | [BlockStmt] { r ... 0]; } | semmle.label | [BlockStmt] { r ... 0]; } |
|
||||
| tst.ts:488:5:488:21 | [ReturnStmt] return colors[0]; | semmle.label | [ReturnStmt] return colors[0]; |
|
||||
| tst.ts:488:12:488:17 | [VarRef] colors | semmle.label | [VarRef] colors |
|
||||
| tst.ts:488:12:488:20 | [IndexExpr] colors[0] | semmle.label | [IndexExpr] colors[0] |
|
||||
| tst.ts:488:19:488:19 | [Literal] 0 | semmle.label | [Literal] 0 |
|
||||
| tst.ts:491:3:491:19 | [VarRef] createStreetLight | semmle.label | [VarRef] createStreetLight |
|
||||
| tst.ts:491:3:491:57 | [CallExpr] createS ... ellow") | semmle.label | [CallExpr] createS ... ellow") |
|
||||
| tst.ts:491:3:491:58 | [ExprStmt] createS ... llow"); | semmle.label | [ExprStmt] createS ... llow"); |
|
||||
| tst.ts:491:21:491:46 | [ArrayExpr] ["red", ... green"] | semmle.label | [ArrayExpr] ["red", ... green"] |
|
||||
| tst.ts:491:22:491:26 | [Literal] "red" | semmle.label | [Literal] "red" |
|
||||
| tst.ts:491:29:491:36 | [Literal] "yellow" | semmle.label | [Literal] "yellow" |
|
||||
| tst.ts:491:39:491:45 | [Literal] "green" | semmle.label | [Literal] "green" |
|
||||
| tst.ts:491:49:491:56 | [Literal] "yellow" | semmle.label | [Literal] "yellow" |
|
||||
| tst.ts:493:3:495:5 | [DeclStmt] const myObj = ... | semmle.label | [DeclStmt] const myObj = ... |
|
||||
| tst.ts:493:9:493:13 | [VarDecl] myObj | semmle.label | [VarDecl] myObj |
|
||||
| tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | semmle.label | [VariableDeclarator] myObj = ... "; }) |
|
||||
| tst.ts:493:17:493:22 | [VarRef] Object | semmle.label | [VarRef] Object |
|
||||
| tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | semmle.label | [DotExpr] Object.groupBy |
|
||||
| tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | semmle.label | [MethodCallExpr] Object. ... "; }) |
|
||||
| tst.ts:493:24:493:30 | [Label] groupBy | semmle.label | [Label] groupBy |
|
||||
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | semmle.label | [ArrayExpr] [0, 1, 2, 3, 4, 5] |
|
||||
| tst.ts:493:33:493:33 | [Literal] 0 | semmle.label | [Literal] 0 |
|
||||
| tst.ts:493:36:493:36 | [Literal] 1 | semmle.label | [Literal] 1 |
|
||||
| tst.ts:493:39:493:39 | [Literal] 2 | semmle.label | [Literal] 2 |
|
||||
| tst.ts:493:42:493:42 | [Literal] 3 | semmle.label | [Literal] 3 |
|
||||
| tst.ts:493:45:493:45 | [Literal] 4 | semmle.label | [Literal] 4 |
|
||||
| tst.ts:493:48:493:48 | [Literal] 5 | semmle.label | [Literal] 5 |
|
||||
| tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | semmle.label | [ArrowFunctionExpr] (num, i ... d"; } |
|
||||
| tst.ts:493:53:493:55 | [SimpleParameter] num | semmle.label | [SimpleParameter] num |
|
||||
| tst.ts:493:58:493:62 | [SimpleParameter] index | semmle.label | [SimpleParameter] index |
|
||||
| tst.ts:493:68:495:3 | [BlockStmt] { r ... d"; } | semmle.label | [BlockStmt] { r ... d"; } |
|
||||
| tst.ts:494:5:494:41 | [ReturnStmt] return ... "odd"; | semmle.label | [ReturnStmt] return ... "odd"; |
|
||||
| tst.ts:494:12:494:14 | [VarRef] num | semmle.label | [VarRef] num |
|
||||
| tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | semmle.label | [BinaryExpr] num % 2 |
|
||||
| tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | semmle.label | [BinaryExpr] num % 2 === 0 |
|
||||
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | semmle.label | [ConditionalExpr] num % 2 ... : "odd" |
|
||||
| tst.ts:494:18:494:18 | [Literal] 2 | semmle.label | [Literal] 2 |
|
||||
| tst.ts:494:24:494:24 | [Literal] 0 | semmle.label | [Literal] 0 |
|
||||
| tst.ts:494:28:494:33 | [Literal] "even" | semmle.label | [Literal] "even" |
|
||||
| tst.ts:494:36:494:40 | [Literal] "odd" | semmle.label | [Literal] "odd" |
|
||||
| tstModuleCJS.cts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | semmle.label | [ExportDeclaration] export ... 'b'; } |
|
||||
| tstModuleCJS.cts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | semmle.order | 90 |
|
||||
| tstModuleCJS.cts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | semmle.order | 91 |
|
||||
| tstModuleCJS.cts:1:8:3:1 | [FunctionDeclStmt] functio ... 'b'; } | semmle.label | [FunctionDeclStmt] functio ... 'b'; } |
|
||||
| tstModuleCJS.cts:1:17:1:28 | [VarDecl] tstModuleCJS | semmle.label | [VarDecl] tstModuleCJS |
|
||||
| tstModuleCJS.cts:1:33:1:35 | [LiteralTypeExpr] 'a' | semmle.label | [LiteralTypeExpr] 'a' |
|
||||
@@ -1776,7 +1836,7 @@ nodes
|
||||
| tstModuleCJS.cts:2:34:2:36 | [Literal] 'a' | semmle.label | [Literal] 'a' |
|
||||
| tstModuleCJS.cts:2:40:2:42 | [Literal] 'b' | semmle.label | [Literal] 'b' |
|
||||
| tstModuleES.mts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | semmle.label | [ExportDeclaration] export ... 'b'; } |
|
||||
| tstModuleES.mts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | semmle.order | 91 |
|
||||
| tstModuleES.mts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | semmle.order | 92 |
|
||||
| tstModuleES.mts:1:16:3:1 | [FunctionDeclStmt] functio ... 'b'; } | semmle.label | [FunctionDeclStmt] functio ... 'b'; } |
|
||||
| tstModuleES.mts:1:25:1:35 | [VarDecl] tstModuleES | semmle.label | [VarDecl] tstModuleES |
|
||||
| tstModuleES.mts:1:40:1:42 | [LiteralTypeExpr] 'a' | semmle.label | [LiteralTypeExpr] 'a' |
|
||||
@@ -1794,7 +1854,7 @@ nodes
|
||||
| tstModuleES.mts:2:34:2:36 | [Literal] 'a' | semmle.label | [Literal] 'a' |
|
||||
| tstModuleES.mts:2:40:2:42 | [Literal] 'b' | semmle.label | [Literal] 'b' |
|
||||
| tstSuffixA.ts:1:1:3:1 | [ExportDeclaration] export ... .ts'; } | semmle.label | [ExportDeclaration] export ... .ts'; } |
|
||||
| tstSuffixA.ts:1:1:3:1 | [ExportDeclaration] export ... .ts'; } | semmle.order | 92 |
|
||||
| tstSuffixA.ts:1:1:3:1 | [ExportDeclaration] export ... .ts'; } | semmle.order | 93 |
|
||||
| tstSuffixA.ts:1:8:3:1 | [FunctionDeclStmt] functio ... .ts'; } | semmle.label | [FunctionDeclStmt] functio ... .ts'; } |
|
||||
| tstSuffixA.ts:1:17:1:28 | [VarDecl] resolvedFile | semmle.label | [VarDecl] resolvedFile |
|
||||
| tstSuffixA.ts:1:33:1:47 | [LiteralTypeExpr] 'tstSuffixA.ts' | semmle.label | [LiteralTypeExpr] 'tstSuffixA.ts' |
|
||||
@@ -1802,7 +1862,7 @@ nodes
|
||||
| tstSuffixA.ts:2:5:2:27 | [ReturnStmt] return ... xA.ts'; | semmle.label | [ReturnStmt] return ... xA.ts'; |
|
||||
| tstSuffixA.ts:2:12:2:26 | [Literal] 'tstSuffixA.ts' | semmle.label | [Literal] 'tstSuffixA.ts' |
|
||||
| tstSuffixB.ios.ts:1:1:3:1 | [ExportDeclaration] export ... .ts'; } | semmle.label | [ExportDeclaration] export ... .ts'; } |
|
||||
| tstSuffixB.ios.ts:1:1:3:1 | [ExportDeclaration] export ... .ts'; } | semmle.order | 93 |
|
||||
| tstSuffixB.ios.ts:1:1:3:1 | [ExportDeclaration] export ... .ts'; } | semmle.order | 94 |
|
||||
| tstSuffixB.ios.ts:1:8:3:1 | [FunctionDeclStmt] functio ... .ts'; } | semmle.label | [FunctionDeclStmt] functio ... .ts'; } |
|
||||
| tstSuffixB.ios.ts:1:17:1:28 | [VarDecl] resolvedFile | semmle.label | [VarDecl] resolvedFile |
|
||||
| tstSuffixB.ios.ts:1:33:1:51 | [LiteralTypeExpr] 'tstSuffixB.ios.ts' | semmle.label | [LiteralTypeExpr] 'tstSuffixB.ios.ts' |
|
||||
@@ -1810,7 +1870,7 @@ nodes
|
||||
| tstSuffixB.ios.ts:2:5:2:31 | [ReturnStmt] return ... os.ts'; | semmle.label | [ReturnStmt] return ... os.ts'; |
|
||||
| tstSuffixB.ios.ts:2:12:2:30 | [Literal] 'tstSuffixB.ios.ts' | semmle.label | [Literal] 'tstSuffixB.ios.ts' |
|
||||
| tstSuffixB.ts:1:1:3:1 | [ExportDeclaration] export ... .ts'; } | semmle.label | [ExportDeclaration] export ... .ts'; } |
|
||||
| tstSuffixB.ts:1:1:3:1 | [ExportDeclaration] export ... .ts'; } | semmle.order | 94 |
|
||||
| tstSuffixB.ts:1:1:3:1 | [ExportDeclaration] export ... .ts'; } | semmle.order | 95 |
|
||||
| tstSuffixB.ts:1:8:3:1 | [FunctionDeclStmt] functio ... .ts'; } | semmle.label | [FunctionDeclStmt] functio ... .ts'; } |
|
||||
| tstSuffixB.ts:1:17:1:28 | [VarDecl] resolvedFile | semmle.label | [VarDecl] resolvedFile |
|
||||
| tstSuffixB.ts:1:33:1:47 | [LiteralTypeExpr] 'tstSuffixB.ts' | semmle.label | [LiteralTypeExpr] 'tstSuffixB.ts' |
|
||||
@@ -1818,16 +1878,16 @@ nodes
|
||||
| tstSuffixB.ts:2:5:2:27 | [ReturnStmt] return ... xB.ts'; | semmle.label | [ReturnStmt] return ... xB.ts'; |
|
||||
| tstSuffixB.ts:2:12:2:26 | [Literal] 'tstSuffixB.ts' | semmle.label | [Literal] 'tstSuffixB.ts' |
|
||||
| type_alias.ts:1:1:1:17 | [TypeAliasDeclaration,TypeDefinition] type B = boolean; | semmle.label | [TypeAliasDeclaration,TypeDefinition] type B = boolean; |
|
||||
| type_alias.ts:1:1:1:17 | [TypeAliasDeclaration,TypeDefinition] type B = boolean; | semmle.order | 95 |
|
||||
| type_alias.ts:1:1:1:17 | [TypeAliasDeclaration,TypeDefinition] type B = boolean; | semmle.order | 96 |
|
||||
| type_alias.ts:1:6:1:6 | [Identifier] B | semmle.label | [Identifier] B |
|
||||
| type_alias.ts:1:10:1:16 | [KeywordTypeExpr] boolean | semmle.label | [KeywordTypeExpr] boolean |
|
||||
| type_alias.ts:3:1:3:9 | [DeclStmt] var b = ... | semmle.label | [DeclStmt] var b = ... |
|
||||
| type_alias.ts:3:1:3:9 | [DeclStmt] var b = ... | semmle.order | 96 |
|
||||
| type_alias.ts:3:1:3:9 | [DeclStmt] var b = ... | semmle.order | 97 |
|
||||
| type_alias.ts:3:5:3:5 | [VarDecl] b | semmle.label | [VarDecl] b |
|
||||
| type_alias.ts:3:5:3:8 | [VariableDeclarator] b: B | semmle.label | [VariableDeclarator] b: B |
|
||||
| type_alias.ts:3:8:3:8 | [LocalTypeAccess] B | semmle.label | [LocalTypeAccess] B |
|
||||
| type_alias.ts:5:1:5:50 | [TypeAliasDeclaration,TypeDefinition] type Va ... ay<T>>; | semmle.label | [TypeAliasDeclaration,TypeDefinition] type Va ... ay<T>>; |
|
||||
| type_alias.ts:5:1:5:50 | [TypeAliasDeclaration,TypeDefinition] type Va ... ay<T>>; | semmle.order | 97 |
|
||||
| type_alias.ts:5:1:5:50 | [TypeAliasDeclaration,TypeDefinition] type Va ... ay<T>>; | semmle.order | 98 |
|
||||
| type_alias.ts:5:6:5:17 | [Identifier] ValueOrArray | semmle.label | [Identifier] ValueOrArray |
|
||||
| type_alias.ts:5:19:5:19 | [Identifier] T | semmle.label | [Identifier] T |
|
||||
| type_alias.ts:5:19:5:19 | [TypeParameter] T | semmle.label | [TypeParameter] T |
|
||||
@@ -1839,14 +1899,14 @@ nodes
|
||||
| type_alias.ts:5:34:5:48 | [GenericTypeExpr] ValueOrArray<T> | semmle.label | [GenericTypeExpr] ValueOrArray<T> |
|
||||
| type_alias.ts:5:47:5:47 | [LocalTypeAccess] T | semmle.label | [LocalTypeAccess] T |
|
||||
| type_alias.ts:7:1:7:28 | [DeclStmt] var c = ... | semmle.label | [DeclStmt] var c = ... |
|
||||
| type_alias.ts:7:1:7:28 | [DeclStmt] var c = ... | semmle.order | 98 |
|
||||
| type_alias.ts:7:1:7:28 | [DeclStmt] var c = ... | semmle.order | 99 |
|
||||
| type_alias.ts:7:5:7:5 | [VarDecl] c | semmle.label | [VarDecl] c |
|
||||
| type_alias.ts:7:5:7:27 | [VariableDeclarator] c: Valu ... number> | semmle.label | [VariableDeclarator] c: Valu ... number> |
|
||||
| type_alias.ts:7:8:7:19 | [LocalTypeAccess] ValueOrArray | semmle.label | [LocalTypeAccess] ValueOrArray |
|
||||
| type_alias.ts:7:8:7:27 | [GenericTypeExpr] ValueOrArray<number> | semmle.label | [GenericTypeExpr] ValueOrArray<number> |
|
||||
| type_alias.ts:7:21:7:26 | [KeywordTypeExpr] number | semmle.label | [KeywordTypeExpr] number |
|
||||
| type_alias.ts:9:1:15:13 | [TypeAliasDeclaration,TypeDefinition] type Js ... Json[]; | semmle.label | [TypeAliasDeclaration,TypeDefinition] type Js ... Json[]; |
|
||||
| type_alias.ts:9:1:15:13 | [TypeAliasDeclaration,TypeDefinition] type Js ... Json[]; | semmle.order | 99 |
|
||||
| type_alias.ts:9:1:15:13 | [TypeAliasDeclaration,TypeDefinition] type Js ... Json[]; | semmle.order | 100 |
|
||||
| type_alias.ts:9:6:9:9 | [Identifier] Json | semmle.label | [Identifier] Json |
|
||||
| type_alias.ts:10:5:15:12 | [UnionTypeExpr] \| strin ... Json[] | semmle.label | [UnionTypeExpr] \| strin ... Json[] |
|
||||
| type_alias.ts:10:7:10:12 | [KeywordTypeExpr] string | semmle.label | [KeywordTypeExpr] string |
|
||||
@@ -1862,12 +1922,12 @@ nodes
|
||||
| type_alias.ts:15:7:15:10 | [LocalTypeAccess] Json | semmle.label | [LocalTypeAccess] Json |
|
||||
| type_alias.ts:15:7:15:12 | [ArrayTypeExpr] Json[] | semmle.label | [ArrayTypeExpr] Json[] |
|
||||
| type_alias.ts:17:1:17:15 | [DeclStmt] var json = ... | semmle.label | [DeclStmt] var json = ... |
|
||||
| type_alias.ts:17:1:17:15 | [DeclStmt] var json = ... | semmle.order | 100 |
|
||||
| type_alias.ts:17:1:17:15 | [DeclStmt] var json = ... | semmle.order | 101 |
|
||||
| type_alias.ts:17:5:17:8 | [VarDecl] json | semmle.label | [VarDecl] json |
|
||||
| type_alias.ts:17:5:17:14 | [VariableDeclarator] json: Json | semmle.label | [VariableDeclarator] json: Json |
|
||||
| type_alias.ts:17:11:17:14 | [LocalTypeAccess] Json | semmle.label | [LocalTypeAccess] Json |
|
||||
| type_alias.ts:19:1:21:57 | [TypeAliasDeclaration,TypeDefinition] type Vi ... ode[]]; | semmle.label | [TypeAliasDeclaration,TypeDefinition] type Vi ... ode[]]; |
|
||||
| type_alias.ts:19:1:21:57 | [TypeAliasDeclaration,TypeDefinition] type Vi ... ode[]]; | semmle.order | 101 |
|
||||
| type_alias.ts:19:1:21:57 | [TypeAliasDeclaration,TypeDefinition] type Vi ... ode[]]; | semmle.order | 102 |
|
||||
| type_alias.ts:19:6:19:16 | [Identifier] VirtualNode | semmle.label | [Identifier] VirtualNode |
|
||||
| type_alias.ts:20:5:21:56 | [UnionTypeExpr] \| strin ... Node[]] | semmle.label | [UnionTypeExpr] \| strin ... Node[]] |
|
||||
| type_alias.ts:20:7:20:12 | [KeywordTypeExpr] string | semmle.label | [KeywordTypeExpr] string |
|
||||
@@ -1883,7 +1943,7 @@ nodes
|
||||
| type_alias.ts:21:43:21:53 | [LocalTypeAccess] VirtualNode | semmle.label | [LocalTypeAccess] VirtualNode |
|
||||
| type_alias.ts:21:43:21:55 | [ArrayTypeExpr] VirtualNode[] | semmle.label | [ArrayTypeExpr] VirtualNode[] |
|
||||
| type_alias.ts:23:1:27:6 | [DeclStmt] const myNode = ... | semmle.label | [DeclStmt] const myNode = ... |
|
||||
| type_alias.ts:23:1:27:6 | [DeclStmt] const myNode = ... | semmle.order | 102 |
|
||||
| type_alias.ts:23:1:27:6 | [DeclStmt] const myNode = ... | semmle.order | 103 |
|
||||
| type_alias.ts:23:7:23:12 | [VarDecl] myNode | semmle.label | [VarDecl] myNode |
|
||||
| type_alias.ts:23:7:27:5 | [VariableDeclarator] myNode: ... ] ] | semmle.label | [VariableDeclarator] myNode: ... ] ] |
|
||||
| type_alias.ts:23:15:23:25 | [LocalTypeAccess] VirtualNode | semmle.label | [LocalTypeAccess] VirtualNode |
|
||||
@@ -1908,12 +1968,12 @@ nodes
|
||||
| type_alias.ts:26:23:26:36 | [Literal] "second-child" | semmle.label | [Literal] "second-child" |
|
||||
| type_alias.ts:26:41:26:62 | [Literal] "I'm the second child" | semmle.label | [Literal] "I'm the second child" |
|
||||
| type_definition_objects.ts:1:1:1:33 | [ImportDeclaration] import ... dummy"; | semmle.label | [ImportDeclaration] import ... dummy"; |
|
||||
| type_definition_objects.ts:1:1:1:33 | [ImportDeclaration] import ... dummy"; | semmle.order | 103 |
|
||||
| type_definition_objects.ts:1:1:1:33 | [ImportDeclaration] import ... dummy"; | semmle.order | 104 |
|
||||
| type_definition_objects.ts:1:8:1:17 | [ImportSpecifier] * as dummy | semmle.label | [ImportSpecifier] * as dummy |
|
||||
| type_definition_objects.ts:1:13:1:17 | [VarDecl] dummy | semmle.label | [VarDecl] dummy |
|
||||
| type_definition_objects.ts:1:24:1:32 | [Literal] "./dummy" | semmle.label | [Literal] "./dummy" |
|
||||
| type_definition_objects.ts:3:1:3:17 | [ExportDeclaration] export class C {} | semmle.label | [ExportDeclaration] export class C {} |
|
||||
| type_definition_objects.ts:3:1:3:17 | [ExportDeclaration] export class C {} | semmle.order | 104 |
|
||||
| type_definition_objects.ts:3:1:3:17 | [ExportDeclaration] export class C {} | semmle.order | 105 |
|
||||
| type_definition_objects.ts:3:8:3:17 | [ClassDefinition,TypeDefinition] class C {} | semmle.label | [ClassDefinition,TypeDefinition] class C {} |
|
||||
| type_definition_objects.ts:3:14:3:14 | [VarDecl] C | semmle.label | [VarDecl] C |
|
||||
| type_definition_objects.ts:3:16:3:15 | [BlockStmt] {} | semmle.label | [BlockStmt] {} |
|
||||
@@ -1921,36 +1981,36 @@ nodes
|
||||
| type_definition_objects.ts:3:16:3:15 | [FunctionExpr] () {} | semmle.label | [FunctionExpr] () {} |
|
||||
| type_definition_objects.ts:3:16:3:15 | [Label] constructor | semmle.label | [Label] constructor |
|
||||
| type_definition_objects.ts:4:1:4:17 | [DeclStmt] let classObj = ... | semmle.label | [DeclStmt] let classObj = ... |
|
||||
| type_definition_objects.ts:4:1:4:17 | [DeclStmt] let classObj = ... | semmle.order | 105 |
|
||||
| type_definition_objects.ts:4:1:4:17 | [DeclStmt] let classObj = ... | semmle.order | 106 |
|
||||
| type_definition_objects.ts:4:5:4:12 | [VarDecl] classObj | semmle.label | [VarDecl] classObj |
|
||||
| type_definition_objects.ts:4:5:4:16 | [VariableDeclarator] classObj = C | semmle.label | [VariableDeclarator] classObj = C |
|
||||
| type_definition_objects.ts:4:16:4:16 | [VarRef] C | semmle.label | [VarRef] C |
|
||||
| type_definition_objects.ts:6:1:6:16 | [ExportDeclaration] export enum E {} | semmle.label | [ExportDeclaration] export enum E {} |
|
||||
| type_definition_objects.ts:6:1:6:16 | [ExportDeclaration] export enum E {} | semmle.order | 106 |
|
||||
| type_definition_objects.ts:6:1:6:16 | [ExportDeclaration] export enum E {} | semmle.order | 107 |
|
||||
| type_definition_objects.ts:6:8:6:16 | [EnumDeclaration,TypeDefinition] enum E {} | semmle.label | [EnumDeclaration,TypeDefinition] enum E {} |
|
||||
| type_definition_objects.ts:6:13:6:13 | [VarDecl] E | semmle.label | [VarDecl] E |
|
||||
| type_definition_objects.ts:7:1:7:16 | [DeclStmt] let enumObj = ... | semmle.label | [DeclStmt] let enumObj = ... |
|
||||
| type_definition_objects.ts:7:1:7:16 | [DeclStmt] let enumObj = ... | semmle.order | 107 |
|
||||
| type_definition_objects.ts:7:1:7:16 | [DeclStmt] let enumObj = ... | semmle.order | 108 |
|
||||
| type_definition_objects.ts:7:5:7:11 | [VarDecl] enumObj | semmle.label | [VarDecl] enumObj |
|
||||
| type_definition_objects.ts:7:5:7:15 | [VariableDeclarator] enumObj = E | semmle.label | [VariableDeclarator] enumObj = E |
|
||||
| type_definition_objects.ts:7:15:7:15 | [VarRef] E | semmle.label | [VarRef] E |
|
||||
| type_definition_objects.ts:9:1:9:22 | [ExportDeclaration] export ... e N {;} | semmle.label | [ExportDeclaration] export ... e N {;} |
|
||||
| type_definition_objects.ts:9:1:9:22 | [ExportDeclaration] export ... e N {;} | semmle.order | 108 |
|
||||
| type_definition_objects.ts:9:1:9:22 | [ExportDeclaration] export ... e N {;} | semmle.order | 109 |
|
||||
| type_definition_objects.ts:9:8:9:22 | [NamespaceDeclaration] namespace N {;} | semmle.label | [NamespaceDeclaration] namespace N {;} |
|
||||
| type_definition_objects.ts:9:18:9:18 | [VarDecl] N | semmle.label | [VarDecl] N |
|
||||
| type_definition_objects.ts:9:21:9:21 | [EmptyStmt] ; | semmle.label | [EmptyStmt] ; |
|
||||
| type_definition_objects.ts:10:1:10:21 | [DeclStmt] let namespaceObj = ... | semmle.label | [DeclStmt] let namespaceObj = ... |
|
||||
| type_definition_objects.ts:10:1:10:21 | [DeclStmt] let namespaceObj = ... | semmle.order | 109 |
|
||||
| type_definition_objects.ts:10:1:10:21 | [DeclStmt] let namespaceObj = ... | semmle.order | 110 |
|
||||
| type_definition_objects.ts:10:5:10:16 | [VarDecl] namespaceObj | semmle.label | [VarDecl] namespaceObj |
|
||||
| type_definition_objects.ts:10:5:10:20 | [VariableDeclarator] namespaceObj = N | semmle.label | [VariableDeclarator] namespaceObj = N |
|
||||
| type_definition_objects.ts:10:20:10:20 | [VarRef] N | semmle.label | [VarRef] N |
|
||||
| type_definitions.ts:1:1:1:33 | [ImportDeclaration] import ... dummy"; | semmle.label | [ImportDeclaration] import ... dummy"; |
|
||||
| type_definitions.ts:1:1:1:33 | [ImportDeclaration] import ... dummy"; | semmle.order | 110 |
|
||||
| type_definitions.ts:1:1:1:33 | [ImportDeclaration] import ... dummy"; | semmle.order | 111 |
|
||||
| type_definitions.ts:1:8:1:17 | [ImportSpecifier] * as dummy | semmle.label | [ImportSpecifier] * as dummy |
|
||||
| type_definitions.ts:1:13:1:17 | [VarDecl] dummy | semmle.label | [VarDecl] dummy |
|
||||
| type_definitions.ts:1:24:1:32 | [Literal] "./dummy" | semmle.label | [Literal] "./dummy" |
|
||||
| type_definitions.ts:3:1:5:1 | [InterfaceDeclaration,TypeDefinition] interfa ... x: S; } | semmle.label | [InterfaceDeclaration,TypeDefinition] interfa ... x: S; } |
|
||||
| type_definitions.ts:3:1:5:1 | [InterfaceDeclaration,TypeDefinition] interfa ... x: S; } | semmle.order | 111 |
|
||||
| type_definitions.ts:3:1:5:1 | [InterfaceDeclaration,TypeDefinition] interfa ... x: S; } | semmle.order | 112 |
|
||||
| type_definitions.ts:3:11:3:11 | [Identifier] I | semmle.label | [Identifier] I |
|
||||
| type_definitions.ts:3:13:3:13 | [Identifier] S | semmle.label | [Identifier] S |
|
||||
| type_definitions.ts:3:13:3:13 | [TypeParameter] S | semmle.label | [TypeParameter] S |
|
||||
@@ -1958,14 +2018,14 @@ nodes
|
||||
| type_definitions.ts:4:3:4:7 | [FieldDeclaration] x: S; | semmle.label | [FieldDeclaration] x: S; |
|
||||
| type_definitions.ts:4:6:4:6 | [LocalTypeAccess] S | semmle.label | [LocalTypeAccess] S |
|
||||
| type_definitions.ts:6:1:6:16 | [DeclStmt] let i = ... | semmle.label | [DeclStmt] let i = ... |
|
||||
| type_definitions.ts:6:1:6:16 | [DeclStmt] let i = ... | semmle.order | 112 |
|
||||
| type_definitions.ts:6:1:6:16 | [DeclStmt] let i = ... | semmle.order | 113 |
|
||||
| type_definitions.ts:6:5:6:5 | [VarDecl] i | semmle.label | [VarDecl] i |
|
||||
| type_definitions.ts:6:5:6:16 | [VariableDeclarator] i: I<number> | semmle.label | [VariableDeclarator] i: I<number> |
|
||||
| type_definitions.ts:6:8:6:8 | [LocalTypeAccess] I | semmle.label | [LocalTypeAccess] I |
|
||||
| type_definitions.ts:6:8:6:16 | [GenericTypeExpr] I<number> | semmle.label | [GenericTypeExpr] I<number> |
|
||||
| type_definitions.ts:6:10:6:15 | [KeywordTypeExpr] number | semmle.label | [KeywordTypeExpr] number |
|
||||
| type_definitions.ts:8:1:10:1 | [ClassDefinition,TypeDefinition] class C ... x: T } | semmle.label | [ClassDefinition,TypeDefinition] class C ... x: T } |
|
||||
| type_definitions.ts:8:1:10:1 | [ClassDefinition,TypeDefinition] class C ... x: T } | semmle.order | 113 |
|
||||
| type_definitions.ts:8:1:10:1 | [ClassDefinition,TypeDefinition] class C ... x: T } | semmle.order | 114 |
|
||||
| type_definitions.ts:8:7:8:7 | [VarDecl] C | semmle.label | [VarDecl] C |
|
||||
| type_definitions.ts:8:8:8:7 | [BlockStmt] {} | semmle.label | [BlockStmt] {} |
|
||||
| type_definitions.ts:8:8:8:7 | [ClassInitializedMember,ConstructorDefinition] constructor() {} | semmle.label | [ClassInitializedMember,ConstructorDefinition] constructor() {} |
|
||||
@@ -1977,14 +2037,14 @@ nodes
|
||||
| type_definitions.ts:9:3:9:6 | [FieldDeclaration] x: T | semmle.label | [FieldDeclaration] x: T |
|
||||
| type_definitions.ts:9:6:9:6 | [LocalTypeAccess] T | semmle.label | [LocalTypeAccess] T |
|
||||
| type_definitions.ts:11:1:11:17 | [DeclStmt] let c = ... | semmle.label | [DeclStmt] let c = ... |
|
||||
| type_definitions.ts:11:1:11:17 | [DeclStmt] let c = ... | semmle.order | 114 |
|
||||
| type_definitions.ts:11:1:11:17 | [DeclStmt] let c = ... | semmle.order | 115 |
|
||||
| type_definitions.ts:11:5:11:5 | [VarDecl] c | semmle.label | [VarDecl] c |
|
||||
| type_definitions.ts:11:5:11:16 | [VariableDeclarator] c: C<number> | semmle.label | [VariableDeclarator] c: C<number> |
|
||||
| type_definitions.ts:11:8:11:8 | [LocalTypeAccess] C | semmle.label | [LocalTypeAccess] C |
|
||||
| type_definitions.ts:11:8:11:16 | [GenericTypeExpr] C<number> | semmle.label | [GenericTypeExpr] C<number> |
|
||||
| type_definitions.ts:11:10:11:15 | [KeywordTypeExpr] number | semmle.label | [KeywordTypeExpr] number |
|
||||
| type_definitions.ts:13:1:15:1 | [EnumDeclaration,TypeDefinition] enum Co ... blue } | semmle.label | [EnumDeclaration,TypeDefinition] enum Co ... blue } |
|
||||
| type_definitions.ts:13:1:15:1 | [EnumDeclaration,TypeDefinition] enum Co ... blue } | semmle.order | 115 |
|
||||
| type_definitions.ts:13:1:15:1 | [EnumDeclaration,TypeDefinition] enum Co ... blue } | semmle.order | 116 |
|
||||
| type_definitions.ts:13:6:13:10 | [VarDecl] Color | semmle.label | [VarDecl] Color |
|
||||
| type_definitions.ts:14:3:14:5 | [EnumMember,TypeDefinition] red | semmle.label | [EnumMember,TypeDefinition] red |
|
||||
| type_definitions.ts:14:3:14:5 | [VarDecl] red | semmle.label | [VarDecl] red |
|
||||
@@ -1993,29 +2053,29 @@ nodes
|
||||
| type_definitions.ts:14:15:14:18 | [EnumMember,TypeDefinition] blue | semmle.label | [EnumMember,TypeDefinition] blue |
|
||||
| type_definitions.ts:14:15:14:18 | [VarDecl] blue | semmle.label | [VarDecl] blue |
|
||||
| type_definitions.ts:16:1:16:17 | [DeclStmt] let color = ... | semmle.label | [DeclStmt] let color = ... |
|
||||
| type_definitions.ts:16:1:16:17 | [DeclStmt] let color = ... | semmle.order | 116 |
|
||||
| type_definitions.ts:16:1:16:17 | [DeclStmt] let color = ... | semmle.order | 117 |
|
||||
| type_definitions.ts:16:5:16:9 | [VarDecl] color | semmle.label | [VarDecl] color |
|
||||
| type_definitions.ts:16:5:16:16 | [VariableDeclarator] color: Color | semmle.label | [VariableDeclarator] color: Color |
|
||||
| type_definitions.ts:16:12:16:16 | [LocalTypeAccess] Color | semmle.label | [LocalTypeAccess] Color |
|
||||
| type_definitions.ts:18:1:18:33 | [EnumDeclaration,TypeDefinition] enum En ... ember } | semmle.label | [EnumDeclaration,TypeDefinition] enum En ... ember } |
|
||||
| type_definitions.ts:18:1:18:33 | [EnumDeclaration,TypeDefinition] enum En ... ember } | semmle.order | 117 |
|
||||
| type_definitions.ts:18:1:18:33 | [EnumDeclaration,TypeDefinition] enum En ... ember } | semmle.order | 118 |
|
||||
| type_definitions.ts:18:6:18:22 | [VarDecl] EnumWithOneMember | semmle.label | [VarDecl] EnumWithOneMember |
|
||||
| type_definitions.ts:18:26:18:31 | [EnumMember,TypeDefinition] member | semmle.label | [EnumMember,TypeDefinition] member |
|
||||
| type_definitions.ts:18:26:18:31 | [VarDecl] member | semmle.label | [VarDecl] member |
|
||||
| type_definitions.ts:19:1:19:25 | [DeclStmt] let e = ... | semmle.label | [DeclStmt] let e = ... |
|
||||
| type_definitions.ts:19:1:19:25 | [DeclStmt] let e = ... | semmle.order | 118 |
|
||||
| type_definitions.ts:19:1:19:25 | [DeclStmt] let e = ... | semmle.order | 119 |
|
||||
| type_definitions.ts:19:5:19:5 | [VarDecl] e | semmle.label | [VarDecl] e |
|
||||
| type_definitions.ts:19:5:19:24 | [VariableDeclarator] e: EnumWithOneMember | semmle.label | [VariableDeclarator] e: EnumWithOneMember |
|
||||
| type_definitions.ts:19:8:19:24 | [LocalTypeAccess] EnumWithOneMember | semmle.label | [LocalTypeAccess] EnumWithOneMember |
|
||||
| type_definitions.ts:21:1:21:20 | [TypeAliasDeclaration,TypeDefinition] type Alias<T> = T[]; | semmle.label | [TypeAliasDeclaration,TypeDefinition] type Alias<T> = T[]; |
|
||||
| type_definitions.ts:21:1:21:20 | [TypeAliasDeclaration,TypeDefinition] type Alias<T> = T[]; | semmle.order | 119 |
|
||||
| type_definitions.ts:21:1:21:20 | [TypeAliasDeclaration,TypeDefinition] type Alias<T> = T[]; | semmle.order | 120 |
|
||||
| type_definitions.ts:21:6:21:10 | [Identifier] Alias | semmle.label | [Identifier] Alias |
|
||||
| type_definitions.ts:21:12:21:12 | [Identifier] T | semmle.label | [Identifier] T |
|
||||
| type_definitions.ts:21:12:21:12 | [TypeParameter] T | semmle.label | [TypeParameter] T |
|
||||
| type_definitions.ts:21:17:21:17 | [LocalTypeAccess] T | semmle.label | [LocalTypeAccess] T |
|
||||
| type_definitions.ts:21:17:21:19 | [ArrayTypeExpr] T[] | semmle.label | [ArrayTypeExpr] T[] |
|
||||
| type_definitions.ts:22:1:22:39 | [DeclStmt] let aliasForNumberArray = ... | semmle.label | [DeclStmt] let aliasForNumberArray = ... |
|
||||
| type_definitions.ts:22:1:22:39 | [DeclStmt] let aliasForNumberArray = ... | semmle.order | 120 |
|
||||
| type_definitions.ts:22:1:22:39 | [DeclStmt] let aliasForNumberArray = ... | semmle.order | 121 |
|
||||
| type_definitions.ts:22:5:22:23 | [VarDecl] aliasForNumberArray | semmle.label | [VarDecl] aliasForNumberArray |
|
||||
| type_definitions.ts:22:5:22:38 | [VariableDeclarator] aliasFo ... number> | semmle.label | [VariableDeclarator] aliasFo ... number> |
|
||||
| type_definitions.ts:22:26:22:30 | [LocalTypeAccess] Alias | semmle.label | [LocalTypeAccess] Alias |
|
||||
@@ -2216,6 +2276,14 @@ edges
|
||||
| file://:0:0:0:0 | (Arguments) | tst.ts:478:17:478:42 | [IndexExpr] SomeCla ... tadata] | semmle.order | 0 |
|
||||
| file://:0:0:0:0 | (Arguments) | tst.ts:483:17:483:58 | [SatisfiesExpr] ["hello ... string> | semmle.label | 0 |
|
||||
| file://:0:0:0:0 | (Arguments) | tst.ts:483:17:483:58 | [SatisfiesExpr] ["hello ... string> | semmle.order | 0 |
|
||||
| file://:0:0:0:0 | (Arguments) | tst.ts:491:21:491:46 | [ArrayExpr] ["red", ... green"] | semmle.label | 0 |
|
||||
| file://:0:0:0:0 | (Arguments) | tst.ts:491:21:491:46 | [ArrayExpr] ["red", ... green"] | semmle.order | 0 |
|
||||
| file://:0:0:0:0 | (Arguments) | tst.ts:491:49:491:56 | [Literal] "yellow" | semmle.label | 1 |
|
||||
| file://:0:0:0:0 | (Arguments) | tst.ts:491:49:491:56 | [Literal] "yellow" | semmle.order | 1 |
|
||||
| file://:0:0:0:0 | (Arguments) | tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | semmle.label | 0 |
|
||||
| file://:0:0:0:0 | (Arguments) | tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | semmle.order | 0 |
|
||||
| file://:0:0:0:0 | (Arguments) | tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | semmle.label | 1 |
|
||||
| file://:0:0:0:0 | (Arguments) | tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | semmle.order | 1 |
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:14:17:14:17 | [SimpleParameter] x | semmle.label | 0 |
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:14:17:14:17 | [SimpleParameter] x | semmle.order | 0 |
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:14:28:14:28 | [SimpleParameter] y | semmle.label | 1 |
|
||||
@@ -2314,6 +2382,14 @@ edges
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:474:12:474:18 | [SimpleParameter] _target | semmle.order | 0 |
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:474:21:474:28 | [SimpleParameter] _context | semmle.label | 1 |
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:474:21:474:28 | [SimpleParameter] _context | semmle.order | 1 |
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:487:48:487:53 | [SimpleParameter] colors | semmle.label | 0 |
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:487:48:487:53 | [SimpleParameter] colors | semmle.order | 0 |
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:487:61:487:72 | [SimpleParameter] defaultColor | semmle.label | 1 |
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:487:61:487:72 | [SimpleParameter] defaultColor | semmle.order | 1 |
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:493:53:493:55 | [SimpleParameter] num | semmle.label | 0 |
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:493:53:493:55 | [SimpleParameter] num | semmle.order | 0 |
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:493:58:493:62 | [SimpleParameter] index | semmle.label | 1 |
|
||||
| file://:0:0:0:0 | (Parameters) | tst.ts:493:58:493:62 | [SimpleParameter] index | semmle.order | 1 |
|
||||
| file://:0:0:0:0 | (Parameters) | type_alias.ts:14:10:14:17 | [SimpleParameter] property | semmle.label | 0 |
|
||||
| file://:0:0:0:0 | (Parameters) | type_alias.ts:14:10:14:17 | [SimpleParameter] property | semmle.order | 0 |
|
||||
| file://:0:0:0:0 | (Parameters) | type_alias.ts:21:19:21:21 | [SimpleParameter] key | semmle.label | 0 |
|
||||
@@ -2346,6 +2422,8 @@ edges
|
||||
| file://:0:0:0:0 | (TypeParameters) | tst.ts:462:40:462:72 | [TypeParameter] const T ... tring[] | semmle.order | 0 |
|
||||
| file://:0:0:0:0 | (TypeParameters) | tst.ts:481:16:481:16 | [TypeParameter] T | semmle.label | 0 |
|
||||
| file://:0:0:0:0 | (TypeParameters) | tst.ts:481:16:481:16 | [TypeParameter] T | semmle.order | 0 |
|
||||
| file://:0:0:0:0 | (TypeParameters) | tst.ts:487:30:487:45 | [TypeParameter] C extends string | semmle.label | 0 |
|
||||
| file://:0:0:0:0 | (TypeParameters) | tst.ts:487:30:487:45 | [TypeParameter] C extends string | semmle.order | 0 |
|
||||
| file://:0:0:0:0 | (TypeParameters) | type_alias.ts:5:19:5:19 | [TypeParameter] T | semmle.label | 0 |
|
||||
| file://:0:0:0:0 | (TypeParameters) | type_alias.ts:5:19:5:19 | [TypeParameter] T | semmle.order | 0 |
|
||||
| file://:0:0:0:0 | (TypeParameters) | type_definitions.ts:3:13:3:13 | [TypeParameter] S | semmle.label | 0 |
|
||||
@@ -5182,6 +5260,104 @@ edges
|
||||
| tst.ts:483:46:483:58 | [GenericTypeExpr] Pair3<string> | tst.ts:483:46:483:50 | [LocalTypeAccess] Pair3 | semmle.order | 1 |
|
||||
| tst.ts:483:46:483:58 | [GenericTypeExpr] Pair3<string> | tst.ts:483:52:483:57 | [KeywordTypeExpr] string | semmle.label | 2 |
|
||||
| tst.ts:483:46:483:58 | [GenericTypeExpr] Pair3<string> | tst.ts:483:52:483:57 | [KeywordTypeExpr] string | semmle.order | 2 |
|
||||
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:486:8:486:11 | [VarDecl] TS54 | semmle.label | 1 |
|
||||
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:486:8:486:11 | [VarDecl] TS54 | semmle.order | 1 |
|
||||
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | semmle.label | 2 |
|
||||
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | semmle.order | 2 |
|
||||
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:491:3:491:58 | [ExprStmt] createS ... llow"); | semmle.label | 3 |
|
||||
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:491:3:491:58 | [ExprStmt] createS ... llow"); | semmle.order | 3 |
|
||||
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:493:3:495:5 | [DeclStmt] const myObj = ... | semmle.label | 4 |
|
||||
| tst.ts:486:1:496:1 | [NamespaceDeclaration] module ... }); } | tst.ts:493:3:495:5 | [DeclStmt] const myObj = ... | semmle.order | 4 |
|
||||
| tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | file://:0:0:0:0 | (Parameters) | semmle.label | 1 |
|
||||
| tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | file://:0:0:0:0 | (Parameters) | semmle.order | 1 |
|
||||
| tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | file://:0:0:0:0 | (TypeParameters) | semmle.label | 2 |
|
||||
| tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | file://:0:0:0:0 | (TypeParameters) | semmle.order | 2 |
|
||||
| tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | tst.ts:487:12:487:28 | [VarDecl] createStreetLight | semmle.label | 0 |
|
||||
| tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | tst.ts:487:12:487:28 | [VarDecl] createStreetLight | semmle.order | 0 |
|
||||
| tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | tst.ts:487:88:489:3 | [BlockStmt] { r ... 0]; } | semmle.label | 5 |
|
||||
| tst.ts:487:3:489:3 | [FunctionDeclStmt] functio ... 0]; } | tst.ts:487:88:489:3 | [BlockStmt] { r ... 0]; } | semmle.order | 5 |
|
||||
| tst.ts:487:30:487:45 | [TypeParameter] C extends string | tst.ts:487:30:487:30 | [Identifier] C | semmle.label | 1 |
|
||||
| tst.ts:487:30:487:45 | [TypeParameter] C extends string | tst.ts:487:30:487:30 | [Identifier] C | semmle.order | 1 |
|
||||
| tst.ts:487:30:487:45 | [TypeParameter] C extends string | tst.ts:487:40:487:45 | [KeywordTypeExpr] string | semmle.label | 2 |
|
||||
| tst.ts:487:30:487:45 | [TypeParameter] C extends string | tst.ts:487:40:487:45 | [KeywordTypeExpr] string | semmle.order | 2 |
|
||||
| tst.ts:487:48:487:53 | [SimpleParameter] colors | tst.ts:487:56:487:58 | [ArrayTypeExpr] C[] | semmle.label | -2 |
|
||||
| tst.ts:487:48:487:53 | [SimpleParameter] colors | tst.ts:487:56:487:58 | [ArrayTypeExpr] C[] | semmle.order | -2 |
|
||||
| tst.ts:487:56:487:58 | [ArrayTypeExpr] C[] | tst.ts:487:56:487:56 | [LocalTypeAccess] C | semmle.label | 1 |
|
||||
| tst.ts:487:56:487:58 | [ArrayTypeExpr] C[] | tst.ts:487:56:487:56 | [LocalTypeAccess] C | semmle.order | 1 |
|
||||
| tst.ts:487:61:487:72 | [SimpleParameter] defaultColor | tst.ts:487:76:487:85 | [GenericTypeExpr] NoInfer<C> | semmle.label | -2 |
|
||||
| tst.ts:487:61:487:72 | [SimpleParameter] defaultColor | tst.ts:487:76:487:85 | [GenericTypeExpr] NoInfer<C> | semmle.order | -2 |
|
||||
| tst.ts:487:76:487:85 | [GenericTypeExpr] NoInfer<C> | tst.ts:487:76:487:82 | [LocalTypeAccess] NoInfer | semmle.label | 1 |
|
||||
| tst.ts:487:76:487:85 | [GenericTypeExpr] NoInfer<C> | tst.ts:487:76:487:82 | [LocalTypeAccess] NoInfer | semmle.order | 1 |
|
||||
| tst.ts:487:76:487:85 | [GenericTypeExpr] NoInfer<C> | tst.ts:487:84:487:84 | [LocalTypeAccess] C | semmle.label | 2 |
|
||||
| tst.ts:487:76:487:85 | [GenericTypeExpr] NoInfer<C> | tst.ts:487:84:487:84 | [LocalTypeAccess] C | semmle.order | 2 |
|
||||
| tst.ts:487:88:489:3 | [BlockStmt] { r ... 0]; } | tst.ts:488:5:488:21 | [ReturnStmt] return colors[0]; | semmle.label | 1 |
|
||||
| tst.ts:487:88:489:3 | [BlockStmt] { r ... 0]; } | tst.ts:488:5:488:21 | [ReturnStmt] return colors[0]; | semmle.order | 1 |
|
||||
| tst.ts:488:5:488:21 | [ReturnStmt] return colors[0]; | tst.ts:488:12:488:20 | [IndexExpr] colors[0] | semmle.label | 1 |
|
||||
| tst.ts:488:5:488:21 | [ReturnStmt] return colors[0]; | tst.ts:488:12:488:20 | [IndexExpr] colors[0] | semmle.order | 1 |
|
||||
| tst.ts:488:12:488:20 | [IndexExpr] colors[0] | tst.ts:488:12:488:17 | [VarRef] colors | semmle.label | 1 |
|
||||
| tst.ts:488:12:488:20 | [IndexExpr] colors[0] | tst.ts:488:12:488:17 | [VarRef] colors | semmle.order | 1 |
|
||||
| tst.ts:488:12:488:20 | [IndexExpr] colors[0] | tst.ts:488:19:488:19 | [Literal] 0 | semmle.label | 2 |
|
||||
| tst.ts:488:12:488:20 | [IndexExpr] colors[0] | tst.ts:488:19:488:19 | [Literal] 0 | semmle.order | 2 |
|
||||
| tst.ts:491:3:491:57 | [CallExpr] createS ... ellow") | file://:0:0:0:0 | (Arguments) | semmle.label | 1 |
|
||||
| tst.ts:491:3:491:57 | [CallExpr] createS ... ellow") | file://:0:0:0:0 | (Arguments) | semmle.order | 1 |
|
||||
| tst.ts:491:3:491:57 | [CallExpr] createS ... ellow") | tst.ts:491:3:491:19 | [VarRef] createStreetLight | semmle.label | 0 |
|
||||
| tst.ts:491:3:491:57 | [CallExpr] createS ... ellow") | tst.ts:491:3:491:19 | [VarRef] createStreetLight | semmle.order | 0 |
|
||||
| tst.ts:491:3:491:58 | [ExprStmt] createS ... llow"); | tst.ts:491:3:491:57 | [CallExpr] createS ... ellow") | semmle.label | 1 |
|
||||
| tst.ts:491:3:491:58 | [ExprStmt] createS ... llow"); | tst.ts:491:3:491:57 | [CallExpr] createS ... ellow") | semmle.order | 1 |
|
||||
| tst.ts:491:21:491:46 | [ArrayExpr] ["red", ... green"] | tst.ts:491:22:491:26 | [Literal] "red" | semmle.label | 1 |
|
||||
| tst.ts:491:21:491:46 | [ArrayExpr] ["red", ... green"] | tst.ts:491:22:491:26 | [Literal] "red" | semmle.order | 1 |
|
||||
| tst.ts:491:21:491:46 | [ArrayExpr] ["red", ... green"] | tst.ts:491:29:491:36 | [Literal] "yellow" | semmle.label | 2 |
|
||||
| tst.ts:491:21:491:46 | [ArrayExpr] ["red", ... green"] | tst.ts:491:29:491:36 | [Literal] "yellow" | semmle.order | 2 |
|
||||
| tst.ts:491:21:491:46 | [ArrayExpr] ["red", ... green"] | tst.ts:491:39:491:45 | [Literal] "green" | semmle.label | 3 |
|
||||
| tst.ts:491:21:491:46 | [ArrayExpr] ["red", ... green"] | tst.ts:491:39:491:45 | [Literal] "green" | semmle.order | 3 |
|
||||
| tst.ts:493:3:495:5 | [DeclStmt] const myObj = ... | tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | semmle.label | 1 |
|
||||
| tst.ts:493:3:495:5 | [DeclStmt] const myObj = ... | tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | semmle.order | 1 |
|
||||
| tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | tst.ts:493:9:493:13 | [VarDecl] myObj | semmle.label | 1 |
|
||||
| tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | tst.ts:493:9:493:13 | [VarDecl] myObj | semmle.order | 1 |
|
||||
| tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | semmle.label | 2 |
|
||||
| tst.ts:493:9:495:4 | [VariableDeclarator] myObj = ... "; }) | tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | semmle.order | 2 |
|
||||
| tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | tst.ts:493:17:493:22 | [VarRef] Object | semmle.label | 1 |
|
||||
| tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | tst.ts:493:17:493:22 | [VarRef] Object | semmle.order | 1 |
|
||||
| tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | tst.ts:493:24:493:30 | [Label] groupBy | semmle.label | 2 |
|
||||
| tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | tst.ts:493:24:493:30 | [Label] groupBy | semmle.order | 2 |
|
||||
| tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | file://:0:0:0:0 | (Arguments) | semmle.label | 1 |
|
||||
| tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | file://:0:0:0:0 | (Arguments) | semmle.order | 1 |
|
||||
| tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | semmle.label | 0 |
|
||||
| tst.ts:493:17:495:4 | [MethodCallExpr] Object. ... "; }) | tst.ts:493:17:493:30 | [DotExpr] Object.groupBy | semmle.order | 0 |
|
||||
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:33:493:33 | [Literal] 0 | semmle.label | 1 |
|
||||
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:33:493:33 | [Literal] 0 | semmle.order | 1 |
|
||||
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:36:493:36 | [Literal] 1 | semmle.label | 2 |
|
||||
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:36:493:36 | [Literal] 1 | semmle.order | 2 |
|
||||
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:39:493:39 | [Literal] 2 | semmle.label | 3 |
|
||||
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:39:493:39 | [Literal] 2 | semmle.order | 3 |
|
||||
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:42:493:42 | [Literal] 3 | semmle.label | 4 |
|
||||
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:42:493:42 | [Literal] 3 | semmle.order | 4 |
|
||||
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:45:493:45 | [Literal] 4 | semmle.label | 5 |
|
||||
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:45:493:45 | [Literal] 4 | semmle.order | 5 |
|
||||
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:48:493:48 | [Literal] 5 | semmle.label | 6 |
|
||||
| tst.ts:493:32:493:49 | [ArrayExpr] [0, 1, 2, 3, 4, 5] | tst.ts:493:48:493:48 | [Literal] 5 | semmle.order | 6 |
|
||||
| tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | file://:0:0:0:0 | (Parameters) | semmle.label | 1 |
|
||||
| tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | file://:0:0:0:0 | (Parameters) | semmle.order | 1 |
|
||||
| tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | tst.ts:493:68:495:3 | [BlockStmt] { r ... d"; } | semmle.label | 5 |
|
||||
| tst.ts:493:52:495:3 | [ArrowFunctionExpr] (num, i ... d"; } | tst.ts:493:68:495:3 | [BlockStmt] { r ... d"; } | semmle.order | 5 |
|
||||
| tst.ts:493:68:495:3 | [BlockStmt] { r ... d"; } | tst.ts:494:5:494:41 | [ReturnStmt] return ... "odd"; | semmle.label | 1 |
|
||||
| tst.ts:493:68:495:3 | [BlockStmt] { r ... d"; } | tst.ts:494:5:494:41 | [ReturnStmt] return ... "odd"; | semmle.order | 1 |
|
||||
| tst.ts:494:5:494:41 | [ReturnStmt] return ... "odd"; | tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | semmle.label | 1 |
|
||||
| tst.ts:494:5:494:41 | [ReturnStmt] return ... "odd"; | tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | semmle.order | 1 |
|
||||
| tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | tst.ts:494:12:494:14 | [VarRef] num | semmle.label | 1 |
|
||||
| tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | tst.ts:494:12:494:14 | [VarRef] num | semmle.order | 1 |
|
||||
| tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | tst.ts:494:18:494:18 | [Literal] 2 | semmle.label | 2 |
|
||||
| tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | tst.ts:494:18:494:18 | [Literal] 2 | semmle.order | 2 |
|
||||
| tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | semmle.label | 1 |
|
||||
| tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | tst.ts:494:12:494:18 | [BinaryExpr] num % 2 | semmle.order | 1 |
|
||||
| tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | tst.ts:494:24:494:24 | [Literal] 0 | semmle.label | 2 |
|
||||
| tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | tst.ts:494:24:494:24 | [Literal] 0 | semmle.order | 2 |
|
||||
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | semmle.label | 1 |
|
||||
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | tst.ts:494:12:494:24 | [BinaryExpr] num % 2 === 0 | semmle.order | 1 |
|
||||
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | tst.ts:494:28:494:33 | [Literal] "even" | semmle.label | 2 |
|
||||
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | tst.ts:494:28:494:33 | [Literal] "even" | semmle.order | 2 |
|
||||
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | tst.ts:494:36:494:40 | [Literal] "odd" | semmle.label | 3 |
|
||||
| tst.ts:494:12:494:40 | [ConditionalExpr] num % 2 ... : "odd" | tst.ts:494:36:494:40 | [Literal] "odd" | semmle.order | 3 |
|
||||
| tstModuleCJS.cts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | tstModuleCJS.cts:1:8:3:1 | [FunctionDeclStmt] functio ... 'b'; } | semmle.label | 1 |
|
||||
| tstModuleCJS.cts:1:1:3:1 | [ExportDeclaration] export ... 'b'; } | tstModuleCJS.cts:1:8:3:1 | [FunctionDeclStmt] functio ... 'b'; } | semmle.order | 1 |
|
||||
| tstModuleCJS.cts:1:8:3:1 | [FunctionDeclStmt] functio ... 'b'; } | tstModuleCJS.cts:1:17:1:28 | [VarDecl] tstModuleCJS | semmle.label | 0 |
|
||||
|
||||
@@ -658,6 +658,40 @@ getExprType
|
||||
| tst.ts:483:17:483:58 | ["hello ... string> | [first: string, string] |
|
||||
| tst.ts:483:18:483:24 | "hello" | "hello" |
|
||||
| tst.ts:483:27:483:33 | "world" | "world" |
|
||||
| tst.ts:486:8:486:11 | TS54 | typeof TS54 in library-tests/TypeScript/Types/tst.ts |
|
||||
| tst.ts:487:48:487:53 | colors | C[] |
|
||||
| tst.ts:488:12:488:17 | colors | C[] |
|
||||
| tst.ts:488:12:488:20 | colors[0] | C |
|
||||
| tst.ts:488:19:488:19 | 0 | 0 |
|
||||
| tst.ts:491:3:491:57 | createS ... ellow") | "red" \| "green" \| "yellow" |
|
||||
| tst.ts:491:21:491:46 | ["red", ... green"] | ("red" \| "green" \| "yellow")[] |
|
||||
| tst.ts:491:22:491:26 | "red" | "red" |
|
||||
| tst.ts:491:29:491:36 | "yellow" | "yellow" |
|
||||
| tst.ts:491:39:491:45 | "green" | "green" |
|
||||
| tst.ts:491:49:491:56 | "yellow" | "yellow" |
|
||||
| tst.ts:493:9:493:13 | myObj | Partial<Record<"even" \| "odd", number[]>> |
|
||||
| tst.ts:493:17:493:22 | Object | ObjectConstructor |
|
||||
| tst.ts:493:17:493:30 | Object.groupBy | <K extends PropertyKey, T>(items: Iterable<T>, ... |
|
||||
| tst.ts:493:17:495:4 | Object. ... ";\\n }) | Partial<Record<"even" \| "odd", number[]>> |
|
||||
| tst.ts:493:24:493:30 | groupBy | <K extends PropertyKey, T>(items: Iterable<T>, ... |
|
||||
| tst.ts:493:32:493:49 | [0, 1, 2, 3, 4, 5] | Iterable<number> |
|
||||
| tst.ts:493:33:493:33 | 0 | 0 |
|
||||
| tst.ts:493:36:493:36 | 1 | 1 |
|
||||
| tst.ts:493:39:493:39 | 2 | 2 |
|
||||
| tst.ts:493:42:493:42 | 3 | 3 |
|
||||
| tst.ts:493:45:493:45 | 4 | 4 |
|
||||
| tst.ts:493:48:493:48 | 5 | 5 |
|
||||
| tst.ts:493:52:495:3 | (num, i ... d";\\n } | (num: number, index: number) => "even" \| "odd" |
|
||||
| tst.ts:493:53:493:55 | num | number |
|
||||
| tst.ts:493:58:493:62 | index | number |
|
||||
| tst.ts:494:12:494:14 | num | number |
|
||||
| tst.ts:494:12:494:18 | num % 2 | number |
|
||||
| tst.ts:494:12:494:24 | num % 2 === 0 | boolean |
|
||||
| tst.ts:494:12:494:40 | num % 2 ... : "odd" | "even" \| "odd" |
|
||||
| tst.ts:494:18:494:18 | 2 | 2 |
|
||||
| tst.ts:494:24:494:24 | 0 | 0 |
|
||||
| tst.ts:494:28:494:33 | "even" | "even" |
|
||||
| tst.ts:494:36:494:40 | "odd" | "odd" |
|
||||
| tstModuleCJS.cts:1:17:1:28 | tstModuleCJS | () => "a" \| "b" |
|
||||
| tstModuleCJS.cts:2:12:2:15 | Math | Math |
|
||||
| tstModuleCJS.cts:2:12:2:22 | Math.random | () => number |
|
||||
@@ -1138,6 +1172,12 @@ getTypeExprType
|
||||
| tst.ts:483:46:483:50 | Pair3 | Pair3<T> |
|
||||
| tst.ts:483:46:483:58 | Pair3<string> | Pair3<string> |
|
||||
| tst.ts:483:52:483:57 | string | string |
|
||||
| tst.ts:487:30:487:30 | C | C |
|
||||
| tst.ts:487:40:487:45 | string | string |
|
||||
| tst.ts:487:56:487:56 | C | C |
|
||||
| tst.ts:487:56:487:58 | C[] | C[] |
|
||||
| tst.ts:487:76:487:82 | NoInfer | any |
|
||||
| tst.ts:487:84:487:84 | C | C |
|
||||
| tstModuleCJS.cts:1:33:1:35 | 'a' | "a" |
|
||||
| tstModuleCJS.cts:1:33:1:41 | 'a' \| 'b' | "a" \| "b" |
|
||||
| tstModuleCJS.cts:1:39:1:41 | 'b' | "b" |
|
||||
@@ -1357,18 +1397,23 @@ unionIndex
|
||||
| "boolean" | 3 | "string" \| "number" \| "bigint" \| "boolean" \| "s... |
|
||||
| "c" | 2 | "a" \| "b" \| "c" |
|
||||
| "circle" | 0 | "circle" \| "square" |
|
||||
| "even" | 0 | "even" \| "odd" |
|
||||
| "function" | 7 | "string" \| "number" \| "bigint" \| "boolean" \| "s... |
|
||||
| "green" | 1 | "red" \| "green" \| "blue" |
|
||||
| "green" | 1 | "red" \| "green" \| "yellow" |
|
||||
| "hello" | 0 | "hello" \| 42 |
|
||||
| "number" | 1 | "string" \| "number" \| "bigint" \| "boolean" \| "s... |
|
||||
| "number" | 1 | keyof TypeMap |
|
||||
| "object" | 6 | "string" \| "number" \| "bigint" \| "boolean" \| "s... |
|
||||
| "odd" | 1 | "even" \| "odd" |
|
||||
| "red" | 0 | "red" \| "green" \| "blue" |
|
||||
| "red" | 0 | "red" \| "green" \| "yellow" |
|
||||
| "square" | 1 | "circle" \| "square" |
|
||||
| "string" | 0 | "string" \| "number" \| "bigint" \| "boolean" \| "s... |
|
||||
| "string" | 0 | keyof TypeMap |
|
||||
| "symbol" | 4 | "string" \| "number" \| "bigint" \| "boolean" \| "s... |
|
||||
| "undefined" | 5 | "string" \| "number" \| "bigint" \| "boolean" \| "s... |
|
||||
| "yellow" | 2 | "red" \| "green" \| "yellow" |
|
||||
| () => number | 0 | (() => number) \| (ClassMethodDecoratorContext<P... |
|
||||
| () => number | 1 | void \| (() => number) |
|
||||
| ClassMethodDecoratorContext<Person, () => numbe... | 1 | (() => number) \| (ClassMethodDecoratorContext<P... |
|
||||
|
||||
@@ -481,4 +481,16 @@ module TS52 {
|
||||
type Pair3<T> = [first: T, T];
|
||||
|
||||
console.log(["hello", "world"] satisfies Pair3<string>);
|
||||
}
|
||||
|
||||
module TS54 {
|
||||
function createStreetLight<C extends string>(colors: C[], defaultColor?: NoInfer<C>) {
|
||||
return colors[0];
|
||||
}
|
||||
|
||||
createStreetLight(["red", "yellow", "green"], "yellow");
|
||||
|
||||
const myObj = Object.groupBy([0, 1, 2, 3, 4, 5], (num, index) => {
|
||||
return num % 2 === 0 ? "even": "odd";
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import 'dummy';
|
||||
|
||||
let trackedProp = "implicit-receiver-prop"; // name: implicit-receiver-prop
|
||||
|
||||
function factory() {
|
||||
let obj = unknown(); // name: implicit-receiver-obj
|
||||
obj.foo = function() {
|
||||
track(this); // track: implicit-receiver-obj
|
||||
track(this.x); // track: implicit-receiver-obj track: implicit-receiver-prop
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
let obj = factory();
|
||||
obj.x = trackedProp;
|
||||
|
||||
|
||||
function factory2() {
|
||||
let obj2 = { // name: implicit-receiver-obj2
|
||||
foo: function() {
|
||||
track(this); // track: implicit-receiver-obj2
|
||||
track(this.x); // track: implicit-receiver-obj2 track: implicit-receiver-prop
|
||||
}
|
||||
}
|
||||
return obj2;
|
||||
}
|
||||
let obj2 = factory2()
|
||||
obj2.x = trackedProp;
|
||||
41
javascript/ql/test/library-tests/TypeTracking/summarize.js
Normal file
41
javascript/ql/test/library-tests/TypeTracking/summarize.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import 'dummy';
|
||||
|
||||
function identity(x) {
|
||||
return x;
|
||||
}
|
||||
function load(x) {
|
||||
return x.loadProp;
|
||||
}
|
||||
function store(x) {
|
||||
return { storeProp: x };
|
||||
}
|
||||
function loadStore(x) {
|
||||
return { storeProp: x.loadProp };
|
||||
}
|
||||
function loadStore2(x) {
|
||||
let mid = x.loadProp;
|
||||
return { storeProp: mid };
|
||||
}
|
||||
|
||||
identity({});
|
||||
load({});
|
||||
store({});
|
||||
loadStore({});
|
||||
loadStore2({});
|
||||
|
||||
const obj = {}; // name: obj
|
||||
|
||||
let x = identity(obj);
|
||||
x; // track: obj
|
||||
|
||||
x = load({ loadProp: obj });
|
||||
x; // track: obj
|
||||
|
||||
x = store(obj);
|
||||
x.storeProp; // track: obj
|
||||
|
||||
x = loadStore({ loadProp: obj });
|
||||
x.storeProp; // track: obj
|
||||
|
||||
x = loadStore2({ loadProp: obj });
|
||||
x.storeProp; // track: obj
|
||||
@@ -84,6 +84,26 @@ nodes
|
||||
| ReflectedXss.js:110:16:110:30 | request.query.p |
|
||||
| ReflectedXss.js:110:16:110:30 | request.query.p |
|
||||
| ReflectedXss.js:110:16:110:30 | request.query.p |
|
||||
| ReflectedXss.js:114:11:114:41 | queryKeys |
|
||||
| ReflectedXss.js:114:13:114:27 | keys: queryKeys |
|
||||
| ReflectedXss.js:114:13:114:27 | keys: queryKeys |
|
||||
| ReflectedXss.js:116:11:116:45 | keys |
|
||||
| ReflectedXss.js:116:18:116:26 | queryKeys |
|
||||
| ReflectedXss.js:116:18:116:45 | queryKe ... s?.keys |
|
||||
| ReflectedXss.js:116:31:116:45 | paramKeys?.keys |
|
||||
| ReflectedXss.js:116:31:116:45 | paramKeys?.keys |
|
||||
| ReflectedXss.js:118:11:118:61 | keyArray |
|
||||
| ReflectedXss.js:118:22:118:61 | typeof ... : keys |
|
||||
| ReflectedXss.js:118:49:118:54 | [keys] |
|
||||
| ReflectedXss.js:118:50:118:53 | keys |
|
||||
| ReflectedXss.js:118:58:118:61 | keys |
|
||||
| ReflectedXss.js:119:11:119:72 | invalidKeys |
|
||||
| ReflectedXss.js:119:25:119:32 | keyArray |
|
||||
| ReflectedXss.js:119:25:119:72 | keyArra ... s(key)) |
|
||||
| ReflectedXss.js:122:30:122:73 | `${inva ... telist` |
|
||||
| ReflectedXss.js:122:30:122:73 | `${inva ... telist` |
|
||||
| ReflectedXss.js:122:33:122:43 | invalidKeys |
|
||||
| ReflectedXss.js:122:33:122:54 | invalid ... n(', ') |
|
||||
| ReflectedXssContentTypes.js:10:14:10:36 | "FOO: " ... rams.id |
|
||||
| ReflectedXssContentTypes.js:10:14:10:36 | "FOO: " ... rams.id |
|
||||
| ReflectedXssContentTypes.js:10:24:10:36 | req.params.id |
|
||||
@@ -307,6 +327,26 @@ edges
|
||||
| ReflectedXss.js:103:76:103:83 | req.body | ReflectedXss.js:103:12:103:84 | markdow ... q.body) |
|
||||
| ReflectedXss.js:103:76:103:83 | req.body | ReflectedXss.js:103:12:103:84 | markdow ... q.body) |
|
||||
| ReflectedXss.js:110:16:110:30 | request.query.p | ReflectedXss.js:110:16:110:30 | request.query.p |
|
||||
| ReflectedXss.js:114:11:114:41 | queryKeys | ReflectedXss.js:116:18:116:26 | queryKeys |
|
||||
| ReflectedXss.js:114:13:114:27 | keys: queryKeys | ReflectedXss.js:114:11:114:41 | queryKeys |
|
||||
| ReflectedXss.js:114:13:114:27 | keys: queryKeys | ReflectedXss.js:114:11:114:41 | queryKeys |
|
||||
| ReflectedXss.js:116:11:116:45 | keys | ReflectedXss.js:118:50:118:53 | keys |
|
||||
| ReflectedXss.js:116:11:116:45 | keys | ReflectedXss.js:118:58:118:61 | keys |
|
||||
| ReflectedXss.js:116:18:116:26 | queryKeys | ReflectedXss.js:116:18:116:45 | queryKe ... s?.keys |
|
||||
| ReflectedXss.js:116:18:116:45 | queryKe ... s?.keys | ReflectedXss.js:116:11:116:45 | keys |
|
||||
| ReflectedXss.js:116:31:116:45 | paramKeys?.keys | ReflectedXss.js:116:18:116:45 | queryKe ... s?.keys |
|
||||
| ReflectedXss.js:116:31:116:45 | paramKeys?.keys | ReflectedXss.js:116:18:116:45 | queryKe ... s?.keys |
|
||||
| ReflectedXss.js:118:11:118:61 | keyArray | ReflectedXss.js:119:25:119:32 | keyArray |
|
||||
| ReflectedXss.js:118:22:118:61 | typeof ... : keys | ReflectedXss.js:118:11:118:61 | keyArray |
|
||||
| ReflectedXss.js:118:49:118:54 | [keys] | ReflectedXss.js:118:22:118:61 | typeof ... : keys |
|
||||
| ReflectedXss.js:118:50:118:53 | keys | ReflectedXss.js:118:49:118:54 | [keys] |
|
||||
| ReflectedXss.js:118:58:118:61 | keys | ReflectedXss.js:118:22:118:61 | typeof ... : keys |
|
||||
| ReflectedXss.js:119:11:119:72 | invalidKeys | ReflectedXss.js:122:33:122:43 | invalidKeys |
|
||||
| ReflectedXss.js:119:25:119:32 | keyArray | ReflectedXss.js:119:25:119:72 | keyArra ... s(key)) |
|
||||
| ReflectedXss.js:119:25:119:72 | keyArra ... s(key)) | ReflectedXss.js:119:11:119:72 | invalidKeys |
|
||||
| ReflectedXss.js:122:33:122:43 | invalidKeys | ReflectedXss.js:122:33:122:54 | invalid ... n(', ') |
|
||||
| ReflectedXss.js:122:33:122:54 | invalid ... n(', ') | ReflectedXss.js:122:30:122:73 | `${inva ... telist` |
|
||||
| ReflectedXss.js:122:33:122:54 | invalid ... n(', ') | ReflectedXss.js:122:30:122:73 | `${inva ... telist` |
|
||||
| ReflectedXssContentTypes.js:10:24:10:36 | req.params.id | ReflectedXssContentTypes.js:10:14:10:36 | "FOO: " ... rams.id |
|
||||
| ReflectedXssContentTypes.js:10:24:10:36 | req.params.id | ReflectedXssContentTypes.js:10:14:10:36 | "FOO: " ... rams.id |
|
||||
| ReflectedXssContentTypes.js:10:24:10:36 | req.params.id | ReflectedXssContentTypes.js:10:14:10:36 | "FOO: " ... rams.id |
|
||||
@@ -461,6 +501,8 @@ edges
|
||||
| ReflectedXss.js:100:12:100:39 | markdow ... q.body) | ReflectedXss.js:100:31:100:38 | req.body | ReflectedXss.js:100:12:100:39 | markdow ... q.body) | Cross-site scripting vulnerability due to a $@. | ReflectedXss.js:100:31:100:38 | req.body | user-provided value |
|
||||
| ReflectedXss.js:103:12:103:84 | markdow ... q.body) | ReflectedXss.js:103:76:103:83 | req.body | ReflectedXss.js:103:12:103:84 | markdow ... q.body) | Cross-site scripting vulnerability due to a $@. | ReflectedXss.js:103:76:103:83 | req.body | user-provided value |
|
||||
| ReflectedXss.js:110:16:110:30 | request.query.p | ReflectedXss.js:110:16:110:30 | request.query.p | ReflectedXss.js:110:16:110:30 | request.query.p | Cross-site scripting vulnerability due to a $@. | ReflectedXss.js:110:16:110:30 | request.query.p | user-provided value |
|
||||
| ReflectedXss.js:122:30:122:73 | `${inva ... telist` | ReflectedXss.js:114:13:114:27 | keys: queryKeys | ReflectedXss.js:122:30:122:73 | `${inva ... telist` | Cross-site scripting vulnerability due to a $@. | ReflectedXss.js:114:13:114:27 | keys: queryKeys | user-provided value |
|
||||
| ReflectedXss.js:122:30:122:73 | `${inva ... telist` | ReflectedXss.js:116:31:116:45 | paramKeys?.keys | ReflectedXss.js:122:30:122:73 | `${inva ... telist` | Cross-site scripting vulnerability due to a $@. | ReflectedXss.js:116:31:116:45 | paramKeys?.keys | user-provided value |
|
||||
| ReflectedXssContentTypes.js:10:14:10:36 | "FOO: " ... rams.id | ReflectedXssContentTypes.js:10:24:10:36 | req.params.id | ReflectedXssContentTypes.js:10:14:10:36 | "FOO: " ... rams.id | Cross-site scripting vulnerability due to a $@. | ReflectedXssContentTypes.js:10:24:10:36 | req.params.id | user-provided value |
|
||||
| ReflectedXssContentTypes.js:20:14:20:36 | "FOO: " ... rams.id | ReflectedXssContentTypes.js:20:24:20:36 | req.params.id | ReflectedXssContentTypes.js:20:14:20:36 | "FOO: " ... rams.id | Cross-site scripting vulnerability due to a $@. | ReflectedXssContentTypes.js:20:24:20:36 | req.params.id | user-provided value |
|
||||
| ReflectedXssContentTypes.js:39:13:39:35 | "FOO: " ... rams.id | ReflectedXssContentTypes.js:39:23:39:35 | req.params.id | ReflectedXssContentTypes.js:39:13:39:35 | "FOO: " ... rams.id | Cross-site scripting vulnerability due to a $@. | ReflectedXssContentTypes.js:39:23:39:35 | req.params.id | user-provided value |
|
||||
|
||||
@@ -109,3 +109,17 @@ hapi.route({
|
||||
handler: function (request){
|
||||
return request.query.p; // NOT OK
|
||||
}});
|
||||
|
||||
app.get("invalid/keys/:id", async (req, res) => {
|
||||
const { keys: queryKeys } = req.query;
|
||||
const paramKeys = req.params;
|
||||
const keys = queryKeys || paramKeys?.keys;
|
||||
|
||||
const keyArray = typeof keys === 'string' ? [keys] : keys;
|
||||
const invalidKeys = keyArray.filter(key => !whitelist.includes(key));
|
||||
|
||||
if (invalidKeys.length) {
|
||||
res.status(400).send(`${invalidKeys.join(', ')} not in whitelist`);
|
||||
return;
|
||||
}
|
||||
});
|
||||
@@ -19,6 +19,8 @@
|
||||
| ReflectedXss.js:100:12:100:39 | markdow ... q.body) | Cross-site scripting vulnerability due to $@. | ReflectedXss.js:100:31:100:38 | req.body | user-provided value |
|
||||
| ReflectedXss.js:103:12:103:84 | markdow ... q.body) | Cross-site scripting vulnerability due to $@. | ReflectedXss.js:103:76:103:83 | req.body | user-provided value |
|
||||
| ReflectedXss.js:110:16:110:30 | request.query.p | Cross-site scripting vulnerability due to $@. | ReflectedXss.js:110:16:110:30 | request.query.p | user-provided value |
|
||||
| ReflectedXss.js:122:30:122:73 | `${inva ... telist` | Cross-site scripting vulnerability due to $@. | ReflectedXss.js:114:13:114:27 | keys: queryKeys | user-provided value |
|
||||
| ReflectedXss.js:122:30:122:73 | `${inva ... telist` | Cross-site scripting vulnerability due to $@. | ReflectedXss.js:116:31:116:45 | paramKeys?.keys | user-provided value |
|
||||
| ReflectedXssContentTypes.js:10:14:10:36 | "FOO: " ... rams.id | Cross-site scripting vulnerability due to $@. | ReflectedXssContentTypes.js:10:24:10:36 | req.params.id | user-provided value |
|
||||
| ReflectedXssContentTypes.js:20:14:20:36 | "FOO: " ... rams.id | Cross-site scripting vulnerability due to $@. | ReflectedXssContentTypes.js:20:24:20:36 | req.params.id | user-provided value |
|
||||
| ReflectedXssContentTypes.js:39:13:39:35 | "FOO: " ... rams.id | Cross-site scripting vulnerability due to $@. | ReflectedXssContentTypes.js:39:23:39:35 | req.params.id | user-provided value |
|
||||
|
||||
@@ -4,8 +4,13 @@ private import codeql.util.test.InlineExpectationsTest
|
||||
module Impl implements InlineExpectationsTestSig {
|
||||
private import javascript
|
||||
|
||||
class ExpectationComment extends LineComment {
|
||||
final private class LineCommentFinal = LineComment;
|
||||
|
||||
class ExpectationComment extends LineCommentFinal {
|
||||
string getContents() { result = this.getText() }
|
||||
|
||||
/** Gets this element's location. */
|
||||
Location getLocation() { result = super.getLocation() }
|
||||
}
|
||||
|
||||
class Location = JS::Location;
|
||||
|
||||
Reference in New Issue
Block a user