Skip to content

Commit d7f5ed4

Browse files
committed
Use getStringValue/0 in getNamespace/0
The original only covered `StringLiterals`, but `getStringValue` covers more cases ("constant folding").
1 parent cd26594 commit d7f5ed4

File tree

1 file changed

+1
-3
lines changed
  • javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap

1 file changed

+1
-3
lines changed

javascript/frameworks/cap/lib/advanced_security/javascript/frameworks/cap/CDS.qll

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ class CdsEntitiesCall extends DataFlow::CallNode {
3838
/**
3939
* Gets the namespace that this entity belongs to.
4040
*/
41-
string getNamespace() {
42-
result = this.getArgument(0).getALocalSource().asExpr().(StringLiteral).getValue()
43-
}
41+
string getNamespace() { result = this.getArgument(0).getStringValue() }
4442
}
4543

4644
/**

0 commit comments

Comments
 (0)